Username: Password:

Author Topic: Scripting Documentation  (Read 2958 times)

Offline =Mindee=

  • Commander Shepard
  • BOT Developer Administrator
  • Dragon
  • *****
  • Posts: 2,658
  • Cookies 9017
  • We'll bang, OKAY?
    • View Profile
    • http://mindee-bot.com
Scripting Documentation
« on: January 17, 2020, 03:52:58 PM »
Events

onScriptActivation()
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)
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-3 minutes when cipsoft pings client. Can be used as a timer or etc.

onReceiveUserData(icon, looktypeId)
Executed: every 3-5 seconds when server updates client outfit. Can be used as a timer or etc.

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.

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.

Methods

script.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.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.GetStaminaTime()
- Returns current stamina in minutes. 3360 = 56h.
Just calculate stamina hours by 60 and add minutes. If your stamina is 54:32, then time will be 54*60+32 = 3272

script.GetStaminaText()
- Returns current stamina text like "56:00".

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.
(DemonLord, you should use it as well. (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.html
Make 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.html
Make 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.html
Example:
Code: [Select]
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.
« Last Edit: August 08, 2020, 12:28:08 PM by =Mindee= »




Mindee-BOT creator, founder and developer.

Offline =Mindee=

  • Commander Shepard
  • BOT Developer Administrator
  • Dragon
  • *****
  • Posts: 2,658
  • Cookies 9017
  • We'll bang, OKAY?
    • View Profile
    • http://mindee-bot.com
Re: Scripting Documentation
« Reply #1 on: June 28, 2020, 01:31:11 PM »
Events Part 2

onUpdateSpellStatus(canuse, cooldown):
Executed: when spell status gets changed.
canuse (True/False)

onReceiveDepotMenu(depot_name, depot_id, depot_type, slots):
Executed: when character enters depot or opens inventory/depotmail.
depot_type 0 = inventory, 1 = depotmail, 2 = depot
slots - available slots.

onEffectChanged(effect):
Executed: when character effect is changed. ('BUFF', 'DEBUFF', 'NONE', 'UNKNOWN')

onDroppedItem(from_slot):
Executed: when bot is dropping item from slot.

onEncryptedScriptLoad(status):
Executed: when encrypted script is loaded or failed to load.

Methods Part 2

script.BroadcastMessage('text')
- Displays ingame message. Same like StatusMessage, but a different packet.

script.ForgetLocation()
- Forgets GoToTile location.
Use this when you want to return to waypoints (if using any).

script.HasTarget()
- Returns True / False if character has target. (GoToNpc, EnterShop, GoToTile, etc)

script.GetSpellStatus()
- Returns True / False if character can use spell at the moment or not. (Cooldown)

script.ChangeBuffSlotId(slot)
- Change buff slot selection to a new slot.

script.IsCharacterOnline()
- Returns True/False if character is online in game or not.

script.GetCharacterName()
- Returns character name or null if character not found.

script.GetCharacterWorld()
- Returns character world or 1000 if character not found.

script.GetUniqueKey()
- Returns unique key for character. (Can be used in script.SetRegVar())

script.GetBackpackItems()
- Returns list of all backpack items from slot 1 to slot 16.
Code: [Select]
items = script.GetBackpackItems()
script.StatusMessage('My weapon id is: ' + str(items[9])) # 0 is slot 1, 9 is slot 10 (weapon slot) and so on.

script.RetrieveItem(itemId)
- Retrieves item from inventory.
- Returns True/False if success or not.

script.RetrieveItemTo(itemId, slot)
- Retrieves item from inventory to specified slot. If slot contains item, replaces it.
- Returns True/False if success or not.

script.RetrieveSlot(slot)
- Retrieves item from specified inventory slot.
- Returns True/False if success or not.

script.RetrieveSlotTo(slot, to_slot)
- Retrieves item from specified inventory slot to specified backpack slot.  If backpack slot contains item, replaces it.
- Returns True/False if success or not.

script.StoreItem(itemId, to_inventory(True/False))
- Stores first specified item from backpack to inventory/depotmail.
- Returns backpack slot id from which item was stored or -1 if storage failed.

script.StoreItemTo(itemId, to_slot, to_inventory(True/False))
- Stores first specified item from backpack to specified inventory/depotmail slot.
- Returns backpack slot id from which item was stored or -1 if storage failed.

script.StoreSlot(slot, to_inventory(True/False))
- Stores item from specified backpack slot.
- Returns inventory/depotmail slot in which item was stored or -1 if storage failed.

script.StoreSlotTo(slot, to_slot, to_inventory(True/False))
- Stores item from specified backpack slot to specified inventory/depotmail slot.
- Returns True/False if success or not.

script.SwitchToInventory()
- Switches to inventory. Works only when inside depot/inventory/depotmail.

script.SwitchToDepotmail()
- Switches to depotmail. Works only when inside depot/inventory/depotmail.

script.SwitchDepotPage(depotId)
- Switches to specified depot id. Works only when inside depot.

script.ForceCloseInventory()
- Forces bot to close inventory/depotmail.

script.RunEventEx('eventName', variable, delay)
- Runs event/method after delay with variable included.
For example if you have function "def doStuff(itemId):", you can use this to run it after delay like that: script.RunEvent('doStuff', 1234, 1000)
Delay is in milliseconds. 1000 = 1 second.
script.RunEventEx('doStuff', 1234, 0) is same as just calling doStuff(1234).
Variable can be any type.

script.LookAtBackPackSlot(slot)
- Looks at specified backpack slot and then onReceiveItemDescription event is executed.

script.GetEffect()
- Returns current character effect. ('BUFF', 'DEBUFF', 'NONE', 'UNKNOWN')

script.GetStatistics(type)
- Returns received exp and gold, killed monsters.
Types:
0 - received exp
1 - received total exp
2 - received gold
3 - received total gold
4 - killed monsters
5 - killed monsters (total)
6 - experience per hour
7 - gold per hour
8 - experience left for the next level
9 - current monster
10 - curent HP
11 - current HP %
12 - max HP
13 - curent MP
14 - current MP %
15 - max MP
16 - script log
17 - walking status
18 - stamina

script.PauseStorage(True/False)
- Pauses/resumes item storage. Good for dropping unwanted items, etc.

script.ToggleAntiPvp(True/False)
- Enable/disable antitrap pvp feature.

script.ChooseShopOptionEx(menuId, optionId, delay)
- Chooses shop option like Buy, Sell, etc with delay. (ChooseShopOption uses 3000 (3s) delay)
- 1000 = 1s, 0 = no delay.

script.ChooseMenuOptionEx(menuId, optionId, listOptionId, delay)
- Chooses menu option id with delay. (ChooseMenuOption uses 3000 (3s) delay)
- 1000 = 1s, 0 = no delay.

script.SetSpellBelowMobHp(percentage)
- Set percentage for "Use at <=%" in spell settings. 0 = disable.

script.IsTalkingToNpc()
- Returns True/False if currently talking to npc or not (talking via script).

script.PauseMovementEx(resume_delay)
- Pauses movement and resumes after delay. (If not canceled by running script.PauseMovement(True/False) function)

script.SetCharRegVar('key', value)
- Sets variable in script registry by key for current character.
Key must be a string, value can be any type.

script.GetCharRegVar('key')
- Returns variable (for current character) from script registry by key or 0 if variable not set.

script.TogglePeacefulHunt(True/False)
- Enable / disable peaceful hunt feature.

script.ToggleDisableStaminaInSets(True/False)
- Enable / disable "Disable Stamina In Sets" feature.

script.ToggleDisableStaminaNotInSets(True/False)
- Enable / disable "Disable Stamina Not In Sets" feature.

script.SetDisableStaminaInSetsList(list)
- Sets 'Disable Stamina In Sets" waypoint sets list. Format: id,id,id and so on.

script.SetDisableStaminaNotInSetsList(list)
- Sets 'Disable Stamina Not In Sets" waypoint sets list. Format: id,id,id and so on.

script.AddSetInSets(setId)
- Adds waypoint set id to 'Disable Stamina In Sets" waypoint sets list.

script.AddSetNotInSets(setId)
- Adds waypoint set id to 'Disable Stamina Not In Sets" waypoint sets list.

script.RemoveSetInSets(setId)
- Removes waypoint set id from 'Disable Stamina In Sets" waypoint sets list.

script.RemoveSetNotInSets(setId)
- Removes waypoint set id from 'Disable Stamina Not In Sets" waypoint sets list.

script.GetVocationId()
- Returns player vocation id.
1 = warrior, 2 = wizard, 0 = not set (using mask?)

script.GetStorageRoom(type)
- Returns number of free slots in specified storage.
0 = backpack, 1 = inventory, 2 = depotmail

script.IsUsingMenu()
- Returns True/False if character is using any menu (inventory/depotmail, status, etc)

script.ToggleMovement(True/False)
- Enable/disable movement in "MOVE" settings.

script.ToggleMovementAll(True/False)
- Enable/disable movement for all tabs in "MOVE" settings.

script.SendPM(name, text)
- Sends private message to player.

script.ChooseMenuOptionText(menuId, optionId, text, delay)
- Chooses menu option with input text. Delay = 0 = instant execution.

script.LoadEncryptedScript(path)
- Loads encrypted script from file system. (Ex.: 'C:/blabla/script.bin')
- Returns status (success, failed, etc)

(*** COMING SOON ***)

script.StoreInDepot(itemid)
- Stores item by id from backpack to an empty slot of current depot.
- Returns True/False if success or not.

script.StoreSlotInDepot(slot)
- Stores item from specified backpack slot to an empty current depot page slot.
- Returns True/False if success or not.

script.StoreInDepotSlot(itemId, depotSlot)
- Stores item by id from backpack to specified slot of current depot page.
- Returns True/False if success or not.

script.StoreSlotInDepotSlot(slot, depotSlot)
- Stores item from specified backpack slot to specified slot of current depot page.
- Returns True/False if success or not.

script.GetCurrentDepotItems()
- Returns list of opened depot page items.
« Last Edit: October 18, 2020, 07:27:17 PM by =Mindee= »


Mindee-BOT creator, founder and developer.

Offline =Mindee=

  • Commander Shepard
  • BOT Developer Administrator
  • Dragon
  • *****
  • Posts: 2,658
  • Cookies 9017
  • We'll bang, OKAY?
    • View Profile
    • http://mindee-bot.com
Re: Scripting Documentation
« Reply #2 on: August 01, 2020, 05:10:38 PM »
Modules / Classes
Location(x, y, z)
Simple wrapper for locations.
To see if one location equals other location just use == operator.
Example:
Code: [Select]
playerPos = Location(11111, 22222, 7)
enemyPos = Location(77777, 66666, 5)

# examples
myX = playerPos.x
myY = playerPos.y
myZ = playerPos.z

if playerPos == enemyPos:
    do stuff

Weapon(id, enabled(optional), slot(optional))
Wrapper for weapon id and boolean.
Example:
Code: [Select]
Weapons149 = (
    Weapon(1234, True),
    Weapon(3456, False),
    Weapon(4567, False, 3)
)

def getWeapon(place):
    wpns_len = len(Weapons149)
    if place < 1: place = 1
    elif place > wpns_len: place = wpns_len

    return Weapons149[place - 1]

def onScriptActivation():
    weapon = getWeapon(1)
    if weapon is not None:
        id = weapon.id
        enabled = weapon.enabled
        slot = weapon.slot
        script.Alarm('My weapon: ' + str(weapon))

« Last Edit: August 01, 2020, 05:35:18 PM by =Mindee= »


Mindee-BOT creator, founder and developer.