EventsonScriptActivation()Executed: after activating the script
onScriptDeactivation()Executed: before deactivating the script
onReceiveItemOnGround(x, y, z, itemId)Executed: when item appears on ground (dropped for example)
onChangeLocation(x, y, z)Executed: when x, y or z is changed.
onReceivePlatinumUpdate(platinum)Executed: when platinum count is received
onReceiveCurrentHp(hp)Executed: when current HP is changed
onReceiveCurrentMp(mp)Executed: when current MP is changed
onReceiveEnemyHp(uid, hp_percent, name)Executed: when enemy HP percentage is received
onReceiveRemoveItemFromGround(x, y, z)Executed: when item on ground is removed (taken for example)
onReceiveClearBackpack(slot, itemId)Executed: when backpack slot is erased (dropped item, used potion, etc)
onReceiveAddItemToDepot(slot, itemId)Executed: when item is stored to a slot in depot
onReceiveAddItemToBackpack(slot, itemId)Executed: when item appears in backpack slot (taken, retrieved from depot, bought, etc)
onReceiveGroundText(x, y, z, type, text)Executed: when ground text appears ('X EP or anything else like damage values)
onKilledEnemy(name, templateId)Executed: when character kills an enemy
onReachedLocation(x, y, z)Executed: when character reaches location after executing GoToNpc or GoToLocation methods
onReachedNpc(uid, name)Executed: when npc is reached after executing GoToNpc and GoToNpcEx methods
onReceiveTalkWithNpc(name)Executed: when chat with npc is started
onReceiveLeavedNpc()Executed: when chat with npc is ended
onReceiveNpcText(name, text, page)Executed: for each npc chat text
*page is deprecated
onReceiveNpcAnswer(text, id)Executed: for each npc chat option
Must return True/False. False = stop proceeding all other npc options.
onReceiveNpcAnswers(answers)Executed: all npc chat options at once as a list
onReceiveQuestLogUpdate(text)Executed: when quest log is updated
onReceiveDirectionMarker(x, y, z, text)Executed: when received new direction marker
onWaypointsEnded()Executed: when reached waypoints end and there are nowhere else to go
onReceiveLeftShop()Executed: when left the current shop character was in.
onReceiveEnteredMenu(shopPacket, menuId, title)Executed: when entered menu. <1/0 if entered shop, unique menu id, menu title>
onReceiveMenuRows(rows)Executed: after receiving all menu rows
Row values: menuId, menu row id, menu row name, templateId (itemId, look, etc)
Row values are textual.
onReceiveMenuRowsEx(rows)Executed: after receiving all menu rows. Rows contain more information from menu.
Row values: menuId, menu row id, menu row name, templateId (itemId, look, etc), menu row name (again), unused string, price/etc, is row activated or not
Row values are textual.
onReceiveMenuText(menuId, title, text):Executed: when menu text packet is received.
onReceiveFullBackpack(slot1, slot2, slot3, slot4, slot5.....slot16)Executed: on full backpack update (log in, etc)
onTalkedWithNpc(uid, result (true/false))Executed: when used TalkToNpc or used GoToNpc functions. If result = false, you can use this event to try to talk to npc again.
onDisconnect(info)Executed: when character is being disconnected
onConnect()Executed: when character connects to the game
onTick()Executed: every x milliseconds. Use script.EnableTickEvent(interval) function to enable it.
onReceiveAddCreature(uid, spawn, dir, name, obj_type, icon, looktype)Executed: when new creature appears on screen.
onRemoveCreature(uid, name, looktype, entity_type, x, y, z)Executed: when creature gets removed from screen. (Death, logout, teleport somewhere, etc)
onReceivePrivateMessage(name, text)Executed: when someone sends you a private message.
onReceiveGuildChat(name, text)Executed: when guild member sends a message in guild chat.
onReceivePublicChat(uid, name, text)Executed: when someone speaks in public chat nearby.
onReceivePingPacket()Executed: every ~1 minute when cipsoft pings client. (Doesn't work when char is walking)
onReceiveUserData(icon, looktypeId)Executed: when server updates client outfit.
onReceiveItemDescription(itemId, name)Executed: when received item in backpack/when looked at item's description.
Return: 1 - if you want bot to drop that item, 0 - keep it.
onReceiveItemDescriptionEx(itemId, name, slot)Executed: when received item in backpack/when looked at item's description.
onReceiveItemDescriptionBackpack(itemId, name, slot)Executed: when received item in backpack only.
onReceiveItemDescriptionDepot(itemId, name, slot)Executed: when received item in depot only.
onReceiveGameMessage(text):Executed: when server broadcasts message or when you look at tile and etc.
onEraseMonsterHealth():Executed: when enemy health bar is erased.
onCharacterInactive():Executed: when character inactive alarm is played.
onReceiveNpcDialogue(name, text, answers):Executed: when npc text and answers are received.
answers is array
To check if answer is in array use something like that:
if 'blabla' in answers:To get answer id, use
script.GetAnswerId('answer', answers) function.
onSkillDeactivated(skill):Executed: when skill effect is finished and skill enters cooldown phase.
<skill: 1 - left, 2 - right>
onSkillActivated(skill):Executed: when skill gets activated.
<skill: 1 - left, 2 - right>
onSkillExecuted(skill):Executed: when skill gets executed (used).
<skill: 1 - left, 2 - right>
Won't work if skill is running out and you're not attacking anyone, because at that condition server only updates it when time is up.
onReachedTileLocation(spriteId, location, inline (True/False - inline or on tile)):Executed: when script.GoToTile function finishes moving character.
Methodsscript.ShowMessage('text', 'title')- Displays window message
script.StatusMessage('text')- Displays ingame message
script.SetWay(setId:byte, reverse:byte)- Sets current waypoints set <set_id, 1 - reverse / 2 - don't reverse / 0 - keep default>
script.GetWay()- Returns current waypoint set
script.GetX()- Returns current x position
script.GetY()- Returns current y position
script.GetZ()- Returns current z position
script.GetLevel()- Returns current level.
script.GetExp()- Returns current experience
script.GetGold()- Returns current gold
script.GetPlatinum()- Returns current platinum
script.SetVar('key', value)- Sets variable by key.
Key must be a string, value can be any type.
script.GetVar('key')- Returns variable by key or 0 if variable not set.
script.SetRegVar('key', value)- Sets variable in script registry by key.
Key must be a string, value can be any type.
script.GetRegVar('key')- Returns variable from script registry by key or 0 if variable not set.
script.GoToNpc('name', range:int)- Goes to specified npc nearby <name, range 1-8>
- Returns true if success, false otherwise
script.ForgetNpc()- Forget npc executed by "GoToNpc"
script.EndNpcChat()- Send 'Farewell" to npc.
script.ChooseNpcOption(option:byte)- Choose npc chat option by id <id 0-xx>
script.Alarm('text')- Play bot alarm with specified text <text>
script.GoToLocation(x, y, z) - Goes to specified location nearby <x, y, z>
script.LogoutFor(seconds)- Logs out character for n seconds.
script.Logout()- Logs out character permanently.
script.LogoutUntil('timeOfDay')- Logs out character until time of day. Format: HH:MM (Example.: 17:45)
script.LogoutUntilEx('timeOfDay', offset)- Logs out character until time of day with offset in seconds. Format: HH:MM (Example.: '17:45', -60 -> Will relog at 17:45 - 60 seconds)
script.DisconnectAt('time' )- Logs out character at specified time of day. Format: HH:MM (Example.: 17:45)
script.DisconnectAtUntil('time' , 'time' )- Logs out character at specified time of day and relogs at specified time of day. Formats: HH:MM (Example.: 17:45, 21:30)
script.DisconnectAtUntilEx('time' , 'time', offset)- Logs out character at specified time of day and relogs at specified time of day with offset in seconds. Formats: HH:MM (Example.: '17:45', '21:30', -60 -> Will relog at 21:30 - 60 seconds)
script.GetCurrentTime()- Returns current time in seconds.
script.GetItemsCount(itemId, true/false (include inventory/depotmail or not))- Gets current items count in backpack and inventory/depotmail if set to true.
script.GetItemsCountWithInventory(itemId)- Gets current items count in backpack and inventory.
script.GetFreeBackpackSlot()- Returns empty slot id in backpack or 255 if no free slots are available.
script.GetFreeInventorySlot()- Returns empty slot id in inventory or 255 if no free slots are available.
script.GetFreeDepotMailSlot()- Returns empty slot id in depotmail or 255 if no free slots are available.
script.IsStorageFull()- Returns true/false if all containers (backpack, inventory and depotmail) are full.
script.EnterShop()- Enters nearby shop. Shop must be one step away. Returns true/false if success.
script.LeaveShop()- Leaves current shop and refreshes depotmail, inventory.
script.LeaveShopEx()- Leave current shop.
script.GetTabId()- Returns the id of bot tab in which script is executed.
script.ChooseShopOption(menuId, optionId)- Chooses shop option like Buy, Sell, etc.
script.ChooseMenuOption(menuId, optionId, listOptionId)- Chooses menu option id.
script.IgnoreMonsters(1/0 - enable/disable)- Ignores all monsters if activated.
script.DropItem(slotId, 1/0 - should search for free spot or not)- Drops item from specified slot 1-16 and 101-102. 101 = left skill, 102 = right skill.
- Returns 'ok' if success, otherwise returns error message.
Messages:
'forbidden_main_weapon', 'no_room', 'item_not_found', 'protection_zone', 'offline', 'forbidden_1', 'forbidden_2', 'forbidden_3', 'forbidden_4', 'forbidden_5', 'forbidden_6', 'in_shop'
script.IsInLoot(itemId)- Returns 1/0 if item is in autoloot list or not.
script.GoToNpcEx(name)- Different go to npc function. This one doesn't talk to npc automatically.
(Use onReachedNpc(uid, name) event to talk to npc)
script.TalkToNpc(uid)- Talks to npc. Npc must be in line with you (one step distance).
script.EnableTickEvent(interval)- Enables/disables onTick() event in script. Interval < 100 will disable tick event. Anything above will enable it and tick event will run every "interval" milliseconds.
1000 milliseconds = 1 second.
script.Say(text)- Character says "text" in public chat. Text length can't exceed 40 letters.
- Limit is one message per 6 seconds.
script.SayDelay(text, delay)- Character says "text" in public chat. Text length can't exceed 40 letters.
- Message is delayed for x seconds.
script.IsInShop()- Returns 1 / 0 if character is in shop or not.
script.GetItemSlot(itemId)- Returns first slot with provided itemId or 0 if no items were found.
script.GetItemInSlot(slot)- Returns itemId from backpack slot.
script.ToggleTargetSwitch(1/0)- Enable / disable target switching features. (Good for Don Correc quest to avoid killing more monsters)
script.PZChecksForDrop(1/0)- Enable / disable safe zone checks from DropItem function. Enabled by default to avoid dropping items in town.
script.GetStamina()- Returns current stamina percentage.
script.UseItemSlot(slot)- Uses item in slot 1-9 or skill in slot 101-102.
- Returns 1/0 (true/false) if success.
script.UseItemId(itemId)- Finds item by id in backpack and uses it if available.
- Returns 1/0 (true/false) if success.
script.UseItemSlotEx(slot, delay)- Uses item in slot 1-9 or skill in slot 101-102 with delay in milliseconds. 1000 = 1 second.
- Returns 1/0 (true/false) if success.
script.UseItemIdEx(itemId, delay)- Finds item by id in backpack and uses it if available with delay in milliseconds. 1000 = 1 second.
- Returns 1/0 (true/false) if success.
script.ToggleStaminaSystem(type, 1/0 - enable, disable)- Enable/disable stamina system. (Type: 1 = new stamina system, 2 - old stamina system)
script.SuspendStaminaSystemOnReconnect(1/0 - true/false)- Don't enable any stamina system when reconnecting to the game if it's enabled in waypoints file.
(if player uses ToggleStaminaSystem(1, 0) to disable stamina and then relogs after dc, stamina becomes enabled again.
This function prevents that.)
Perfect place for this functions is in onScriptActivation/Deactivation events.
script.ToggleSpell(type, 1/0 - enable/disable)- Enable/disable spell. Type 1 = range spell, 2 = all direction spell, 3 - new area spell, 4 - buff spell.
script.LookAt('direction')- Character looks at tile. Takes stuff from chests, etc. Directions: 'up', 'down', 'left', 'right'
script.IsLocationFree(x, y, z)- Returns 1/0 if location is free for item drop.
script.GetSecondsFromHM('HH:MM')- Converts time of day to seconds.
script.GetSecondsFromHMS('HH:MM:SS')- Converts time of day to seconds.
script.IsItTime('HH:MM', offsetInSeconds, 0/1 (compare by seconds too))- Checks if provided time is current time.
script.LoadFile('path')- Loads waypoints file with settings and script. It works like "Load" button.
- Returns "success" or error text.
Path must be like "C:/blabla/blabla/blabla/waypoints.bot"
script.IsSkillEnabled(1/2)- Returns 1/0 if skill option(left - 1, right - 2) is enabled.
script.IsSkillActivated(1/2)- Returns 1/0 if skill (left - 1, right - 2) is activated.
script.ToggleSkill(skill, 1/0)- Enable/disable skill. (Left -1, right - 2) (1/0 - enable/disable)
script.ChangePetSlotId(newslot)- Change pet slot selection to a new slot.
script.IsEntityOnScreen('name', 0-8 (range), 1/0 (should check if can reach entity or not))- Checks if an entity with specified name is on screen.
- Returns 1/0 (true/false).
script.RunEvent('eventName', delay)- Runs event/method after delay.
For example if you have function "def doStuff():", you can use this to run it after delay like that: script.RunEvent('doStuff', 1000)
Delay is in milliseconds. 1000 = 1 second.
script.RunEvent('doStuff', 0) is same as just calling doStuff().
script.ActivateSkill('skill name', 1/2 - left/right)- Activates skill by name, enables skill option if disabled and enables "Activate saved skills" option if not enabled.
- Returns result as string.
Skill names can be found here:
https://mindee-bot.com/forum/index.php/topic,1796.0.htmlMake sure that your character has a specified skill before using this function!script.ActivateSkillId(skillId, 1/2 - left/right)- Activates skill by id, enables skill option if disabled and enables "Activate saved skills" option if not enabled.
- Returns result as string.
Skill ids can be found here:
https://mindee-bot.com/forum/index.php/topic,1796.0.htmlMake sure that your character has a specified skill before using this function!script.SetSkillOption(0/1/2 - Other skill settings/Left skill/Right skill, 0-xx - skill option, 0-xxx - skill option value)- Sets specified skill settings.
If skill option is a checkbox, then skill option value 1 enables it or anything else disables it.
Skill options:0 - ENABLE
1 - Use only when under attack.
2 - Including Ignored Mobs
3 - Switch target when Enemy HP <= %:
4 - Switch target when Enemy HP <= % value.
5 - Use when Enemy HP > %:
6 - Use when Enemy HP > % value.
7 - Use when Character HP < %:
8 - Use when Character HP < % value.
9 - Use when Character MP < %:
10 - Use when Character MP < % value.
11 - Use when Enemy HP <= % value. (Second value for <= %) (Only for left skill)
(Other Skill Settings)0 - Use LEFT skill first.
1 - Use RIGHT skill first.
2 - Activate only one skill at the time.
3 - Activate saved skills (if not active).
script.ToggleAutoloot(1/0 - enabled/disabled)- Enables/disables autoloot feature.
script.ClearItemList(0/1/2/3 - type)- Clears all or autoloot or inventory/depotmail storage item lists.
0 - all
1 - autoloot
2 - inventory
3 - depotmail
script.SetItemList(0/1/2/3 - type, 'itemid,itemid,itemid...')- Sets specified items list. (Example: script.SetItemList(0, '5126') - sets list to one item only)
0 - all
1 - autoloot
2 - inventory
3 - depotmail
script.AddItemToList(0/1/2/3 - type, itemId)- Adds item to specified list.
0 - all
1 - autoloot
2 - inventory
3 - depotmail
script.RemoveItemFromList(0/1/2/3 - type, itemId)- Removes item from specified list.
0 - all
1 - autoloot
2 - inventory
3 - depotmail
script.IgnoreNextItem(itemId)- Ignore next dropped item by id (by your character). (Prevents picking same item again if it's in autoloot)
script.GetAnswerId('answer', answers)- Returns npc dialogue answer id or -1 if not found.
script.ClearScriptChat()- Clears script chat.
script.SetIgnoredMobsList('list')- Sets ignored monsters list.
script.ResetIgnoredMobsList()- Resets ignored monsters list to default saved list in waypoints file.
script.ToggleStorage(1/0 - enable/disable)- Enables/disables storage feature in bot.
script.PauseMovement(1/0 - pause/resume)- Pauses/resumes movement.
script.IsStorageRunning()- Returns True/False if item storage is running at the moment or not.
script.FindSprite(spriteId)- Finds sprite nearby and returns Location object or None if not found. (In pathfinding range)
Ids can be found here:
https://mindee-bot.com/forum/index.php/topic,1834.0.htmlExample:
pos = script.FindSprite(2600)
if pos == None:
script.StatusMessage('Not found!')
else:
script.StatusMessage('X: ' + str(pos.X) + ' Y: ' + str(pos.Y) + ' Z: ' + str(pos.Z))
script.GoToTile(location, spriteId, True/False - should go onto tile or just stay by side)- Moves character to tile at location (to script.FindSprite return value).
- Returns True/False if function was launched successfully.
Pass spriteId only if you need to know it in onReachedTileLocation() event. Or put 0.
script.GetItemList(1/2/3 - type)- Returns specified items list as string (text).
1 - autoloot
2 - inventory
3 - depotmail