Archived

This topic is now archived and is closed to further replies.

Gordonfreeman75

iBot Variables and Functions

4 posts in this topic

iBot Variables and Functions

________________________________
 

Well, since the official forums are now private I decided to put some of my time to create a thread with all variables and functions that you can use on iBot until v1.1.7, it is just the same thread that we had on the official forums, but now public for all CM so that you can make your own scripts with this info  :)

________________________________

 

Info

 

Events in iBot are operations that ultimately will perform some kind of action in the Tibia client be it by mouse or keyboard. The following functions create these events in order to achieve a particular purpose. The iBot uses the Lua language for creating scripts for their actions. 

 

 

Summary

 

1 Variables
1.1 Self Class
1.1.1 Character Information
1.1.2 Skills Information
1.1.3 Special Condition Information
1.1.4 Equipment Information
1.2 Client Class
1.2.1 Client Windows Information
1.2.2 Client Process Information
1.3 System Class
1.3.1 System Engines
1.3.2 Waypoints
1.4 Creatures Class
1.4.1 Creature Information
1.4.2 Skull Types ID's
1.4.3 War Banner Types ID's
1.4.4 Party Types ID's
2 Functions
2.1 Self Class
2.1.1 Self Information
2.1.2 Self Actions
2.2 System Class
2.2.1 Bot System
2.2.2 Operational System
2.3 Client Class
2.3.1 Client Information
2.3.2 Client Actions
2.4 HUD Class
2.4.1 HUD Creation and Display
2.5 Item Class
2.5.1 Item Information
2.6 Tile Class
2.6.1 Tile Information
2.7 Container Class
2.7.1 Container Information
2.8 Message Class
2.8.1 Messages Information
2.8.2 Messages Type ID's
2.9 Creature Class
2.9.1 Creatures Information
3 Miscellaneous Class
3.1 Variables
3.2 Functions


 

Legend

On the text below you can see the variables and functions he have in iBot, we have also the returning type of each variable/function separated by two brackets "[type]", and a explication of what it does.


Types

int: abbreviation of integer, it is a number type. Examples: 1, 100.0 (in this case you have a float integer), -50.
string: it is a text inside of quotes or double quotes. Examples: 'iBot', "" (in this case you have an empty string), '-50'.
table: returns a table object of Lua program. Example: {"table", "containing", "text"}, {1, 2, 3}.
boolean: returns true of false values. Boolean type carries only 2 values: truefalse.
userdata: its a table with a meta table associated with it. You can't use it as a normal table, only with the functions it carry within it.


 

___________________________________________

 

1 Variables

1.1 Self Class

The following variables return information about your character.

1.1.1 Character Information

id [int]: Returns the creature ID of your character.

name [string]: Returns the name of your character.

hp [int]: Returns your current amount of hit points.

hppc [int]: Returns the percentage of your character's hp.

maxhp [int]: Returns your maximum amount of hit points.

mp [int]: Returns your current amount of mana points.

mppc [int]: Returns the percentage of your character's mp.

maxmp [int]: Returns your maximum amount of mana points.

level [int]: Returns the level of your character.

exp [int]: Returns your total amount of experience points.

cap [int]: Returns your remaining capacity.

stamina [int]: Returns the remaining stamina in minutes.

offtrain [int]: Returns the remaining offline training in minutes.

soul [int]: Returns the remaining soul points.

outfit [int]: Returns the outfit ID of your character.

posx [int]: Returns the x position of your character.

posy [int]: Returns the y position of your character.

posz [int]: Returns the z position of your character.

vocation [int]: Returns the vocation type of your character. (1 - Knight, 2 -
Paladin, 3 - Sorcerer, 4 - Druid)


1.1.2 Skills Information

mlevel [int]: Returns the level of your magic skill.

mlevelpc [int]: Returns the percentage leanrt of the magic skill.

fist [int]: Returns the level of your fist skill.

fistpc [int]: Returns the percentage learnt of the fist skill.

club [int]: Returns the level of your club skill.

clubpc [int]: Returns the percentage learnt of the club skill.

