Page 1 of 1

Bot error after rev. 767 update

Posted: Wed Nov 20, 2013 9:23 pm
by spyfromsiochain
After the update from rev 766 --> 767

I get the erro att.

I check the funtions.lua line and:

local function replaceUtf8( _str, _key )
local tmp = database.utf8_ascii[_key];
_str = string.gsub(_str, string.char(tmp.utf8_1, tmp.utf8_2), string.char(tmp.ascii) ); (error in this line)
return _str
end

Re: Bot error after rev. 767 update

Posted: Thu Nov 21, 2013 3:42 am
by rock5
There is no reason that shouldn't work. Did you get any corrupt files when you updated? That's files with red or yellow icons next to them in explorer?

Re: Bot error after rev. 767 update

Posted: Thu Nov 21, 2013 11:18 am
by spyfromsiochain
Rocks.
After reinstallation of micromacro and rombot I got the same error, that I got after the update from 766-767, but by chance I managed to trace the problem (at least till now no more errors), the problem was in this user function addon_attackspeedzero.lua, from http://solarstrike.net/phpBB3/viewtopic ... ero#p49642, with rev. 767 prompts the error in previews post.

ty

Re: Bot error after rev. 767 update

Posted: Thu Nov 21, 2013 1:56 pm
by rock5
Sorry, I should have been able to tell you it was a userfunction by the error message.

This took me quite awhile to figure out. It's because of the GetIdName commands that are not inside a function at line 133,134. That's bad programming practice because it forces the bot to run getWIN early before everything else has loaded and causes problems like this.

That said, the reason 767 is getting this error is because of the code I added to display the character names properly when selecting the window to attach to. I did add code to handle early running of getWIN but it wasn't good enough to handle this situation.

Changing line 103 of functions.lua

Code: Select all

			if database then
to

Code: Select all

			if database and next(database.utf8_ascii) then
should fix it.