Error after running bot for a while.

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
duder77
Posts: 5
Joined: Tue Jun 11, 2013 12:30 am

Error after running bot for a while.

#1 Post by duder77 » Fri Jun 14, 2013 6:05 pm

Hi, I have made a small waypoint and loaded the default profile. Everything runs fine and then I will get a functions.lua:474: bad argument #7

I have the updated MicroMicro did updates and I even started from scratch. After I get this error, it will run the script again for a few second and repeat the error but it ran fine for an hour.

I looked and couldn't find any solution.

Thanks

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

Re: Error after running bot for a while.

#2 Post by lisa » Fri Jun 14, 2013 6:24 pm

functions.lua:474: bad argument #7
There has to be more to the error.

Either way it will be either player.ExpPerMin or player.TimeTillLevel

As to why it is erroring, no idea, for now you could just use the userfunction I posted for the set window and see if that helps.
http://www.solarstrike.net/phpBB3/viewt ... =setwindow

Rock might have some idea as to why it is erroring.
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

duder77
Posts: 5
Joined: Tue Jun 11, 2013 12:30 am

Re: Error after running bot for a while.

#3 Post by duder77 » Fri Jun 14, 2013 6:51 pm

The full error line is
/scripts/rom/functions.lua:474: bad argument to 'string.format' (not a number in proper range)
Execution error: Runtime error
Loaded plugin "lxp'
executing script 'bot.lua'

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

Re: Error after running bot for a while.

#4 Post by lisa » Fri Jun 14, 2013 8:49 pm

Ahh ok then it is deffinately the player.TimeTillLevel

