Log in

View Full Version : Is this possible!?



Nikkos
02-22-2013, 10:12 AM
I recently started playing inferna, as part of the pk team of jik~, the thing is...
It's better to just not refill since you'll get assraped in the cities while getting fresh supps.

So my question is:
is it possible to let the bot loot from a bag/backpack that is on the floor, let him put on spears / mana's ?

Sincerely Yours,

Nikk

Spectrus
02-22-2013, 10:14 AM
Of course, but something this specific requires more details. How would you set up your supply bag that's on the floor?

Nikkos
02-22-2013, 10:18 AM
Just put a bag on the floor of the tomb for example.
Once het gets to waypoint X he checks the supplies
if <XX he opens the backpack and picks up XX supplies

Spectrus
02-22-2013, 10:32 AM
Just put a bag on the floor of the tomb for example.
Once het gets to waypoint X he checks the supplies
if <XX he opens the backpack and picks up XX supplies

Yes but the script side of that is a tad more confusing. Watch...

local spearID = 1234
local stockPos = {x = 1234, y = 1234, z = 7}

registerEventListener(WALKER_SELECTLABEL, "onLabel")

function onLabel(label)
if (label == 'Restock') then
if (Self.ItemCount(spearID) <= 10) then
Walker.Stop()
local c = Container.New(Self.UseItemFromGround(stockPos.x, stockPos.y, stockPos.z))
wait(1000, 1200)
if c:isOpen() then
-- Here is where it's a bit more involved, this is just assuming the manas are directly inside the bp on ground. Finding them inside another bp would be even harder.
while Self.ItemCount(spearID) <= 20 do
for s = 0, c:ItemCount() do
local i = c:GetItemData(s)
if (i.id == manaID) then
c:MoveItemToContainer(s, 0, math.min(100, maxManas - Self.ItemCount(manaID)))
wait(500, 900)
break
end
end
end
else
print("Opening container failed.")
end
Self.Equip(spearID, 'weapon')
wait(500, 900)
Walker.Start()
end
end
end

Nikkos
02-22-2013, 10:41 AM
I see, can you make it that he just picks up spears out of the backpack when it's below 10?
If possible also equips them

Spectrus
02-22-2013, 10:45 AM
I see, can you make it that he just picks up spears out of the backpack when it's below 10?
If possible also equips them

I updated the example I posted to work like you want, wasn't sure how many you wanted to pick up so I set it to up to 15.

Nikkos
02-22-2013, 10:55 AM
Thanks so much!! will try it out right away

Nikkos
02-22-2013, 11:05 AM
Doesn't work=/ It doesn't open the backpack below him..

* Made a label with Restock and ran the lua ofc.

Nikkos
02-22-2013, 11:33 AM
If I give him a hand and open the bp for him, he does pick up a spear and puts it on weapon slot.. but that's it..
Does it mather if it's a backpack or bag? No right/

Nostrax
02-22-2013, 11:40 AM
Be aware of floor resets, which might get u killed cuz of no bag = no manas ;)

Nikkos
02-22-2013, 11:43 AM
Well, you got a point there.
Willing to take the risk, it's a pity that there is not one single script like this on the forum :<
Is it that hard to create ? ( I suck at scripting lua so.. )