sword [int]: Returns the level of your sword skill.

swordpc [int]: Returns the percentage learnt of the swords skill.

axe [int]: Returns the level of your axe skill.

axepc [int]: Returns the percentage learnt of the axe skill.

distance [int]: Returns the level of your distance skill.

distancepc [int]: Returns the percentage learnt of the distance skill.

shielding [int]: Returns the level of your shielding skill.

shieldingpc [int]: Returns the percentage learnt of the shielding skill.

fishing [int]: Returns the level of your fishing skill.

fishingpc [int]: Returns the percentage learnt of the fishing skill.



1.1.3 Special Condition Information

battlesigned [boolean]: Returns true if your character is battle signed, false otherwise.

drunk [boolean]: Returns true if your character is drunk, false otherwise.

hasted [boolean]: Returns true if your character is hasted, false otherwise.

manashielded [boolean]: Returns true if your character is mana shielded, false otherwise.

strengthened [boolean]: Returns true if your character is strengthened, false otherwise.

burning [boolean]: Returns true if your character is burning, false otherwise.

cursed [boolean]: Returns true if your character is cursed, false otherwise.

energized [boolean]Returns true if your character is electrified, false otherwise.

paralyzed [boolean]: Returns true if your character is paralyzed, false otherwise.

poisoned [boolean]: Returns true if your character is poisoned, false otherwise.

pvpsigned [boolean]: Returns true if your character is pvp signed, false otherwise.

pzone [boolean]: Returns true if your character is in a protection zone, false otherwise.



1.1.4 Equipment Information     

helmet [int]: Returns the ID of the item on your head slot.

amulet [int]: Returns the ID of the item on your neck slot.

back [int]: Returns the ID of the item on your back slot.

armor [int]: Returns the ID of the item on your chest slot.

shield [int]: Returns the ID of the item on your shield slot.

weapon [int]: Returns the ID of the item on your weapon slot.

weaponamount [int]: Returns the amount of items on your weapon slot.

legs [int]: Returns the ID of the item on your legs slot.

boots [int]: Returns the ID of the item on your feet slot.

ring [int]: Returns the ID of the item on your finger slot.

ammo [int]: Returns the ID of the item on your ammo slot.

ammoamount [int]: Returns the amount of items on your ammo slot.


 

1.2 Client Class
The following variables return various information relating to the game client.

1.2.1 Client Windows Information

battleopen [boolean]: Returns true if the battle window is open, false otherwise.

connected [boolean]: Returns true if connected to a server, false otherwise.

focused [boolean]: Returns true if client is focused, false otherwise.

minimized [boolean]: Returns true if client is minimized, false otherwise.

openmenuname [string]: Returns the name of the currently open menu/window or 'Context' if it's a context menu (with options like Attack/Use/Open etc).

tradeopen [boolean]: Returns true if the trade window is open, false otherwise.

exphour [int]: Returns the average experience per hour since it's been reset based on bot information.

tibiaexphour [int]: Returns the average experience per hour since it's been reset based on tibia window information.

expgained [int]: Returns the exp gained since exp counter has been reset.

timehunt [int]: Returns the time in milliseconds that the exp counter has been running.

timehuntstart [int]: Returns the time in milliseconds that the exp counter was started.



1.2.2 Client Process Information

clientwin [userdata]: Returns the rectangle containing the measurements of the client window and it's data structure.

worldwin [userdata]: Returns the rectangle containing the measurements of the world window and it's data structure.

.bottom [int]: Returns bottom position of the client process window variable.

.left [int]: Returns left position of the client process window variable.

.right [int]: Returns right position of the client process window variable.

.top [int]: Returns top position of the client process window variable.

.width [int]: Returns max width of the client process window variable.

.height [int]: Returns max height of the client process window variable.


1.3 System Class

The following variables return various information calculated by the bot.

1.3.1 System Engines

cavebot [boolean]: Returns true if cavebot is enabled, false otherwise.

looting [boolean]: Returns true if looting is enabled, false otherwise.

