OK so I wrote my first macro today and am quite proud with it. It is pretty much just for my character but could be modified for others I guess. I am using to pull clops on seafury isl in oot back to my pet and them killing em off. Here is my code:
|**pullclops.mac
**Writen by driftinsupra
**My first script that will pull a seafury to my pet for me and kill it
**|
#define mypet "Varer"
sub Main
:FindLoop
/call ClopsPull
/if $target(name)=="My characters name" /goto :FindLoop
/call ClopsKill
/return
/endmacro
sub ClopsPull
/stand
/target "a seafury cyclops"
:GotoTargLoop
/face nopredict
/call AutoRun 1
/if n $target(distance)>200 /goto :GotoTargLoop
/call AutoRun 0
/delay 10
/if n $target(hp,pct)!=100 {
/call gotopet2
/return }
/cast 1
/delay 18 }
:GotoPet
/target mypet
:GotoTargLoop2
/face nopredict
/call AutoRun 1
/if n $target(distance)>10 /goto :GotoTargLoop2
/call autorun 1
/delay 15
/call autorun 0
/target mypet
/face nopredict
/return
sub GotoPet2
/target mypet
:GotoTargLoop3
/face nopredict
/call AutoRun 1
/if n $target(distance)>10 /goto :GotoTargLoop3
/call autorun 0
/press F1
/sit
/delay 300
/return
sub ClopsKill
/echo $target(distance)
/target "a seafury cyclops"
:chkdistance
/if n $target(distance)<=100 /goto :continue
/delay 10
/goto :chkdistance
:continue
/pet attack
/delay 20
/cast 2
/delay 100
/target mypet
/cast 5
/delay 26
/target "a seafury cyclops"
/sit
/delay 200
/stand
/target mypet
/cast 5
/delay 26
/sit
/target "a seafury cyclops
:CastDoom
/if n $target(hp,pct)<=40 {
/stand
/cast 3
} else {
/goto :CastDoom
}
/delay 50
/sit
/return
Sub AutoRun
/if $p0==$v80 /return
/varset v80 $p0
/if $p0==1 /sendkey down up
/if $p0==0 /sendkey up up
/return
Ok so my questions are:
1.) How can I get it to notice if I have pulled 2 clops or just 1? I can kill 2 at a time but have to change my battle style to do so.
2.) What can I do about running into a tree. This seems to be the only problem and killed me once while I was in the bathroom. Ran into tree and didnt move.
3.) How do I use variables. I had to use wether I was targeted or not as a test to find out if someone was already attacking the mob I targeted. Although it works fine it seems kinda newbyish.
4.) How the hell does the autorun thing work. I copied it over into my code but for the life of me I could quite understand it.
5.) Lastly, how can I post my code in the little boxes you guys have?
