monk macro conversion

For questions regarding conversion of scripts from the old, parm style to the new MQ2Data format. Conversion questions only!

Moderator: MacroQuest Developers

hardarac
a lesser mummy
a lesser mummy
Posts: 37
Joined: Sat Nov 30, 2002 2:25 pm

monk macro conversion

Post by hardarac » Sat May 22, 2004 5:39 pm

I am crap at code writing but would like to know if anyone would be willing to convert the following macro for me please. I originaly got this from this site written bt grimjack i think.



| - Attack.mac -
|
#turbo
#event enraged "has become ENRAGED"
#event offrage "is no longer enraged"
#event stun "You are stunned"
#event unstun "You are unstunned"

sub Main

/declare MyXLOC global
/declare MyYLOC global
/declare ObstacleCount global
/declare targetarray array
/declare enragevar global
/declare stunvar global
/declare atk global

/varset targetarray(0) "$target(name,clean)"
/varset targetarray(1) $target(level)
/varset targetarray(2) $target(name)
/varset targetarray(3) $target(id)
/varset enragevar 0
/varset stunvar 0
/varset atk 1

/echo Fighting a level @targetarray(1) @targetarray(0)
/stand
/face
/call MovetoMob

:CloserAF
/if "$target(id)"!=@targetarray(3) /goto :EndAF
/if @atk==1 {
/if $char(state)==FEIGN /end
/if n $target(distance)>10 /press up
/if n $target(distance)<10 /press down
/if n $target(distance)<15 /attack on
/if n $target(distance)>15 /attack off
/if n $target(distance)>15 /call MovetoMob
/face fast
/if n $target(distance)<11 /if n $char(ability,"Flying Kick")>0 /doability "Flying Kick"
| /if n $char(buff,"Celestial Tranquility")==0 {
| /delay 1s
| /press 2
| }
}
/if n $char(ability,"Mend")>0 {
/if n $char(hp,pct)<70 /doability "Mend"
}
/if n $char(hp,pct)<20 {
/attack off
/doability "Feign Death"
/look
/echo "<< $char(hp,pct)% LOW HP - FD >>
/end
}
/doevents
/goto :CloserAF

:EndAF
/echo The level @targetarray(1) @targetarray(0) is dead...
/sendkey up up
/sendkey up down
/attack off
/varset targetarray(3) 0
/delay 1s
/doability "Feign Death"
/look
/return

sub MoveToMob

/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstacleCount 0

/if n $target(distance)<=15 {
/face
/return
}
/sendkey down up

:Movementloop
/varadd ObstacleCount 1
/if $target()=="FALSE" /return
/if $char(state)==FEIGN /end
/face
/if n $target(distance)<=10 {
/face
/sendkey up up
/return
}
/if @ObstacleCount>=3 {
/call CheckObstacle
/goto :Movementloop
}
/if n $target(distance)>10 /goto :MovementLoop
/return

sub CheckObstacle
/if n @MyXLOC==$char(x) /if n @MyYLOC==$char(y) /call HitObstacle
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstacleCount 0
/return

sub HitObstacle
/sendkey up up
/sendkey down down
/delay 3
/sendkey up down
/sendkey down ctrl
/if n $rand(99)>50 {
/sendkey down right
} else {
/sendkey down left
}
/delay 5
/sendkey up right
/sendkey up left
/sendkey up ctrl
/sendkey down up
/return

Sub Event_enraged
/if $target()=="TRUE" {
/varset enragevar 1
/varset atk 0
/echo "Mob is Enraged - Halting Attack"
/attack off
}
/return

Sub Event_offrage
/if $target()=="TRUE" {
/varset enragevar 0
/varset atk 1
/echo "Mob is no longer Enraged - Rengaging"
/stand
/attack
}
/return

Sub Event_stun
/if $target()=="TRUE" {
/varset stunvar 1
/varset atk 0
/echo "You are stunned - Halting Attack"
/attack off
}
/return

Sub Event_unstun
/if $target()=="TRUE" {
/varset stunvar 0
/varset atk 1
/echo "You are no longer stunned - Rengaging"
/attack
}
/return

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Sat May 22, 2004 7:57 pm

At least try converting it on your own some. I don't mind helping someone who tries to help themselves. It's not too hard to look up the various commands.

Also, please use the Code button to enclose the macro from now on.