Page 1 of 1

levelupSkills1To10() cause a problem

Posted: Sun Jan 15, 2012 11:57 am
by gloover
Hey experts,

I've tried to level up one of my characters from 0 to lvl 10 and got everytime on level up or teleporting this error

Code: Select all

5:44pm - scripts\rom/bot.lua:537: Fehler im Profile bei der Zeitpunktverarbeiten: onLeaveCombat 
error D:/RMB/scripts/rom/functions.lua:908: attempt to compare nil with number
I'm using the standard l1-10 prifile with this settings:

Code: Select all

	<onLeaveCombat>
		-- Additional Lua code to execute after a target is finished

			if(player.Level == 10) then
				__WPL:setForcedWaypointType("TRAVEL")
			end;


	</onLeaveCombat>

	<onLevelup>
		-- thats a demo for opening the gift bags from Lvl 1-10
		-- and levelup the skills for a new character (mage or priest recommended)
		-- you can delete that lines if you don't want to use that

			-- single skill would be: sendMacro("SetSpellPoint(4,2);");
			-- or levelupSkill(_skillname, _times)
			levelupSkills1To10();

			-- open giftbag and equipt content
			openGiftbags1To10(player.Level);

	</onLevelup>
Whats going wrong since the last revision?

Re: Error on levelup?!

Posted: Sun Jan 15, 2012 12:22 pm
by lisa
according to your error it is saying player.TP is nil, which is kind of weird.

Re: Error on levelup?!

Posted: Sun Jan 15, 2012 12:49 pm
by gloover
Its really weird, because by leveling a character from lvl 1-10 u always get enough TP so level up 2 or 3 skills to max.

Commenting --levelupSkills1To10(); out seems to solve the problem, but to level a character with lvl1 skill up to lvl 10 is most harder :-/

Re: levelupSkills1To10() cause a problem

Posted: Sun Jan 15, 2012 7:49 pm
by lisa
try using this and see if it helps.

Re: levelupSkills1To10() cause a problem

Posted: Mon Jan 16, 2012 2:58 pm
by gloover
Have tried your function.lua Lisa, but from time to time (Elf Druid lvl up to 4 and to 6, Elf Mage lvl up to 5) got this message again

Code: Select all

8:53pm - D:\RMB\scripts\rom/bot.lua:537: Fehler im Profile bei d
er Zeitpunktverarbeiten: onLeaveCombat error D:/RMB/scripts/rom/functions.lua:912: 
attempt to compare nil with number
:cry:

Re: levelupSkills1To10() cause a problem

Posted: Mon Jan 16, 2012 10:51 pm
by rock5
Have you tried the latest revision of the bot? It shouldn't get nil values for player variables. Make sure you "revert" any changed files after doing the svn update.

Re: levelupSkills1To10() cause a problem

Posted: Mon Jan 16, 2012 11:05 pm
by lisa
I think it might be getting nil from

Code: Select all

local name, _, icon, _, rank, type, upgradeCost, isSkillable, isAvailable = RoMScript("GetSkillDetail("..skill_from_db.skilltab..","..skill_from_db.skillnum..")")
because the tab and num don't exist for the skill in database. You get the issue if trying to lvl up skills that arn't actually in the skills database.

I also noticed that the levelupSkills1To10 has skills which can't actually be leveled up at all, like "PRIEST_HOLY_AURA".

It needs a total rewrite, I just haven't got the time for it at the moment.

Re: levelupSkills1To10() cause a problem

Posted: Wed Jan 18, 2012 9:22 am
by gloover
EDIT:

Hmm, strange: if you're using openGiftbags1To10(player.Level); AND levelupSkills1To10(); inside of <onlevelup>
thas cause this error. Commenting out one of them seems to solve it.

Now I've deleted the TP-Check and also deleted
if hf_return == true then
settings.updateSkillsAvailability()
end
in functions.lua:

Code: Select all

	for i = 1, _times do
		yrest(600);
		sendMacro("SetSpellPoint("..skill_from_db.skilltab..","..skill_from_db.skillnum..");");
		hf_return = true;
	end
Now everything works fine!

Lisa, rock, can u remove (or if u have time: improve) the TP-Check, as it was in the earlier revision?

THX in advance