Page 1 of 2

Bot is running for hours, and then it stops with an error

Posted: Sun Mar 14, 2010 2:06 pm
by flameboy
Subject says it all, and I don't know if it matters, but I have 2 ROM windows.
This has happened a few times, so it must be a special case, but not too special :)

Here is the log:

Code: Select all

Sun Mar 14 16:58:53 2010 : Language: english
Sun Mar 14 16:58:58 2010 : Using static char address 0x985C3C, player address 0x1F745F00
Sun Mar 14 16:58:59 2010 : QUICK_TURN = false
Sun Mar 14 16:58:59 2010 : Keyboard settings are from bindings.txt:
Sun Mar 14 16:58:59 2010 : MAGE_ELEMENTAL_CATALYST       9
Sun Mar 14 16:58:59 2010 : TARGET                        Tab
Sun Mar 14 16:58:59 2010 : MAGE_ENERGY_SUPPLY            2
Sun Mar 14 16:58:59 2010 : ROTATE_RIGHT                  E
Sun Mar 14 16:58:59 2010 : MAGE_FLAME                    4
Sun Mar 14 16:58:59 2010 : MACRO                         0
Sun Mar 14 16:58:59 2010 : MAGE_MAGIC_TARGET             6
Sun Mar 14 16:58:59 2010 : MOVE_FORWARD                  W
Sun Mar 14 16:58:59 2010 : MOVE_BACKWARD                 S
Sun Mar 14 16:58:59 2010 : ROTATE_LEFT                   Q
Sun Mar 14 16:58:59 2010 : STRAFF_RIGHT                  D
Sun Mar 14 16:58:59 2010 : DRUID_RECOVER                 1
Sun Mar 14 16:58:59 2010 : STRAFF_LEFT                   A
Sun Mar 14 16:58:59 2010 : MAGE_ENERGY_WELL              3
Sun Mar 14 16:58:59 2010 : TARGET_FRIEND                 Z
Sun Mar 14 16:58:59 2010 : MAGE_PERCEPTION               5
Sun Mar 14 16:58:59 2010 : JUMP                          Space
Sun Mar 14 16:58:59 2010 : ATTACK                        7
In main thread:
stack traceback:
	D:/micromacro/scripts/rom/functions.lua:58: in function 'debugAssert'
	D:/micromacro/scripts/rom/classes/pawn.lua:168: in function 'update'
	D:/micromacro/scripts/rom/classes/player.lua:765: in function 'fight'
	scripts\rom/bot.lua:513: in function 'foo'
	D:\micromacro\lib\lib.lua:510: in function <D:\micromacro\lib\lib.lua:508>

----------TRACEBACK END----------

Sun Mar 14 19:30:16 2010 : D:/micromacro/scripts/rom/classes/pawn.lua:168: Error in memory reading
Sun Mar 14 19:30:16 2010 : Execution error: Runtime error
(You can see from the time, that it had been running fine for 2.5 hours)

Re: Bot is running for hours, and then it stops with an erro

Posted: Sun Mar 14, 2010 2:19 pm
by Administrator
In classes/pawn.lua, line 168, you'll see this:

Code: Select all

tmp = debugAssert(memoryReadString(proc, namePtr));
Directly above that line, add this:

Code: Select all

printf("Id: %d, type: %d, Name: %s, Address: 0x%X\n", tonumber(self.Id or 0), tonumber(self.Type or 0), tostring(self.Name or "<UNKNOWN>"), self.Address);
What does it print out?

Re: Bot is running for hours, and then it stops with an erro

