Wait4rez.mac: consent, accept rez then loot (Update 4/17/05)

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

Moderator: MacroQuest Developers

fantum409
a ghoul
a ghoul
Posts: 141
Joined: Fri Nov 14, 2003 10:03 pm

Wait4rez.mac: consent, accept rez then loot (Update 4/17/05)

Post by fantum409 » Sat Jun 12, 2004 2:18 am

This will consent your guild, raid, and group then autoaccept rez. Once rezzed in, it loots all the items on your corpse. Specify number of items to leave on corpse:
/mac wait4rez 0
will fully loot the corpse.

Warning: TL boxes look just like rez boxes so it will accept any kind of rezz or TL. Need to find a way to make it read the text...

Code: Select all

|** Wait4rez.mac by FaNTuM
This will automatically accept rez, then loot your corpse for you, leaving
   the specified number of items on it. Usage: </mac wait4rez 0> where 0
   is the number of items to leave on corpse, 0 loots all items.
03/30/2005 **|


| -------------- 
| -- Main Sub -- 
| -------------- 
Sub Main
   /declare t int outer 0 
   /declare loottotal int outer
   /declare lootslot int outer
   /declare lootleft int outer 1

   /if (!${Defined[Param0]}) { 
      /echo Defaulting to leaving ${lootleft} item/s on corpse
   } else {
      /varset lootleft ${Param0}
   }
   /echo Wait4rez.mac activated. Now consenting guild, raid, and group.
| -------------- 
| -- Consents -- 
| -------------- 
   /consent guild
   /delay 30
   /consent raid
   /delay 30
   /consent group
   /echo Awaiting rez: will auto-accept, then loot leaving ${lootleft} item/s on corpse
| --------------------- 
| -- Auto-accept Rez -- 
| --------------------- 
   :waitforrez
   /if (!${Window[ConfirmationDialogBox].Open}) {
      /delay 1s ${Window[ConfirmationDialogBox].Open}
      /goto :waitforrez
   }
   /if (${Window[ConfirmationDialogBox].Open}) /notify ConfirmationDialogBox Yes_Button leftmouseup
