Page 5 of 6
Re: Warden pet class
Posted: Thu Mar 08, 2012 11:05 pm
by rock5
lisa wrote:Seems an ID changed in one of the little tiny patches we have been having because it used to work as I tested all of the buffs myself.
I avoided this problem with regular skills by getting the names of the ids and comparing the names. That way if the id changes, as long as the name remains the same, it will still work. You should probably do the same with the pet skills. Wouldn't be too difficult.
Re: Warden pet class
Posted: Fri Mar 09, 2012 1:10 am
by lisa
but wouldn't the name be different for each language?
I'll have to have a look at your code to see how you did it. Might have some time next week.
Re: Warden pet class
Posted: Fri Mar 09, 2012 2:56 am
by abron1
ok thanks ill try that...
Re: Warden pet class
Posted: Fri Mar 09, 2012 3:58 am
by rock5
lisa wrote:but wouldn't the name be different for each language?
You still save ids but compare their names instead of the ids.
Eg. instead of
Code: Select all
if pet.Id ~= fairy.PetId then -- Fairy
you could use
Code: Select all
if pet.Name ~= fairy.Name then -- Fairy
instead of
you could use
Code: Select all
if GetIdName(buffid) == GetIdName(HavePetBuff) then
The only problem I see is you are using english strings "spirit", "heart", "nature" and "walker".
Re: Warden pet class
Posted: Fri Mar 09, 2012 9:30 am
by lisa
hmmm I don't see how doing that will allow for Id changes.
In this example the skill went from Id 493346 to 491668
The part of the code that is failing is in classes/skill.lua
Code: Select all
if player.Class1 == CLASS_WARDEN then
local skillName = GetIdName(self.Id)
if self.Type == STYPE_BUFF then
if not player.Battling then
--=== sacrifice pet buffs
if self.Id == 493346 then -- heart of the oak
wardenbuff(503946) -- code in classes/pet.lua
return
end
So if the Id has changed from 493346 to 491668 doing a check for GetIdName(493346) won't get the name we want anyway. Unless they duplicated the skill to another ID and they still kept all the old skill info for the previous ID.
Actually when I was testing it earlier today it worked with the old skill Id, so they must duplicate it for what ever reason. So doing that would work for now I guess.
The only problem I see is you are using english strings "spirit", "heart", "nature" and "walker".
That is only if you call for the buff skill yourself, the code in default bot uses the ID's.
So if you had in profile onleavecombat
wardenbuff("heart")
it would make sure you have the buff heart of the oak.
Re: Warden pet class
Posted: Fri Mar 09, 2012 9:44 am
by lisa
give these a test for me if you have the time.
both in
micromacro/rom/classes/
folder
Re: Warden pet class
Posted: Sat Mar 10, 2012 3:37 am
by abron1
the skills one works now from what i have tested thanks
Re: Warden pet class
Posted: Sat Mar 10, 2012 5:58 am
by rock5
lisa wrote:hmmm I don't see how doing that will allow for Id changes.
...
So if the Id has changed from 493346 to 491668 doing a check for GetIdName(493346) won't get the name we want anyway. Unless they duplicated the skill to another ID and they still kept all the old skill info for the previous ID.
Usually, when skill or buff ids change, it's some minor change but the name remains the same. Like the ids you said, both are "Heart of the Oak".
Re: Warden pet class
Posted: Sat Mar 10, 2012 9:05 pm
by lisa
fixed in rev 699
Re: Warden pet class
Posted: Sat Mar 17, 2012 3:58 pm
by emmanuel04
Did a change happen with the warden pet buffs?
I cant seem to get it to work anymore.
Code: Select all
GM detection started
Clearing target.
Moving to waypoint #6, (2099, 2633)
Use MACRO: WARDEN_HEART_OF_THE_Did not find any crashed game clients.
4:52pm - ...ktop/RomBot 2012/scripts/rom/classes/memorytable.lua:122: attempt to
compare number with boolean
Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>
And my profile skills for my warden
Code: Select all
<skills_warden>
<skill name="WARDEN_SUMMON_SPIRIT_OF_THE_OAK" hotkey="MACRO" priority="90" autouse="false" />
<skill name="WARDEN_SUMMON_NATURE_CRYSTAL" hotkey="MACRO" priority="90" autouse="false" />
<skill name="WARDEN_SUMMON_OAK_WALKER" hotkey="MACRO" priority="90" autouse="false" />
<skill name="WARDEN_POWER_OF_THE_OAK" hotkey="MACRO" priority="90" />
<skill name="WARDEN_SUMMON_CHIRON_THE_CENTAUR" hotkey="MACRO" priority="90" />
<skill name="WARDEN_BRIAR_SHIELD" hotkey="MACRO" priority="90" />
<skill name="SCOUT_JOINT_BLOW" hotkey="MACRO" priority="250" />
<skill name="WARDEN_POWER_OF_THE_WOOD_SPIRIT" hotkey="MACRO" priority="10" />
<skill name="WARDEN_FRANTIC_BRIAR" hotkey="MACRO" priority="100" autouse="false"/>
<skill name="SCOUT_VAMPIRE_ARROWS" hotkey="MACRO" priority="70" autouse="false"/>
<skill name="SCOUT_SHOT" hotkey="MACRO" priority="330" autouse="false"/>
<skill name="WARDEN_SAVAGE_POWER" modifier="" hotkey="MACRO" priority="777" autouse="false" inbattle="false" />
<skill name="WARDEN_MORALE_BOOST" modifier="" hotkey="MACRO" priority="777" autouse="false" inbattle="false" />
<skill name="WARDEN_EXPLOSION_OF_POWER" modifier="" hotkey="MACRO" priority="777" autouse="false" inbattle="false" />
<skill name="WARDEN_ENERGY_ABSORB" modifier="" hotkey="MACRO" priority="777" autouse="false" inbattle="false" />
<skill name="WARDEN_ELVEN_AMULET" modifier="" hotkey="MACRO" priority="777" autouse="false" inbattle="false" />
</skills_warden>
Re: Warden pet class
Posted: Mon Mar 19, 2012 7:37 pm
by Edamh
I was just coming on to ask the same. I am seeing
Code: Select all
player.Class1 == CLASS_WARDEN
Pet.HP: 1000
Pet.MaxHP: 1000
Setting up buff.
Casting WARDEN_SUMMON_OAK_WALKER.
Use 9: WARDEN_SUMMON_OAK_WA=> * Failed to cast *
Casting WARDEN_POWER_OF_THE_OAK.
Use 0: WARDEN_POWER_OF_THE_Did not find any crashed game clients.
7:32pm - D:/micromacro/scripts/rom/classes/player.lua:1430: Error in your profil
e: onLeaveCombat error: D:/micromacro/scripts/rom/classes/memorytable.lua:122: a
ttempt to compare number with boolean
Here's the onLeaveCombat code that I had been using but is now failing for some reason.
Code: Select all
if(player.Class1 == CLASS_WARDEN ) then
cprintf(cli.yellow, "player.Class1 == CLASS_WARDEN \n");
cprintf(cli.blue, "Pet.HP: %d\n", player.Pet.HP);
cprintf(cli.blue, "Pet.MaxHP: %d\n", player.Pet.MaxHP)
if not player:hasBuff("Power of the Oak") then
cprintf(cli.yellow, "Setting up buff.\n");
cprintf(cli.yellow, "Casting WARDEN_SUMMON_OAK_WALKER.\n");
player:cast("WARDEN_SUMMON_OAK_WALKER");
yrest(9500);
cprintf(cli.yellow, "Casting WARDEN_POWER_OF_THE_OAK.\n");
player:cast("WARDEN_POWER_OF_THE_OAK");
yrest(1500);
cprintf(cli.yellow, "Casting WARDEN_SUMMON_CHIRON_THE_CENTAUR.\n");
player:cast("WARDEN_SUMMON_CHIRON_THE_CENTAUR");
yrest(9500);
RoMScript("UsePetAction(6,true)")
yrest(800);
RoMScript("UsePetAction(7,true)")
yrest(800);
end
-- Summon pet if not present
if( player.PetPtr == 0 or ( player.Pet.HP/player.Pet.MaxHP*100 ) < 20 ) then
cprintf(cli.yellow, "Summoning pet. \n");
player:cast("WARDEN_SUMMON_CHIRON_THE_CENTAUR");
yrest(9000);
RoMScript("UsePetAction(6,true)")
yrest(800);
RoMScript("UsePetAction(7,true)")
yrest(800);
end;
-- Heal Pet
player:update()
if 70 > (player.Pet.HP/player.Pet.MaxHP * 100) then
cprintf(cli.yellow, "Healing pet. \n");
player:target( player.Pet )
player:cast("WARDEN_ELVEN_PRAYER")
yrest(1000)
end
end;
emmanuel04 wrote:Did a change happen with the warden pet buffs?
I cant seem to get it to work anymore.
Code: Select all
GM detection started
Clearing target.
Moving to waypoint #6, (2099, 2633)
Use MACRO: WARDEN_HEART_OF_THE_Did not find any crashed game clients.
4:52pm - ...ktop/RomBot 2012/scripts/rom/classes/memorytable.lua:122: attempt to
compare number with boolean
Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>
And my profile skills for my warden
Code: Select all
<skills_warden>
<skill name="WARDEN_SUMMON_SPIRIT_OF_THE_OAK" hotkey="MACRO" priority="90" autouse="false" />
<skill name="WARDEN_SUMMON_NATURE_CRYSTAL" hotkey="MACRO" priority="90" autouse="false" />
<skill name="WARDEN_SUMMON_OAK_WALKER" hotkey="MACRO" priority="90" autouse="false" />
<skill name="WARDEN_POWER_OF_THE_OAK" hotkey="MACRO" priority="90" />
<skill name="WARDEN_SUMMON_CHIRON_THE_CENTAUR" hotkey="MACRO" priority="90" />
<skill name="WARDEN_BRIAR_SHIELD" hotkey="MACRO" priority="90" />
<skill name="SCOUT_JOINT_BLOW" hotkey="MACRO" priority="250" />
<skill name="WARDEN_POWER_OF_THE_WOOD_SPIRIT" hotkey="MACRO" priority="10" />
<skill name="WARDEN_FRANTIC_BRIAR" hotkey="MACRO" priority="100" autouse="false"/>
<skill name="SCOUT_VAMPIRE_ARROWS" hotkey="MACRO" priority="70" autouse="false"/>
<skill name="SCOUT_SHOT" hotkey="MACRO" priority="330" autouse="false"/>
<skill name="WARDEN_SAVAGE_POWER" modifier="" hotkey="MACRO" priority="777" autouse="false" inbattle="false" />
<skill name="WARDEN_MORALE_BOOST" modifier="" hotkey="MACRO" priority="777" autouse="false" inbattle="false" />
<skill name="WARDEN_EXPLOSION_OF_POWER" modifier="" hotkey="MACRO" priority="777" autouse="false" inbattle="false" />
<skill name="WARDEN_ENERGY_ABSORB" modifier="" hotkey="MACRO" priority="777" autouse="false" inbattle="false" />
<skill name="WARDEN_ELVEN_AMULET" modifier="" hotkey="MACRO" priority="777" autouse="false" inbattle="false" />
</skills_warden>
Re: Warden pet class
Posted: Mon Mar 19, 2012 8:45 pm
by lisa
I might get a chance today to do some testing on this.
Here's the onLeaveCombat code that I had been using but is now failing for some reason.
You shouldn't need all that code anymore, just put the skills you want used in your profile. So just the buff skill and the actual pet you want used, the bot will take care of everything else. If you have elven prayer in skills list of profile it should also heal your pet.
Re: Warden pet class
Posted: Tue Mar 20, 2012 2:40 am
by lisa
Ok finally found the issue, it was the way it was checking if it already had the buff.
Test drive this for me please.
Re: Warden pet class
Posted: Tue Mar 20, 2012 9:46 am
by Edamh
lisa wrote:Ok finally found the issue, it was the way it was checking if it already had the buff.
Test drive this for me please.
No more errors. Issue resolved with updated
pet.lua. Thanks much.
Re: Warden pet class
Posted: Fri May 04, 2012 12:29 am
by abron1
when the warden goes inside a instance the pet skills are off how do i turn them back on? i have tried
Code: Select all
RoMScript("UsePetAction(6,true)")
yrest(800);
RoMScript("UsePetAction(7,true)")
yrest(800);
end
...in my waypoint but it didn't work...
Re: Warden pet class
Posted: Fri May 04, 2012 1:25 am
by rock5
Re: Warden pet class
Posted: Fri May 04, 2012 4:03 am
by abron1
works perfect rock thanks...one question is there away to do this each time the warden and pet zone so i can use the same waypoints with other characters? i know your busy with the big update so i was just asking
Re: Warden pet class
Posted: Fri May 04, 2012 6:37 am
by rock5
Technically speaking the bot doesn't know when you zone but it does detect when your players address changes. So you could easily have it run that function when it detects the address change.
In player.lua, near the top of the update function, around line 42, you'll find
Code: Select all
if( tmpAddress ~= self.Address and tmpAddress ~= 0 ) then
self.Address = tmpAddress;
cprintf(cli.green, language[40], self.Address);
addressChanged = true
end;
This is the part that detects address changes. Just stick the function in there, something like this.
Code: Select all
if( tmpAddress ~= self.Address and tmpAddress ~= 0 ) then
self.Address = tmpAddress;
cprintf(cli.green, language[40], self.Address);
addressChanged = true
setpetautoattacks()
end;
I may even leave that in as I don't see it causing any issues seeing as it runs only when the address changes.
Re: Warden pet class
Posted: Fri May 04, 2012 6:55 am
by lisa
Maybe check for the warden class before trying to do the function as the function itself assumes you are a warden if you call it and doesn't do a check.
Code: Select all
if( tmpAddress ~= self.Address and tmpAddress ~= 0 ) then
self.Address = tmpAddress;
cprintf(cli.green, language[40], self.Address);
addressChanged = true
if player.Class1 == CLASS_WARDEN then
setpetautoattacks()
end
end;
Re: Warden pet class
Posted: Fri May 04, 2012 7:06 am
by rock5
Yeah, technically that would be the right way to do it. Although I did test it with non warden classes and saw no issue. Better to be on the safe side.