Page 1 of 1

Drag.mac

Posted: Sat May 01, 2004 1:07 am
by Diggler

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

Posted: Sat May 01, 2004 1:59 am
by Virtuoso65
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.

Posted: Sat May 01, 2004 3:26 am
by Diggler
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

Posted: Sun May 02, 2004 3:24 am
by dok
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.

Posted: Sun May 02, 2004 3:51 am
by dok
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.

Posted: Sun May 02, 2004 9:40 pm
by dirx
This macro works very well has anyone modified it so that it will also drag a targeted single corpse.

Thanks,

Dirx

Posted: Sun May 02, 2004 10:26 pm
by dirx
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