targeting [boolean]: Returns true if targeting is enabled, false otherwise.

lootbodies [boolean]: Returns true if there are loot bodies not yet looted, false otherwise.

lootbodiescount [int]: Returns the amount of loot bodies not yet looted being queued up for looting.

standtime [int]: Returns the time in milliseconds that your character has been standing still.

timems [int]: Returns the the current time in milliseconds since the system has started.

lasttimeplayeronscreen [int]: Returns the time in milliseconds since the last time any player was seen in your screen.

 

1.3.2 Waypoints

wpt [userdata]: Returns the data structure for current waypoint.

.id [int]: Returns the id of the current waypoint.

.type [string]: Returns the type of the current waypoint.

.x [int]: Returns the x position of the current waypoint.

.y [int]: Returns the y position of the current waypoint.

.z [int]: Returns the z position of the current waypoint.


 

1.4 Creature Class

The following properties can be appended to a creature pointer and return a value as defined.

1.4.1 Creature Information

target [userdata]: Returns the creature data structure of the creature you have attacked.

follow [userdata]: Returns the creature data structure of the creature you have followed.

.id [int]: Returns the unique ID of the creature.

.name [string]: Returns the creature's name.

.hppc [int]: Returns the creature's health percentage.

.x [int]: Returns the creature's x coordinate.

.y [int]: Returns the creature's y coordinate.

.z [int]: Returns the creature's z coordinate.

.direction [string]: Returns the creature's direction name as "n", "s", "w" or "e".

.outfit [int]: Returns the ID of creature's outfit.

.speed [int]: Returns the creature's speed.

.dist [int]: Returns the biggest distance in either x or y between the creature and your character.

.skull [int]: Returns the creature's skull type id.

.party [int]: Returns the creature's party type id.

.waricon [int]: Returns the creature's war banner type id.

.visible [int]: Returns 1 if the creature is visible, 0 otherwise.

.walking [int]: Returns 1 if the creature is visible, 0 otherwise.

.ignored [boolean]: Returns true if creature is being ignored by the targeting system (if ignorecreature() was used
on it), false otherwise.

.hittime [int]: Returns, in milliseconds, the last time the creature dealt damage on other creature.

.type [int]: Returns the creature type ID.

.isattackme [boolean]: Returns true if creature is attacking, false otherwise.

.isplayerattack [boolean]: Returns true if creature is attacking player, false otherwise.

.ismonster [boolean]: Returns true if creature is a monster, false otherwise.

.isplayer [boolean]: Returns true if creature is a player, false otherwise.

.isshootable [boolean]: Returns true can be shot from your position, false otherwise.

.isreachable [boolean]: Returns true can be reach from your position, false otherwise.



1.4.2 Skull Types ID's

0: Creature is not skulled.

1: Creature is yellow skulled.

2: Creature is green skulled.

3: Creature is white skulled.

4: Creature is red skulled.

5: Creature is black skulled.

6: creature is orange skulled.



1.4.3 War Banner Types ID's

0: Creature have no war banner.

1: Creature have green war banner, friend.

2: Creature have red war banner, enemy.

3: Creature have blue war banner, neutral.



1.4.4 Party Types ID's

0: Creature have no party.

1: Creature is leader inviting you to party.

2: Creature is member invited to party

3: Creature is member of a party

4: Creature is leader of the party

5: Creature have exp share working fine, member of a party

6: Creature have exp share working fine, leader of the party

7: Creature have exp share on standby, member of a party

8: Creature have exp share on standby, leader of the party

9: Creature have exp disabled because of a low level char or player in different floor, member of a party

10: Creature have exp disabled because of a low level char or player in different floor, leader of the party

 

 

 

2 Functions

2.1 Self Class

This functions will have some value relational with your character, or do your character realize an action.

2.1.1 Self Information

cancast(string castspell) [boolean]: Returns true if can cast spell at the moment it called the function, false otherwise.

cooldown(string spell) [int]: Returns number, in milliseconds, of time needed for cool down spell.

exptolevel(optional int level) [int]: If level is not specified, returns the amount of exp left for next level. Otherwise, returns the amount of exp left for level.

