multiple onload in the same file ?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
s018mes
Posts: 79
Joined: Sun Jan 16, 2011 11:14 am

multiple onload in the same file ?

#1 Post by s018mes » Wed Jul 25, 2012 10:46 am

Can you use 2 different onload sections within the same waypoint file?

It doesn't seem to load the GMDetect or any of the options in the first onload. It only loads the function onload. I know you can also use the profile file to inject onload features.

But could you combine ProfileOptions and Functions within the same onload?

Like:

Code: Select all

   <onLoad>
   cprintf(cli.white, "DOD LET'S RUN THIS");
changeProfileOption("AUTO_ELITE_FACTOR", 2500);
changeProfileOption("COMBAT_DISTANCE", 75);
changeProfileOption("COMBAT_RANGED_PULL", false);
changeProfileOption("QUICK_TURN", false);
startGMDetect();
  </onLoad>

<onload>
function bossbuff()
   if player.Class1 == 4 and player.Class2 == 5 then -- mage/priest
      player:cast("MAGE_ENERGY_INFLUX")
      player:cast("MAGE_ELECTROSTATIC_CHARGE")      
      player:cast("MAGE_SOLDIERS_CHARGE")
      player:cast("MAGE_INTENSIFICATION")
      player:cast("MAGE_ELEMENTAL_CATALYST")
   end
   if inventory:itemTotalCount(206874) > 1 then
	useGoodie(206874)
   end
   if inventory:itemTotalCount(206890) > 1 then
	useGoodie(206890)
   end
end
</onload>

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: multiple onload in the same file ?

#2 Post by rock5 » Wed Jul 25, 2012 1:37 pm

The onload probably just gets loaded twice and the second one overwrites the first one. You should be able to merge them into 1 onload.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: multiple onload in the same file ?

#3 Post by lisa » Wed Jul 25, 2012 6:58 pm

having 2 onload is like defining a variable twice.

lollies = true
lollies = false

you overwrite the first bit of code with the second.

You should be able to have all that code you posted in a single onload and work fine.

Code: Select all

  <onLoad>
   cprintf(cli.white, "DOD LET'S RUN THIS");
changeProfileOption("AUTO_ELITE_FACTOR", 2500);
changeProfileOption("COMBAT_DISTANCE", 75);
changeProfileOption("COMBAT_RANGED_PULL", false);
changeProfileOption("QUICK_TURN", false);
startGMDetect();

function bossbuff()
   if player.Class1 == 4 and player.Class2 == 5 then -- mage/priest
      player:cast("MAGE_ENERGY_INFLUX")
      player:cast("MAGE_ELECTROSTATIC_CHARGE")      
      player:cast("MAGE_SOLDIERS_CHARGE")
      player:cast("MAGE_INTENSIFICATION")
      player:cast("MAGE_ELEMENTAL_CATALYST")
   end
   if inventory:itemTotalCount(206874) > 1 then
   useGoodie(206874)
   end
   if inventory:itemTotalCount(206890) > 1 then
   useGoodie(206890)
   end
end
</onload>
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

s018mes
Posts: 79
Joined: Sun Jan 16, 2011 11:14 am

Re: multiple onload in the same file ?

#4 Post by s018mes » Wed Jul 25, 2012 10:16 pm

I get the following error when trying the code Lisa suggested:


haltOnError: false
Did not find any crashed game clients.
10:13pm - wapypointlist.lua:24: XML Parse Error.
Line 26
Column: 3
Pos: 788
Message; mismatched tag

s018mes
Posts: 79
Joined: Sun Jan 16, 2011 11:14 am

Re: multiple onload in the same file ?

#5 Post by s018mes » Wed Jul 25, 2012 10:22 pm

AH.... It works now.

Both I and Lisa forgot to capitalize : </onLoad>

But,

I am not sure if GMdetect is activated. I thought it use to say GMDetect started or something in the Rombot.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: multiple onload in the same file ?

#6 Post by lisa » Wed Jul 25, 2012 10:49 pm

s018mes wrote:AH.... It works now.

Both I and Lisa forgot to capitalize : </onLoad>

But,

I am not sure if GMdetect is activated. I thought it use to say GMDetect started or something in the Rombot.
onLoad or onload doesn't matter aslong as both the same it seems
<onload>
</onload>
or
<onLoad>
</onLoad>

You also need to have the GMdetect in the profile set aswell.

Code: Select all

		<option name="GMDETECT"			value="true" /> -- enables the GM detection userfunction
		<option name="GMnearbylogout"	value="true" /> -- If a GM is close to the character it will log out.
		<option name="PAUSEONGM"		value="" />  -- Pauses when GM whispers for value in seconds. ie 300 = 5 minutes
		<option name="RECALL"			value="true" /> -- if in combat while pausing it will use recall and whisper/logout
		<option name="playerDETECT"		value="true" /> -- enables the player detection userfunction

Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests