Page 1 of 1

Scout stop attack when is attacked

Posted: Thu Jul 09, 2015 1:55 am
by Nijura
Hi there, I have a problem with my scout. When I want her to attack on her own she stops attacking when she is attacked herself. Micromacro tells me:
"micromacro/scripts/rom/classes/skill.lua: 409: attempt to compare number with nil"

What do I have to do to?

Greetings and thanks for the help
Nijura

Re: Scout stop attack when is attacked

Posted: Thu Jul 09, 2015 2:48 am
by rock5
You posted in the wrong section. All rombot queries go in the "Runes of Magic" forum. I moved it for you.

Line 409 should be

Code: Select all

			if ammo.ObjSubType ~= 5 or ammo.ItemCount < self.ConsumableNumber then
Try adding the following line before this so we know which value is causing the problem.

Code: Select all

if ammo.ObjSubType == nil or ammo.ItemCount ==nil or self.ConsumableNumber == nil then
print(self.Id,self.Name,ammo.ObjSubType or "nil",ammo.ItemCount or "nil",self.ConsumableNumber or "nil")
end
When you get the error tell us what it prints.

Re: Scout stop attack when is attacked

Posted: Thu Jul 09, 2015 3:09 am
by Nijura
Thanks for the quick answer. I'm sorry for the wrong section for my question.
I don't know, where I should write the lines you told me. Is it in skills or profile?

Greetings
Nijura

Re: Scout stop attack when is attacked

Posted: Thu Jul 09, 2015 3:53 am
by rock5
The error you posted said line 409 of skill.lua. So that's the file I meant. Just add it before that line.

Re: Scout stop attack when is attacked

Posted: Thu Jul 09, 2015 4:05 am
by Nijura
I added it and the bot runs for several minutes now without crashing. I hope the problem won't show up again.
Thank you very much!

Re: Scout stop attack when is attacked

Posted: Thu Jul 09, 2015 4:08 am
by Nijura
I see now, that the scout is not using any skills consuming arrows. That's odd.

Re: Scout stop attack when is attacked

Posted: Thu Jul 09, 2015 4:14 am
by rock5
What I posted shouldn't stop it from errorring, only add a message before it errors. So you're not getting errors its just not using arrows? Maybe it's a glitch that would be fixed after restarting the game?

Re: Scout stop attack when is attacked

Posted: Thu Jul 09, 2015 4:24 am
by Nijura
I restarted the game. Now she uses arrows again but I get that error again. "micromacro/scripts/rom/classes/skill.lua: 412: attempt to compare number with nil"

Re: Scout stop attack when is attacked

Posted: Thu Jul 09, 2015 7:51 am
by noobbotter
Do you have a line starting with

Code: Select all

<option name="ARROW_QUIVER"
in your profile you're using?

Re: Scout stop attack when is attacked

Posted: Thu Jul 09, 2015 8:02 am
by rock5
Nijura wrote:I restarted the game. Now she uses arrows again but I get that error again. "micromacro/scripts/rom/classes/skill.lua: 412: attempt to compare number with nil"
Didn't I say to tell me what it prints when you get the error? The print out I had you add should appear just before the error.

Re: Scout stop attack when is attacked

Posted: Thu Jul 09, 2015 10:01 am
by Nijura
I looked it up myself, the line before error. It seems that some buffs caused trouble. I removed them from my profile and everything goes well since then.

Thank you for your patience and good advise :D