findcreature(string name) [int]: Returns the distance of the first creature found with name, if not found returns -1 as value.

istrapped() [boolean]: Returns true if your character is trapped by unwalkable objects, false otherwise.

maround(optional int range, optional bool allfloors, optional string names) [int]: Returns number of monsters found within the parameters, if optional values are not set, returns all monsters found within range 7, including only your floor.

paround(optional int range, optional bool allfloors, optional string names) [int]: Returns number of players found within the parameters, if optional values are not set, returns all players found within range 7, including only your floor.



2.1.2 Self Actions

attack(string creature) [void]: Attacks the first creature found with name creature name.

bedtrain(int x, int y, int z, string style) [void]: Reaches the bed located at given coordinates and start training offline, parameters for style are "axe", "club", "distance", "magic level" or "sword".

buyitems(string item, int count) [void]: Buys count amount of items named itemname, which must be exactly the way it appears in the trade list. A trade window must be open.

buyitemsupto(string item, int amount, optional int currentamount) [void]: Buy all amount of items.

cast(string spellwords) [void]: Cast spellwords, first check if you have the spell in hotkeys and use it, if not he try write the spell.

depositall() [void]: Uses say and npcsay to deposit all.

depotdeposit(string backpack, items) [void]: Deposit each item on items array into backpack.

dropitems(int id) [void]: Drop first item id found on any backpack.

eatfood() [void]: Eat first food item found on any backpacks.

fish(int dist, optional bool wait) [void]: Uses fishing rod on each water tile or water elemental body tile found within the range dist, optionally you can add to wait decay status of bodies to fish.

followcreature(string creature name) [void]: Follows the first creature found with name creature name.

levitate(string direction, string updown) [void]: Faces your character to the specified direction and levitate up or down.

move(string direction) [void]: Moves 1 square meter to any direction. Parameters for direction could be "n", "s", "e", "w", "nw", "ne", "sw" and "se".

moveitems(string item, string from, optional string onto, optional in count) [void]: Move item of id or name in location.

moveitemsonto(string item, string from, string to, int amount, int index) [void]: Move item of id or name in to another item.

npcsay(string text) [void]: Says text in the 'NPCs' channel.

openhole(int x, int y, int z) [void]: Open hole located on tile with positions xyz defined.

openitem(string item, optional string locationfrom, optional bool new, optional int index) [void]: Opens item, optionally you can add location to search for item, boolif new item, and item index number.

openpick(int x, int y, int z) [void]: Opens pick hole located on tile with positions xyz defined.

opensand(int x, int y, int z) [void]: Open sand hole located on tile with positions xyz defined.

opentrade() [void]: Open trade using say and npcsay functions.

pickupitems(string dir, array items) [void]: Pickup each item on items array and direction, to the first open backpack found.

reachcreature(string name) [void]: Reaches the first creature found with name.

reachgrounditem(string/int item) [void]: Moves your character to stand next to the closest item found on the screen.

reachlocation(int x, int y, int z) [boolean]: Reach and return true value if you reached tile location xyz defined, false otherwise.

resizewindow(string/int item, int size) [void]: Resize window. Can be used item or backpack index.

resizewindows() [void]: Resizes all windows to minimum size.

say(string text, optional string channel) [void]: Says text in channel, if optional channel was not typed in, it says on default channel.

sellflasks() [void]: Try sell all visible flasks. A trade window must be open.

sellitems(string itemname, int count) [void]: Sells count amount of items named itemname, which must be exactly the way it appears in the trade list. A trade window must be open.

sellitemsupto(string item, int amount, optional int currentamount) [void]: Sell all amount of items.

skin(int dist, optional bool wait) [void]: Uses obsidian knife on each skinable tile found within the range dist, optionally you can to wait decay status of bodies to skin.

stake(int dist, optional bool wait) [void]: Uses blessed wooden stake on each stakeable tile found within the
range dist, optionally you can to wait decay status of bodies to stake.

stopattack() [void]: Simulates the press of button 'ESC', stop all current actions to be made.

