Username: Password:

Author Topic: count item loot  (Read 1022 times)

Offline Nicaragua

  • Bug
  • *
  • Posts: 14
  • Cookies 0
  • I love Mindee-BOT!
    • View Profile
count item loot
« on: August 18, 2023, 08:03:22 PM »
once we know how to move inventory item to the backpack

How to count the item loot and not collect more items

crystal work
egg of petraclop
any other more

crystal_w only 3

egg_petr only 5

def onChangeLocation(x, y, z):

if crystal_w >= 3 :
setway(xxxxx, 2)



Offline Xmidnightx

  • Bug
  • *
  • Posts: 6
  • Cookies 1
  • I love Mindee-BOT!
    • View Profile
Re: count item loot
« Reply #1 on: August 19, 2023, 07:33:08 PM »
A simple example:


Code: [Select]
Syorta_ore = 6405
def onReceiveAddItemToBackpack(slot, itemId):
    if script.GetItemsCountEx(Syorta_ore, True, False, False) >= 3 :
        script.ToggleAutoloot(0)
        script.StatusMessage("ok")
« Last Edit: August 19, 2023, 07:54:53 PM by Xmidnightx »

Offline Nicaragua

  • Bug
  • *
  • Posts: 14
  • Cookies 0
  • I love Mindee-BOT!
    • View Profile
Re: count item loot
« Reply #2 on: August 19, 2023, 07:50:06 PM »
 [hmmm] Thank you, but the part is missing that when you already have the necessary amount, don't pick up that item anymore, if it's not too much trouble :)

Offline Xmidnightx

  • Bug
  • *
  • Posts: 6
  • Cookies 1
  • I love Mindee-BOT!
    • View Profile
Re: count item loot
« Reply #3 on: August 19, 2023, 08:33:44 PM »
Here is removing the item from Autoloot.

Code: [Select]
Syorta_ore = 6405
def onReceiveAddItemToBackpack(slot, itemId):
    if script.GetItemsCountEx(Syorta_ore, True, False, False) >= 3 :
        script.RemoveItemFromList(1, Syorta_ore) # deletes the autoloot itemId
        script.StatusMessage("ok")

Offline Nicaragua

  • Bug
  • *
  • Posts: 14
  • Cookies 0
  • I love Mindee-BOT!
    • View Profile
Re: count item loot
« Reply #4 on: August 19, 2023, 08:35:58 PM »
 [ummmm]

Very thanks