local variable error

Talk about anything in Runes of Magic. This does not need to pertain to botting.
Post Reply
Message
Author
wilifox
Posts: 86
Joined: Tue Jul 26, 2011 6:00 pm

local variable error

#1 Post by wilifox » Wed Nov 06, 2013 1:59 pm

my waypoint is this:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<!-- #  1 --><waypoint x="-4149" z="5716" y="36">

                player:target_NPC("Calabaza bromista");
		local x = inventory:findItem("Piruleta de arco iris")
                x:moveTo("bank") 
		sendMacro("ChoiceOption(1);");
		sendMacro("DrawBankItem(1);");

	</waypoint>
</waypoints>
Script Error: Why?? Thxx ;)

Image

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: local variable error

#2 Post by lisa » Wed Nov 06, 2013 4:51 pm

If it can't find the item named then x will be nil.

If you are sure you have the item in your inventory then you may need to change the name or use the item ID instead.

If there are times when you may not have the item then you should do a check if x exists.

Code: Select all

      local x = inventory:findItem("Piruleta de arco iris")
if x then
                x:moveTo("bank") 
      sendMacro("ChoiceOption(1);");
      sendMacro("DrawBankItem(1);");
end
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest