I keep getting this error

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
adonisz
Posts: 47
Joined: Tue Apr 26, 2011 11:05 pm

I keep getting this error

#1 Post by adonisz » Sun Jun 05, 2011 10:42 am

When running my bot, I keep getting this error: Error in your profile: onleavecombat error: ....pawn.lua:537:bad argument #1 to 'gmatch' <string expected, got nil>

my profile looks like this

Code: Select all

	<onLeaveCombat><![CDATA[
		-- Additional Lua code to execute after killing an enemy
                 useGoodie("mdmg2");
     if (not player:hasBuff("506687")) then
    inventory:useItem(207203);
    end 

     if (not player:hasBuff("506686")) then
    inventory:useItem(207202);
    end

     if (not player:hasBuff("506684")) then
    inventory:useItem(207200);
    end 
                catchCavy();
        ]]></onLeaveCombat>
Any idea on how to fix it?
Thanks in advance

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

Re: I keep getting this error

#2 Post by lisa » Sun Jun 05, 2011 10:49 am

you can try to narrow down the cause by making some code not used by adding -- at the front

Code: Select all

-- useGoodie("mdmg2");
I am guessing it is something to do with the useGoodie as the rest of the code that deals with buffs seems ok.
The error is to do with buffs.
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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: I keep getting this error

#3 Post by rock5 » Sun Jun 05, 2011 11:09 am

Try not surrounding the id numbers with quotes. They are numbers, not strings. :)

Edit: Scratch that. Looks like the buff functions convert the string to a number anyway. Lisa is probably right. It's probably your useGoodie function.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: I keep getting this error

#4 Post by kanta » Sun Jun 05, 2011 7:57 pm

This works for me:

Code: Select all

	<onLeaveCombat><![CDATA[
		-- Additional Lua code to execute after killing an enemy
		if( not player:hasBuff("Unimaginable Salad") and inventory:itemTotalCount(207215) > 0 ) then
			inventory:useItem(207215)
			inventory:update()
			yrest(750)
		end
		if not player:hasBuff(501823) then
         player:cast("KNIGHT_ENHANCED_ARMOR");
               yrest(300);
		end
	]]></onLeaveCombat>
Maybe without the item check it's getting an error if the item doesn't exist?
Scout/Knight/Rogue 70/66/66

adonisz
Posts: 47
Joined: Tue Apr 26, 2011 11:05 pm

Re: I keep getting this error

#5 Post by adonisz » Tue Jun 07, 2011 9:44 pm

so i put

Code: Select all

     if (not player:hasBuff("495632")) then
    inventory:useItem(207214);
    end
for my delicious swamp mix and the problem is i eat the swamp mix after each combat, so if I kill one monster, I eat one swamp mix, another monster another swamp mix..... is there something wrong with my code?

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

Re: I keep getting this error

#6 Post by lisa » Tue Jun 07, 2011 9:47 pm

if it is eating the swamp mix then the useitem must be right, so I'd say double check the buff number id.
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

adonisz
Posts: 47
Joined: Tue Apr 26, 2011 11:05 pm

Re: I keep getting this error

#7 Post by adonisz » Tue Jun 07, 2011 10:10 pm

i double checked the buff name id and it is right.
hmm its really weird that my character would just keep eating the swamp mix when the buff is already there...

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: I keep getting this error

#8 Post by rock5 » Tue Jun 07, 2011 11:03 pm

I'm not sure how you are double checking the id but what I would do is use this command

Code: Select all

/script i=1 while UnitBuff( "player", i) ~= nil do name, __, __, ID = UnitBuff( "player", i) SendSystemChat(name.." "..ID) i = i + 1 end
That will list your buffs and ids.

Another option might be to use the buff name instead of the id. useGoodie uses ids so that it's universal but for your own use there is no reason why you couldn't use the name instead. The name of the item too for that matter.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

adonisz
Posts: 47
Joined: Tue Apr 26, 2011 11:05 pm

Re: I keep getting this error

#9 Post by adonisz » Wed Jun 08, 2011 10:50 am

