Page 1 of 1

Error

Posted: Mon Jul 19, 2010 1:48 pm
by rock5
What can cause this error? I seem to remember getting it once before.

Code: Select all

scripts\bot.lua:2: ...gram Files/micromacro/scripts/rom/classes/player.lua:1293: att
empt to index global 'self' (a nil value)

Re: Error

Posted: Mon Jul 19, 2010 1:54 pm
by raff
Hi,

I got this error after after I updated to r473, too.
I believe its caused, after my bot was trying to call

Code: Select all

if not player:hasBuff("Regenerate") then
player:cast("PRIEST_REGENERATE");yrest(200);
end
in onskillcast

Re: Error

Posted: Mon Jul 19, 2010 2:03 pm
by rock5
raff wrote:Hi,

I got this error after after I updated to r473, too.
I believe its caused, after my bot was trying to call

Code: Select all

if not player:hasBuff("Regenerate") then
player:cast("PRIEST_REGENERATE");yrest(200);
end
in onskillcast
I don't have anything like that in this profile, just the regular skills in the skill section.

Re: Error

Posted: Mon Jul 19, 2010 2:30 pm
by raff
Oh, okay. I got this error a few times yesterday. But I was always afk, when this error was occured. I remember that my bot was casting regenerate, before this error occured.

Btw I just started the bot and I pulled some extra adds by hand, then I got the error again.

Code: Select all

Use 1: SCOUT_VAMPIRE_ARROWS=>   Aslan Dragonfly (2064/2064)
Use 4: SCOUT_WIND_ARROWS   =>   Fire mane Boar (3791/3791)
Use 4: SCOUT_WIND_ARROWS   =>   Fire mane Boar (2112/2133)
Use 1: SCOUT_VAMPIRE_ARROWS=>   Fire mane Boar (2039/2133)
Use 2: SCOUT_SHOT          =>   Fire mane Boar (1952/2133)
Taking too long to damage target, breaking sequence...
Clearing target.
Fight finished. Killed 1 <UNKNOWN>. (fight #2 / runtime 3 minutes)
Durability:0.98989898989899
scripts/classes/player.lua:1293: attempt to index global 'self' (a nil value)
"Taking too long to damage target, breaking sequence..." because I manually pressed TAB to pull a few mobs

Re: Error

Posted: Mon Jul 19, 2010 4:18 pm
by DrG
i'm getting this a lot of times :(

Edit: Sorry, image deleted

Re: Error

Posted: Mon Jul 19, 2010 4:55 pm
by wil32
im getting the same here, i tried to follow the bot to see wats going on.., when i got the error a couplke of time, the bot wont start again,

i went back a few version for now

Re: Error

Posted: Mon Jul 19, 2010 8:52 pm
by rock5
wil32 wrote:im getting the same here, i tried to follow the bot to see wats going on.., when i got the error a couplke of time, the bot wont start again,

i went back a few version for now
What do you mean "the bot wont start again"? Did it say a different error or the same error when it wouldn't start?

Re: Error

Posted: Mon Jul 19, 2010 9:01 pm
by rock5
DrG wrote:i'm getting this a lot of times :(
It's against the forum rules to use images of text errors.
"11. Do not post screenshots of text errors. Really, it doesn't help."

Re: Error

Posted: Mon Jul 19, 2010 10:01 pm
by wil32
it starts but i get the error right away

Re: Error

Posted: Mon Jul 19, 2010 10:22 pm
by rock5
I'm testing a fix for this now. I'll commit it in a couple of hours if I don't get anymore errors.

FYI: The error happens when the bot is going says it will ignore a target for x seconds.

Re: Error

Posted: Tue Jul 20, 2010 5:47 am
by Administrator
Please attach a copy of log.txt. Hopefully the traceback will provide more information. Also, we probably have different versions of player.lua, so provide a snippet of the area around that line.

Re: Error

Posted: Tue Jul 20, 2010 6:00 am
by rock5
Administrator wrote:Please attach a copy of log.txt. Hopefully the traceback will provide more information. Also, we probably have different versions of player.lua, so provide a snippet of the area around that line.
I already comited it. It was an obvious fix. In that function 'self' had no context so I just changed it to 'player'. This is the section with the 'self's already changed.

Code: Select all

	-- check if we just ignored that target / ignore it for 10 sec
	if(address == player.Last_ignore_target_ptr  and
	   os.difftime(os.time(), player.Last_ignore_target_time)  < 10 )then	
		if ( player.Battling == false ) then	-- if we don't have aggro then
			cprintf(cli.green, language[87], target.Name, 	-- We ignore %s for %s seconds.
			   10-os.difftime(os.time(), player.Last_ignore_target_time ) );
			debug_target("ignore that target for 10 sec (e.g. after doing no damage")
			return false;			-- he is not a valid target
		end;

		if( player.Battling == true  and		-- we have aggro
		target.TargetPtr ~= self.Address ) then	-- but not from that mob
			debug_target("we have aggro from another mob")
			return false;         
		end;
	end

Re: Error

Posted: Tue Jul 20, 2010 5:54 pm
by RussianBrother

Re: Error

Posted: Tue Jul 20, 2010 6:14 pm
by romvn
Not a fix. r474 still has the same problem.

Re: Error

Posted: Tue Jul 20, 2010 6:29 pm
by DrG
now got a new error.

Code: Select all

: .../Documents/micromacro/scripts/rom/classes/player.lua:1301: attempt to index global 'self' (a nil value)

Re: Error

Posted: Tue Jul 20, 2010 11:23 pm
by rock5
DrG wrote:now got a new error.

Code: Select all

: .../Documents/micromacro/scripts/rom/classes/player.lua:1301: attempt to index global 'self' (a nil value)
Me too and my 58/58 level character died. 1.5kk XP debt. Ouch! :(

I didn't examine the evalTargetDefault function properly. There was still a lot of 'self's in it. There shouldn't be any selfs as they have no context in that function. I've more thoroughly changed all the 'self's to 'player'. There shouldn't be anymore "'self' (a nil value)" errors.

So update to revision 475.

Re: Error

Posted: Wed Jul 21, 2010 9:45 am
by RussianBrother
WoW thx =) its works fine ;)