Bard Diamond/Cirlce Macro

Have a macro idea but not sure where to start? Ask here.

Moderator: MacroQuest Developers

Huggles
orc pawn
orc pawn
Posts: 11
Joined: Wed Apr 21, 2004 6:13 pm

Bard Diamond/Cirlce Macro

Post by Huggles » Tue May 04, 2004 4:32 pm

Looking for a simple macro that will run a diamond or a circle around a given location and twist.

Zeit
a lesser mummy
a lesser mummy
Posts: 34
Joined: Sat Jan 24, 2004 5:54 am

Post by Zeit » Wed Jun 09, 2004 6:00 pm

the one i used to use its not comliant with the new data params if someone wants to fix it up for you

Code: Select all

#turbo
#chat tell
#Event TOLD "tells you"

Sub Main
   /zapvars

   | These variables are related to movement and AI control.
   /declare RubberX global
   /declare RubberY global
   /varset RubberX @Param1
   /varset RubberY @Param0

   | These variables are related to song-twisting.
   /declare SongTimer timer
   /declare Songs array
   /declare CurSong global
   /declare PrevSong global
   /declare nSongs global
   /declare EachSong local



   | This block of code checks for proper arguments and echos error or initialization messages.
   /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
   }



   | This block of code sorts out the list of songs to be twisted while running.
   /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.



   | The main loop, this iterates unless some AI warning is reached.
   /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 loc @RubberY,$calc(@RubberX-@Param4)
   /look -90
   /if (n $char(x)<@RubberX && n $char(y)<@RubberY) /face fast loc $calc(@RubberY-@Param3),@RubberX
   /look -90
   /if (n $char(x)>@RubberX && n $char(y)<@RubberY) /face fast loc @RubberY,$calc(@RubberX+@Param5)
   /look -90
   /if (n $char(x)>@RubberX && n $char(y)>@RubberY) /face fast loc $calc(@RubberY+@Param2),@RubberX
   /look -90

   | Sing songs.
   /doevents
   /if $char(casting)==FALSE {
      /varset CurSong @PrevSong
      /call Event_Timer
   }

   | Get a new target if the current one is no good.
   /if n $target(id)==0 /call GetTarget
   /if $target(name)~~"corpse" /call GetTarget
   /if $target(type)=="PC" /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
   /if n $searchspawn(npc,radius:200)>0 /target npc radius 200
   /if n $target(level)>66 /press esc
   /if n $target(range)>200 /press esc
/return 

Sub Event_TOLD
   /beep
/return