pass a varable from the waypoint to player profile on.....

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

pass a varable from the waypoint to player profile on.....

#1 Post by beanybabe » Mon Jul 21, 2014 4:39 am

I needing a way to make the waypoints a little more custom. will this work some how so i can enable and disable the buff in profile do i need make variable global or some method ?

profile................
<onSkillCast><![CDATA[
if (player.Class1 or player.Class2 == CLASS_DRUID) and (not player:hasBuff("Corrosion")) and passvardontbuff =false then
player:cast("DRUID_ANTIDOTE")
end
]]></onSkillCast>

waypoint .................
<!-- # 2 --><waypoint x="188" z="458" y="32"> passvardontbuff=true </waypoint>
...
<!-- # 12 --><waypoint x="188" z="458" y="32"> passvardontbuff=false </waypoint>

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

Re: pass a varable from the waypoint to player profile on.

#2 Post by rock5 » Mon Jul 21, 2014 10:21 am

That looks like it might work once the syntax is fixed. Try this

Code: Select all

<onSkillCast><![CDATA[
    if (player.Class1 == CLASS_DRUID or player.Class2 == CLASS_DRUID) and (not player:hasBuff("Corrosion")) and passvardontbuff == false then
        player:cast("DRUID_ANTIDOTE")
    end
]]></onSkillCast>
I'm a little confused as to what it's supposed to do. This looks like it only casts Antidote when you do not have the Corrosion buff and you've set passverdontbuff to false. Is this right?
  • 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
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: pass a varable from the waypoint to player profile on.

#3 Post by beanybabe » Mon Jul 21, 2014 12:13 pm

Sorry don't pay attn to that code much its just was for example.

what I'm trying to so is make waypoints that can change how profile does things.

id like to avoid editing the profile and change little things all the time. I tried putting x=123 in a way point then do if x=123 in a profile's onleavecombat but it is not seeing it.

there must be some global or local thing that's needed.

- - - - - - - - - - - - - - -

The reason for this is some areas mobs have a different behavior so the profile needs tuned a bit. say a area has eletes and you needed hero pots cast you could put code to allow them used for that waypoint but not others.
i prefer making on custom waypoints that act more like natural player does. Id like to add and escape to safey bit of waypoint some time. I talked about hide before and you mentioned that it was not really coded for that. From what i have found it works well but one change would be nice. Have it cast hide after onleavecombat if hide is not already cast. then if player does buffs and such its not casting it over and over.
I been thinking that another file may be nice to help rombot it has profile but it needs a waypoint-profile so you can code specific stuff you like in each waypoint. I have a bit of code i move into each waypoint with slight changes. a template might just be like a css statement for html. I was thinking of posting this later when I got more clear on the idea but now that you are coding rombot2 i thought it might be good so you can think of adding it.

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

Re: pass a varable from the waypoint to player profile on.

#4 Post by rock5 » Mon Jul 21, 2014 11:26 pm

In lua a variable is local only if it is declared local. If a variable is not declared local it will be global. So your x=123 should work as long as it executes before the profile checks it.

To use a skill, either automatically or cast manually, requires it to be included in the profile. If you don't want it to be used automatically then you would set autouse="false" as part of the skill details. Then you could cast it manually when you want.

The onskillcast example above should work but if you want to concentrate your changes in the waypoint file it is possible to change the onskillcast from the waypoint file, eg.

Code: Select all

		if oldOnSkillCast == nil then oldOnSkillCast = settings.profile.events.onSkillCast end
		function settings.profile.events.onSkillCast()
			oldOnSkillCast()

			if (player.Class1 == CLASS_DRUID or player.Class2 == CLASS_DRUID) and (not player:hasBuff("Corrosion")) and passvardontbuff == false then
			        player:cast("DRUID_ANTIDOTE")
			end
		end
If you want an adaptable solution that can help you setup your options with different waypoint files, you could create a userfunction with functions that do all the work. Then just call those functions in the waypoint file.
  • 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
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: pass a varable from the waypoint to player profile on.

#5 Post by beanybabe » Tue Jul 22, 2014 2:07 pm

example: i want to control catchcavy then each wp can have a flag to allow or disallow hunting them.
In some areas I don't want to cast certain buffs. or to enable and disable ranged attack or hide or knights shield or druid pets

