Rogue Helper v6.0 [Complete Rogue Macro] (Updated: 10-26-04)

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

Jerle69
a hill giant
a hill giant
Posts: 263
Joined: Wed Apr 28, 2004 3:26 pm

Post by Jerle69 » Wed Aug 11, 2004 5:13 pm

A_druid_00:

Yeah, I considered doing that too, but it creates a little spam in the player's default chat window, and I'm just anal and weird about doing that. As is, I hate forcing /lootnodrop off/on/drop with the /autoninja command, but I did it for that (so easy to have that screw up)... I just don't like the spam.
--Jerle

Jerle69
a hill giant
a hill giant
Posts: 263
Joined: Wed Apr 28, 2004 3:26 pm

Post by Jerle69 » Sun Aug 15, 2004 12:00 pm

Version 5.7 has been posted. Here's the summary:

Code: Select all

| VERSION 5.7: 
| 
| Just a small update this time (it's sure been a while, hasn't it?)  This update adds 
| trap negotiation skills to RH.  It also finally provides a month-old bug fix to the 
| loading and saving of target-switch states. 
| 
|     . /autotraps - This command will toggle the automatic sensing/disarming of traps. 
|       If you sense a trap, it will automatically attempt to deactivate it.  Be careful 
|       with this switch, as sensing a trap causes the EQ client to face you in the 
|       trap's direction.  This can be hazardous when in combat!  To mitigate this 
|       nasty side-effect, RH remembers the direction you faced prior to discovering 
|       a trap and will have you return to your previous facing position after disarming 
|       it (or at least attempting to disarm it). 
| 
--Jerle

Knight
orc pawn
orc pawn
Posts: 27
Joined: Thu Jun 17, 2004 1:45 am

Post by Knight » Tue Aug 17, 2004 8:45 am

Hmm...if I remember correctly, you don't have to be facing a trap to disarm it, you just have to have sensed it. So the code:

Code: Select all

Sub Event_FTrap 
  /varset lastevent Event_FTrap 
  /echo ** Floor Trap discovered... 
  /if (${Me.AbilityReady[Disarm Traps]}) { 
    /echo ** Disarming... 
    /doability "Disarm Traps" 
  } else { 
    /echo ** Can't disarm yet... 
  } 
  |- Face our "old" heading, in case we were spun around 
  /face nolook fast heading ${oldheading} 
/return
Could be changed to:

Code: Select all

Sub Event_FTrap 
  |- Face our "old" heading, in case we were spun around 
  /face nolook fast heading ${oldheading} 
  /varset lastevent Event_FTrap 
  /echo ** Floor Trap discovered... 
  /if (${Me.AbilityReady[Disarm Traps]}) { 
    /echo ** Disarming... 
    /doability "Disarm Traps" 
  } else { 
    /echo ** Can't disarm yet... 
  } 
/return
Not that it makes much difference in how fast your character reacts, but it would be a little bit quicker of a turn back. Same with BTrap.

Also, in your Sub Event_BTrap you set lastevent to FTrap, not that it really matters since you're not using those events to check anything right now, but for consistency, last event should be BTrap.

There's some other things I want to check tonight when I get home, but I'll throw them out anyway: As far as 'Box Traps' go, can you sense a trap on a chest without already having it targetted (I assume that's what the check is for)? Like, if you're standing in a room with something else targetted? It's been a while since I've done it, but I thought chests were special objects that you had to have targetted in order to sense the trap on. And, if you don't get to it before I have a chance to work on it, adding in a variable timer for the last time that you succesfully disarmed a trap would keep down on how much your character turns. (Ie, once you sense a trap, until you're out of range of that trap or have sensed another trap, you can continue to disarm it without resensing it). Radius code is probably good here. About to be late for work if I keep looking at this though, so I better go.

Jerle69
a hill giant
a hill giant
Posts: 263
Joined: Wed Apr 28, 2004 3:26 pm

Post by Jerle69 » Wed Aug 18, 2004 7:42 pm

Knight:

