Drag.mac

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

Moderator: MacroQuest Developers

Diggler
> Oid
Posts: 120
Joined: Thu Oct 09, 2003 3:28 pm
Location: Lexington, KY

Drag.mac

Post by Diggler » Sat May 01, 2004 1:07 am

Code: Select all

|Drag.mac
|By Diggler
|----------
|Very short, very simple, very efficient macro to drag unlimited corpses.
|Usage: /macro drag *person* *person* *person* ..... etc

Sub Main
/declare ParamCount int
/declare ParamString
/declare MaxParam int -1

/if (!${Defined[Param0]}) {
   /echo Usage: /macro drag *person* *person* *person* .... etc
   /end
   }

:loop
/if (${Defined[Param${ParamCount}]}) {
   /varcalc MaxParam ${MaxParam}+1
   /varcalc ParamCount ${ParamCount}+1
   /goto :loop
   }

:loop2
/for ParamCount 0 to ${MaxParam}
   /tar ${Param${ParamCount}}'s
   /cor
   /delay 1
/next ParamCount
/goto :loop2

Virtuoso65
a hill giant
a hill giant
Posts: 150
Joined: Wed Oct 15, 2003 2:29 pm

Post by Virtuoso65 » Sat May 01, 2004 1:59 am

Looks good, the way you did the unlimited drag is inventive. The only reason I capped mine at 10 was because of lag issues with the /corpse command.

Diggler
> Oid
Posts: 120
Joined: Thu Oct 09, 2003 3:28 pm
Location: Lexington, KY

Post by Diggler » Sat May 01, 2004 3:26 am

Lol you should see it with no delay ;) Drags SICK fast, if you /end the macro, the corpses still follow you for like 15-20 seconds at least depending on how long you ran it lol. I find delay 1 nice tho heh, unless full raid or something i suppose

dok
a ghoul
a ghoul
Posts: 127
Joined: Mon Mar 15, 2004 3:38 pm

Post by dok » Sun May 02, 2004 3:24 am

what if we were to do something like store the consent messages from people in an array and cycle through that for corpses to drag? would just have to have it running before people consented you and you'd be set.

Not sure what would happen with multiple corpses, but it might be a better thing to do on even 50 person raids.

dok
a ghoul
a ghoul
Posts: 127
Joined: Mon Mar 15, 2004 3:38 pm

Post by dok » Sun May 02, 2004 3:51 am

Here's a few pre-test functions to do something like that. Haven't tested, debugged, or anything else to it. Just soft of a layout for a possible solution:

Code: Select all


/declare CorpseArray[100] int outer 0

#event Consent "has give you consent"  
|or whatever the consent message is....

Sub Event_Consent(string EvtText)
    /declare counter int local 1
    /if (${EvtText.Find[${Me.Zone}]}) { |only add corpses in the same zone as you.  guess it wouldn't matter as you woulnd't get a valid id from it anyway
        :CorpseLoop
            /if (${CorpseArray[${counter}]}==0) {
                /varset CorpseArray[${counter}] ${Spawn[${EvtText.Mid[1,1]} corpse].ID}
                |Use Mid, Left, Right, Whatever to find the name of the person that consented you depending what you're comfortable with and the consent message text
                /return
            }
            /varcalc counter ${counter}+1
            /goto :CorpseLoop
    }
/return
Then you could replace your :loop2 with something like...

Code: Select all

:loop2 
/for ParamCount 1 to 100
    /if (${Spawn[${CorpseArray[${ParamCount}]}]}) {
        /if (${Spawn[${CorpseArray[${ParamCount}]}].Distance}>100) {  |Max drag distance == ???
            /tar id ${CorpseArray[${ParamCount}]}
            /cor 
            /delay 1 
        }
        /next ParamCount
        |move to next ParamCount if Corpse Found
    }
    /varset CorpseArray[${ParamCount}] 0
    | sets array value to 0 if corpse not found
/next ParamCount 
/goto :loop2

Anyway, just some partial code I threw together after thinking about it a little It wont run as it is cause I know I make a lot of silly typos and such, but will give yo a direction to go if you go that way. No clue how an array size of 100 will react time wise, etc.

dirx
orc pawn
orc pawn
Posts: 21
Joined: Fri Dec 05, 2003 1:00 am
Location: orlando

Post by dirx » Sun May 02, 2004 9:40 pm

This macro works very well has anyone modified it so that it will also drag a targeted single corpse.

Thanks,

Dirx

dirx
orc pawn
orc pawn
Posts: 21
Joined: Fri Dec 05, 2003 1:00 am
Location: orlando

Post by dirx » Sun May 02, 2004 10:26 pm

I got it to do both by adding a third loop dunno if thats the best way but all variations of dragging work for me now.

Code: Select all


Sub Main 
/declare ParamCount int 
/declare ParamString 
/declare MaxParam int -1 

[color=red]/if (!${Defined[Param0]}) { 
   /if (${Target.State.Equal[DEAD]}) { 
   /echo Dragging ${Target.CleanName}. 
   /goto :loop3
   }    
   /echo Who's corpse did you want to drag? 
   /end 
   }[/color] 

:loop 
/if (${Defined[Param${ParamCount}]}) { 
   /varcalc MaxParam ${MaxParam}+1 
   /varcalc ParamCount ${ParamCount}+1 
   /goto :loop 
   } 

:loop2 
/for ParamCount 0 to ${MaxParam} 
   /tar ${Param${ParamCount}}'s 
   /cor 
   /delay 1 
/next ParamCount 
/goto :loop2

[color=red]:loop3 
   /cor 
   /delay 1 
/if (${Target.ID}) /goto :loop3
/end[/color]

Thanks,

Dirx