Posted: Sun Mar 14, 2010 3:10 pm
by flameboy
I started it now, and it is spamming the BOT window like crazy. (debugging is set to true, I didn't switch it back the last time I had a problem)
Should I wait until it stops with an error, and then copy the content of the log again?

Re: Bot is running for hours, and then it stops with an erro

Posted: Sun Mar 14, 2010 3:17 pm
by Administrator
Wait till it errors out, then copy the message from the console window. That line of code won't add it to the log.

Re: Bot is running for hours, and then it stops with an erro

Posted: Mon Mar 15, 2010 2:19 am
by flameboy
xxx would be my char's name masked out.

Code: Select all

Id: 1002, type: 1, Name: xxx, Address: 0x1DE27300
Id: 100367, type: 2, Name: <UNKNOWN>, Address: 0x9CCD700
Id: 100367, type: 2, Name: <UNKNOWN>, Address: 0x9CCD700
Id: 100367, type: 2, Name: <UNKNOWN>, Address: 0x9CCD700
Id: 100367, type: 2, Name: <UNKNOWN>, Address: 0x9CCD700
Id: 100367, type: 2, Name: <UNKNOWN>, Address: 0x9CCD700
Id: 100367, type: 2, Name: <UNKNOWN>, Address: 0x9CCD700
Id: 100367, type: 2, Name: <UNKNOWN>, Address: 0x9CCD700
Id: 1002, type: 1, Name: xxx, Address: 0x1DE27300
Id: 100367, type: 2, Name: <UNKNOWN>, Address: 0x9CCD700
Id: 100367, type: 2, Name: <UNKNOWN>, Address: 0x9CCD700
Id: 100367, type: 2, Name: <UNKNOWN>, Address: 0x9CCD700
Id: 100367, type: 2, Name: <UNKNOWN>, Address: 0x9CCD700
Id: 100367, type: 2, Name: <UNKNOWN>, Address: 0x9CCD700
Id: 100367, type: 2, Name: <UNKNOWN>, Address: 0x9CCD700
Id: 100367, type: 2, Name: <UNKNOWN>, Address: 0x9CCD700
Id: 1002, type: 1, Name: xxx, Address: 0x1DE27300
Id: 100367, type: 2, Name: <UNKNOWN>, Address: 0x9CCD700
Id: 1065203561, type: 1040560188, Name: <UNKNOWN>, Address: 0x9CCD700
D:/micromacro/scripts/rom/classes/pawn.lua:169: Error in memory reading
And here is another:

Code: Select all

Id: 100365, type: 2, Name: <UNKNOWN>, Address: 0x1EC95F00
Id: 1002, type: 1, Name: xxx, Address: 0x1DE27300
Id: 100365, type: 2, Name: <UNKNOWN>, Address: 0x1EC95F00
Id: 100365, type: 2, Name: <UNKNOWN>, Address: 0x1EC95F00
Id: 100365, type: 2, Name: <UNKNOWN>, Address: 0x1EC95F00
Id: 100365, type: 2, Name: <UNKNOWN>, Address: 0x1EC95F00
Id: 100365, type: 2, Name: <UNKNOWN>, Address: 0x1EC95F00
Id: 100365, type: 2, Name: <UNKNOWN>, Address: 0x1EC95F00
Id: 100365, type: 2, Name: <UNKNOWN>, Address: 0x1EC95F00
Id: 1002, type: 1, Name: xxx, Address: 0x1DE27300
Id: 100365, type: 2, Name: <UNKNOWN>, Address: 0x1EC95F00
Id: 100365, type: 2, Name: <UNKNOWN>, Address: 0x1EC95F00
Id: 100365, type: 2, Name: <UNKNOWN>, Address: 0x1EC95F00
Id: 100365, type: 2, Name: <UNKNOWN>, Address: 0x1EC95F00
Id: 100365, type: 2, Name: <UNKNOWN>, Address: 0x1EC95F00
Id: 100365, type: 2, Name: <UNKNOWN>, Address: 0x1EC95F00
Id: 100365, type: 2, Name: <UNKNOWN>, Address: 0x1EC95F00
Id: 1002, type: 1, Name: xxx, Address: 0x1DE27300
Id: 1064768976, type: 1048909566, Name: <UNKNOWN>, Address: 0x1EC95F00
D:/micromacro/scripts/rom/classes/pawn.lua:169: Error in memory reading
I have added 2 of mage/druid elites in the skills database, but I don't think that could cause the problem. Well at least I hope so. This is a relatively new char, and the problem might be related to it, or the class combo.
I am now running a bot with my older char, to check whether it also has the problem.

Re: Bot is running for hours, and then it stops with an erro

Posted: Mon Mar 15, 2010 4:22 am
by flameboy
It happened with my other character too. (mob's name is masked out)

Code: Select all

Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Id: 1000, type: 1, Name: xxx, Address: 0x3F369B00
Resting finished after 4 seconds.
Id: 1064962936, type: 1045037156, Name: mobname, Address: 0x3F36D200
D:/micromacro/scripts/rom/classes/pawn.lua:169: Error in memory reading

Re: Bot is running for hours, and then it stops with an erro

Posted: Mon Mar 15, 2010 6:55 am
by Administrator
Can you tell what it has targeted when you get this error?

Can you also try changing the debug information like so:

Code: Select all

logMessage(sprintf("Id: %d, type: %d, Name: %s, Address: 0xX%, namePtr: 0x%X\n", tonumber(self.Id or 0), tonumber(self.Type or 0), tostring(self.Name or "[UNKNOWN]"), self.Address, namePtr));
This will dump it to your log.txt making it easier to copy. It also includes the namePtr this time.

Re: Bot is running for hours, and then it stops with an erro

Posted: Mon Mar 15, 2010 7:09 am
by flameboy
Does this code go to the same place in classes/pawn.lua?
Instead of

Code: Select all

printf("Id: %d, type: %d, Name: %s, Address: 0x%X\n", tonumber(self.Id or 0), tonumber(self.Type or 0), tostring(self.Name or "<UNKNOWN>"), self.Address);
?

Servers are currently down for patching, but I will try and see what's targeted when they are up.
UPDATE: When the bot stopped, I switched to the game window, and saw, that a dead mob was targeted (but it had already disappeared)

Re: Bot is running for hours, and then it stops with an erro

Posted: Mon Mar 15, 2010 9:40 am
by Administrator
Yes, replace the code I gave you earlier.

It's normal for a dead enemy to still be shown as being targeted at the top of your screen. It has actually already been cleared. Can you tell me what the monster's name is and where to find it? I really need a lot more information to even begin to debug the issue. If you don't want to provide any of that sort of information publicly, PM it to me.

Re: Bot is running for hours, and then it stops with an erro

Posted: Mon Mar 15, 2010 10:20 am
by flameboy
PM sent with the details.

Something is wrong with the code, because it says:

Code: Select all

Resumed.
OPENING LOCAL SKILLS DB!
Attempt to read playerAddress
D:/micromacro/scripts/rom/classes/pawn.lua:168: invalid option '%,' to 'format'
(since I inserted the new code you wrote)

Re: Bot is running for hours, and then it stops with an erro

Posted: Mon Mar 15, 2010 10:48 am
by Administrator
Woops, change the "Address: 0xX%". The % should be between the 'x' and 'X'.

Try disabling all addons and see if that helps at all.

Re: Bot is running for hours, and then it stops with an erro

Posted: Mon Mar 15, 2010 1:56 pm
by flameboy
Yup, it must be one of the addons, because now without them it seems to be fine.
I'll try to find out which one it is.

Re: Bot is running for hours, and then it stops with an erro

Posted: Tue Mar 16, 2010 4:58 am
by flameboy
I was wrong, it happens without any addon.
And it might be a performance related issue, because it seems to end up in error, when my computer gets more loading.
I send you the details from the log.txt in PM.

Re: Bot is running for hours, and then it stops with an erro

Posted: Tue Mar 16, 2010 8:07 am
by Administrator
What do you mean "gets more loading"? Do you mean it happens when you enter a loading screen?

Re: Bot is running for hours, and then it stops with an erro

Posted: Tue Mar 16, 2010 8:14 am
by flameboy
No, I mean when I start copying stuff in the background, or start an application. Basically do stuff outside the game and the bot (in windows) that stalls the game (and/or the bot) a little.

Re: Bot is running for hours, and then it stops with an erro

Posted: Tue Mar 16, 2010 8:24 am
by Administrator
Ok, yeah, that could do it. And unfortunately it's a difficult thing to detect and prevent. I'll see what I can come up with, though.

Re: Bot is running for hours, and then it stops with an erro

Posted: Tue Mar 16, 2010 8:37 am
by flameboy
Yeah... I am now trying to copy and archive stuff, and even though the game window is not responding, the problem doesn't occur.
I guess it needs a specific state for the problem to occur.

What I can say for sure:
- It is not specific to level, or place (or mob)
- It is not addon related.
- It is not character or class related

What I suspect, but I am not sure about:
- when there is a lag, it seems more likely to occur
- it seems to occur more, when I am running more bots

Although it just happened right now with only one window, and without experiencing a lag of any kind.

One other thing:
I have windows 7 64 bit.

Re: Bot is running for hours, and then it stops with an erro

Posted: Wed Mar 17, 2010 5:22 am
by flameboy
Today when I switched to the game window (it was minimized), it was somewhat slow, and needed like 1-2 seconds to load it.
Meanwhile the bot wrote the following:

Code: Select all

Item:update(): empty or wrong bagid return, we don't update slot 44 name
Item:update(): empty or wrong bagid return, we don't update slot 45 name
Item:update(): empty or wrong bagid return, we don't update slot 46 name
It started from the first empty backpack slot (Backpack used 43/60). And it stopped when the game window was fully loaded. I think this is also a similar problem, only the bot doesn't stop because of this.
Also I noticed it running in circles sometimes. Instead of just going forward, it was also turning, and that resulted in running in circles. Then it started the unsticking process. But this is also happening only sometimes.

Re: Bot is running for hours, and then it stops with an erro

Posted: Thu Mar 18, 2010 12:19 am
by newbie2009
flameboy wrote:Today when I switched to the game window (it was minimized), it was somewhat slow, and needed like 1-2 seconds to load it.
Meanwhile the bot wrote the following:

Code: Select all

Item:update(): empty or wrong bagid return, we don't update slot 44 name
Item:update(): empty or wrong bagid return, we don't update slot 45 name
Item:update(): empty or wrong bagid return, we don't update slot 46 name
It started from the first empty backpack slot (Backpack used 43/60). And it stopped when the game window was fully loaded. I think this is also a similar problem, only the bot doesn't stop because of this.
Also I noticed it running in circles sometimes. Instead of just going forward, it was also turning, and that resulted in running in circles. Then it started the unsticking process. But this is also happening only sometimes.

yes, iam have same problem with flameboy, same error as quote. bot give that error after run more than 1 hours, and lots of unsticking, even the char not stuck at all. my high lv char in this couple days not dare use it at all, always die in area where there is no chance can't die, cause ald bot in that area almost 1 month and nvr die even once. but after the problem.... always die. btw after unsticking the bot logout the char and the rom client even not respond when i try to enter world again kind like hang, must restart pc to play the rom

PS : i will try to install win 7 x64bit in couple days when have time, work with rom and micromacro ??? <-- try to reinstall windows and rom, see if problem fixed or not

Re: Bot is running for hours, and then it stops with an erro

Posted: Thu Mar 18, 2010 2:09 pm
by unicron
I'm on win7 64bit and i've had it running for 8-10 hours at a time for a couple weeks now. I usually have 2-6 clients open on an i7 920 /w 6 gigs of ram. Rom will hardboot my system though if it hogs past the 6 gigs if I maximize / minimize one of the windows. Doesn't seem to be rombot related though.