-
Notifications
You must be signed in to change notification settings - Fork 19
Python functions reference
Rebell edited this page Apr 4, 2016
·
6 revisions
https://github.com/Wisling/tibiaauto/blob/master/tibiaauto-kernel/PythonEngine_fun.cpp
| Function Name | Parameters | Description |
|---|---|---|
| setProcessId | (int processId) | Changes the process TA recognizes as the Tibia client to processId |
| readSelfCharacter | () | Returns all known information about the currently logged in character |
| readContainer | (int containerNr) | Returns information for the container containerNr |
| readContainerItem | (int containerNr, int pos) | Returns information for the item in containerNr at pos |
| writeSelfLightPower | (int value) | Sets the brightness to value |
| writeSelfLightColor | (int value) | Sets the colour to value and accepts colours 0-255 used in Enable_Light |
| readSelfLightPower | () | Returns current light brightness |
| readSelfLightColor | () | Returns current light colour |
| cancelAttackCoords | () | Stops character movement and sets the goto coordinates to 0 |
| writeGotoCoords | (int x, int y, int z) | Sets the goto coordinates to x, y, z |
| getLoggedCharNr | () | Returns the creature number of the currently logged in character |
| getSelfEventFlags | () | Returns the condition flags for the character(fire, poison, logout block) |
| writeVisibleCreatureName | (int chNr, string name) | Sets the in-game name of the creature chNr to name |
| getTradeItemPartner | (int nr) | Returns information for the item at pos in the partner trade container |
| getTradeItemSelf | (int nr) | Returns information for the item at pos in your own trade container |
| getTradeCountPartner | () | Returns the number of items in the partner trade container |
| getTradeCountSelf | () | Returns the number of items in your own trade container |
| getAttackedCreature | () | Returns the tibiaId of the currently attacked creature |
| GetLoggedChar | (int processId) | Returns the name of the currently logged in character |
| readBattleListMax | () | Returns the highest creature number of a creature in the battle list(used for efficient iteration over creatures) |
| readBattleListMin | () | Returns the lowest creature number of a creature in the battle list(used for efficient iteration over creatures) |
| readVisibleCreature | (int nr) | Returns information for the creature nr |
| readItem | (int locationAddress) | Returns information for an item at memory address locationAddress |
| getCharacterByTibiaId | (int tibiaId) | Searches and returns the info for the creature matching tibiaId |
| mapGetPointItemsCount | (int x, int y, int z) | Returns the number of items at the relative coordinate x, y, z |
| mapGetPointItemId | (int x, int y, int z, int stackNr) | Returns info for the item at position stackNr on relative coordinate x, y, z |
| mapSetPointItemsCount | (int x, int y, int z, int count) | Sets the number of items at the relative coordinate x, y, z to count |
| mapSetPointItemId | (int x, int y, int z, int stackNr, int tileId) | Sets the item id at position stackNr on relative coordinate x, y, z to tileId |
| mapGetPointItemExtraInfo | (int x, int y, int z, int stackNr, int extraPos) | Returns an extra integer for item at position stackNr on relative coordinate x, y, z'extraPos*4 bytes past item end(0 is itemId, 1 is quantity/charId, 2 is usually 0) |
| mapGetPointStackIndex | (int x, int y, int z, int stackNr) | Returns the visual index of an item as seen in the Tibia client at internal position stackNr(usually in order of what you would drag off first staring with items, then players, then immovable tiles) |
| getCurrentTm | () | Gets the time of Tibia's internal client clock measured in miliseconds since the client was started |
| setRemainingTilesToGo | (int val) | When walking by clicking on a point, sets the number of steps it thinks it needs to take before sending another walk packet to val(max is 15) |
| setMemIntValue | (int address, int value) | Changes the 4-byte value of the number at address to value (0x01020304 saves as 04 03 02 01 which is appropriate for integers but not text) |
| getMemIntValue | (int address) | Retrieves the 4-byte value at address (FF 5D 01 00 is seen as 0x00015DFF which is appropriate for integers but not text) |
| writeEnableRevealCName | () | Edits Tibia's memory to reveal the creature names on different floors |
| writeDisableRevealCName | () | Edits Tibia's memory to hide the creature names on different floors |
| getProcessId | () | Returns the process id TA is using for the Tibia client |
| getKernelMainVersion | () | Returns TA's kernel version |
| getKernelPatchVersion | () | Returns TA's Patch version |
| writeCreatureLightPower | (int creatureNr, int value) | Sets the brightness for creatureNr to value |
| writeCreatureLightColor | (int creatureNr, int value) | Sets the colour for creatureNr to value and accepts colours 0-255 used in Enable_Light |
| readCreatureLightPower | (int creatureNr) | Returns current light brightness for creatureNr |
| readCreatureLightColor | (int creatureNr) | Returns current light colour for creatureNr |
| getTibiaTile | (int tileNr) | Returns all tibiaauto-items.xml information for tileNr |
| setGlobalVariable | (string name, string value) | Sets a global variable within TA to a certain string (internal values include "caveboot_halfsleep" and "caveboot_fullsleep" which can be set to "true" or "false") |
| getGlobalVariable | (string name) | Returns the string associated with the global TA variable |
| readMiniMap | (int nr) | Tibia keeps 10 *.map files in memory, this returns the map coordinates for the map store in slot nr along with the number of labels on the minimap |
| readMiniMapPoint | (int mapNr, int pointNr) | Returns an absolute coordinate and name of a label marked on minimap mapNr at index pointNr |
| setMainWindowText | (string text) | Changes the title of the Tibia client window to text |
| setMainTrayText | (string text) | Changes the text in the tool tip of the TA tray icon to text |
| getPlayerModeAttackPlayers | () | Returns a value of 1 if the unmarked character safety is on and 0 if the safety is off |
| getPlayerModeAttackType | () | Returns a value if 1 for full attack, 2 for balanced and 3 for full defense |
| getPlayerModeFollow | () | Returns 0 if follow is off and 1 if follow is on |
| getOpenWindowName | () | Returns the title of a subwindow within Tibia (such as "Quest log") |
| getConnectionState | () | Returns a value between 0 and 8 where 8 is connected, and 0 is disconnected. Other values signify a connection is in progress. |
| setXRayValues | (int v1, int v2) | Default is (7, 2). Sets the above-ground floor index to 'v1' and the underground floor index to 'v2' |
| getXRayValue1 | () | Returns the delta index of the floor while the character is above-ground (8 is one higher) |
| getXRayValue2 | () | Returns the delta index of the floor while the character is underground (3 is one higher) |
| writeCreatureDeltaXY | (int creatureNr, int deltaX, int deltaY) | Sets the intermediate walking state of creatureNr to deltaX pixels right and deltaY pixels down |
| setAttackedCreature | (int tibiaId) | Tells the client to put a red box around creature tibiaId. Doesn't do much else. |
| getCreatureDeltaX | (int creatureNr) | Gets the intermediate walking state of creatureNr |
| getCreatureDeltaY | (int creatureNr) | Gets the intermediate walking state of creatureNr |
| readVIPEntry | (int vipNr) | Gets information about the VIP entry at vipNr. A nonexistent VIP has a blank name. |
| mapGetPointTopPos | (int x, int y, int z) | Returns the index of the item that is visibly on top of the relative position x, y, z in the Tibia client(the index of the item that would move if you dragged sometihng off the tile |
| Function Name | Parameters | Description |
|---|---|---|
| useWithObjectFromFloorOnFloor | (int sourceObjectId, int sourceX, int sourceY, int sourceZ, int targetObjectId, int targetX, int targetY, int targetZ, int method=2) | This uses item sourceObjectId on ground tile sourceX, sourceY, sourceZ on another object targetObjectId ontargetX, targetY, tragetZ. (Like using a fishing rod placed underneath you on water) |
| useWithObjectFromFloorInContainer | (int sourceObjectId, int sourceX, int sourceY, int sourceZ, int targetObjectId, int targetContNr, int targetPos, int method=2) | This uses item sourceObjectId on ground tile sourceX, sourceY, sourceZ on another object targetObjectId intargetContainerNr at targetPos. (Not used very often) |
| useWithObjectFromContainerInContainer | (int sourceObjectId, int sourceContNr, int sourcePos, int targetObjectId, int targetContNr, int targetPos, int method=2) | This uses item sourceObjectId in sourceContainerNr at sourcePos on another object targetObjectId intargetContainerNr at targetPos. (For carving ice cubes) |
| useWithObjectFromContainerOnFloor | (int sourceObjectId, int sourceContNr, int sourcePos, int targetObjectId, int targetX, int targetY, int targetZ, int method=2) | This uses item sourceObjectId in sourceContainerNr at sourcePos on another object targetObjectId ontargetX, targetY, tragetZ. (Like using a fishing rod on water) |
| useWithObjectOnFloor | (int sourceObjectId, int targetObjectId, int targetX, int targetY, int targetZ, int method=2) | This uses item sourceObjectId on another object targetObjectId on targetX, targetY, tragetZ from a closed backpack. (Like using a rune on a tile) |
| useWithObjectInContainer | (int sourceObjectId, int targetObjectId, int contNr, int itemPos, int method=2) | This uses item sourceObjectId on another object targetObjectId in targetContainerNr at targetPos from a closed backpack. |
| moveObjectFromFloorToFloor | (int objectId, int srcX, int srcY, int srcZ, int destX, int destY, int destZ, int quantity) | Moves quantity items objectId from location srcX, srcY, srcZ to location destX, destY, destZ |
| moveObjectFromFloorToContainer | (int objectId, int sourceX, int sourceY, int sourceZ, int targetContNr, int targetPos, int quantity) | Drags quantity items objectId from location srcX, srcY, srcZ to targetContNr at targetPos(Item automatically goes to first slot or gets put into a subcontainer) |
| moveObjectBetweenContainers | (int objectId, int sourceContNr, int sourcePos, int targetContNr, int targetPos, int qty) | Drags quantity items objectId from sourceContNr at sourcePos to targetContNr at targetPos(Item automatically goes to first slot or gets put into a subcontainer) |
| moveObjectFromContainerToFloor | (int objectId, int contNr, int pos, int x, int y, int z, int quantity) | Drags quantity items objectId from sourceContNr at sourcePos to location x, y, z(Item automatically goes to first slot or gets put into a subcontainer) |
| castRuneAgainstCreature | (int contNr, int itemPos, int runeObjectId, int creatureId, int method) | Uses any item runeObjectId from contNr at itemPos on creatureId |
| castRuneAgainstHuman | (int contNr, int itemPos, int runeObjectId, int targetX, int targetY, int targetZ, int method) | Uses any item runeObjectId from contNr at itemPos to tile targetX, targetY, targetZ |
| useItemOnCreature | (int objectId, int creatureId) | Uses item objectId from a closed backpack on creatureId |
| useItemFromContainerOnCreature | (int objectId, int contNr, int itemPos, int creatureId) | Uses item objectId from contNr at itemPos on creatureId |
| useItemFromFloorOnCreature | (int objectId, int x, int y, int z, int creatureId) | Uses item objectId from location x, y, z on creatureId |
| sendTAMessage | (string msg) | Loops an internal text message msg to your client that only you can see |
| useItem | (int objectId) | Uses an item objectId from a closed backpack |
| useItemOnFloor | (int objectId, int x, int y, int z) | Uses an item objectId at location x, y, z |
| useItemInContainer | (int objectId, int contNr, int pos) | Uses an item objectId from contNr at itemPos |
| openAutoContainerFromFloor | (int objectId, int x, int y, int z) | Opens a container objectId at location x, y, z and also returns the container number it opens in |
| openContainerFromFloor | (int objectId, int x, int y, int z, int targetBag) | Opens a container objectId at location x, y, z as container number targetBag |
| openAutoContainerFromContainer | (int objectId, int contNrFrom, int contPosFrom) | Opens a container objectId from contNrFrom at contPosFrom and also returns the container number it opens in |
| openContainerFromContainer | (int objectId, int contNrFrom, int contPosFrom, int targetBag) | Opens a container objectId from contNrFrom at contPosFrom as container number targetBag |
| say | (string buf) | Say a message buf to players through default chat |
| sayWhisper | (string buf) | Whisper a message buf to players through default chat |
| sayYell | (string buf) | Yell a message buf to players through default chat |
| sayNPC | (string msg) | Say a message buf through NPC chat to NPCs |
| npcBuy | (int objectId, int qty, int ignoreCap, int withBackpack) | Purchace qty items of objectId using parameters ignoreCap and withBackpack. Only useful after saying "hi" to an NPC, "trade" is not necessary. |
| npcSell | (int objectId, int qty) | Sell qty items of objectId. Only useful after saying "hi" to an NPC, "trade" is not necessary. |
| tell | (string msg, string playerName) | Send playerName a message msg through private chat |
| sayOnChan | (string msg, int channelId1, int channelId2) | Say msg by means of speech type channelId1(say, yell, channel) with subtype channelId2 (Summary here) |
| logout | () | Send a logout command to the server |
| walkOnTAMap | (int x, int y, int z) | Set a position x, y, z to walk to at any distance that is researched in TA |
| closeContainer | (int contNr) | Close the container contNr. The number of the backpacks you want to close should be kept track of when you open them |
| attackMode | (int mode, int follow) | Sends new attack style mode and run style follow to the Tibia server. Buttons will not change but you will act differently. |
| attack | (int tibiaCharId) | Sends an command to attack tibiaCharId |
| follow | (int tibiaCharId) | Sends an command to follow tibiaCharId |
| turnLeft | () | Sends a command to turn char left |
| turnRight | () | Sends a command to turn char right |
| turnUp | () | Sends a command to turn char up |
| turnDown | () | Sends a command to turn char down |
| sendCreatureInfo | (string name, string info1, string info2) | Changes the client-sided name line, info line 1 and info line 2 (3 lines total) to name, info1, info2respectively |
| look | (int x, int y, int z, int objectId) | Sends a requests to look at objectId at location x, y, z but this only works for the top item |
| ignoreLook | (int ignoreLookEnd) | Will prevent any green text from displaying up until ignoreLookEnd < tareader.getCurrentTm() |
| sendAutoAimConfig | (int active, int onlyCreatures, int aimPlayersFromBattle) | (Deprecated) Does nothing, but is there :P |
| sendClearCreatureInfo | () | Will reset the information of creatures that are not currently onscreen ie(last location, last hp%, tibiaId) |
| enableCName | (int enable) | Will set the visibility of creature names on lower floors to enable |
| sendAttackedCreatureToAutoAim | (int attackedCreature) | (Deprecated) Does nothing, but is also there :P |
| stopAll | () | Simulates the pressing of the ESC key in Tibia |
| Function Name | Parameters | Description |
|---|---|---|
| removePointAvailable | (int x, int y, int z) | Sets the TA map location as unexplored/blocking |
| prohPointClear | () | Clears the temporary list of points blocked by players and creatures |
| prohPointAdd | (int x, int y, int z) | Makes location x, y, z a blocked point(used as a temporary indicator for creatures and players) |
| getPointUpDown | (int x, int y, int z) | Returns the code for the type of level change tile (Summary here) |
| getPointUpDownNoProh | (int x, int y, int z) | Returns the code for the type of level change tile while ignoring prohibited points(Summary here) |
| setPointUpDown | (int x, int y, int z, int updown) | Sets the location as a floor change tile indicate by updown |
| getPrevPointZ | (int x, int y, int z) | Returns the z coordinate 1 square prior to x, y, z along the previously computed path |
| getPrevPointY | (int x, int y, int z) | Returns the y coordinate 1 square prior to x, y, z along the previously computed path |
| getPrevPointX | (int x, int y, int z) | Returns the x coordinate 1 square prior to x, y, z along the previously computed path |
| clearPrevPoint | () | Removes the coordinate 1 square prior to x, y, z along the previously computed path |
| setPrevPoint | (int x, int y, int z, int prevX, int prevY, int prevZ) | Sets the coordinate 1 square prior to x, y, z along the path you wish to keep track of |
| clear | () | Resets all prohibited points, available tiles, and previously computer paths to a blank state |
| setPointAsAvailable | (int x, int y, int z) | Sets the TA map location as walkable |
| isPointAvailable | (int x, int y, int z) | Returns whether the TA map at location is walkable |
| isPointAvailableNoProh | (int x, int y, int z) | Returns whether the TA map at location is walkable and is not in the prohibited point list |
| size | () | Returns the current number of points being kept track of in the TA map |
| Function Name | Parameters | Description |
|---|---|---|
| match | (int x, int y, int z) | Sets the TA map location as unexplored/blocking |
| Function Name | Parameters | Description |
|---|---|---|
| respond | (string text, string id) | Will send a artificially created message to player with name id in response to text |
| Function Name | Parameters | Description |
|---|---|---|
| findCreatureStatForLocationTibiaId | (int x, int y, int z, int pos) | Crashes TA |
| findCreatureStatForLocationCount | (int x, int y, int z) | Crashes TA |
| findCreatureStatForLocationName | (int x, int y, int z, int pos) | Crashes TA |
| findCreatureStatInArea | (int x, int y, int z, int rangeXY, int rangeZ) | Crashes TA |
| Function Name | Parameters | Description |
|---|---|---|
| getName | (int objectId) | Returns the name found for the item objectId within the items.xml |
| getObjectId | (string name) | Returns the item ID for the item named name within the items.xml |
| getValueForConst | (string code) | Returns an integer value for the constant named code within the items.xml |
| refreshItemLists | () | Retreives all the changes to the item lists after editing the items.xml |
| getCorpseIdByCreatureName | (string name) | (Depricated) Returns the ID of the corpse for creatures named name |
| getItemsItems | (int nr) | Return the name of item number nr |
| getItemsItemsId | (int nr) | Return the ID of item number nr |
| getItemsItemsCount | () | Return the total number of regular items in the items.xml |
| getItemsFood | (int nr) | Return the name of food item number nr |
| getItemsFoodId | (int nr) | Return the ID of food item number nr |
| getItemsFoodCount | () | Return the total number of food items in the items.xml |
| getItemsCorpses | (int nr) | Return the name of corpse number nr |
| getItemsCorpsesId | (int nr) | Return the ID of corpse number nr |
| getItemsCorpsesCount | () | Return the total number of corpses in the items.xml |
| getItemsLooted | (int nr) | Return the name of loot item number nr |
| getItemsLootedId | (int nr) | Return the ID of loot item number nr |
| getItemsLootedCount | () | Return the total number of loot items in the items.xml |
| Function Name | Parameters | Description |
|---|---|---|
| startModule | (string name) | Starts the given TA module |
| stopModule | (string name) | Stops the given TA module |
| getModuleDesc | (string name) | Returns the description within given TA module |
| isModuleStarted | (string name) | Returns whether or not given TA module is started |
| getModuleVersion | (string name) | Returns the version within given TA module |
| getModuleParam | (string moduleName, string paramNamee) | Returns configuration parameter value of the given module |
| setModuleParam | (string moduleName, string paramName, string vaulue) | Sets configuration parameter value of the given module |
| startPythonModule | (int nr) | Starts Python module number nr |
| stopPythonModule | (int nr) | Stops Python module number nr |
| getPythonModuleCount | () | Returns the number of Python modules |
| getPythonModuleName | (int nr) | Returns the name of Python module number nr |
| isPythonModuleStarted | (int nr) | Returns the description within Python module number nr |
| getPythonModuleDesc | (int nr) | Returns whether or not Python module number nr is started |
| getPythonModuleVersion | (int nr) | Returns the version within Python module number nr |