Interesting tidbit regarding facing your trap (or not needing to) but the time it takes for the code to actually execute that fragment of code is probably 1/10th of a second (if that) on a P4 processor, and the time gained by moving that piece of logic higher than lower is maybe 2/10ths of a second. I'm not sure anyone would notice (and I wasn't sure if you had to face traps or not, so it certainly seemed better to disarm, then spin rather than sense, spinback immediately, then disarm.

Thanks for the event typo from FTrap to BTrap... cut-n-paste strikes again. And actually that lastevent flag is used in one place, autofollow. The autofollow routine is the only interruptable sub-event loop that could return control back to the main loop. Since you can't write multithreaded macros, I sort-of hacked out my own thread controller using a global variable that contains the name of the last event that fired. This way any thread can interrogate the flag (if it wants) to find out if a blockable event is running--neat eh? I did this so autofollow could be interrupted by tell commands, but the only way to acheive it was to make other events fire and block existing events... Tricky stuff.

And I have to admit, regarding your questions and ponderings about box-traps, I have NO CLUE. I wrote that code and tested the floor traps and haven't done an LDoN adventure since then. I'm guessing the code will work ok since it's syntactically and logically sound (and it's very similar to what Vexix has in GenBot, I might add) but I haven't done any blackbox testing on that portion of code, or any integration tests like I have with everything else that's here. I was too lazy to fire up 4 characters and do an LDoN adventure just to test it and it seemed to pass "inspection" testing (aka gray-matter CPU compiled it fine)... HEHE!
--Jerle

Knight
orc pawn
orc pawn
Posts: 27
Joined: Thu Jun 17, 2004 1:45 am

Post by Knight » Wed Aug 18, 2004 9:22 pm

What I meant by "Since you're not using those events to check anything right now" was that BTrap and FTrap don't have separate rules for blocking. In essence, they are the same thing as far as the script is concerned.

As for the facing, I mentioned that it would only be a little bit quicker of a turn back, but mostly that was to note that you didn't have to be facing a trap, so you only needed to sense whenever you moved to a new place. Sense a trap, disarm, disarm, disarm, disarm, move out of range...start the sensing code again. I agree that in the situation, it's not much of a difference to warrant chancing pushing broken code vs a 2/10ths of a second gain and you chose well, just a note that it will work the other way.

I've not played with the new macro at all, but I did run an LDoN last night and got lucky with a rogue chest coming up. If you do not have a chest targetted you will not sense the trap within it, no matter how close you are. So unless you just want to keep it in to be lazy in disarming chests that you've targetted there's no real need for BTrap. And if you do keep it in, there's no reason to do a reface since you'll need to be actively trying to disarm that trap (ie, have it targetted) to sense it. Don't you just love backseat coders? ;-)

Jerle69
a hill giant
a hill giant
Posts: 263
Joined: Wed Apr 28, 2004 3:26 pm

Post by Jerle69 » Thu Aug 19, 2004 6:04 pm

Everyone:

