Lua documentation

[lol] library:

  • MoveTo(x,y,z)
    Moves your hero to the target location.
    lol.MoveTo( player.x+5, player.y, player.z ) –Move your hero 5 units on the x axis
  • Attack( object.pointer )
    Attacks the given object.
  • HoldPosition()
    Your hero stops the current action.
  • PrintChat( text )
    Prints a text to your current chat which will be only visible to yourself.
    lol.PrintChat(string.format(“Hello world! My name is %s” ,player.name))
  • SendChat( text )
    Sends a chat message to other players.
    lol.PrintChat(“Stop feeding noobs!!”)
  • PingSignal( type, x ,y ,z )
    Creates a client-sided ping signal which will be only visible to yourself and only the animation is visible (not the sound). You can either use PING_NORMAL or PING_FALLBACK as type.
  • DrawCircle( radius, x, y, z )
    Draws a circle around a given point with the given radius. This function will only work in a DrawCallback function!
  • DrawText( text, x, y, r, g, b, a )
    Draws a text anywhere on the screen where rgba is the color value. This function will only work in a DrawCallback function!
  • GetUnitCount()
    Returns the current unit count in the game.
  • GetUnit( index )
    Retrieves the unit from the given index.
  • GetPlayerCount()
    Returns the current player count in the game.
  • GetPlayer( index )
    Retrieves the player from the given index.
  • GetDistance2D( object1.pointer, object2.pointer )
    Distance in 2D space between 2 objects.
  • GetDistance3D( object1.pointer, object2.pointer )
    Distance in 3D space between 2 objects.
  • CalculateDamage( object1.pointer, object2.pointer )
    First object is the attacker and the second one is the victim. Calculates the auto attack damage including victim’s armor, attacker’s armor pen.
  • UseSpell( slot )
  • UseSpell( slot, target.pointer )
  • UseSpell( slot, x, y, z )
  • UseSpell( slot, x1, y1, z1, x2, y2, z2 )
  • state = CanUseSpell( slot ) 
[system] library
  • SetTimerCallback( functionName, timerInvervall )
    Sets a timer callback which gets called every [timerIntervall] milliseconds. The first argument of your given function is the current tick count.
  • SetDrawCallbackfunctionName )
    Sets a callback function to use functions like DrawCircle or DrawText. For other stuff you should use the timer callback.
  • SetCreateObjectCallbackfunctionName )
    Sets a callback function which is always called when an unit spawns on the map. The first parameter of your given function is the newly created object. Be aware that all kind of projectiles and other stuff are also handled as game objects.
  • SetDeleteObjectCallbackfunctionName )
    Sets a callback function which is always called when an game object is removed from the game. The first parameter of your given function is the object which will be deleted after your function.
  • SetKeyCallback( functionName )
    Sets a callback function which is always called on user input (using keyboard or mouse). The first parameter of your given function is the msg code (see below) and the second parameter is the keycode.
  • IsScriptLoaded( scriptName )
    Returns: Boolean
    Checks if a script is already loaded.
  • LoadedCount()
    Returns: Integer
    Returns the loaded lua script count.
  • LoadedName( index )
    Returns: String
    Get the name of a script at the given index. The index is from 0 to LoadedCount().
  • Load( scriptName )
    Load a lua script. The script must be located in your Scripts folder and may not be loaded twice.
  • Unload( scriptName )
    Unload a lua script. Be aware that the script is completely unloaded and can’t reload itself or do any action.
  • UnloadAll()
    Unload all loaded lua scripts.
  • ExitLoL()
    Close your client immediatelly.
  • GetTick()
    Returns: Integer
[globals]
  • player
    Type: GameObject
  • SCRIPT_NAME
    Type: String
  • PING_NORMAL, PING_FALLBACK
    Type: Integer
    Function: PingSignal
  • TEAM_RED, TEAM_BLUE, TEAM_NONE, TEAM_NEUTRAL
    Type: Integer
    Function: gameobject.team
  • LANE_TOP, LANE_MID, LANE_BOT, LANE_NONE
    Type: Integer
    Function: gameobject.lane
  • KEY_DOWN, KEY_UP
    Type: Integer
    Function: KeyCallback, 1st parameter
  • WINDOW_X, WINDOW_Y, WINDOW_W, WINDOW_H
    Type: Integer
  • STARTED_TICK
    Type: Integer
    Start tick of the game.  Value of system.GetTick()
  • SPELL_SLOT_1, SPELL_SLOT_2, SPELL_SLOT_3, SPELL_SLOT_4, SPELL_RECALL, SPELL_SUMMONER_1, SPELL_SUMMONER_2, ITEM_SLOT_1, ITEM_SLOT_2, ITEM_SLOT_3, ITEM_SLOT_4, ITEM_SLOT_5, ITEM_SLOT_6
    Type: Integer
    Slot values for the spell and item functions.
  • STATE_READY, STATE_NOTLEARNED, STATE_SUPRESSED, STATE_COOLDOWN, STATE_NOMANA, STATE_UNKNOWN
    Type: Integer
    Return values for the lol.CanUseSpell function