| ---------------------------------------------- 
| -- Wait until fully zoned in before looting -- 
| ---------------------------------------------- 
   :zonein
   /delay 5
   /target mycorpse
   /delay 5 ${Target.CleanName.Equal[${Me}'s corpse]}
   /if (${Target.CleanName.NotEqual[${Me}'s corpse]}) /goto :zonein
   /if (${Target.CleanName.Equal[${Me}'s corpse]}) {
      /delay 3s
      /call Loot
   } else /goto :zonein
/end

| ----------------------- 
| -- Pull corpse close -- 
| ----------------------- 
Sub Loot 
   :corpsepull
   /target mycorpse 
   /delay 5 ${Target.CleanName.Equal[${Me}'s corpse]}
   /if (${Target.CleanName.NotEqual[${Me}'s corpse]}) { 
      /echo No corpse in this zone
      /return 
   } 
   /delay 3s
   /corpse
   /delay 1s ${Target.Distance}<20
   /if (${Target.Distance}>20) {
      /echo Corpse is too far away
      /return
   }
| ---------------------
| -- Open the corpse -- 
| ---------------------
   /if (${Target.CleanName.Equal[${Me}'s corpse]}) {
      /loot 
   } else {
      /echo where did my corpse go?
      /return
   }
   /delay 5s ${Me.State.Equal[BIND]}
   /if (${Me.State.NotEqual[BIND]}) /goto :corpsepull
   /varset loottotal 0 
| ----------------- 
| -- Count items -- 
| ----------------- 
   /delay 3s
   :LootLag 
   /if (${loottotal}!=${Corpse.Items}) { 
      /varset loottotal ${Corpse.Items} 
      /delay 2s 
      /goto :LootLag 
   } 
   /if (${loottotal}<=${lootleft}) { 
      /echo Looting aborted.  Error in number of items to be left on corpse. 
      /notify LootWnd DoneButton leftmouseup 
      /return 
   } 
   /varset loottotal ${Math.Calc[${Corpse.Items}-${lootleft}]} 
| --------------------- 
| -- Loot the corpse -- 
| --------------------- 
   /echo Looting all but ${lootleft} item(s) 
   /for lootslot 1 to ${loottotal} 
   :LootItem 
   /itemnotify loot${lootslot} rightmouseup 
   /delay 5 !${Corpse.Item[${lootslot}].ID}
   /if (!${Corpse.Item[${lootslot}].ID}) { 
      /next lootslot 
   } else /goto :LootItem 
| ----------------- 
| -- Doublecheck -- 
| ----------------- 
   /if (${Math.Calc[${Corpse.Items}-${lootleft}]}>0) /goto :LootLag
   /notify LootWnd DoneButton leftmouseup 
   /echo Done looting.  ${lootleft} Item(s) left on your corpse. 
/return
Edit: added a little more delay between consents to improve reliability, and added comments and such per PhoenixZorn's request.
Edit: Added delay when corpse is first opened, to improve reliability.
=)
Last edited by fantum409 on Sun Apr 17, 2005 1:23 pm, edited 6 times in total.

Foggrey
orc pawn
orc pawn
Posts: 15
Joined: Fri Jun 11, 2004 7:03 am

Post by Foggrey » Sat Jun 12, 2004 3:09 am

or necro sac box =)
have fun

fantum409
a ghoul
a ghoul
Posts: 141
Joined: Fri Nov 14, 2003 10:03 pm

Post by fantum409 » Sat Jun 12, 2004 3:16 am

Now that shit would be funny. I tried to get this to read the text in the ConfirmationDialogBox but it won't seem to do it.

/e ${Window[ConfirmationDialogBox].Text[OutputText]}

returns nothing, for example. If I could find a way to interact with the text at all, this could be made safer.

rzmonk76
a hill giant
a hill giant
Posts: 165
Joined: Sat Jan 31, 2004 1:37 pm
Contact:

request

Post by rzmonk76 » Mon Jun 14, 2004 9:10 am

have it consent bards mebe too, and monks.

how would i do that? just keep adding this module for how many other classes i need? changing the red?

Code: Select all

/for a 1 to ${Raid.Members} 
      /if (${Raid.Member[${a}].Class.Name.Equal[[color=red]Rogue[/color]]}) { 
         /consent ${Raid.Member[${a}].Name} 
         /varset Names ${Names}${Raid.Member[${a}].Name}, 
         /varcalc t ${t}+1 
         /delay 2s 
      } 
   /next a 
      /varset Names ${Names}(${t} total) 
      /echo ${Names} 

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Re: request

Post by Chill » Mon Jun 14, 2004 4:15 pm

rzmonk76 wrote:have it consent bards mebe too, and monks.

how would i do that?

Code: Select all

/if (${Raid.Member[${a}].Class.Name.Equal[[color=red]Rogue[/color]]} || ${Raid.Member[${a}].Class.Name.Equal[[color=red]Monk[/color]]} || ${Raid.Member[${a}].Class.Name.Equal[[color=red]Bard[/color]]}) {
is the easy 1 line method. I updated my consent macro a while back however to:

Code: Select all

Sub Main 

   /declare a int local 1 
   /declare r int local 0 
   /declare m int local 0 
   /declare c int local 0 
   /declare rogues string local 
   /declare monks string local 
   /declare clerics string local 
   /varset rogues "" 
   /varset monks "" 
   /varset clerics "" 

   /for a 1 to ${Raid.Members} 

      /if (${Raid.Member[${a}].Class.Name.Equal[Rogue]}) { 
         /consent ${Raid.Member[${a}].Name} 
         /varset rogues ${rogues}${Raid.Member[${a}].Name}, 
         /varcalc r ${r}+1 
         /delay 2s 
      } else /if (${Raid.Member[${a}].Class.Name.Equal[Monk]}) { 
         /consent ${Raid.Member[${a}].Name} 
         /varset monks ${monks}${Raid.Member[${a}].Name}, 
         /varcalc m ${m}+1 
         /delay 2s 
      } else /if (${Raid.Member[${a}].Class.Name.Equal[Cleric]}) { 
         /consent ${Raid.Member[${a}].Name} 
         /varset clerics ${clerics}${Raid.Member[${a}].Name}, 
         /varcalc c ${c}+1 
         /delay 2s 
      } 
   /next a 
      /echo Consented ${r} Rogues: ${rogues} 
      /echo Consented ${m} Monks: ${monks} 
      /echo Consented ${c} Clerics: ${clerics} 

/return
it gives 1 line of report per class. If you like that better could could use it and change Cleric to Bard or whatever.

Flea
a lesser mummy
a lesser mummy
Posts: 55
Joined: Fri Dec 26, 2003 4:56 am

Post by Flea » Tue Jun 15, 2004 1:50 am

What is the syntax to define how many items to leave on corpse? Didnt see it listed anywhere in macro or post.

My guess is "/macro wait4rez.mac #" but could you clear that up?

Goofmester1
a hill giant
a hill giant
Posts: 241
Joined: Thu Nov 06, 2003 4:26 am

Post by Goofmester1 » Tue Jun 15, 2004 2:01 am

/varset lootleft ${Param0}

so yes the syntax would be /macro wait4rez.mac #

fantum409
a ghoul
a ghoul
Posts: 141
Joined: Fri Nov 14, 2003 10:03 pm

Post by fantum409 » Tue Jun 15, 2004 11:44 pm

Actually, the ${Param0} item is local to the sub. Only Sub Main gets it from the command that executed the macro, other subs have it passed to them from the /call

In the Main sub the line that said

Code: Select all

/call Loot 0
passed the "0" to the Loot sub. The Loot sub then sees ${Param0} as zero, even if you executed the mac with /mac wait4rez 1

But anyway, I will edit it so you can run the macro with /mac wait4rez <items to leave>
That just makes more sense. :smile:

Seariz
a lesser mummy
a lesser mummy
Posts: 52
Joined: Thu Feb 06, 2003 1:22 pm
Location: The Computer
Contact:

Post by Seariz » Fri Jun 25, 2004 9:22 pm

Hello, I was just wondering if some how you could input a raid version of this macro to maybe look for the closest shaman/cleric/pally/ranger/druid/chanter and ask for the buffs...such as VoQ/VQ, Focus, Kzaad, Brells, SoP, BoT9 and SoE...im just hella lazy and like to go afk when I die. Would be nice to come back fully looted and buffed heh, just an idea =) thanks!
Every work group has one sadistic nut who makes the job unbearable for everyone else. That's why they hired me!

fantum409
a ghoul
a ghoul
Posts: 141
Joined: Fri Nov 14, 2003 10:03 pm

Post by fantum409 » Fri Jun 25, 2004 10:30 pm

yeah, scroll down a bit there is a macro called buffbeg.mac

would be easy to combine/edit for what you need. Maybe sometime soon will take the time to paste it together. Buffbeg is needing some editing so that it thinks about what class you are and asks for appropriate buffs. the one on this board is set up for a wiz/caster.

Seariz
a lesser mummy
a lesser mummy
Posts: 52
Joined: Thu Feb 06, 2003 1:22 pm
Location: The Computer
Contact:

Post by Seariz » Sat Jun 26, 2004 2:13 am

Gotcha, yea would be super cool if you would do that, im 100% newbie and doubt i could even figure it out but imma try =) Thanks again!
Every work group has one sadistic nut who makes the job unbearable for everyone else. That's why they hired me!

Flea
a lesser mummy
a lesser mummy
Posts: 55
Joined: Fri Dec 26, 2003 4:56 am

Post by Flea » Sun Jun 27, 2004 11:13 pm

Broken atm?

Not accepting rez, which leads to not summoning corpse after rezzed, which leads to not looting corpse after corpse is summoned to player.

Not reporting any errors.

fantum409
a ghoul
a ghoul
Posts: 141
Joined: Fri Nov 14, 2003 10:03 pm

Post by fantum409 » Sun Jun 27, 2004 11:54 pm

Flea this is UI dependent... do you have a custom ui? any more info is appreciated, ty in advance

Flea
a lesser mummy
a lesser mummy
Posts: 55
Joined: Fri Dec 26, 2003 4:56 am

Post by Flea » Mon Jun 28, 2004 12:48 am

I have been using it since it was posted. Same custom UI. It has worked fine until I downloaded latest zip. I use Solaria UI with MQ2 labels.

Flea
a lesser mummy
a lesser mummy
Posts: 55
Joined: Fri Dec 26, 2003 4:56 am

Post by Flea » Mon Jun 28, 2004 1:07 am

Nevermind, I figured out what is up, for some reason my "ConfirmationDialogBox" window, dissapeared, out of no where. Who knows.