I might do up a new char to test this, unfortunately it could be a lot of things =(

Seems weird to me it does it when you start the bot up again, all values should be gotten fresh.

Just use my userfunction I posted for now as it dissables the default setwindow code and uses my own.
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

duder77
Posts: 5
Joined: Tue Jun 11, 2013 12:30 am

Re: Error after running bot for a while.

#5 Post by duder77 » Fri Jun 14, 2013 9:03 pm

Once that error happens, I get it again and again. Strange that it will run a task fine and then get an error and then not allow the script to run for more than 5 seconds without the error again. It can run for an hour no problem...

Seems weird to me it does it when you start the bot up again, all values should be gotten fresh.

duder77
Posts: 5
Joined: Tue Jun 11, 2013 12:30 am

Re: Error after running bot for a while.

#6 Post by duder77 » Fri Jun 14, 2013 9:05 pm

lisa wrote:Ahh ok then it is deffinately the player.TimeTillLevel

I might do up a new char to test this, unfortunately it could be a lot of things =(

Seems weird to me it does it when you start the bot up again, all values should be gotten fresh.

Just use my userfunction I posted for now as it dissables the default setwindow code and uses my own.
Are you talking about the userfunction_setwindow.lua you posted? Or do you have a direct link?

Thanks so much for your help.... I've spent hours trying to figure this out.

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

Re: Error after running bot for a while.

#7 Post by lisa » Fri Jun 14, 2013 10:11 pm

duder77 wrote:Are you talking about the userfunction_setwindow.lua you posted?
yes


Well I ran a new char for an hour on the WP included with bot to lvl up in pioneers, no error.

In your WP onload add this line

Code: Select all

atError(print(player.TimeTillLevel.." "..player.ExpPerMin));
So when the bot errors it will print those values, that is when not using my userfunction because my userfunction won't error ;)
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

duder77
Posts: 5
Joined: Tue Jun 11, 2013 12:30 am

Re: Error after running bot for a while.

#8 Post by duder77 » Fri Jun 14, 2013 10:28 pm

I have download your userfunction_setwindow.lua and placed it into the userfunctions folder and I would call it like this?

<waypoints type="travel">
<onLoad>
setwindow(whatever i want to track)
</onload>
xxx-my-waypoints-xxx
</waypoints>

Also, thank you so much for all your work on the forums! I have learned a lot from your posts and have enjoyed you scripts. I love the userfunction svn collection!! Very nice!

Thanks for all you help :)

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

Re: Error after running bot for a while.

#9 Post by lisa » Fri Jun 14, 2013 10:32 pm

duder77 wrote:placed it into the userfunctions folder and I would call it like this?
yup
duder77 wrote: I love the userfunction svn collection
set window was in there, so no need to download it again if you already had it.
duder77 wrote:Thanks for all you help
Your welcome.
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: Error after running bot for a while.

#10 Post by rock5 » Sat Jun 15, 2013 1:57 am

I don't have much to add except 'not a number in proper range' indicates that one of the values that it tried to use in the string.format was outside of the range -0x80000000 to 0x7FFFFFFF. I think this clearly indicates a failure to read a correct value from memory. Which one and why it failed, I don't know.

On second thought, it might not be a memory failure. The function only uses int memory reads which I believe can only return values within that range. Maybe one of the calculations is resulting in a number outside that range. For example if the ExpPerMin is very low, just a fraction of one, it could result in a number outside that range.

Although there is a check for that

Code: Select all

			if( player.TimeTillLevel > 9999 ) then
				player.TimeTillLevel = 9999;
			end
But that only checks for very big positive numbers, not negative numbers. You shouldn't normally get a negative value for the calculation for that value so we come back to failed memory reads.
  • 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

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

Re: Error after running bot for a while.

#11 Post by lisa » Sat Jun 15, 2013 3:29 am

Yeah I wanted to see what it had as the value for that number failure, which is why I posted the aterror code, might shine some light on it without having to spend hours trying to work out what numbers could cause it. Unfortunately the other numbers in the calculation are of course locals to the function itself so we couldn't do prints of them without altering the functions.lua file itself, I was hoping to avoid that.
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

nightdps
Posts: 5
Joined: Thu Oct 18, 2012 3:18 pm

Re: Error after running bot for a while.

#12 Post by nightdps » Tue Jun 18, 2013 10:20 am

I noticed this happening when the player's current xp is greater than the xp it needs for the next level. In the past, when using an xp orb, the character doesn't level up to the correct level until you hit a couple mobs for it to recalculate the xp.

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

Re: Error after running bot for a while.

#13 Post by rock5 » Tue Jun 18, 2013 11:26 am

Oh, a fix for this didn't make it in my last commit. Too bad.

I'm looking at the code and I think the xp 'gain' could be calculated better. At the moment it's very prone to error because it doesn't handle level ups very well. I mean it doesn't include the last xp gained before leveling up, in it's calculations. If you use an experience orb that levels multiple levels it wont include any of that xp in it's calculations except the xp of the last level, not that it really matters. But to be more accurate I could easily have it calculate the exact xp difference between 2 xp levels eg. the difference between level 2 with 200 xp and level 5 with 50 xp.

I'm not sure yet whether I should even bother.
  • 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

Flexo85
Posts: 1
Joined: Sat Jul 27, 2013 3:48 am

Re: Error after running bot for a while.

#14 Post by Flexo85 » Sat Jul 27, 2013 3:55 am

Hey guys i had the same problem with my bot when im lvl 80 and have more exp then needed for lvl up. By gathering. I fixed it but the exp calc will probably wont be correct. But atleast you dont get errors

Code: Select all

player.ExpPerMin = expGainSum / ( valueCount * player.ExpUpdateInterval / 60 );
			if( player.ExpPerMin <= 0 ) then -- edited from original
			    player.ExpPerMin = 1; -- edited from original
			end
			
				player.TimeTillLevel = (maxExp - newExp) / player.ExpPerMin;
			if( player.TimeTillLevel > 9999 or player.TimeTillLevel <= 0 ) then -- edited from original
				player.TimeTillLevel = 9999;
			end
first time posting so not really sure if the code will appear good

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

Re: Error after running bot for a while.

#15 Post by rock5 » Sat Jul 27, 2013 8:59 am

A fix for the error was included in rev 761. Update and see if it fixes it for you.
  • 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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 27 guests