Diamond.mac -- Stable bard chant-kiting script

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

Guest

Diamond.mac -- Stable bard chant-kiting script

Post by Guest » Mon Mar 22, 2004 12:01 pm

Here is a trimmed down version, ignores PCs nearby, simply chant-kites forever, killing anything within 200 ft. Shamelessly used the stwist.mac algorithm for song-handling here. This macro doesn't wander at all, both versions have been tested for 48+ hours continuously.

Code: Select all

#turbo
#chat tell

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
Here is the fully-functional version, including standby mode for proximity of non-friendly PCs and the presence of GMs. Also includes a password to allow friends 24/7 access to exp. To change the password for group access, simply edit the word "password" to whatever you like.

Code: Select all

#turbo
#chat tell

Sub Main
   /zapvars 

   | These variables are related to movement and AI control.
   /declare RubberX global
   /declare RubberY global
   /declare StopMe global
   /declare StopTimer timer
   /declare ProximityTimer timer
   /varset RubberX @Param1
   /varset RubberY @Param0
   /varset StopMe 0
   /varset ProximityTimer 1m

   | 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(Param7)==false {
      /echo Usage: /mac Chant <Y> <X> <North> <South> <East> <West> <Song list> <TooClose>
      /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.
      /echo <TooClose   -- Distance at which non-friendly players halt kiting.
      /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

   | Do stuff if not in a holding phase.
   /if n @StopMe==0 {
      /doevents
      /if $char(casting)==FALSE { 
         /varset CurSong @PrevSong 
         /call Event_Timer 
      } 
      | If a GM zones in, shut down for 30 minutes.
      /if $gm==TRUE {
         /echo GM detected in zone, going into standby at $time(h):$time(m):$time(s).
         /g GM detected in zone, going into standby at $time(h):$time(m):$time(s).
         /stopsong
         /varset StopMe 1
         /varSet StopTimer 200
      }

      /if n @ProximityTimer<100 {
         | If an ungrouped PC comes within specified range, shut down until they leave.
         /if n $searchspawn(pc,noalert:1,radius:@Param7)>0 {
            /echo $spawn($searchspawn(pc,noalert:1,radius:@Param7),name,clean) is inside @Param7 ft., going into standby at $time(h):$time(m):$time(s).
            /g $spawn($searchspawn(pc,noalert:1,radius:@Param7),name,clean) is inside @Param7 ft., going into standby at $time(h):$time(m):$time(s).
            /stopsong
            /varset StopMe 2
            /varset StopTimer 200
         }
         /varadd ProximityTimer 1m
      }

      | 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
   }

   | Quit the ChantLoop and go into a holding phase if criteria are met.
   /if (n @StopTimer<10 && n @StopMe>0) /goto :StopStuff
   /goto :ChantLoop



   | This block of code is operations to perform before going into the standby loop.
   :StopStuff
   | Face the far corner, stop moving and Fade Memories.
   /stopsong
   /face fast heading 135
   /delay 10
   /sendkey up up
   /alt activate 212   

   | If a GM is in zone, set a timer for 30 minutes.
   /if n @StopMe==1 {
      /varset StopTimer 18000
   }
   | If someone came within specified range, set a timer for 5 minutes.
   /if n @StopMe==2 {
      /varset StopTimer 1m
   }



   | This loop (StopLoop) waits for 30 minutes after a GM zones in to restart
   | or until no ungrouped PCs are within specified range.
   :StopLoop
   /if n @StopMe==1 {
      /if n @StopTimer==0 {
         /echo It's been 30 minutes since a GM was sighted, resuming chant-kiting at $time(h):$time(m):$time(s).
         /g It's been 30 minutes since a GM was sighted, resuming chant-kiting at $time(h):$time(m):$time(s).
         /varset StopMe 0
         /sendkey down up
         /goto :ChantLoop
      }
   }
   /if n @StopMe==2 {
      /if (n @StopTimer==0 && n $char(mana,cur)>1000) {
         /if n $searchspawn(pc,noalert:1,radius:@Param7)==0 {
            /echo No PCs within @Param7 ft., resuming chant-kiting at $time(h):$time(m):$time(s).
            /g No PCs within @Param7 ft., resuming chant-kiting at $time(h):$time(m):$time(s).
            /varset StopMe 0
            /sendkey down up
            /goto :ChantLoop
         } else {
            /varset StopTimer 1m
         }
      }
   }
   /goto :StopLoop
/return

Sub Event_Chat(ChatType,Sender,ChatText)
   /declare MyMob local
   /varset MyMob $target(id)
   /if "$lcase("@ChatText")"~~"password" {
      /target range 1 22000 @Sender
      /if n $group(count)<6 {
         /tell @Sender I'm kiting at $char(y), $char(x) -- come join me.
         /invite
         /alert add 1 pc @Sender
      } else {
         /tell @Sender My group is full right now, try back later!
         /alert add 1 pc @Sender
      }
   }
   
   /target npc range 1 200 id MyMob
/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

jcooler
a ghoul
a ghoul
Posts: 87
Joined: Wed Dec 31, 2003 7:38 pm

Post by jcooler » Mon Mar 22, 2004 3:55 pm

chant kiteing suxs ...... AEing is the way to go =p 17 mobs in PoV solo = one AA

kkmonte
orc pawn
orc pawn
Posts: 23
Joined: Sat Dec 14, 2002 2:52 pm

Post by kkmonte » Mon Mar 22, 2004 4:37 pm

Whats the difference between chant kiting and ae kiting?

User avatar
Ute
decaying skeleton
decaying skeleton
Posts: 8
Joined: Wed Jan 07, 2004 1:31 pm

Post by Ute » Mon Mar 22, 2004 7:52 pm

chant = 1 mob; ae = many mobs.

GuardianX99
a lesser mummy
a lesser mummy
Posts: 43
Joined: Tue Dec 31, 2002 6:31 pm
Contact:

Post by GuardianX99 » Tue Mar 23, 2004 5:06 am

Chanting is most definately safer as far as killing goes, AEing yu really can't afk and leave it there and expect to see yourself alive after a 10 min lunch afk.

Gaillodar
decaying skeleton
decaying skeleton
Posts: 2
Joined: Fri Mar 05, 2004 9:56 am

this macro

Post by Gaillodar » Tue Mar 30, 2004 8:11 pm

What is the command line to trigger the macro? is it the same as old ones, /mac diamond 1234 5 6 ?

Pheph
a hill giant
a hill giant
Posts: 196
Joined: Thu Oct 09, 2003 8:15 pm

Post by Pheph » Tue Mar 30, 2004 10:36 pm

Usage: /mac Diamond <Y> <X> <North> <South> <East> <West> <Song list>
<Y> -- Y-coordinate of the center point.
<X> -- X-coordinate of the center point.
<North> -- Maximum distance north of the center point to travel.
<South> -- Maximum distance south of the center point to travel.
<East> -- Maximum distance east of the center point to travel.
<West> -- Maximum distance west of the center point to travel.
<Song list> -- List of songs to be sung, include Selo's if needed.

bdragon13
decaying skeleton
decaying skeleton
Posts: 1
Joined: Mon Mar 10, 2003 7:54 am

Post by bdragon13 » Wed Mar 31, 2004 6:32 am

getting an error

Ending macro: Bad variable in /var function.
diamond.mac@41 (Main):/varset Songs(@EachSong) $mid($calc(@EachSong-1),1,@Param6)

help please

kkmonte
orc pawn
orc pawn
Posts: 23
Joined: Sat Dec 14, 2002 2:52 pm

Post by kkmonte » Wed Mar 31, 2004 5:34 pm

I"m trying this macro and the mob runs off when it gets low on health and the bot don't chase him? And it just keeps spaming your target is out of range, get closer. ?

What do I do now?

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Wed Mar 31, 2004 5:42 pm

kkmonte wrote:What do I do now?
Write your own macro.
Debug this macro.
Shoot yourself.
Drink the Kool-Aid.
Vote for Bush.

kkmonte
orc pawn
orc pawn
Posts: 23
Joined: Sat Dec 14, 2002 2:52 pm

Post by kkmonte » Wed Mar 31, 2004 5:47 pm

What I meant was is this by design? and if it is, then how is this macro supposed to kill any mobs unless it chases it when it gets out of range? I would be willing to try and add that in, however my programming skils isn't the best, I'd be willing to try.

BrainDozer
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sun Aug 03, 2003 2:10 pm

Post by BrainDozer » Wed Mar 31, 2004 10:47 pm

Or, you could pick a better static kite spot.

Guest

Post by Guest » Thu Apr 01, 2004 1:19 pm

It's not really intended to work with fleeing mobs, the entire point is for the bard to run a specific path for hours or days on end while chant-kiting.

jcooler
a ghoul
a ghoul
Posts: 87
Joined: Wed Dec 31, 2003 7:38 pm

Post by jcooler » Thu Apr 01, 2004 4:15 pm

you must pick mobs that are social =)

Soup
decaying skeleton
decaying skeleton
Posts: 1
Joined: Fri Apr 02, 2004 10:52 am

Post by Soup » Fri Apr 02, 2004 11:20 am

A simple in game fix is to add the snare song towards the end of the song cycle. for example: if your songs lineup = 1: snare song, 2:wind marr, 3:venom chant, 4: disease chant, 5:fire chant, 6: cold chant, 7: selo's, 8:selo's travel. Then enter your normal diamond commands for the <x> <y> <n> <s> <e> <w> <73456134561> <distance alert>.....or somethin like that