Code: Select all
#turbo
#chat tell
#Event OOR "Your target is out of range"
#Event DEAD "LOADING"
#Event TOLD "tells you"
Sub Main
/zapvars
/declare RubberX global
/declare RubberY global
/varset RubberX @Param1
/varset RubberY @Param0
/declare SongTimer timer
/declare Songs array
/declare CurSong global
/declare PrevSong global
/declare nSongs global
/declare EachSong local
/if $defined(Param6)==false {
/echo Usage: /mac Diamond <Y> <X> <North> <South> <East> <West> <Song list>
/echo <Y> -- Y-coordinate of the center point.
/echo <X> -- X-coordinate of the center point.
/echo <North> -- Maximum distance north of the center point to travel.
/echo <South> -- Maximum distance south of the center point to travel.
/echo <East> -- Maximum distance east of the center point to travel.
/echo <West> -- Maximum distance west of the center point to travel.
/echo <Song list> -- List of songs to be sung, include Selo's if needed.
/endm
}
/varset nSongs $strlen(@Param6)
/for EachSong 1 to @nSongs
/varset Songs(@EachSong) $mid($calc(@EachSong-1),1,@Param6)
/echo Song @EachSong: $char(gem,@Songs(@EachSong))
/next EachSong
/varset CurSong 1
/call Event_Timer
/echo Running a diamond path with center at @RubberY, @RubberX and chant-kiting mobs.
/sendkey down up
:ChantLoop
| Face the correct corner of the diamond, given character's current position.
/if (n $char(x)<@RubberX && n $char(y)>@RubberY) /face fast nolook loc @RubberY,$calc(@RubberX-@Param4)
/if (n $char(x)<@RubberX && n $char(y)<@RubberY) /face fast nolook loc $calc(@RubberY-@Param3),@RubberX
/if (n $char(x)>@RubberX && n $char(y)<@RubberY) /face fast nolook loc @RubberY,$calc(@RubberX+@Param5)
/if (n $char(x)>@RubberX && n $char(y)>@RubberY) /face fast nolook loc $calc(@RubberY+@Param2),@RubberX
/doevents
/if $char(casting)==FALSE {
/varset CurSong @PrevSong
/call Event_Timer
}
/if $target()==FALSE /call GetTarget
/if $target(name)~~"corpse" /call GetTarget
/goto :ChantLoop
/return
Sub Event_Timer(TimerName)
/delay 2
/stopsong
/cast @Songs(@CurSong)
/varset PrevSong @CurSong
/varset SongTimer 30
/varadd CurSong 1
/if n @CurSong>@nSongs /varset CurSong 1
/return
Sub GetTarget
/target npc radius 150
/delay 1s
/if n $target(level)>20 /press esc
/if n $target(range)>400 /press esc
/return
Sub Event_OOR
/call GetTarget
/return
Sub Event_DEAD
/endm
Sub Event_TOLD
/beep
/return