every waypoint I always insert code after waypoint 1 and have wondered if there was a way to just modify the source to do this simultaneously as creating them.

my goal is to make a bit of code to put in start of each waypoint that makes it easy to tweak it fast for each class without changing the profile each time.

also profile code for onleave conbat that works with most classes could be made then. ending up with only needing one default profile.

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

Re: pass a varable from the waypoint to player profile on.

#6 Post by rock5 » Tue Jul 22, 2014 9:48 pm

Are you aware you can use a <onload> section in your waypoint file? This code runs when the waypoint is loaded. It's ideal for setting up settings for your waypoint file.

I still think the first option is the easiest, especially if you are using only 1 profile. If you just don't want to change the profile for each waypoint file then you won't need to. You can change it only once to use option variables such as passvardontbuff then set the variables in the waypoint file, eg.

Code: Select all

<onSkillCast>
	if Clear_Corrosion_Debuff then
		if (player.Class1 == CLASS_DRUID or player.Class2 == CLASS_DRUID) and player:hasBuff("Corrosion") then
			player:cast("DRUID_ANTIDOTE")
		end
	end
        
	if Catch_Cavies then
		catchCavy()
	end
</onSkillCast>
Then all you have to do in your waypoint file is

Code: Select all

<onload>
	Clear_Corrosion_Debuff = true
	Catch_Cavies = false
</onload>
I've assumed that you use Antidote to clear the Corrosion debuff.

To enable or disable a skill you can use
  • changeProfileSkill("DRUID_SKILLNAME", "AutoUse", true/false)
Hide is tricky. I don't think you can have the bot cast it automatically. I think it would have to be cast at a waypoint or in the onLeaveCombat. If you wanted it to use it in the onLeaveCombat you can use the same method.

Code: Select all

<onLeaveCombat>
	if Hide_After_Combat then
		if player.Class1 == CLASS_ROGUE then
			player:cast("ROGUE_HIDE")
		end
	end
</onLeaveCombat>
Then add the option to the waypoint file

Code: Select all

Hide_After_Combat = true
  • 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
beanybabe
Posts: 647
Joined: Wed Mar 06, 2013 1:27 am

Re: pass a varable from the waypoint to player profile on.

#7 Post by beanybabe » Fri Aug 08, 2014 6:25 am

Thanks I got this working

things im using this for

hideplayer....................... set to use stealth or not while moving on waypoint.
catchcavies 1 2...............set 1 for any 2 for golden leave empty for none
playercheck ....................this sets varable that passes to onleave combat code to check or not check
summonwardenpet a b c...set which pet is needed for that waypoint.
waypointonesafe...............sets player to move to first waypoint before doing auto logout.

Some make custom waypoints and would not need this, but for most of the out in open waypoints such as hunting, gathering and questing these would be handy.
Im gonna work on this a while ill try to post what I end up with.
Thanks again end of this topic.

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

Re: pass a varable from the waypoint to player profile on.

#8 Post by lisa » Fri Aug 08, 2014 5:46 pm

beanybabe wrote:summonwardenpet a b c...set which pet is needed for that waypoint.
For this just add all the skills you want to profile and have them with autouse = false.

Code: Select all

		<skill name="WARDEN_SUMMON_SPIRIT_OF_THE_OAK"	hotkey="MACRO" priority="90" />
		<skill name="WARDEN_SUMMON_NATURE_CRYSTAL"	  	hotkey="MACRO" priority="90" autouse="false" />
		<skill name="WARDEN_SUMMON_OAK_WALKER"	  		hotkey="MACRO" priority="90" autouse="false" />
Then in the waypoint you change autouse from false to true and just make sure to change the others to false. you can use this function changeProfileSkill(_skill, _option, _value)

Code: Select all

changeProfileSkill("WARDEN_SUMMON_SPIRIT_OF_THE_OAK","autouse",false)
changeProfileSkill("WARDEN_SUMMON_NATURE_CRYSTAL","autouse",false)
changeProfileSkill("WARDEN_SUMMON_OAK_WALKER","autouse",true)
might be Autouse rather than autouse, it's been a while since I had to use it.
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 3 guests