pass a varable from the waypoint to player profile on.....
pass a varable from the waypoint to player profile on.....
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>
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>
Re: pass a varable from the waypoint to player profile on.
That looks like it might work once the syntax is fixed. Try this
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?
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>
- 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
Re: pass a varable from the waypoint to player profile on.
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.
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.
Re: pass a varable from the waypoint to player profile on.
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.
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.
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
- 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
Re: pass a varable from the waypoint to player profile on.
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.
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.
Re: pass a varable from the waypoint to player profile on.
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.
Then all you have to do in your waypoint file is
I've assumed that you use Antidote to clear the Corrosion debuff.
To enable or disable a skill you can use
Then add the option to the 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>
Code: Select all
<onload>
Clear_Corrosion_Debuff = true
Catch_Cavies = false
</onload>
To enable or disable a skill you can use
- changeProfileSkill("DRUID_SKILLNAME", "AutoUse", true/false)
Code: Select all
<onLeaveCombat>
if Hide_After_Combat then
if player.Class1 == CLASS_ROGUE then
player:cast("ROGUE_HIDE")
end
end
</onLeaveCombat>
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
Re: pass a varable from the waypoint to player profile on.
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.
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.
Re: pass a varable from the waypoint to player profile on.
For this just add all the skills you want to profile and have them with autouse = false.beanybabe wrote:summonwardenpet a b c...set which pet is needed for that waypoint.
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" />
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)
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Who is online
Users browsing this forum: No registered users and 3 guests