rest after killing

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
aasi888
Posts: 64
Joined: Fri May 15, 2009 5:13 am

rest after killing

#1 Post by aasi888 » Sat May 16, 2009 4:06 am

I tried this but it shows error at line 24 column 1.

Code: Select all

<options>
	<option name="HP_LOW" value="80" />
	<option name="HP_LOW_POTION" value="55" />
        <option name="MP_LOW_POTION" value="30" />
        <option name="HP_LOW_REST" value="85" />
       	<option name="MP_LOW_REST" value="85" />
       	<option name="COMBAT_TYPE" value="ranged" />
       	<option name="COMBAT_DISTANCE" value="165" />
	<option name="ANTI_KS" value="true" />
	<option name="WAYPOINTS" value="bandits.xml" />
	<option name="RETURNPATH" value="back_to_bandit.xml" />
	<option name="PATH_TYPE" value="waypoints" />
	<option name="WANDER_RADIUS" value="500" />
	<option name="WAYPOINT_DEVIATION" value="25" />
	<option name="LOOT" value="true" />
	<option name="LOOT_TIME" value="2000" />
	<option name="LOOT_DISTANCE" value="250" />
	<option name="ENERGY_STORAGE_1" value="concentration" />
	<option name="ENERGY_STORAGE_2" value="mana" />
	<option name="POTION_COOLDOWN" value="15" />
	<option name="MAX_FIGHT_TIME" value="30" />
	<option name="DOT_PERCENT" value="90" />
</options>
<friends>
	<friend name="Katalontti" />
	<friend name="friendsname2" />
	<friend name="friendsname3" />
	<friend name="friendsname4" />
	<friend name="friendsname5" />
	<friend name="friendsname6" />
</friends>
<hotkeys>
	<hotkey name="HP_POTION" key="VK_MINUS" />
	<hotkey name="MP_POTION" key="VK_EQUAL" />
	<hotkey name="ATTACK" key="VK_0" />
	<hotkey name="RES_MACRO" key="VK_9" />
</hotkeys>
<skills>
	<skill name="SCOUT_VAMPIRE_ARROWS" hotkey="VK_1" priority="" />
	<skill name="MAGE_FIREBALL" hotkey="VK_4" priority="" level="13" />
	<skill name="SCOUT_WIND_ARROWS" hotkey="VK_2" priority="1" level="9" />
	<skill name="MAGE_LIGHTNING" hotkey="VK_5" priority="" level="13" />
	<skill name="SCOUT_FROST_ARROW" hotkey="VK_6" priority="" />
	<skill name="SCOUT_ARROW_OF_ESSENCE" hotkey="VK_7" priority="" />
</skills>
<onDeath></onDeath>
<onLeaveCombat>
			while( (self.HP/self.MaxHP*100) < settings.profile.options.HP_LOW_REST ) do
					if( not player.Alive ) then
							-- Make sure they aren't still trying to run off
							keyboardRelease(settings.hotkeys.MOVE_FORWARD.key);
							keyboardRelease(settings.hotkeys.MOVE_BACKWARD.key);
							keyboardRelease(settings.hotkeys.ROTATE_LEFT.key);
							keyboardRelease(settings.hotkeys.ROTATE_RIGHT.key);
							keyboardRelease(settings.hotkeys.STRAFF_LEFT.key);
							keyboardRelease(settings.hotkeys.STRAFF_RIGHT.key);

							if( type(settings.profile.events.onDeath) == "function" ) then
								local status,err = pcall(settings.profile.events.onDeath);
								if( status == false ) then
									local msg = sprintf("onDeath error: %s", err);
									error(msg);
								end
							end


							if( settings.profile.hotkeys.RES_MACRO ) then
								cprintf(cli.red, language[3]);
								keyboardPress(settings.profile.hotkeys.RES_MACRO.key);
								yrest(5000);

								cprintf(cli.red, language[4]);
								yrest(60000); -- wait 60 seconds before going about your path.
								player:update();
							end

							-- Must have a resurrect macro and waypoints set to be able to use
							-- a return path!
							if( settings.profile.hotkeys.RES_MACRO and player.Returning == false and
							__RPL ~= nil ) then
								player.Returning = true;
								__RPL:setWaypointIndex(1); -- Start from the beginning
							else
								pauseOnDeath();
							end
						end

					
						local modifier = settings.profile.hotkeys.HP_POTION.modifier
						if( modifier ) then keyboardHold(modifier); end
							keyboardPress(settings.profile.hotkeys.HP_POTION.key);
							if( modifier ) then keyboardRelease(modifier); end
							cprintf(cli.green, language[10]);
							yrest(1000);
						end;
			end
</onLeaveCombat>
<onSkillCast>-- Additional Lua code to execute when casting a skill
-- Note: arg1 contains the skill being used.
-- i.e. arg1.Name will be the name of the skill being cast.</onSkillCast>
</profile>
-- Additional Lua code to execute on death
pauseOnDeath(); -- Stop the script</onDeath>
line 24:
<friends>


Wtf is wrong there?

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: rest after killing

#2 Post by Administrator » Sat May 16, 2009 5:56 pm

Don't know why it's complaining about line 24, but I think I know what your problem is.

Code: Select all

</profile>
-- Additional Lua code to execute on death
pauseOnDeath(); -- Stop the script</onDeath>
You have code outside of the <profile> tag. In XML, you must only have one outer limit tag, with everything else contained within it. Since the last two lines span outside of the outer limit tag (profile), you have an error. In addition, you are closing onDeath, but not starting it.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 3 guests