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

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Mon Dec 13, 2004 10:49 am

Just used my .inc version yesterday with the new zip, no problems. The only difference between this one and my inc is the sub names, so I can't see it behaving differently.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

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

Post by fantum409 » Sun Apr 17, 2005 1:27 pm

Something in EQ or MQ changed a while back and now it need some delay to wait for all of the items to show up before looting. If you were getting "error in number of items to loot" and the macro ended before looting appropriately, you need this update.

=)

jaq
a ghoul
a ghoul
Posts: 148
Joined: Fri Mar 12, 2004 8:29 am

Post by jaq » Fri May 06, 2005 2:40 am

Great Macro fantum409, I really enjoy using it. I wanted to point out a very minor bug I found in the code while I was in the process of moding the macro to one that will just loot my corpse for me (basicly striped out the wait for rez part)

The condition in the /if statement below will always return NULL if the player does not have a target. Its not a huge issue as the macro catches it down further and echos the "where did my corpse go.. " message. But the message "No corpse in this zone" is never seen.

Code: Select all

| -----------------------
| -- Pull corpse close --
| -----------------------
Sub Loot
   :corpsepull
   /target mycorpse
   /delay 5 ${Target.CleanName.Equal[${Me}'s corpse]}
   [color=red]/if (${Target.CleanName.NotEqual[${Me}'s corpse]})[/color] {

      /echo No corpse in this zone
      /return
I fixed this just by adding a || check to see if the player has a target. If they don't then it assumes they don't have a corpse in zone.

Code: Select all

| -----------------------
| -- Pull corpse close --
| -----------------------
Sub Loot
   :corpsepull
   /target mycorpse
   /delay 5 ${Target.CleanName.Equal[${Me}'s corpse]}
  [color=lime] /if (${Target.CleanName.NotEqual[${Me}'s corpse]} || !${Target.ID}) [/color]{
      /echo No corpse in this zone
      /return
I know this is really minor, but thought I would point it out. I doubt anyone would ever see the bug unless they did what I did and used the loot code without the rez accept code.

--jaq

Fixxer
a ghoul
a ghoul
Posts: 146
Joined: Wed Apr 13, 2005 8:15 am

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

Post by Fixxer » Sat May 07, 2005 3:11 pm

fantum409 wrote: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...
So what you are saying is that some sick necro could wait in the guild lobby and cast Sacrifice on you, and this would automatically accept it? Has there been any progress on figuring out how to prevent this (other than waiting in your guild hall instead of the guild lobby for the rez)?

Thanks.

Clueless_Coder
a hill giant
a hill giant
Posts: 192
Joined: Wed Aug 25, 2004 3:18 pm

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

Post by Clueless_Coder » Sun May 08, 2005 12:31 pm

Fixxer wrote:So what you are saying is that some sick necro could wait in the guild lobby and cast Sacrifice on you, and this would automatically accept it? Has there been any progress on figuring out how to prevent this (other than waiting in your guild hall instead of the guild lobby for the rez)?

Thanks.
I'm not a coder by any means, nor do I have a handle on all that can be put into a macro, but was just wondering if building a slight pause into the routine that accepts the rez might help? Give you time to read the confirm box before it accecpts it that way? So if it were a TL or Sac confirmation you can decline it?

DumbStruck
a ghoul
a ghoul
Posts: 125
Joined: Fri Apr 30, 2004 8:46 am

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

Post by DumbStruck » Fri May 13, 2005 3:59 pm

Clueless_Coder wrote:
Fixxer wrote:So what you are saying is that some sick necro could wait in the guild lobby and cast Sacrifice on you, and this would automatically accept it? Has there been any progress on figuring out how to prevent this (other than waiting in your guild hall instead of the guild lobby for the rez)?

Thanks.
I'm not a coder by any means, nor do I have a handle on all that can be put into a macro, but was just wondering if building a slight pause into the routine that accepts the rez might help? Give you time to read the confirm box before it accecpts it that way? So if it were a TL or Sac confirmation you can decline it?
In order to sacrifice some one u must be in same group ..

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Mon May 16, 2005 8:50 am

This mac is only set up to run once and end once the corpse is looted. So technically some evil necro could sac you, but he could only sac you once unless you're a dumbass and decided to restart the macro and let him do it again.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

dedpoet
a hill giant
a hill giant
Posts: 247
Joined: Sat Aug 14, 2004 12:22 pm

Post by dedpoet » Mon May 16, 2005 11:04 am

If you're worried about it, find this line in there:

Code: Select all

/if (${Window[ConfirmationDialogBox].Open}) /notify ConfirmationDialogBox Yes_Button leftmouseup
And change it to something like:

Code: Select all

/if (${Window[ConfirmationDialogBox].Open}) {
   /delay 5s
   /notify ConfirmationDialogBox Yes_Button leftmouseup
}
That would leave the box up for 5 seconds. If this is a big problem fo you though, you may want to consider just accepting the rez manually and then once you're zoned, use lootmycorpse to do the looting.

Terramantian
a ghoul
a ghoul
Posts: 120
Joined: Thu May 13, 2004 6:20 pm

Post by Terramantian » Sat Jul 02, 2005 1:36 pm

People in the help forum are too busy complaining about the pointless string change, so i'll ask here. Is this working for anyone since the patch? The ConfirmationDialogBox window seems to have disappeared, at least for me.

Warauinu
a snow griffon
a snow griffon
Posts: 377
Joined: Fri Apr 15, 2005 9:21 am

Post by Warauinu » Wed Jul 13, 2005 12:45 am

Getting the error message

Code: Select all

Bad {} blocking
and it references these sections

Code: Select all

} else /goto :LootItem

Code: Select all

/call Loot

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Wed Jul 13, 2005 7:09 am

/shrug, my wait4rez.inc still works. If anyone wants to take a look at it and find out what's so different between the two, feel free. Or you can even just make a macro that has

Code: Select all

#include Wait4Rez.inc
Sub Main
/call Wait4Rez
/return
and start it up.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Wed Jul 13, 2005 10:39 am

Change

Code: Select all

} else /goto :zonein
to

Code: Select all

} else {
/goto :zonein
}
Change

Code: Select all

} else /goto :LootItem
to

Code: Select all

} else {
/goto :LootItem
}
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Wed Jul 13, 2005 10:54 am

Apparently it's a good thing I haven't updated my zip since like the 7th!
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

Warauinu
a snow griffon
a snow griffon
Posts: 377
Joined: Fri Apr 15, 2005 9:21 am

Post by Warauinu » Thu Jul 14, 2005 10:38 pm

Thanks Fearless

Harden
a hill giant
a hill giant
Posts: 244
Joined: Thu Aug 25, 2005 8:23 pm

Post by Harden » Tue Mar 14, 2006 9:17 am

I havent had the chance to Die and test this yet, so someone please post if it's not working. Just did a coupld minor updates to it.

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 
03/14/2006 Updated by Harden
	-Added a status /echo, when rez box is recieved.
	-Added Automatic Mod Rod Clicking after looting corpse.(Thanks Gimp) Excludes: BER, BRD, MNK, ROG, WAR**| 

#include spell_routines.inc

| -------------- 
| -- 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}) {
		/echo Auto accepting rez in 5 sec
		/echo Rez window text: ${Window[ConfirmationDialogBox].Child[CD_TextOutput].Text}
		/delay 5s
		/notify ConfirmationDialogBox Yes_Button leftmouseup
		/delay 5s
	} 
| ---------------------------------------------- 
| -- 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]} || !${Target.ID}) {
		/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.

| ------------------------------ 
| -- Uses mod rod if possible -- 
| ------------------------------ 
   /if (${Me.MaxMana} && ${Me.PctMana}<=10 && ${Me.CurrentHPs}>=1500 && !${Select[${Me.Class.ShortName},BRD,MNK,ROG,WAR,BER]} && ${FindItem[Rod of Mystical Transvergance].InvSlot} && !${FindItem[Rod of Mystical Transvergance].Timer}) { 
      /call Cast "Rod of Mystical Transvergance" item 
      /echo Clicking modrod 
   } 
   /if (${Me.Standing} && ${Me.MaxMana} && !${Me.Moving} && !${Me.Casting.ID}) /sit 
/return  
Edit- Forgot to mention spell_routines.inc is required for the ModRod code to work properly. Just Delete the following, if you don't want ModRod clicking:

Code: Select all

| ------------------------------ 
| -- Uses mod rod if possible -- 
| ------------------------------ 
   /if (${Me.MaxMana} && ${Me.PctMana}<=10 && ${Me.CurrentHPs}>=1500 && !${Select[${Me.Class.ShortName},BRD,MNK,ROG,WAR,BER]} && ${FindItem[Rod of Mystical Transvergance].InvSlot} && !${FindItem[Rod of Mystical Transvergance].Timer}) { 
      /call Cast "Rod of Mystical Transvergance" item 
      /echo Clicking modrod 
   } 
   /if (${Me.Standing} && ${Me.MaxMana} && !${Me.Moving} && !${Me.Casting.ID}) /sit 
/return 
Last edited by Harden on Wed Mar 15, 2006 12:19 am, edited 3 times in total.
-Harden
I wanna be a Macro Writer when I grow up!