Log in

View Full Version : I Dont get why Im getting this error!



Burton
08-25-2012, 10:36 PM
18:32 XenoScript Error:
Script: mhuman.lua
Line #: 36
Chunk: ...tings\Joseph\My Documents?XenoBot?Scripts?mhuman.lua
Error: attempt to call a number value
This is an error with user-input and should not be reported as a bug with XenoBot.

Someone help?

Burton
08-25-2012, 10:37 PM
Here is the pastebin:

http://pastebin.com/ZUU0PFQ6

Spectrus
08-26-2012, 10:10 AM
Currently, your line 36 is a print function like so:



print("Current Mana Potions: " .. Self.ItemCount(ManaId) "\nCurrent Health Potions: " .. Self.ItemCount(HealthId))


The issue is that you have forgotten some silly little dots.



print("Current Mana Potions: " .. Self.ItemCount(ManaId) .. "\nCurrent Health Potions: " .. Self.ItemCount(HealthId))


See the difference? :)

Burton
08-27-2012, 01:55 AM
Could you also tell me why its not selling Vials to the npc, and also why its not resetting backpacks that well.

Burton
08-27-2012, 01:55 AM
Also possibly why my Exura Ico isnt working on my settings, everything is checked off and all too

Burton
08-27-2012, 05:14 PM
bump please

Crown Royal
08-27-2012, 05:36 PM
dofile("Forgee.lua")
That will help clear up the other 2-3 functions you have on the bottom. Get his library!

end
wait(200,500)
end
This will always help, it's usually best to keep a wait at the end of a function that runs a continous loop.

elseif (labelName == "@PotShop") then
delayWalker(1000)
setWalkerEnabled(false)
Self.SayToNpc({"hi", "flasks", "yes", "flasks", "yes", "flasks", "yes", "trade"}, 50)
wait(1500,1800)
buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(MPotID , (MPotRA-Self.ItemCount(MPotID)))
wait(800,1200)
setWalkerEnabled(true)
This is how my script looks. Reason behind all the ("flask", "yes") is because if you are carrying 500 empty flasks, the flasks won't all sell. The Potion Shop NPC's will only accept 200 at a time. Since it says flasks 3x in this part of my script, then, it will sell up to 600 Empty flasks in the Backpack.

In order for me to fix the resetting of backpacks, I would have to mess with his code, which I dont like doing, since his name is on it, not mine.. I personally would just use Forgee's function 'resetBackpacks()'.

I'll tag Infernal Bolt to this, so he can change it for you, since it's his script :)

EDIT: If you tend to use the 'buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal' function, you need to add it to the bottom of your script. (In place of the other 3-4 scripts / ONLY IF .. ONLY IF.. You 'dofile("Forgee.lua"). Ill type the function here too incase you need it.
function buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(item, count)
count = tonumber(count) or 1
repeat
local amnt = math.min(count, 100)
if(Self.ShopBuyItem(item, amnt) == 0)then
return printf("ERROR: failed to buy item: %s", tostring(item))
end
wait(200,500)
count = (count - amnt)
until count <= 0
end

Burton
08-27-2012, 05:47 PM
I have Forgee

Burton
08-27-2012, 05:48 PM
Or where do i put that, i have forgee in script folder already

Crown Royal
08-27-2012, 05:50 PM
Or where do i put that, i have forgee in script folder already
It stays in the script folder, DONT EXECUTE IT!
I edited the post above, please review, it will explain what you need to know, and wait for a response by Infernal Bolt :)

Burton
08-27-2012, 07:37 PM
It closes the fur bp, then non stop tries to open n close golden bp, so it sits there does nothing

Spectrus
08-27-2012, 08:31 PM
dofile("Forgee.lua")
That will help clear up the other 2-3 functions you have on the bottom. Get his library!

He's not using any non-native functions that require Forgee's lib. He doesn't need it.



end
wait(200,500)
end
This will always help, it's usually best to keep a wait at the end of a function that runs a continous loop.

The function does not run in a continuous loop, it is called when the walker reaches a label, adding a wait is not needed.



elseif (labelName == "@PotShop") then
delayWalker(1000)
setWalkerEnabled(false)
Self.SayToNpc({"hi", "flasks", "yes", "flasks", "yes", "flasks", "yes", "trade"}, 50)
wait(1500,1800)
buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(MPotID , (MPotRA-Self.ItemCount(MPotID)))
wait(800,1200)
setWalkerEnabled(true)
This is how my script looks. Reason behind all the ("flask", "yes") is because if you are carrying 500 empty flasks, the flasks won't all sell. The Potion Shop NPC's will only accept 200 at a time. Since it says flasks 3x in this part of my script, then, it will sell up to 600 Empty flasks in the Backpack.

When returning flasks, his script is set to buy 150 mana potions, not 500, he'll have no problems with flasks, also you can say 'flask', 'yes', 'yes', 'yes'. You don't need to repeat 'flask'. It would be better to do something like...


Self.SayToNpc({'hi','vials'},65)
while Self.ItemCount(flaskID) > 0 do
Self.SayToNpc('yes')
wait(300, 600)
end

Also, the function "buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal" is antiquated and redundant. Self.ShopBuyItem has been updated for months now to support item counts of over 100 items.

Crown Royal
08-27-2012, 11:39 PM
smartass.. smh, still im right too :)

Infernal Bolt
08-28-2012, 07:55 AM
Crown Royal he's using my lua so it has everything, only thing that was wrong with it was 2 dots at the print command which spectrus already said.

Burton
08-28-2012, 02:27 PM
When it gets to StartHunting, when is tries to do the bp reset, it doesnt close all the backpacks. then it just loops trying to open the same backpack..