PDA

View Full Version : Problems with BuyItemsUpTo



NeeP
08-05-2012, 09:07 AM
I made a script for a depositer so I added a Mana buyer. I need normal mana pots with the Item ID 268. I want 60 Mana Pots and the price for each potion is 50gp. So I did this:



-----
MinCap = 50

ManasToLeave = 20

ManaPotID = 268

WantedMps = 60
------------------------
------------------------

elseif (labelName == "ManaShop") then
setWalkerEnabled(false)
Self.SayToNpc({"Hi", "Trade"}, 65)
wait(900, 1200)
Self.BuyItemsUpTo(ManaPotID, 60)
setWalkerEnabled(true)

elseif (labelName == "PotionCheck") then
delayWalker(2500)
if Self.ItemCount(ManaPotID) < 60 then
setWalkerEnabled(false)
else
gotoLabel ("ReturnToHunt")
end


when I load in scripter it works fine but when he opens the trade window of npc
I get error:

Line #: 56
Chunk: ...\Documents\XenoBot\Scripts\Fibula Rots Depositer.lua
Error: attempt to call field 'BuyItemsUpTo' (a nil value)

PS: I just copied the needed parts of my script so line 56 is the BuyItemsUpTo thing

I don't understand where this error is :S Please help
Thanks :)

yours,
NeeP

Forgee
08-05-2012, 10:10 AM
dofile("Forgee.lua") - BuyItemsUpTo is not a native function.

NeeP
08-05-2012, 10:40 AM
omg right :DD thanks :*