turn(string direction) [void]: Faces your character to the specified direction. Direction can be: "n", "e", "s" or "w".

useitem(string/int item, string location) [void]: Uses item with id / name inside location.

useitemon(string item, int x, int y, int z) [void]: Uses backpack item with id / name in sqm.

useitemonitem(string item, string itemon, string itemon location) [void]: Uses backpack item on second item parameter inside container location.

useitemontarget(string item, string creature) [void]: Uses item on your backpack on target creature.

uselever(int x, int y, int z) [void]: Use lever located on tile with positions xyz defined.




2.2 System Class

2.2.1 Bot System

flashclient() [void]: Flashes the client window for around 5 seconds.

focusclient() [void]: Gives focus to the client window.

getsettings(string settingpath) [string]: Gets the value of any setting in the bot as a string representation. The string settingpath must contain the full path of the setting such as "Settings/Healer/Healer/Enabled".

gotolabel(string/int label) [void]: Sets the next waypoint to be the waypoint with the label label name or label id.

islocation(optional int range) [boolean]: Returns true if the action script is executed at the location where the action waypoint was set and false otherwise. If the optional parameter range is specified, return true/false if you are standing within range tiles of the waypoint location in x or y.

pausewalking(int time) [void]: Pauses execution of the cavebot for time milliseconds and resumes once that interval has elapsed.

print(any argument) [void]: Display arguments in a readable form on debug bot system.

setalarms(string value) [void]: Sets the Alarms engine on or off. Value can be 'yes' or 'no'.

setcavebot(string value) [void]: Sets the Cavebot engine on or off. Value can be 'yes' or 'no'.

setlooting(string value) [void]: Sets the Looting engine on or off. Value can be 'yes' or 'no'.

setsettings(string path, string value) [void]: Set the value of any setting in then bot as a string representation. The string settingpath must contain the full path of the setting such as "Settings\\Healer\\Healer\\Enabled".

settargeting(string value) [void]: Sets the Targeting engine on or off. Value can be 'yes' or 'no'.

showbot() [void]: Show the main bot window.

showsettings() [void]: Show the settings window.

updateworld() [void]: Synchronization of all variables in bot with Lua.

wait(int first time, optional int second time) [void]: Pauses execution of the current script for first time milliseconds and resumes once that interval has elapsed. If the optional parameter second time is specified, waits
random amount between first time and second time.



2.2.2 Operational System

date() [string]: Returns string with the current date.

days() [int]: Returns number of the current day.

playsound(string filename) [void]: Plays sound filename (ex: "alert.wav") found in the bot's "\sounds" directory.

screenshot(optional string filename) [void]: Takes a screenshot of the entire client window. If filename is not specified, a filename with the character name and the current date and time will be created.

time() [string]: Returns string with the current time.

tosec(string time) [int]: Returns seconds in number converted from string time.



2.3 Client Class

2.3.1 Client Information

clientitemhotkey(int id, string type) [string]: Searches for the specified item in your client hotkeys and returns a representation of the key sequence it's binded to, (like "F1", "Shift + F5"), otherwise returns "not found" if it wasn't found. Optionally, you may also specify a type, passing "self", "target", "crosshair" or "all" as the second parameter.

clienttexthotkey(string text, string type) [string]: Searches for the specified text in your client hotkeys and returns a representation of the key sequence it's binded to, (like "F1", "Shift + F5"), otherwise returns "not found" if it wasn't found. Optionally, you may also specify a type, passing "manual", "automatic" or "all" as the second parameter.

ischannel(string name) [boolean]: Returns true if the channel is open, false otherwise.

iswindowminimized(string/int name/index) [boolean]: Returns true if the window is opened, false otherwise. Parameter could be "equip", "battle" or the backpack index/name.

isviponline(string name) [boolean]: Returns true if the character with name given is online, false otherwise.

tradecount(string tradetype, int item) [int]: Returns the maximum ammount of the item that can be sold/bought(tradetype). If 'buy', it is determined by your gold and capacity; if 'sell', by the ammount you are currently carrying of that item. If trade window is closed, returns -1.

