Wait4rez.inc v2.1

A forum for macro code snippets to be used in writing other macros. Post routines or .inc files here only, completed macros go to the Macro Depot. MQ2Data format only!

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

Wait4rez.inc v2.1

Post by A_Druid_00 » Mon Nov 22, 2004 8:25 pm

Usage:
I use this in 2 ways in my AutoBot macro. One is via events, the other checks for the presence of a BP and Platinum on your character. Here's an example of both:

Code: Select all

/if (!${InvSlot[chest].Item.ID} && !${Me.Platinum}) /call Wait4Rez

Code: Select all

#Event Dead             "#*#Returning to Bind Location#*#"

Sub Event_Dead
/call Wait4Rez
/doevents flush
/return
12/18
v2.1- Shortened it up to under 40 lines using my patented A_Druid_00 optimization technique. If anyone can make it smaller and still reliably loot a corpse regardless of lag, etc; feel free to post it.
v2.0- OK, I massively rewrote this using my acquired knowldge over the past year or so of working with MQ. It uses local variables to prevent conflict with other incs that might use the same names for variable (Hi advloot). It now only uses 1 subroutine, since the other 2 subroutines were only called once in the macro anyway. It also uses the /nomodkey option for loot window notification, so that if you accidentally hit the Alt key you don't get spammed with 5000 item inspection popup windows. It uses a lot less in the way of /goto :stuff loops, to speed up the whole process and spend less time parsing for :stuff. Oh, it always loots to the last item now, since your corpse no longer poofs if it hasn't been rezzed.

Code: Select all