[GameObject]

  • pointer
    Type: Integer
    Pointer of the object which is used for many functions.
  • x
    Type: Number
    X coordinate of the object.
  • y
    Type: Number
    Y coordinate of the object.
  • z
    Type: Number
    Z coordinate of the object.
  • health
    Type: Number
    Current health of the object
  • maxHealth
    Type: Number
    Max health of the object.
  • mana
    Type: Number
    Current mana of the object.
  • maxMana
    Type: Number
    Max mana of the object.
  • damage
    Type: Number
    Default damage of the object.
  • addDamage
    Type: Number
    Damage which is added to the base damage of the object.
  • totalDamage
    Type: Number
    Basically (damage+addDamage).
  • magicArmor
    Type: Number
    Total magic armor of the object.
  • armor
    Type: Number
    Total armor of the object.
  • armorPen
    Type: Number
    Pure armor penetration of the object.
  • armorPenPercent
    Type: Number
    Armor penetration is percent. This value will give you the percentage which is left on the target’s armor. So if you have 0.6, this means the target has only 60% of its armor value left.
  • charName
    Type: String
    Character name of the object.
  • lane
    Current lane of the object. Check globals for the values.
  • ms
    Type: Number
    Movement speed of the object.
  • name
    Type: String
    Object name or player name of the object.
  • range
    Type: Number
    Attack range of the object.
  • team
    Team of the object. Check globals for the values.
  • id
    Type: Integer
    Network id of the object. Used do identify an object with the network code.
  • visible
    Returns 1 if the object is currently visible else 0.
  • ranged
    Returns 1 if the object is a ranged attacker else 0.
  • melee
    Returns 1 if the object is a melee attacker else 0.
  • dead
    Returns 1 if the object is currently dead, else 0.
  • gold
    Type: Integer
    Current gold of the object. Probably only works on your own character.
  • alias
    Type: String
    Alias for the object’s character name. Check the Alias.txt file.
  • level
    Type: Integer
    Current level of the object.
Leave a comment ?

