Page 2 of 14
Re: Ancient Treasures waypoint
Posted: Mon Dec 26, 2011 9:36 pm
by lisa
it doesn't have any more args?
Generally when I see a function that returns icon first there is usally a few more args after it.
Re: Ancient Treasures waypoint
Posted: Tue Dec 27, 2011 6:37 pm
by kanta
While testing the chest code that Lisa gave me (which it seems I didn't put in right, got a "failed to compile" error) I ran across an aggro issue. While checking for the candle in the center room today, I got to the 3rd location, located the candle and dropped to collect it. This seems to be a very narrow window for aggro spot it seems. Guess I'll have to do a little more fine tuning on coordinates to avoid this problem. I'll update when I can get it fixed.
Re: Ancient Treasures waypoint
Posted: Tue Dec 27, 2011 10:09 pm
by cufRet8e
rock5 wrote:]if settings.profile.options.DISMOUNT == false and zoneid == 355 then return false end --- NEW LINE
Doesn't this effectively disable all skills? You could just disable them all in the waypoint onload. That way a user doesn't need to set anything up.
Code: Select all
for k,v in pairs(settings.profile.skills) do
v.AutoUse = false
end
How to disable all skills except healing ones? Or disable particular skill from mage.
Re: Ancient Treasures waypoint
Posted: Tue Dec 27, 2011 10:34 pm
by rock5
cufRet8e wrote:How to disable all skills except healing ones? Or disable particular skill from mage.
You obviously need it for something else because the healing skills don't work in this minigame.
To disable all skills except healing skill then use this
Code: Select all
for k,v in pairs(settings.profile.skills) do
if v.Type ~= STYPE_HEAL and v.Type ~= STYPE_HOT then
v.AutoUse = false
end
end
To change individual skills use
changeProfileSkill(_skill, _option, _value)
Eg.
Code: Select all
changeProfileSkill("ROGUE_SHADOWSTAB", "AutoUse", true)
The trick is to find the correct option name. Most of them get capitalized when loaded.
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 1:04 am
by cufRet8e
Thank you:)
Yes, it's for something else - running with mount. My character just cast buffs (like MAGE_INTENSIFICATION) when got aggro, even with TRAVEL waypoints (I think), and continue running (dismounted already) with those useless buffs.
You can move this message as it's unrelated to Ancient Treasures, sorry:)
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 2:06 am
by rock5
cufRet8e wrote:running with mount. My character just cast buffs (like MAGE_INTENSIFICATION) when got aggro, even with TRAVEL waypoints (I think), and continue running (dismounted already) with those useless buffs.
Actually I think that is a bug that needs to be fixed. I'll have a look.
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 3:32 am
by rock5
Ok, there is only one reference to the checkskills function in the player:moveTo.
Code: Select all
-- while moving without target: check potions / friendly skills
if( self:checkPotions() or self:checkSkills(ONLY_FRIENDLY) ) then -- only cast friendly spells to ourselfe
So basically what I think I will do is, skip these if mounted and in travel mode
or if mounted and in run mode and not battling. So
Code: Select all
-- while moving without target: check potions / friendly skills
if not (player.Mounted and __WPL.Type == WPT_TRAVEL) and not (player.Mounted and __WPL.Type == WPL_RUN and not player.Battling) then
if( self:checkPotions() or self:checkSkills(ONLY_FRIENDLY) ) then -- only cast friendly spells to ourselfe
How does that sound?
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 6:18 am
by lisa
So many "not"
ok let me see if I understand it properly
Code: Select all
not (player.Mounted and __WPL.Type == WPT_TRAVEL)
So only if both are not at the same time.
so not mounted and wp type isn't travel
Code: Select all
not (player.Mounted and __WPL.Type == WPL_RUN and not player.Battling)
so player battling since double nengative?
so not mounted and also not wp type run and also player battling (in combat).
I am thinking it should be an or between them
Code: Select all
if not (player.Mounted and __WPL.Type == WPT_TRAVEL) or not (player.Mounted and __WPL.Type == WPL_RUN and not player.Battling) then
Little confusing with so many not but it should do the trick.
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 6:49 am
by rock5
Yeh basically, if its type travel and mounted we don't want to cast. So we
do want to cast if "not (type travel and mounted)". Also we dont want it to cast if type is run and mounted but only if not in combat, so we
do want it to cast if "not (type is run and mount and not in combat)".
Finally, if either of those are true then we dont want to cast. But we
do want to cast if "not (type travel and mounted)
and not (type is run and mount and not in combat)". Because if either of those is true then we wouldn't want it to cast.
I think that's right. I can get confused too. It probably would have been easier to write
Code: Select all
if (type travel and mounted) or (type is run and mount and not in combat) then
nothing
else
check skills and potions.
end
Problem is I don't really want to test it. Anyone want to test it? cufRet8e do you want to test it?
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 7:10 am
by cufRet8e
Of course:)
What exactly you wan't me to paste between my waypoints, or which files to modify?
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 7:30 am
by rock5
Just had a thought, you wouldn't want to cast skills when mounted even if the type = normal. So it may be as simple as
Code: Select all
if not player.Mounted or (__WPL.Type ~= WPT_TRAVEL and player.Battling) then
check skills and potions
end
I just did a little test. It still dismounts and it;s not because the logic is wrong. I think this might be harder than we thought because checkskills is run in a few different places.
Is there any reason we can't put the check for mounted right in the skill:canUse function? Then we could just add somewhere.
Code: Select all
-- Is player mounted
if player.Mounted then
if __WPL.Type == WPL_TRAVEL or not player.Battling then
return false
end
end
Ok cufRet8e, try this. In "skill.lua" at around line 172, just before
Code: Select all
-- Is player level more than or equal to aslevel
add the code just above.
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 8:04 am
by cufRet8e
Tested. Not working at the moment.
I inserted code as you said, to 172 line of classes\skill.lua:
Code: Select all
-- Is player mounted
if player.Mounted then
if __WPL.Type == WPL_TRAVEL or not player.Battling then
return false
end
end
Loaded rombot with Default profile, I created simple waypoint file with about 20 WPs, and this code in one of them:
Code: Select all
__WPL:setForcedWaypointType("TRAVEL")
useGoodie(***); <-- rock5, is any better way to get char mounted? :) I'm using mount ID atm. -->
yrest(5000);
So characted get mounted and start running in TRAVEL mode.
Code: Select all
Loading profile Default.xml
Testing 'ingamefunctions' macro. If it gets stuck here, please update the 'ingamefunctions
' by copying the 'ingamefunctions' folder from 'rom/devtools' to the games 'interface/addo
ns' folder.
MACRO Test: ok
Ranged skill found: MAGE_FLAME
[DEBUG] CPU Frequency 3135.537
Waypoint files from X:/Programs/micromacro/scripts/rom:
Enter the number of the path you want to use and press Enter > 51
You chose 51
Loaded waypoint path test.xml
Waypoint #18 is closer then #1. Hence we start with waypoint #18.
No return path with default naming test_return.xml found.
We use the normal waypoint path test.xml now.
Moving to waypoint #24, (-16160, 6766)
Moving to waypoint #1, (-16080, 6720)
Moving to waypoint #2, (-16069, 6648)
Moving to waypoint #3, (-16061, 6580)
Moving to waypoint #4, (-16056, 6523)
Forced waypoint type 'TRAVEL' set by user.
Used 201928.
Clearing target.
Moving to waypoint #5, (-16085, 6471)
Moving to waypoint #6, (-16087, 6432)
Moving to waypoint #7, (-16035, 6444)
Waypoint type TRAVEL, we won't stop and won't fight back
Moving to waypoint #8, (-15989, 6435)
Use MACRO: MAGE_ELEMENTAL_CATAL=> Skorpion ┼╗─ůdl─ůcy (4386/4386)
Use MACRO: MAGE_ENERGY_INFLUX => Skorpion ┼╗─ůdl─ůcy (4386/4386)
Use MACRO: MAGE_ENERGY_WELL => Skorpion ┼╗─ůdl─ůcy (4386/4386)
Waypoint type TRAVEL, we won't stop and won't fight back
Moving to waypoint #9, (-15993, 6472)
Waypoint type TRAVEL, we won't stop and won't fight back
Moving to waypoint #10, (-15944, 6487)
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 8:20 am
by rock5
That's annoying. setForcedWaypointType doesn't change the Type it only changes the ForcedType of the waypoints. Let me have a look at it.
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 8:24 am
by rock5
No it's ok. When it finds the next waypoint it changes the Type to equal the Forced Type.
I see the problem. You can always count on me to include a typo. It should be "WPT_TRAVEL" not "WPL_TRAVEL". Change That and see if it works.
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 8:53 am
by lisa
So the code I put in to player:checkskills isn't working?
Code: Select all
if settings.profile.options.DISMOUNT == false and player.Mounted then return false end
just have
Code: Select all
<option name="DISMOUNT" value="false" />
in your profile and it shouldn't use skills while mounted.
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 9:08 am
by rock5
I see them as being 2 different things. I think by default that it shouldn't try to use skills when mounted if you've set the waypoint type to travel. And if it isn't waypoint type travel then it should not dismount to cast skills unless aggroed. I don't think users should have to set a setting when it should behave this way.
With these default behaviours most people wont need to use your setting. I think it would mainly be useful if users want to override the default waypoint type behavior, ie. if the user wants it not to dismount regardless of waypoint type.
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 9:12 am
by cufRet8e
rock5 wrote:No it's ok. When it finds the next waypoint it changes the Type to equal the Forced Type.
I see the problem. You can always count on me to include a typo. It should be "WPT_TRAVEL" not "WPL_TRAVEL". Change That and see if it works.
Changed in skill.lua:
Code: Select all
if __WPL.Type == WPT_TRAVEL or not player.Battling then
Is that correct?
Because it have no difference, in situation like this (I wrote in again, just to clarify):
- running mounted, TRAVEL mode
got aggro from mob
cast MAGE_INTENSIFICATION etc.
got dismounted because of casting
said in terminal window, that it's not going to fight because of TRAVEL mode
continue walking without harm enemies
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 9:22 am
by cufRet8e
lisa wrote:So the code I put in to player:checkskills isn't working?
Code: Select all
if settings.profile.options.DISMOUNT == false and player.Mounted then return false end
just have
Code: Select all
<option name="DISMOUNT" value="false" />
in your profile and it shouldn't use skills while mounted.
Where I should put this code with "if"? Because simply adding DISMOUNT to false does not change anything.
Code: Select all
We use the normal waypoint path test.xml now.
We changed the option 'DISMOUNT' from 'true' to 'false'.
Moving to waypoint #24, (-16160, 6766)
Moving to waypoint #1, (-16080, 6720)
Moving to waypoint #2, (-16069, 6648)
Moving to waypoint #3, (-16061, 6580)
Moving to waypoint #4, (-16056, 6523)
Forced waypoint type 'TRAVEL' set by user.
Used 201928.
Clearing target.
Moving to waypoint #5, (-16085, 6471)
Moving to waypoint #6, (-16087, 6432)
Waypoint type TRAVEL, we won't stop and won't fight back
Moving to waypoint #7, (-16035, 6444)
Use MACRO: MAGE_ELEMENTAL_CATAL=> Skorpion ┼╗─ůdl─ůcy (4539/4539)
Use MACRO: MAGE_ENERGY_INFLUX => Skorpion ┼╗─ůdl─ůcy (4539/4539)
Use MACRO: MAGE_ENERGY_WELL => Skorpion ┼╗─ůdl─ůcy (4539/4539)
Waypoint type TRAVEL, we won't stop and won't fight back
Moving to waypoint #8, (-15989, 6435)
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 9:33 am
by rock5
Is it possible you have intensification in your onPreSkillCast section of your waypoint?
Re: Ancient Treasures waypoint
Posted: Wed Dec 28, 2011 9:36 am
by lisa
it still used the skill while mounted and profile option DISMOUNT was set to false??
That isn't right.
There must be something else casting those buffs and not the usual bot checking skills.