|Wait4rez.inc v2.1
Sub Wait4Rez
/echo Awaiting rez: auto-accepting, and looting my corpse
/consent group
/delay 25
/consent raid
/delay 25
/consent guild
:rezmeffs
/delay 600m ${Window[ConfirmationDialogBox].Open}
/if (!${Window[ConfirmationDialogBox].Open}) /goto :rezmeffs
/nomodkey /notify ConfirmationDialogBox Yes_Button leftmouseup
:zoneffs
/delay 5m ${Spawn[${Me}'s corpse].ID}
/if (${Spawn[${Me}'s corpse].ID}) /target mycorpse
/delay 5s ${Target.ID}==${Spawn[${Me}'s corpse].ID}
/if (${Target.CleanName.NotEqual[${Me}'s corpse]}) /goto :zoneffs
:corpsepull
/if (${Target.Distance}>100 || !${Spawn[${Me}'s corpse].ID}) /return
/if (${Target.Distance}>20) /corpse
/delay 5s ${Target.Distance}<20
/loot
/delay 5s ${Me.State.Equal[BIND]}
/if (${Me.State.NotEqual[BIND]}) /goto :corpsepull
/declare loottotal int local
:LootLag
/varset loottotal ${Corpse.Items}
/delay 1s ${loottotal}!=${Corpse.Items}
/if (${loottotal}!=${Corpse.Items}) /goto :LootLag
/declare i int local
/for i 1 to ${loottotal}
:lootagain
/itemnotify loot${i} rightmouseup
/delay 10s !${Corpse.Item[${i}].ID}
/if (${Corpse.Item[${i}].ID}) /goto :lootagain
/next i
/nomodkey /notify LootWnd DoneButton leftmouseup
/return
Last edited by A_Druid_00 on Thu Dec 29, 2005 7:07 am, edited 8 times in total.
[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]

fallon
a lesser mummy
a lesser mummy
Posts: 59
Joined: Sat Dec 18, 2004 7:37 pm
Location: Kuwait
Contact:

Post by fallon » Fri Jan 21, 2005 6:31 am

There an easy way to kick this off after comming off a death to desktop or the like?

It works great, when it works. However it fails when you get clobbered in the middle of something in the main macro frequently & also obviosly fails when you crash while zoning from your death, then log back on.

A /wait4rez command to manually deliver a swift kick in the ass and get things going again might be nice... although I'm not sure if that's really possible from an include.

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 » Fri Jan 21, 2005 8:28 am

That's when I just load up vanilla wait4rez.mac.
[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
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Fri Jan 21, 2005 11:07 am

Just put /if (!${Me.Copper}) /call Wait4Rez somewhere in your main macro loop.

JGC84
a ghoul
a ghoul
Posts: 116
Joined: Sat Nov 29, 2003 2:51 am

Post by JGC84 » Fri Jan 21, 2005 11:44 am

i'd check to see if i was wearing a piece of armor on my arm ; thats not somthing very many people ever switch out for clicky effects and what not.
ACK! I think I blew it up....

I dont think your allowed to talk about this outside of a "free speech zone" anymore.

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Fri Jan 21, 2005 11:58 am

i'd check to see if i was wearing a piece of armor on my arm ; thats not somthing very many people ever switch out for clicky effects and what not.
...

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Fri Jan 21, 2005 12:10 pm

Cr4zyb4rd wrote:Just put /if (!${Me.Copper}) /call Wait4Rez somewhere in your main macro loop.
I destroy copper on a regular basis, so the arms or a ring might be more likely, at least for me. It really depends on the person. It is easy enough to modify that line for whatever way you want it.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

JGC84
a ghoul
a ghoul
Posts: 116
Joined: Sat Nov 29, 2003 2:51 am

Post by JGC84 » Sun Jan 23, 2005 12:52 pm

1 JGC point for aC1 for understanding me w/o further explantion!

(JGC points have no value, and no one really wants them anyway, but you get one!)
ACK! I think I blew it up....

I dont think your allowed to talk about this outside of a "free speech zone" anymore.

Arune
a hill giant
a hill giant
Posts: 216
Joined: Sat Jul 03, 2004 1:51 pm

Post by Arune » Sun Jan 23, 2005 2:10 pm

What about a zone name to kick this off? I don't use macros across zones very often, so if it picks up the zone name, then it calls the sub.

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Sun Jan 23, 2005 6:50 pm

For understanding you? Gosh it was just so far over my head...

JGC84
a ghoul
a ghoul
Posts: 116
Joined: Sat Nov 29, 2003 2:51 am

Post by JGC84 » Mon Jan 24, 2005 8:46 am

your just jelous you dont have a JGC point cr4zy
ACK! I think I blew it up....

I dont think your allowed to talk about this outside of a "free speech zone" anymore.

Airvz
Custom Builder
Custom Builder
Posts: 128
Joined: Tue Nov 18, 2003 3:36 pm

Post by Airvz » Sun Jun 26, 2005 1:06 am

Arune wrote:What about a zone name to kick this off? I don't use macros across zones very often, so if it picks up the zone name, then it calls the sub.
Would be easy to do. For example if you were bound in PoK.

Code: Select all

#event PoK "You have entered the Plane of Knowledge."
#include wait4rez.inc
Sub Main
:loop
/doevents
/goto :loop
/return

Sub event_PoK
/call wait4rez
/return
Just an example but you get the point, and that would be easy to add to your mac.

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

Post by fearless » Wed Jul 13, 2005 10:40 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]

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

Post by Fixxer » Wed Jul 13, 2005 11:45 am

With the Autoconsent feature, does this really need to have the consent lines in it anymore?

TheNewGuy
a snow griffon
a snow griffon
Posts: 307
Joined: Sat Jul 10, 2004 9:33 am
Contact:

Post by TheNewGuy » Wed Jul 13, 2005 11:49 am

Yes

It surely doesn't hurt, and on my many toons on many computers I could forget to turn on autoconsent on a few of them on one computer or the other. I'd vote just leave it in, it doesn't hurt anything.
[quote="dont_know_at_all"][quote="sybarite"]Um.. search works fine for me (used spell_routines.inc)... Try scrolling down you lazy fuck.

http://www.macroquest2.com/phpBB2/viewtopic.php?t=8964&highlight=spellroutines+inc[/quote]

That's great but he's looking for move.inc, you fucking spastic colon.[/quote]