windowcount(optional string location name) [int]: Returns the count of windows that are currently open. Optionally, you can specify which windows to consider by providing the 'location name' parameter.

cursorinfo() [userdata]: A pointer for mouse position information.

.id: [int] Returns item id of cursor pointer.

.x: [int] Returns x position of cursor pointer.

.y: [int] Returns y position of cursor pointer.

.z: [int] Returns z position of cursor pointer.


 

2.3.2 Client Actions

autosiovip(int percent) [void]: Heal your characters found in the VIP list that are on your screen and have less than the given percent value of health points.

closetibia() [void]: Closes the client, same as x-log.

closewindow(string/int item) [void]: Close window in description of item, can be item id / name or backpack index.

closewindows() [void]: Close all client windows, like equipment, battle window, backpacks.

connect(string account, string password, string name) [void]: Connects character name with the account and password values.

logout() [void]: Logs you out by pressing Ctrl+L if you are not battlesigned.

minimizeclient() [void]: Minimizes the tibia client window.

reconnect() [void]: Reconnects the last character was logged in.

restoreclient() [void]: Maximizes the tibia client window.

setattackmode(string attack option) [void]: Sets the attack mode of your character to attack option which can be "offensive", "balanced", "defensive", "stand" or "chase".

usehotkey(string key) [void]: Uses F-key hotkey. As key you can use "F1 to F12", "SHIFT+F1 to F12" and "CTRL+F1 to F12".



2.4 HUD Class

2.4.1 HUD Creation and Display

addhudloot(int/string item, int value) [void]: Add a text to the hud loot counter with the name and value of the item looted. (needs more info)

addhudsupplie(int/string item, int value) [void]: Add a text to the hud loot counter with the name and value of the item supply. (needs more info)

addtext(string text, int x, int y) [void]: Adds a text element with the previously specified font style to the current display at position x and y within the display.

rgbcolor(int red, int green, int blue) [string]: Return the rgb color to be used in setfontcolor.

setfontcolor(string color) [void]: Sets the color of the font to color.

setfontstyle(string name, int size, string color) [void]: Sets the name, size and style of the font.

setposition(int width, int heigh) [void]: Sets the width and heigh of the display.




2.5 Item Class

2.5.1 Item Information

getitems(string items) [userdata]: Returns data structure of each item in items array. (needs more info)

itemcost(string/int item) [int]: Returns the price of an item with id/name item.

itemcount(string/int item, optional string location name) [int]: Returns the count of item with name/id as seen in open backpacks.

itemid(string itemname) [int]: Returns the id of item with name itemname.

itemname(int itemid) [string]: Returns the name of the item with id itemid.

itemvalue(string/int item) [int]: Returns the value of an item with id/name item.

servercountitem(string item) [int]: Returns the count of item with name/id as seen in the latest 'Using one of itemname...' message. It's called a server count because the server is counting the items for you while they don't have to be visible.

