Mindee-BOT
Mindee-BOT Community => Share => Scripting => Useful Parts => Topic started by: =Mindee= on April 18, 2020, 10:42:03 am
-
If bot can't drop item (no room, etc), it adds item to the queue and drops it later when possible.
Tested, working, but of course it needs more tests. [badpokerface]
(For version 2.0.13++)
Script:
# Drop items by id:
drop_items_by_id_list = (6405, 2584)
queue = {}
# Private function
def checkDropQueue(x, y, z):
if script.IsLocationFree(x, y, z) == 1:
if len(queue) > 0: # there are items in queue, try to drop them
for slot, itemId in queue.items():
if script.GetItemInSlot(slot) == itemId:
if script.DropItem(slot, 0) == 'ok':
script.StatusMessage('Dropping item from queue.')
queue.pop(slot) # Deletes item from queue
break
else:
script.StatusMessage('Deleted item from queue.')
queue.pop(slot) # Deletes item from queue, because it's not in slot.
def onScriptActivation():
script.PZChecksForDrop(0) # allow to drop items in protection zone
def onChangeLocation(x, y, z):
checkDropQueue(x, y, z)
def onReceiveAddItemToBackpack(slot, itemId):
if itemId in drop_items_by_id_list:
if script.DropItem(slot, 1) == 'no_room':
script.StatusMessage('No room! Adding to queue.')
queue[slot] = itemId # add item to queue and drop it later
-
[nowkiss] I HAVE ALREADY FARMING ITEM N SENT IT TO DEPOT,, MY DEPOT ALREADY FULL,, IF I WANT DROP ALL ITEM ALREADY ON DEPOT,, ( DROP FOR ANOTHER LITLE CHAR ) HOW MAKE THE SCRIPT??