PDA

View Full Version : loggout if balance less that/ npc say you do not have enough funds



Daffik
12-02-2014, 08:33 PM
hi, basic what im looking for is a script that will go to label logout if im trying to restock and i don't have enough money in the bank, rather than it just going anyway and end up dying.
Any help with this would be awesome.

Thanks In Advance

Daffik ;)

svennn
12-03-2014, 02:20 PM
hi, basic what im looking for is a script that will go to label logout if im trying to restock and i don't have enough money in the bank, rather than it just going anyway and end up dying.
Any help with this would be awesome.

Thanks In Advance

Daffik ;)

Just add a checker after it was at bank to check if you have enough money to afford refill. If it doesn't, do Walker.Stop() or os.exit()

aka

if self.money() < (potcost*potamount) then
walker.stop()
os.exit()
end

very simplified, but you get the point.

Daffik
12-03-2014, 03:25 PM
i figured it out in the end, but thanks a bunch
here is how i done it ;)

if (labelName == "check-cash") then
if (Self.ItemCount(3034) == 0) and (Self.ItemCount(3035) == 0) then
Walker.Goto("log-off")
print([[Not Enough Money To Buy supllies, Time To Log Off]])
else
Walker.Goto("go-buy-pots")
print([[Enough Money To Buy supllies, Lets Hunt]])
end