itemproperty(int/string itemid) [userdata]: Returns a pointer to the item data structure. (List is large so I'll not explain each property, some info is missing)

.Brightness [integer]

.ClothSlot [string]

.DisplacementX [integer]

.DisplacementY [integer]

.Elevation [integer]

.ID [integer]

.isAnimateAlways [boolean]

.isAutomap [boolean]

.isAutomapColor [integer]

.isAvoid [boolean]

.isBank [boolean]

.isBottom [boolean]

.isClip [boolean]

.isCloth [boolean]

.isContainer [boolean]

.isCumulative [boolean]

.isDisplaced [boolean]

.isDontHide [boolean]

.isForceUse [boolean]

.isFullBank [boolean]

.isHangable [boolean]

.isHeight [boolean]

.isHookEast [boolean]

.isHookSouth [boolean]

.isIgnoreLook [boolean]

.isLensHelp [boolean]

.isLight [boolean]

.isLiquidContainer [boolean]

.isLiquidPool [boolean]

.isLyingObject [boolean]

.isMarket [boolean]

.isMultiUse [boolean]

.isRotateable [boolean]

.isTakeable [boolean]

.isTop [boolean]

.isTranslucent [boolean]

.isUnmoveable [boolean]

.isUnpassable [boolean]

.isUnsight [boolean]

.isWritable [boolean]

.isWritableOnce [boolean]

.LensHelp [integer]

.LightColor [string]

.MarketName [string]

.MarketRestrictLevel [integer]

.MarketRestrictProfession [string]

.MarketShowAs [string]

.MarketTradeAs [string]

.MaxTextLenght [integer]

.Waypoints [integer]

 


2.6 Tile Class

2.6.1 Tile Information

iscreatureontile(int x, int y, int z) [boolean]: Returns true if there is a creature on tile, false otherwise.

isitemontile(string/int item, int x, int y, int z) [boolean]: Returns true if the item is on tile, false otherwise.

tilereachable(int x, int y, int z) [boolean]: Returns true if the tile can be reached, false otherwise.

tileshootable(int x, int y, int z) [boolean]: Returns true if the tile can be shooted, false otherwise.

tilewalkable(int x, int y, int z) [boolean]: Returns true if the tile can be walked, false otherwise.

toptileitem(int x, int y, int z) [int]: Returns the ID of the tile's top item at given coordinates.

topitem(int x, int y, int z) [userdata]: Returns pointer to the top item on tile at given coordinates.

.count [int]: Returns count of items on tile.

.id [int]: Returns id of item on tile.

gettile(int position x, int position y, int position z) [userdata]: Returns the data structure of a tile with coordinates x, y and z.

.count [int]: Returns the count of items on the tile.

.items [userdata]: Returns the data structure for an item on the tile. You must index item with an int value starting from 1 to specify which item you want to access.

.count [int]: Returns the amount of the item.

.id [int]: Returns the id of the item.


 

2.7 Container Class

2.7.1 Container Information

getcontainer(string/int container) [pointer]: Returns the data structure of a container. You could index container with an int value starting from 0 to specify which container you want to access.

.id [int]: Returns the item id of the container window.

.index [int]: Returns the index of the container window.

.maxslots [int]: Returns the maximum count of items that can be stored in the container.

.name [string]: Returns the name of the container window.

.open [string]: Returns true if the container is open and false otherwise. Always check if a container is open before accessing it's other elements because values stay in memory even after the container has been closed.

.usedslots [int]: Returns the count of items in the container.

.items [userdata]: Returns the data structure for an item in the container. You must index item with an int value starting from 1 to specify which item you want to access.

.count [int]: Returns the amount of the item.

.id [int]: Returns the id of the item.




2.8 Message Class

2.8.1 Messages Information

getmessages(string channel name) [userdata]: Returns all messages data structure of the channel name. You must index which message you want by adding a int starting from 0 to max count of messages.

getnewmessages(string channel name) [userdata]: Returns the current messages data structure of the channel name that you are receiving. You must index which message you want to access by adding a int starting from 0 to max count of messages.

.count [int]: Returns the max amount of messages got in the channel name. This parameter doesn't need to be indexed.

.text [string]: Returns the context of a message.

.sender [string]: Returns the sender of a message.

.type [int]: Returns the type of a message.



2.8.2 Message Type ID's

0: Status message (In the screen).

1: Player/NPC message in Local Chat channel.

2: Any player whispering.

3: Any player yelling.

5: Any NPC answers in NPC channel.

6: Private messages from other players.

7: Any player message in Game/Help/Real/Tutor/Trade channel.

15: Red alert messages.

16: Any white alert message, like raids and skill advance (Only on middle screen).

17: Game/Channel welcome messages.

18: Status messages in Server Log, like raids and skill advance.

19: Green messages, like loot message, in Server Log.

21: Private messages sent by you.

 


2.9 Creature Class

2.9.1 Creatures Information

ignorecreature(int id, bool ignore) [void]: Set the creature with id creature id to be ignored by bot actions.

getcreature(int/string id/name) [userdata]: Returns the data structure for some creature with id or name defined. Parameters shown below, you don't need to index what creature you want to access because it returns a single one.

getcreatures(string filter) [userdata]: A special type of loop iterator that cycles through all creatures and lets you script various operations on each one of them. You must index what creature you want to access by adding a int starting from 0 to max count of creatures. As filter you can pass a combination of conditions defined as follows:
p: creature must be a player.
m: creature must be a monster.
f: creature must be on the same floor as you.
s: creature must be on the same floor as you and on the visible
portion of the screen.
You can use pointers in the same way of target and follow variables
with the additional .count pointer:

.count [int]: Returns the max amount of creatures got with filter. This parameter doesn't need to be indexed.

.id [int]: Returns the unique ID of the creature.

.name [string]: Returns the creature's name.

.hpperc [int]: Returns the creature's health percentage.

.x [int]: Returns the creature's x coordinate.

.y [int]: Returns the creature's y coordinate.

.z [int]: Returns the creature's z coordinate.

.direction [string]: Returns the creature's direction name as "n", "s", "w" or "e".

.outfit [int]: Returns the ID of creature's outfit.

.speed [int]: Returns the creature's speed.

.dist [int]: Returns the biggest distance in either x or y between the creature and your character.

.skull [int]: Returns the creature's skull type id.

.party [int]: Returns the creature's party type id.

.waricon [int]: Returns the creature's war banner type id.

.visible [int]: Returns 1 if the creature is visible, 0 otherwise.

.walking [int]: Returns 1 if the creature is visible, 0 otherwise.

.ignored [boolean]: Returns true if creature is being ignored by the targeting system (if ignorecreature() was used on it), false otherwise.

.hittime [int]: Returns, in milliseconds, the last time the creature dealt damage on other creature.

.type [int]: Returns the creature type ID.·        

.isattackme [boolean]: Returns true if creature is attacking, false otherwise.

.isplayerattack [boolean]: Returns true if creature is attacking player, false otherwise.

.ismonster [boolean]: Returns true if creature is a monster, false otherwise.

.isplayer [boolean]: Returns true if creature is a player, false otherwise.

.isshootable [boolean]: Returns true can be shot from your position, false otherwise.

.isreachable [boolean]: Returns true can be reach from your position, false otherwise.


 

 

3 Miscellaneous Class

3.1 Variables

balance [int]: Returns the last bank balance amount reported by an NPC.


3.2 Functions

abs(int argument) [int]: Same as math.abs, returns the absolute value of arguments.

antifurnituretrap(optional string/int weapon) [void]: Break all items that are not walkable visible on screen. Optionally you can add an especific weapon to use, it'll use machete as default.

gold() [int]: Returns the amount of gold you're carrying, visible on screen.

keyevent(hex key) [void]: Press the button key. As parameter you must use hexadecimal value of a key.

positive(int argument) [int]: Returns the positive value of a math. Otherwise if value is negative it returns 0.

random(int first number, int second numer) [int]: Returns a random number between first number and second number.

shootarearune(int/string rune, int creature amount, string creature's name list) [void]: Shoot an area rune when amount of creatures defined are met, considering only creatures on the list.

underattack(string type) [boolean]: Returns true if you are under attack of the type defined. Parameters for type could be: 'p' and 'm'.

unpack(table argument) [void]: Same as table.unpack, it unpacks all values inside of a table.

wheretomove(int x, int y, int z) [userdata]: Returns the best position X, Y and Z to move the top item on tile.

.x [int]: Returns the position X.

.y [int]: Returns the position Y.

.z [int]: Returns the position Z.

 

_______________________________________________________

 

It took me a whole day to put this all together "visible" (I had to re-format everything line by line :()

So please, click on the  button if I helped you

 

Thank you so much and I hope this will be helpful for all of you  :D

6 people like this

Share this post


Link to post
Share on other sites

Damn, ctrl + f will be needed here! :D

Nice work though Gordon!

Share this post


Link to post
Share on other sites

Useful but theres no crack :( meanwhile im playing ot jaja

Share this post


Link to post
Share on other sites