Now that the AltAbility TLOs are repaired, I'll work on the other features I deferred, but no promises on when I get to them. My life is VERY full right now as my wife's company is starting soon (and I've been enlisted to help in many, many ways) and my job is also pressing, recently.

Knight:

BTrap still has a purpose, the Events themsevles for both floor and box traps execute trap disarming in response to "sensed" traps; these events fire regardless of the trap sense source (be it automatic or through RH's sensing). Either way, disarming the trap is separate from the sensing of them. At worst, the direction spin at the end of BTrap is unnecessary since it'll never fire from an automatic trap sense, only when a manual sense happens (and the box is targetted). I'll get rid of that part of the BTrap event.
--Jerle

Knight
orc pawn
orc pawn
Posts: 27
Joined: Thu Jun 17, 2004 1:45 am

Post by Knight » Sun Aug 22, 2004 6:42 pm

To sense a trap you have to be in a radius of 75. To disarm a trap you have to be in a radius of 150. The following code will make it so that if you are nearest to the last trap that you sensed you will disarm it instead of sensing it again.

Add a variable at the end of the declares:

Code: Select all

/declare lastTrap int outer 1
Change the autosense code to:

Code: Select all

     |- Are we supposed to look for traps?
     /if (${doTraps}) {
       /varset oldheading ${Me.Heading.DegreesCCW}
       /if (${Me.AbilityReady["Sense Traps"]}) {
         /if (${lastTrap}==${Spawn[trap radius 150].ID}) {
		   /if (${Me.AbilityReady[Disarm Traps]}) { 
             /echo Still near the same trap...
  		     /echo ** Disarming...
             /doability "Disarm Traps"
  		   } 
         } else {
           /doability "Sense Traps"
           /echo Looking for traps... 
         }
       }
     }
And change FTrap to:

Code: Select all

Sub Event_FTrap
  /varset lastevent Event_FTrap
  /varset lastTrap ${Spawn[trap radius 150].ID}
  /echo ** Floor Trap discovered...
  /if (${Me.AbilityReady[Disarm Traps]}) { 
    /echo ** Disarming...
    /doability "Disarm Traps" 
  } else {
    /echo ** Can't disarm yet...
  } 
  |- Face our "old" heading, in case we were spun around
  /face nolook fast heading ${oldheading}
/return 
Then under Sub Event_Zoned add:

Code: Select all

/varset lastTrap 1
Now, this will mean that if you have just sensed a floor trap and are still within a radius of 150 when you try to sense a Box Trap, you will not try to sense the box trap, so hit the button manually~ Any other situation should work just as before.

There's probably a better way to do it as far as the starting value of lastTrap is concerned and what to set it to when you zone so that you don't end up skipping over sensing a trap that's ID is 1...but this was just a quick toss together.

You could probably put the varset of oldheading in the else part of the sense traps area too, but it's not hurting anything to leave it.

Jerle69
a hill giant
a hill giant
Posts: 263
Joined: Wed Apr 28, 2004 3:26 pm

Post by Jerle69 » Mon Aug 23, 2004 8:38 am

Knight:

Yeah that'll make it better. What about floor traps that reset every 30 seconds or so (which they do). I'll have to rewrite the crap out of the trap code in order to keep everything straight. There's no easy way to keep up with resetting floor traps, one-shot box traps, and the distances between them all.

I'll think about your code and try testing traps more for next release.

Thanks,
--Jerle

planetsphinx
decaying skeleton
decaying skeleton
Posts: 7
Joined: Sun Aug 22, 2004 12:11 am

Post by planetsphinx » Mon Aug 23, 2004 5:15 pm

Greetings, short time user of MQ2, and I absolutly LOVE this rogue macro!

One short question.. One thing missing from this macro, is the Disarm ability that a rogue can use. I checked the ranger macro, and they had this line in there for disarming..

Code: Select all

/if (${Me.AbilityReady["Disarm"]}) /doability "Disarm"
Which if I added to, let's say the pickpocket sub (or made it's own sub), it would disarm when the button is up, during attack mode.

What I havn't seen, is if there is a way to detect if a mob HAS something in it's hand, and THEN try to disarm.. (for example, any way to tell if he is hitting for piercing/slashing/bashing damage, instead of.. um.. punching? damage.. or maybe there is an easier way..

Either way, I'll be adding the above code somewhere to my script, and will post the changes I make when I verify they work, so others can do the same.. If there is a way to detect when to do it, instead of just spamming it, I would be much happier. :)

Thanks!!

Mimatas
a hill giant
a hill giant
Posts: 262
Joined: Wed Mar 10, 2004 4:22 pm

Post by Mimatas » Mon Aug 23, 2004 6:24 pm

What I havn't seen, is if there is a way to detect if a mob HAS something in it's hand, and THEN try to disarm.. (for example, any way to tell if he is hitting for piercing/slashing/bashing damage, instead of.. um.. punching? damage.. or maybe there is an easier way..
To be honest, I have disarm bound to kick.. so I do both every time (whether the mob is equipped or not). If nothing else, I do it for skillups. You probably don't need to check.

This being said, the information about what a mob has in their hand IS sent to the client (with the exception of GoD). If you /who npc you'll see numbers after their direction... that's primary and secondary ID... which is the item ID for the mob's primary and secondary hand. Unfortunately, I'm not sure how to reference that info directly.. and I'm at work right now so I can't find out. Hopefully knowing that the information IS there will motivate you to check out the readme (look up the Spawn datatype) and see if maybe it's there. I honestly haven't looked. After that, all you need to do is find a mob with nothing in their hand and find out what that item ID is. Compare mob's hand ID v. empty hand ID.. viola! :)

Good luck.

planetsphinx
decaying skeleton
decaying skeleton
Posts: 7
Joined: Sun Aug 22, 2004 12:11 am

Post by planetsphinx » Mon Aug 23, 2004 11:03 pm

Ok.. I've got the Disarm subroutine in.. and a toggle on/off if you want.. (/autodisarm) and for now, it disarms during combat, if on.

Now.. trying to figure out the variables for holding.. /whotar shows the 2 variables "Pri: and Off:" if any NPC or PC is holding something.. but I can't use /whotar.. I gotta use something else.. so I looked up $Target in the readme... got /echo ${Target.Holding} to output some numbers.. on PC's only.. :x

I target myself (or any other PC) and I get this output..

weapons in Prim and Off: 3
Weapons in Prim only: 4
Weapon in Off only: 5
No Weapon at all (and nothing in range): 0
No weapon, something in range: 5

Ok.. looks good.

Target mob output

skelly with club in hand): 0
skelly with shield in off: 0
orc with torch: 0

something not right.. =(

Can anyone nudge me in the right direction here? Still playing with it too..

Jerle69
a hill giant
a hill giant
Posts: 263
Joined: Wed Apr 28, 2004 3:26 pm

Post by Jerle69 » Mon Aug 23, 2004 11:50 pm

You know, I thought about adding in autodisarm for weapons and such to do some skillups (frankly I don't find much use in it other than to have the disarm weapon number get higher). I'll admit my rogue's disarm is maxed out from tinkering with it when he was "growing up," but having said that, is there REALLY a purpose for this stupid skill? It doesn't work on magic weapons (or it didn't a long time ago) and I'm not sure, but I'd swear most mobs Kunark+ in era do more damage WITHOUT a weapon than with one. This ability is positively USELESS in my opinion, and I just didn't feel like cluttering up RH with an absolutely useless skill.

Please, correct me if I'm wrong--I very well could be! In 5 years of playing, I've still yet to find any sort of practical use for the skill though.
--Jerle

peaches
orc pawn
orc pawn
Posts: 10
Joined: Tue Oct 07, 2003 10:24 pm

Post by peaches » Tue Aug 24, 2004 1:25 am

It's great for duels, it works well on pc's. Most people don't even notice you disarmed them till you tell them.

Knight
orc pawn
orc pawn
Posts: 27
Joined: Thu Jun 17, 2004 1:45 am

Post by Knight » Tue Aug 24, 2004 6:24 am

What about floor traps that reset every 30 seconds or so (which they do).
Which ones are you talking about? For the code to not work it would have to despawn, then respawn with the same ID. When you disarm most traps, it's still there it's just inactive. I'd need an example of a disarmable trap that does this to test it. It would depend on how the EQ server determines if you've sensed a trap or not. If it does it by ID then it wouldn't matter, because the last trap you'd sensed would have been that ID. But like I said, those conditions above would have to be met to test it, so I need an example.

taylojl
decaying skeleton
decaying skeleton
Posts: 6
Joined: Thu Apr 29, 2004 8:50 pm

Post by taylojl » Wed Aug 25, 2004 3:16 pm

Not sure why but when i set up Assist, the macro will auto attack when the MT does, but sfor some reason it stops autosticking to mobs. If i reset the macro not to autoassist and just attack on my own it will autostick on mobs. Anyone have any advice on how to get it to autostick on mobs and autoassist?