ok so i got the ID from the goodie userfuction file and i fixed the name bydoing this
if (not player:hasBuff("Delicious Swamp Mix")) then
inventory:useItem(207203);
end
But it's still eating one swamp mix after killing one monster, not every 5 minutes. Could you show me a code that's supposed to work well?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: I keep getting this error

#10 Post by rock5 » Wed Jun 08, 2011 10:44 pm

If "Delicious Swamp Mix" is the name of the buff you see in the tooltip when you hover the mouse over it, then I don't know why it isn't working. Sorry. Unless you are using an older version of the bot.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

adonisz
Posts: 47
Joined: Tue Apr 26, 2011 11:05 pm

Re: I keep getting this error

#11 Post by adonisz » Wed Jun 08, 2011 11:42 pm

Could you post what you have in your profile if possible for eating housmaid potions and food?
Cuz this is the weirdest thing ever, when I fininshed eating Swamp mix after 50 fights (i had 50 swamp mixes and I ate one after every fight), I started consuming one lucky pot after one fight.......
I updated rombot to revision 605 and i have no idea how to fix this.... T.T. It was working fine before when I used to have goodie function in my profile, but the goodie fuction was causing my rombot to stop working.

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

Re: I keep getting this error

#12 Post by lisa » Thu Jun 09, 2011 12:11 am

do you have more then 1 file with the same function in userfunctions folder?
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

adonisz
Posts: 47
Joined: Tue Apr 26, 2011 11:05 pm

Re: I keep getting this error

#13 Post by adonisz » Thu Jun 09, 2011 6:46 am

nope i have catchcavy, gmmonitor, teleport, and usegoodie universal user fuctions all different in the folder

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: I keep getting this error

#14 Post by kanta » Thu Jun 09, 2011 6:23 pm

Are you using Delicious Swamp Mix or Housekeeper Special Delicious Swamp Mix? The buff IDs will be different, make sure you are getting the right one. Do these steps exactly:

1) Use one swamp mix to get buff
2) Use the following command in RoM, not in MM

Code: Select all

/script i=1 while UnitBuff( "player", i) ~= nil do name, __, __, ID = UnitBuff( "player", i) SendSystemChat(name.." "..ID) i = i + 1 end
3) Look in the "General" chat tab in RoM for a list of buffs with a number next to it, that is the ID# you need
Scout/Knight/Rogue 70/66/66

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: I keep getting this error

#15 Post by rock5 » Thu Jun 09, 2011 7:50 pm

And if they hadn't already done that as per my instructions then I'd say they deserve all the troubles they've had.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: I keep getting this error

#16 Post by kanta » Thu Jun 09, 2011 9:10 pm

I remember helping him get going on the bot to begin with. I had to be pretty detailed in how things were said... This isn't to be taken as an insult by him, but he's even more of a newbie than I was when I started out.
Scout/Knight/Rogue 70/66/66

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: I keep getting this error

#17 Post by rock5 » Thu Jun 09, 2011 9:25 pm

Fair enough. But if he didn't understand something he should have asked for clarification. If he doesn't, all I can assume is he tried it but it didn't help.

Pretty much my hands are tied if people don't try the thing I ask them to try and act as if they did.

I do get the impression it should have been sorted by now.

By the way, Try my updated version of useGoodie. It might fix the problem.
http://www.solarstrike.net/phpBB3/viewt ... 952#p21952
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

adonisz
Posts: 47
Joined: Tue Apr 26, 2011 11:05 pm

Re: I keep getting this error

#18 Post by adonisz » Sat Jun 11, 2011 1:35 pm

ahh sorry guys i am kind of noob and slow at learning things.
when rock5 first gave me the advice of /script i=1 while UnitBuff( "player", i) ~= nil do name, __, __, ID = UnitBuff( "player", i) SendSystemChat(name.." "..ID) i = i + 1 end, i didnt understand what he meant... T.T, that's why i had to ask again, but I got it to work now thanks to you guys.
sorry if i am slow at these kind of things :P.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests