Error after running bot for a while.
Error after running bot for a while.
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
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
Re: Error after running bot for a while.
There has to be more to the error.functions.lua:474: bad argument #7
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Error after running bot for a while.
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'
/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'
Re: Error after running bot for a while.
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.
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Error after running bot for a while.
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.
Seems weird to me it does it when you start the bot up again, all values should be gotten fresh.
Re: Error after running bot for a while.
Are you talking about the userfunction_setwindow.lua you posted? Or do you have a direct link?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.
Thanks so much for your help.... I've spent hours trying to figure this out.
Re: Error after running bot for a while.
yesduder77 wrote:Are you talking about the userfunction_setwindow.lua you posted?
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));

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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Error after running bot for a while.
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
<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

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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Error after running bot for a while.
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 thatBut 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.
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
- 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
Re: Error after running bot for a while.
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Error after running bot for a while.
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.
Re: Error after running bot for a while.
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.
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
Re: Error after running bot for a while.
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
first time posting so not really sure if the code will appear good
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
Re: Error after running bot for a while.
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
Who is online
Users browsing this forum: Ahrefs [Bot] and 27 guests