57 Comments.

  1. All functions and members are currently listed here.
    I will add more examples and more accurate information as soon as I’ve got the time for it.

  2. :razz: Nice! This will help lots when writing my own lua scripts.

  3. Anyone know of any map hacks/fog of war removers? Or is that not possible?

  4. it is possible, but in wc3 you can see all ppl then, in lol you can’t see enemies,only your own team cuz it is serverside

  5. btw,when do you update the offsets for the lasthitter Zynox?

  6. Meh, this tool is becoming progressively more powerful. With this tool freely available for everyone its only going to be a matter of time until riot has to take some action.

    Nice work though!

  7. riot take actions with every patch..thats the reason why we have to wait for an update from zynox^^

    • He is probably talking about some anti-cheat solutions rather than simple updates.
      I think in nearest future they will add something for sure but at least now you could pwn without worries

    • Every time a program “updates” it’s not that they are fighting this hack, is that the OFFSETS that the hack uses to manipulate the game changes, thus the hack has to update just like the game did.

  8. it’s legit :)

  9. Attack( object.pointer )

    what is with that? you maybe can integrate a hotkey function.

    so some1 can set

    hotkey=’z’
    smitekey=’f’

    and then if hokey =1 then check if hp etcetc smitekey

    else goto start

  10. Zynox,

    I think your program can survive any Riot complaints, but only if you split the functions into two groups.

    One part of your program is merely calculating information and values and displaying them to the user. I can’t imagine Riot would get mad at this, and further, would even stop this. These functions include timers, pinging, circles, etc. All of this information is readily available to the player, but more advanced players see it easier than novice players. Your program bridges that gap.

    The second part of your program actually gives user controls and automates gameplay. This part, I can certainly see Riot caring about. This includes the autolasthit bot or a smite bot.

    If you developed a platform (like it seems you are doing now) and kept it to the more “aggressive” scripts as addons, then you can keep the core of your program ‘safe’ and let the users run scripts “at their own risk.” What do you think?

  11. Hey Zynox can you add a function like to check for ward timers/wards in inventory? I dont like constantly pressing tab so if you could do that it would be beastmode bro :shock: :shock: :shock: :shock: :shock: :shock: :shock: :shock: :shock:

    • Ohhh, that’s a good idea…a notification to let you know if somebody buys a specific item…useful for wards, pots…really anything…and is mostly a ‘monitoring’ feature, so Riot won’t complain :)

  12. I find you a genius my friend! Thanks for your effort! :D

  13. Cool thing about this game is you can’t really cheat to gain an advantage. FunnyPullback gives you some tools but it definitely isn’t going to make you pro. The last hit bot is good for certain champs (mostly AD carries) but only once you reach a certain level (at least lvl 12)

    Also the last hit bot is only really usable when there isn’t an enemy nearby who can harass you.

    Leaugue is one of very few games you can’t cheat online with. As far as i know there isn’t a maphack or cooldown hack, and a gold hack would be so obvious because everyone would report you when they see you have a deathcap at level 4.

  14. how to use it in Garena LoL

  15. ;3 im confused, how do I download this in the first place? xD

  16. I’m try to use it con GarenaLoL but i’ve 2 error “wrong version or already start” then “cant find the damn pullback”
    Please help!

  17. Can you give us the Unit structure, ObjectManager offset etc … ? I really need it but im a beginner ^^

  18. not so hard to find it….here a keyword

    ce

  19. Added missing type defs and explanations.
    New update will take some more time.

  20. Zynox, can u send me the GameObject struct, i already found the ObjectManager offset etc but my GameObj struct seems wrong, so if u can give it please … (Sorry for my bad english).

  21. Was a patch today, not sure what was done to League of Legends, but this amazing program is now giving the error message that it couldn’t find the pull back and all that jazz. Probably just needs a minor update. Damn you RIOT. Anyways, thanks for the hardwork and effort. It’s an excellent program.

  22. i’ve some experience in AI programming and LUA, and i could not want anything better than this!
    AI runned bots are going to be a piece of cake now, thanks for the release…
    We should begin thinking for a place where gather users made script, i’ve already something to show :D
    By the way i tested the last release you posted today, the built-in auto last hit bot and zoom unlock does not seem to work to me, used to work for me two release ago when i first tried.

  23. forgot to mention the aliases list is outaded

  24. Is this working correctly for everyone else? J/W cause it worked for me then I had to DL a patch for League and it’s not working now :(

  25. Is it possible to do a simple script that if the selected champion is sona, it draws a circle arround her with 700 range?

    • Ok added Sona,700 on the atack range

      • What I want to do is add a draw on those spells which are already smart casts, for example, Karthus Q, Soraka Q, Sona Q, Alistar Q, and so on.

        Most likely the smartest way to do this is drawing it with another color instead of the original to know which one is what.

  26. Zynox I think it would be helpful to have a webpage dedicated to the API or a file included that would be generated by the program that would dump the API.

    A few things I would like to see would be:

    Choosing a color when drawing such as for circles so you can define/display properly for the spells QWER DF
    A hook on the chat command which would allow you to get the event being the message, and then you could also choose whether or not to allow the message to be sent to the clients or not (suppress the message/event)

    Keep up the awesome work, it is greatly appreciated that someone keeps putting time and dedication into this like you have been doing.

    I plan to start contributing to this, idk how I could get my sources to you, you can shoot me a PM @D3 scene, as I would love to talk with you.

  27. Here’s a nice script I’ve done.
    What it does:
    Shows :
    MIA Enemies.
    Time to gank you from their distance.
    Enemy’s HP&Max HP.
    Enemy’s MP&Max MP.
    Enemy’s MAGIC DAMAGE RECIEVED
    Enemy’s Hero name.
    Ally’s HP&Max HP.
    Ally’s Hero Name.

    I would be happy to make more scripts, if someone would redirect me on how to get Object Names (?) .
    Thanks, and enjoy.

    • Nice. But the problem is that your GUI(or text) is far too low, I mean it interference with Mini-Map, and other HUD shit… :/ I don’t know, maybe you play on a bigass resolution.

      P.S Like you want to find it by your self,or you want to set it ? I use it like this on my attackRange script.

      if object.name == 'I Curse You' and object.range > 500 then

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>