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

theoneandonly
orc pawn
orc pawn
Posts: 26
Joined: Sun Apr 11, 2004 6:39 pm

Post by theoneandonly » Sun Apr 25, 2004 9:24 pm

having a problem with songs landing. i just get "your song ends" i think it has something to do with turbo or some kind of delay between songs.

Xondar
decaying skeleton
decaying skeleton
Posts: 6
Joined: Fri Apr 23, 2004 2:32 am

Looking for way to use the /circle instead of diamond

Post by Xondar » Mon Apr 26, 2004 6:18 am

Was hoping someone might be able to change the diamond pattern to a perfect circle, avoids a lot of initial damage and looks better from a distance

theoneandonly
orc pawn
orc pawn
Posts: 26
Joined: Sun Apr 11, 2004 6:39 pm

Post by theoneandonly » Mon Apr 26, 2004 9:37 am

its possible but, you would need to put in atleast twice as many radius parameters, this would make it alot smoother. You could just copy and paste the current ones and change the @Param#'s. Then just add the rest on the beginning of the macro or whereever they are stated at the macro start. i might even try this..

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

Post by Zeit » Mon Apr 26, 2004 10:50 am

/mac chant 150 150 90 90 90 90 1234 10

isnt working for me just ends there used the same syntax as previous versions it just ends like I didnt put it in right back to debuging !~

nald
orc pawn
orc pawn
Posts: 15
Joined: Sat Dec 20, 2003 9:30 am

Post by nald » Mon Apr 26, 2004 11:26 am

Zeit wrote:/mac chant 150 150 90 90 90 90 1234 10

isnt working for me just ends there used the same syntax as previous versions it just ends like I didnt put it in right back to debuging !~
I am guessing here but I assume you named the macro chant.mac instead of diamond.mac since the 1st and 2nd numbers are your Y and X coordinates I think it should be 150.00 so based on your syntax above:

/mac chant 150.00 150.00 90 90 90 90 1234 10

or if your macro is called diamond.mac:

/mac diamond 150.00 150.00 90 90 90 90 1234 10

One other thing if your coordinates are negatives it would be:

/mac chant -150.00 -150.00 90 90 90 90 1234 10

nald
orc pawn
orc pawn
Posts: 15
Joined: Sat Dec 20, 2003 9:30 am

Re: Looking for way to use the /circle instead of diamond

Post by nald » Mon Apr 26, 2004 11:36 am

Xondar wrote:Was hoping someone might be able to change the diamond pattern to a perfect circle, avoids a lot of initial damage and looks better from a distance
There is a macro designed for circle chanting that worked well for me before the last parm change but it is currently busted. There are two threads on it so it is somewhat confusing on which to use but when it is fixed I plan on trying it out

http://macroquest2.com/phpBB2/viewtopic ... c&start=75

http://macroquest2.com/phpBB2/viewtopic.php?t=4536

It seems to be activly looked at and I am hoping it will get fixed soon. I really need to learn this macro stuff but I am a sofware tester not a developer so that will take some time :)

theoneandonly
orc pawn
orc pawn
Posts: 26
Joined: Sun Apr 11, 2004 6:39 pm

Post by theoneandonly » Mon Apr 26, 2004 1:51 pm

100% untested, might not work.... feedback please..

Code: Select all

#turbo 
#chat tell 

#event Zoned "You have entered" 
#event StatusReport "status report" 
#event GainExp "You gain" 

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 CircleNE @Param9
   /varset CircleNW @Param10
   /varset CircleSE @Param11
   /varset CircleSW @Param12
   /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 

   | Experience & Time Variables 
   /declare CurrentExp global 
   /declare CurrentAAXP global 
   /declare CurrentTime global 
   /varset CurrentExp ${Me.PctExp} 
   /varset CurrentAAXP ${Me.PctAAExp} 
   /varset CurrentTime ${Math.Calc[${Macro.RunTime}/60]} 

   | This block of code checks for proper arguments and echos error or initialization messages. 
   /if (!${Defined[Param7]}) { 
      /echo Usage: /mac Chant <Y> <X> <North> <South> <East> <West> <Song list> <TooClose> <NE> <NS> <SE> <SW>
      /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. 
      /echo <NE>        -- more of a circle shape. +20 of <North> recommended
      /echo <NS>        -- more of a circle shape. -20 of <North> recommended
      /echo <SE>        -- more of a circle shape. +20 of <South> recommended
      /echo <SW>        -- more of a circle shape. -20 of <South> recommended
      /endmacro 
   } 



   | This block of code sorts out the list of songs to be twisted while running. 
   /varset nSongs ${String[@Param6].Length} 
   /for EachSong 1 to @nSongs 
      /varset Songs(@EachSong) ${String[@Param6].Mid[${Math.Calc[@EachSong]},1]} 
      /echo Song @EachSong: ${Me.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. 
   /keypress autorun 
   :ChantLoop 
   | Face the correct corner of the diamond, given character's current position. 
   /if (${Me.X}<@RubberX && ${Me.Y}>@RubberY) /face fast loc @RubberY,${Math.Calc[@RubberX-@Param4]} 
   /look -90
   /if (${Me.X}>@RubberX && ${Me.Y}<@RubberY) /face fast loc @RubberY,${Math.Calc[@RubberX-@Param11]} 
   /look -90 
   
   /if (${Me.X}<@RubberX && ${Me.Y}<@RubberY) /face fast loc ${Math.Calc[@RubberY-@Param3]},@RubberX 
   /look -90
   /if (${Me.X}<@RubberX && ${Me.Y}<@RubberY) /face fast loc ${Math.Calc[@RubberY-@Param12]},@RubberX 
   /look -90 
   
   /if (${Me.X}>@RubberX && ${Me.Y}<@RubberY) /face fast loc @RubberY,${Math.Calc[@RubberX+@Param5]} 
   /look -90
   /if (${Me.X}>@RubberX && ${Me.Y}<@RubberY) /face fast loc @RubberY,${Math.Calc[@RubberX+@Param10]} 
   /look -90  
   
   /if (${Me.X}>@RubberX && ${Me.Y}>@RubberY) /face fast loc ${Math.Calc[@RubberY+@Param2]},@RubberX 
   /look -90
   /if (${Me.X}>@RubberX && ${Me.Y}>@RubberY) /face fast loc ${Math.Calc[@RubberY+@Param9]},@RubberX 
   /look -90 

   | Do stuff if not in a holding phase. 
   /if (@StopMe==0) { 
      /doevents 
      /if (!${Me.Casting.ID}) { 
         /varset CurSong @PrevSong 
         /call Event_Timer 
      } 
      | If a GM zones in, shut down for 30 minutes. 
      /if (${Spawn[gm].ID}) { 
         /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 (@ProximityTimer<100) { 
         | If an ungrouped PC comes within specified range, shut down until they leave. 
         /if (${Spawn[pc noalert 1 radius @Param7].ID}) { 
            /echo ${Spawn[pc noalert 1 radius @Param7].CleanName} is inside @Param7 ft., going into standby at ${Time.Time12}. 
            /g ${Spawn[pc noalert 1 radius @Param7].CleanName} is inside @Param7 ft., going into standby at ${Time.Time12}. 
            /stopsong 
            /varset StopMe 2 
            /varset StopTimer 200 
         } 
         /varadd ProximityTimer 1m 
      } 

      | Get a new target if the current one is no good. 
      /if (!${Target.ID}) /call GetTarget 
      /if (${Target.Name.Find[corpse]}) /call GetTarget 
      /if (${Target.Type.Equal[PC]}) /call GetTarget 
   } 

   | Quit the ChantLoop and go into a holding phase if criteria are met. 
   /if (@StopTimer<10 && @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 
   /keypress back 
   /alt activate 212    

   | If a GM is in zone, set a timer for 30 minutes. 
   /if (@StopMe==1) { 
      /varset StopTimer 18000 
   } 
   | If someone came within specified range, set a timer for 5 minutes. 
   /if (@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 (@StopMe==1) { 
      /if (@StopTimer==0) { 
         /echo It's been 30 minutes since a GM was sighted, resuming chant-kiting at ${Time.Time12}. 
         /g It's been 30 minutes since a GM was sighted, resuming chant-kiting at ${Time.Time12}. 
         /varset StopMe 0 
         /keypress autorun 
         /goto :ChantLoop 
      } 
   } 
   /if (@StopMe==2) { 
      /if (@StopTimer>0 && ${Me.CurrentMana}>1000) { 
         /if (!${Spawn[pc noalert 1 radius @Param7].ID}) { 
            /echo No PCs within @Param7 ft., resuming chant-kiting at ${Time.Time12}. 
            /g No PCs within @Param7 ft., resuming chant-kiting at ${Time.Time12}. 
            /varset StopMe 0 
            /keypress autorun 
            /goto :ChantLoop 
         } else { 
            /varset StopTimer 1m 
         } 
      } 
   } 
   /goto :StopLoop 
/return 

Sub Event_Chat(ChatType,Sender,ChatText) 
   /declare MyMob local 
   /varset MyMob $target(id) 
   /if (${String[@ChatText].Lower.Equal[group me]}) { 
      /target range 1 22000 @Sender 
      /if (${Group}<6) { 
         /tell @Sender I'm kiting at ${Me.Y}, ${Me.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 
      } 
   } 
   /if (${String[@ChatText].Lower.Equal[status report]}) { 
      /tell @Sender TARGET: ${Target.CleanName} (${Target.PctHPs}%) SELF: ${Me.Name} (${Me.PctHPs}%) EXP: ${Me.Level} (${Me.PctExp}%) AAXP: ${Me.AAPoints} (${Me.PctAAExp}%) 
   } 
    
   /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 (@CurSong>@nSongs) /varset CurSong 1 
/return 

Sub GetTarget 
   /if (${Spawn[npc radius 200].ID}) /target npc radius 200 
   /if (${Target.Level}<7) /keypress esc 
   /if (${Target.Distance}>200) /keypress esc 
/return 

Sub Event_Zoned 
   /sit 
   /camp desktop 
   /endmacro 
/return 

Sub Event_StatusReport 
   /declare LoopCounter local 
   /declare GroupMembers local 
   /varset GroupMembers "" 

   /for LoopCounter 0 to ${Math.Calc[${Group}-1]} 
   /varcat GroupMembers ${Group[@LoopCounter].Name} 
   /varcat GroupMembers " " 
   /next LoopCounter 

      /echo TARGET: ${Target.CleanName} (${Target.PctHPs}%) 
   /echo SELF: ${Me.Name} (${Me.PctHPs}%) 
   /echo EXP: ${Me.Level} (${Me.PctExp}%) 
   /echo AAXP: ${Me.AAPoints} (${Me.PctAAExp}%) 
   /echo GROUP: @GroupMembers 
   /echo RUNTIME: ${Math.Calc[${Macro.RunTime}/60]} 
/return 

Sub Event_GainExp 
   /varset CurrentExp ${Math.Calc[${Me.PctExp}-@CurrentExp]} 
   /varset CurrentAAXP ${Math.Calc[${Me.PctAAExp}-@CurrentAAXP]} 
   /varset CurrentTime ${Math.Calc[${Math.Calc[${Macro.RunTime}/60]}-@CurrentTime]} 

   /echo EXP: ${Me.PctExp}% (@CurrentExp%) AAXP: ${Me.PctAAExp}% (@CurrentAAXP%) TIME: ${Math.Calc[${Macro.RunTime}/60]} (@CurrentTime) 

   /varset CurrentExp ${Me.PctExp} 
   /varset CurrentAAXP ${Me.PctAAExp} 
   /varset CurrentTime ${Math.Calc[${Macro.RunTime}/60]} 
/return 
once again not tested at all

nald
orc pawn
orc pawn
Posts: 15
Joined: Sat Dec 20, 2003 9:30 am

Post by nald » Mon Apr 26, 2004 7:58 pm

Gave this circle one a try and as soon as i try it I crash to the desktop.

Here is the error:

Macro - Starting macro with '/call Main 1232.05 -979.45 50 50 50 50 6124512458 10 70 30 70 30'

WriteChatColor(Cleared the following: Timers Vars Arrays)

WriteChatColor(No variable named 'CircleNE')

WriteChatColor(Ending macro: Bad variable in /var function.)

WriteChatColor(advtest.mac@19 (Main): /varset CircleNE @Param9)

WriteChatColor(Cleared the following: Timers Arrays)

WriteChatColor(The current macro has ended.)

MQ2Map Module Unloaded

MQ2ChatWnd Module Unloaded

MQ2CustomBinds Module Unloaded

MQ2FPS Module Unloaded

MQ2ItemDisplay Module Unloaded

MQ2Labels Module Unloaded

theoneandonly
orc pawn
orc pawn
Posts: 26
Joined: Sun Apr 11, 2004 6:39 pm

Post by theoneandonly » Mon Apr 26, 2004 8:14 pm

Final Copy...has popups, exp reports. etc etc.. no previous song ending problems either... if you want a circle...program your own! :shock:

Code: Select all

#turbo 
#chat tell

#event Zoned "You have entered"
#event StatusReport "status report"
#event GainExp "You gain"

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 

   | Experience & Time Variables
   /declare CurrentExp global
   /declare CurrentAAXP global
   /declare CurrentTime global
   /varset CurrentExp ${Me.PctExp}
   /varset CurrentAAXP ${Me.PctAAExp}
   /varset CurrentTime ${Math.Calc[${Macro.RunTime}/60]}

   | This block of code checks for proper arguments and echos error or initialization messages. 
   /if (!${Defined[Param7]}) { 
      /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. 
      /endmacro
   } 



   | This block of code sorts out the list of songs to be twisted while running. 
   /varset nSongs ${String[@Param6].Length}
   /for EachSong 1 to @nSongs 
      /varset Songs(@EachSong) ${String[@Param6].Mid[${Math.Calc[@EachSong]},1]}
      /echo Song @EachSong: ${Me.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. 
   /keypress autorun
   :ChantLoop 
   | Face the correct corner of the diamond, given character's current position. 
   /if (${Me.X}<@RubberX && ${Me.Y}>@RubberY) /face fast loc @RubberY,${Math.Calc[@RubberX-@Param4]}
   /look -90 
   /if (${Me.X}<@RubberX && ${Me.Y}<@RubberY) /face fast loc ${Math.Calc[@RubberY-@Param3]},@RubberX 
   /look -90 
   /if (${Me.X}>@RubberX && ${Me.Y}<@RubberY) /face fast loc @RubberY,${Math.Calc[@RubberX+@Param5]}
   /look -90 
   /if (${Me.X}>@RubberX && ${Me.Y}>@RubberY) /face fast loc ${Math.Calc[@RubberY+@Param2]},@RubberX 
   /look -90 

   | Do stuff if not in a holding phase. 
   /if (@StopMe==0) { 
      /doevents 
      /if (!${Me.Casting.ID}) { 
         /varset CurSong @PrevSong 
         /call Event_Timer 
      } 
      | If a GM zones in, shut down for 30 minutes. 
      /if (${Spawn[gm].ID}) { 
         /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 (@ProximityTimer<100) { 
         | If an ungrouped PC comes within specified range, shut down until they leave. 
         /if (${Spawn[pc noalert 1 radius @Param7].ID}) { 
            /echo ${Spawn[pc noalert 1 radius @Param7].CleanName} is inside @Param7 ft., going into standby at 

${Time.Time12}. 
            /g ${Spawn[pc noalert 1 radius @Param7].CleanName} is inside @Param7 ft., going into standby at ${Time.Time12}. 
            /stopsong 
            /varset StopMe 2 
            /varset StopTimer 200 
         } 
         /varadd ProximityTimer 1m 
      } 

      | Get a new target if the current one is no good. 
      /if (!${Target.ID}) /call GetTarget 
      /if (${Target.Name.Find[corpse]}) /call GetTarget 
      /if (${Target.Type.Equal[PC]}) /call GetTarget 
   } 

   | Quit the ChantLoop and go into a holding phase if criteria are met. 
   /if (@StopTimer<10 && @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 
   /keypress back
   /alt activate 212    

   | If a GM is in zone, set a timer for 30 minutes. 
   /if (@StopMe==1) { 
      /varset StopTimer 18000 
   } 
   | If someone came within specified range, set a timer for 5 minutes. 
   /if (@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 (@StopMe==1) { 
      /if (@StopTimer==0) { 
         /echo It's been 30 minutes since a GM was sighted, resuming chant-kiting at ${Time.Time12}. 
         /g It's been 30 minutes since a GM was sighted, resuming chant-kiting at ${Time.Time12}. 
         /varset StopMe 0 
         /keypress autorun
         /goto :ChantLoop 
      } 
   } 
   /if (@StopMe==2) { 
      /if (@StopTimer>0 && ${Me.CurrentMana}>1000) { 
         /if (!${Spawn[pc noalert 1 radius @Param7].ID}) { 
            /echo No PCs within @Param7 ft., resuming chant-kiting at ${Time.Time12}. 
            /g No PCs within @Param7 ft., resuming chant-kiting at ${Time.Time12}. 
            /varset StopMe 0 
            /keypress autorun 
            /goto :ChantLoop 
         } else { 
            /varset StopTimer 1m 
         } 
      } 
   } 
   /goto :StopLoop 
/return 

Sub Event_Chat(ChatType,Sender,ChatText) 
   /declare MyMob local 
   /varset MyMob $target(id) 
   /if (${String[@ChatText].Lower.Equal[group me]}) { 
      /target range 1 22000 @Sender 
      /if (${Group}<6) { 
         /tell @Sender I'm kiting at ${Me.Y}, ${Me.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 
      } 
   }
   /if (${String[@ChatText].Lower.Equal[status report]}) {
      /tell @Sender TARGET: ${Target.CleanName} (${Target.PctHPs}%) SELF: ${Me.Name} (${Me.PctHPs}%) EXP: ${Me.Level} 

(${Me.PctExp}%) AAXP: ${Me.AAPoints} (${Me.PctAAExp}%)
   }
    
   /target npc range 1 200 id @MyMob 
/return 

Sub Event_Timer(TimerName) 
      /delay 2 
      /stopsong 
      /cast @Songs(@CurSong)
      /varset PrevSong @CurSong 
      /varset SongTimer 32 
      /varadd CurSong 1 
      /if (@CurSong>@nSongs) /varset CurSong 1 
/return 

Sub GetTarget 
   /if (${Spawn[npc radius 200].ID}) /target npc radius 200 
   /if (${Target.Level}<7) /keypress esc
   /if (${Target.Distance}>160) /keypress esc 
/return 

Sub Event_Zoned
   /sit
   /camp desktop
   /endmacro
/return

Sub Event_StatusReport
	/declare LoopCounter local
	/declare GroupMembers local
	/varset GroupMembers ""

	/for LoopCounter 0 to ${Math.Calc[${Group}-1]}
	/varcat GroupMembers ${Group[@LoopCounter].Name}
	/varcat GroupMembers " "
	/next LoopCounter

      /echo TARGET: ${Target.CleanName} (${Target.PctHPs}%)
	/echo SELF: ${Me.Name} (${Me.PctHPs}%)
	/echo EXP: ${Me.Level} (${Me.PctExp}%)
	/echo AAXP: ${Me.AAPoints} (${Me.PctAAExp}%)
	/echo GROUP: @GroupMembers
	/echo RUNTIME: ${Math.Calc[${Macro.RunTime}/60]}
/return

Sub Event_GainExp
	/varset CurrentExp ${Math.Calc[${Me.PctExp}-@CurrentExp]}
	/popup You are now at: ${Me.PctExp}%, and have Gained: @CurrentExp%
        /varset CurrentAAXP ${Math.Calc[${Me.PctAAExp}-@CurrentAAXP]}
	/varset CurrentTime ${Math.Calc[${Math.Calc[${Macro.RunTime}/60]}-@CurrentTime]}

	/echo EXP: ${Me.PctExp}% (@CurrentExp%) AAXP: ${Me.PctAAExp}% (@CurrentAAXP%) TIME: ${Math.Calc[${Macro.RunTime}/60]} 

(@CurrentTime)

	/varset CurrentExp ${Me.PctExp}
	/varset CurrentAAXP ${Me.PctAAExp}
	/varset CurrentTime ${Math.Calc[${Macro.RunTime}/60]}
/return

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

Post by Zeit » Tue Apr 27, 2004 12:59 pm

Code: Select all

[color=red]Ending Macro: Flow ran into another subroutine[/color]
[color=white]Diamond.mac@90 (Event_Timer): Sub Event_Timer(TimerName)[/color]
Here is what I'm using cut down version of original, now my head hurts. I'm missing something just not sure what it is

Code: Select all

#turbo
#chat tell

#event Zoned "You have entered"
#event StatusReport "status report"
#event GainExp "You gain"

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

   | Experience & Time Variables
   /declare CurrentExp global
   /declare CurrentAAXP global
   /declare CurrentTime global
   /varset CurrentExp ${Me.PctExp}
   /varset CurrentAAXP ${Me.PctAAExp}
   /varset CurrentTime ${Math.Calc[${Macro.RunTime}/60]}

   | This block of code checks for proper arguments and echos error or 

initialization messages.
   /if (!${Defined[Param6]}) {
      /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.
   }



   | This block of code sorts out the list of songs to be twisted while 

running.
   /varset nSongs ${String[@Param6].Length}
   /for EachSong 1 to @nSongs
      /varset Songs(@EachSong) 

${String[@Param6].Mid[${Math.Calc[@EachSong]},1]}
      /echo Song @EachSong: ${Me.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.
   /keypress autorun
   :ChantLoop
   | Face the correct corner of the diamond, given character's current 

position.
   /if (${Me.X}<@RubberX && ${Me.Y}>@RubberY) /face fast loc 

@RubberY,${Math.Calc[@RubberX-@Param4]}
   /look -90
   /if (${Me.X}<@RubberX && ${Me.Y}<@RubberY) /face fast loc 

${Math.Calc[@RubberY-@Param3]},@RubberX
   /look -90
   /if (${Me.X}>@RubberX && ${Me.Y}<@RubberY) /face fast loc 

@RubberY,${Math.Calc[@RubberX+@Param5]}
   /look -90
   /if (${Me.X}>@RubberX && ${Me.Y}>@RubberY) /face fast loc 

${Math.Calc[@RubberY+@Param2]},@RubberX
   /look -90

   | Do stuff if not in a holding phase.
      /doevents
      /if (!${Me.Casting.ID}) {
         /varset CurSong @PrevSong
         /call Event_Timer
      }
      | Get a new target if the current one is no good.
      /if (!${Target.ID}) /call GetTarget
      /if (${Target.Name.Find[corpse]}) /call GetTarget
      /if (${Target.Type.Equal[PC]}) /call GetTarget
   }

Sub Event_Timer(TimerName)
      /delay 2
      /stopsong
      /cast @Songs(@CurSong)
      /varset PrevSong @CurSong
      /varset SongTimer 32
      /varadd CurSong 1
      /if (@CurSong>@nSongs) /varset CurSong 1
/return

Sub GetTarget
   /if (${Spawn[npc radius 200].ID}) /target npc radius 200
   /if (${Target.Level}<7) /keypress esc
   /if (${Target.Distance}>160) /keypress esc
/return

Sub Event_Zoned
   /sit
   /camp desktop
   /endmacro
/return

Sub Event_StatusReport
   /declare LoopCounter local
   /declare GroupMembers local
   /varset GroupMembers ""

   /for LoopCounter 0 to ${Math.Calc[${Group}-1]}
   /varcat GroupMembers ${Group[@LoopCounter].Name}
   /varcat GroupMembers " "
   /next LoopCounter

      /echo TARGET: ${Target.CleanName} (${Target.PctHPs}%)
   /echo SELF: ${Me.Name} (${Me.PctHPs}%)
   /echo EXP: ${Me.Level} (${Me.PctExp}%)
   /echo AAXP: ${Me.AAPoints} (${Me.PctAAExp}%)
   /echo GROUP: @GroupMembers
   /echo RUNTIME: ${Math.Calc[${Macro.RunTime}/60]}
/return

Sub Event_GainExp
   /varset CurrentExp ${Math.Calc[${Me.PctExp}-@CurrentExp]}
   /popup You are now at: ${Me.PctExp}%, and have Gained: @CurrentExp%
        /varset CurrentAAXP ${Math.Calc[${Me.PctAAExp}-@CurrentAAXP]}
   /varset CurrentTime 

${Math.Calc[${Math.Calc[${Macro.RunTime}/60]}-@CurrentTime]}

   /echo EXP: ${Me.PctExp}% (@CurrentExp%) AAXP: ${Me.PctAAExp}% 

(@CurrentAAXP%) TIME: ${Math.Calc[${Macro.RunTime}/60]}

(@CurrentTime)

   /varset CurrentExp ${Me.PctExp}
   /varset CurrentAAXP ${Me.PctAAExp}
   /varset CurrentTime ${Math.Calc[${Macro.RunTime}/60]}
/return 

spektralkat
orc pawn
orc pawn
Posts: 22
Joined: Sat Dec 20, 2003 5:25 am

Post by spektralkat » Tue Apr 27, 2004 4:34 pm

Just a lil work i did today for those of you that like Diamondkite but would Prefer to orbit rather than spend your time in a dead give away "box"




Code: Select all

#turbo
#chat tell

#event Zoned "You have entered"
#event StatusReport "status report"
#event GainExp "You gain"

Sub Main
   /zapvars

   | These variables are related to movement and AI control.
   /declare RubberX global
   /declare RubberY global
   /declare CirX global
   /declare CirY global
   /declare CirR global
   /declare StopMe global
   /declare StopTimer timer
   /declare ProximityTimer timer
   /varset RubberX @Param1
   /varset RubberY @Param0
   /varset CirX @Param0
   /varset CirY @Param1
   /varset CirR @Param2
   /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

   | Experience & Time Variables
   /declare CurrentExp global
   /declare CurrentAAXP global
   /declare CurrentTime global
   /varset CurrentExp ${Me.PctExp}
   /varset CurrentAAXP ${Me.PctAAExp}
   /varset CurrentTime ${Math.Calc[${Macro.RunTime}/60]}

   | This block of code checks for proper arguments and echos error or initialization messages.
   /if (!${Defined[Param4]}) {
      /echo Usage: /mac Chant <Y> <X> <Radius> <Song list> <TooClose>
      /echo <Y>         -- Y-coordinate of the center point.
      /echo <X>         -- X-coordinate of the center point.
      /echo <Radius>    -- Radius from center point to kite.
      /echo <Song list> -- List of songs to be sung, include Selo's if needed.
      /echo <TooClose   -- Distance at which non-friendly players halt kiting.
      /endmacro
   }



   | This block of code sorts out the list of songs to be twisted while running.
   /varset nSongs ${String[@Param3].Length}
   /for EachSong 1 to @nSongs
      /varset Songs(@EachSong) ${String[@Param3].Mid[${Math.Calc[@EachSong]},1]}
      /echo Song @EachSong: ${Me.Gem[@Songs(@EachSong)]}
   /next EachSong
   /varset CurSong 1
   /call Event_Timer
   /echo Running a Circle with center at @RubberY, @RubberX and chant-kiting mobs.



   | The main loop, this iterates unless some AI warning is reached.
   /keypress autorun
   :ChantLoop
   | Maintain distance from centerpoint, given character's current position.
   /if (${Math.Distance[@CirX,@CirY]}<${Math.Calc[@CirR/2]}) { 
      /face heading ${Math.Calc[${Heading[@CirX,@CirY].DegreesCCW}+180]} 
   } else { 
      /face heading ${Math.Calc[${Heading[@CirX,@CirY].DegreesCCW}+${Math.Calc[90*${Math.Calc[@CirR/${Math.Distance[@CirX,@CirY]}]}]}]}
   } 

   | Do stuff if not in a holding phase.
   /if (@StopMe==0) {
      /doevents
      /if (!${Me.Casting.ID}) {
         /varset CurSong @PrevSong
         /call Event_Timer
      }
      | If a GM zones in, shut down for 30 minutes.
      /if (${Spawn[gm].ID}) {
         /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 (@ProximityTimer<100) {
         | If an ungrouped PC comes within specified range, shut down until they leave.
         /if (${Spawn[pc noalert 1 radius @Param4].ID}) {
            /echo ${Spawn[pc noalert 1 radius @Param4].CleanName} is inside @Param4 ft., going into standby at ${Time.Time12}.
            /g ${Spawn[pc noalert 1 radius @Param4].CleanName} is inside @Param4 ft., going into standby at ${Time.Time12}.
            /stopsong
            /varset StopMe 2
            /varset StopTimer 200
         }
         /varadd ProximityTimer 1m
      }

      | Get a new target if the current one is no good.
      /if (!${Target.ID}) /call GetTarget
      /if (${Target.Name.Find[corpse]}) /call GetTarget
      /if (${Target.Type.Equal[PC]}) /call GetTarget
   }

   | Quit the ChantLoop and go into a holding phase if criteria are met.
   /if (@StopTimer<10 && @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
   /keypress back
   /alt activate 212   

   | If a GM is in zone, set a timer for 30 minutes.
   /if (@StopMe==1) {
      /varset StopTimer 18000
   }
   | If someone came within specified range, set a timer for 5 minutes.
   /if (@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 (@StopMe==1) {
      /if (@StopTimer==0) {
         /echo It's been 30 minutes since a GM was sighted, resuming chant-kiting at ${Time.Time12}.
         /g It's been 30 minutes since a GM was sighted, resuming chant-kiting at ${Time.Time12}.
         /varset StopMe 0
         /keypress autorun
         /goto :ChantLoop
      }
   }
   /if (@StopMe==2) {
      /if (@StopTimer>0 && ${Me.CurrentMana}>1000) {
         /if (!${Spawn[pc noalert 1 radius @Param4].ID}) {
            /echo No PCs within @Param4 ft., resuming chant-kiting at ${Time.Time12}.
            /g No PCs within @Param4 ft., resuming chant-kiting at ${Time.Time12}.
            /varset StopMe 0
            /keypress autorun
            /goto :ChantLoop
         } else {
            /varset StopTimer 1m
         }
      }
   }
   /goto :StopLoop
/return

Sub Event_Chat(ChatType,Sender,ChatText)
   /declare MyMob local
   /varset MyMob $target(id)
   /if (${String[@ChatText].Lower.Equal[group me]}) {
      /target range 1 22000 @Sender
      /if (${Group}<6) {
         /tell @Sender I'm kiting at ${Me.Y}, ${Me.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
      }
   }
   /if (${String[@ChatText].Lower.Equal[status report]}) {
      /tell @Sender TARGET: ${Target.CleanName} (${Target.PctHPs}%) SELF: ${Me.Name} (${Me.PctHPs}%) EXP: ${Me.Level} (${Me.PctExp}%) AAXP: ${Me.AAPoints} (${Me.PctAAExp}%)
   }
   
   /target npc range 1 200 id @MyMob
/return

Sub Event_Timer(TimerName)
      /delay 2
      /alt activate 199
      /stopsong
      /cast @Songs(@CurSong)
      /varset PrevSong @CurSong
      /varset SongTimer 30
      /varadd CurSong 1
      /if (@CurSong>@nSongs) /varset CurSong 1
/return

Sub GetTarget
   /if (${Spawn[npc radius 200].ID}) /keypress esc 
   /if (${Target.Level}<7) /keypress esc
   /if (${Target.Distance}>200) /keypress esc
/return

Sub Event_Zoned
   /sit
   /camp desktop
   /endmacro
/return

Sub Event_StatusReport
   /declare LoopCounter local
   /declare GroupMembers local
   /varset GroupMembers ""

   /for LoopCounter 0 to ${Math.Calc[${Group}-1]}
   /varcat GroupMembers ${Group[@LoopCounter].Name}
   /varcat GroupMembers " "
   /next LoopCounter

      /echo TARGET: ${Target.CleanName} (${Target.PctHPs}%)
   /echo SELF: ${Me.Name} (${Me.PctHPs}%)
   /echo EXP: ${Me.Level} (${Me.PctExp}%)
   /echo AAXP: ${Me.AAPoints} (${Me.PctAAExp}%)
   /echo GROUP: @GroupMembers
   /echo RUNTIME: ${Math.Calc[${Macro.RunTime}/60]}
/return

Sub Event_GainExp
   /varset CurrentExp ${Math.Calc[${Me.PctExp}-@CurrentExp]}
   /varset CurrentAAXP ${Math.Calc[${Me.PctAAExp}-@CurrentAAXP]}
   /varset CurrentTime ${Math.Calc[${Math.Calc[${Macro.RunTime}/60]}-@CurrentTime]}

   /echo EXP: ${Me.PctExp}% (@CurrentExp%) AAXP: ${Me.PctAAExp}% (@CurrentAAXP%) TIME: ${Math.Calc[${Macro.RunTime}/60]} (@CurrentTime)

   /varset CurrentExp ${Me.PctExp}
   /varset CurrentAAXP ${Me.PctAAExp}
   /varset CurrentTime ${Math.Calc[${Macro.RunTime}/60]}
/return 
[/url]
Last edited by spektralkat on Tue Apr 27, 2004 4:50 pm, edited 1 time in total.

theoneandonly
orc pawn
orc pawn
Posts: 26
Joined: Sun Apr 11, 2004 6:39 pm

Post by theoneandonly » Tue Apr 27, 2004 4:43 pm

may want to change

Code: Select all

Sub GetTarget 
   [b]/if (${Spawn[npc radius 200].ID}) /target npc radius 200[/b] 
   /if (${Target.Level}<7) /keypress esc 
   /if (${Target.Distance}>200) /keypress esc 
/return 
to

Code: Select all

Sub GetTarget 
   [b]/if (${Spawn[npc radius 200].ID}) /keypress esc[/b]
   /if (${Target.Level}<7) /keypress esc 
   /if (${Target.Distance}>200) /keypress esc 
/return 
otherwise you'd keep targeting mobs when you have a target within 200 ranger.... The circle is slightly obvious but not as much as the diamond! awesome work
Last edited by theoneandonly on Tue Apr 27, 2004 5:04 pm, edited 1 time in total.

spektralkat
orc pawn
orc pawn
Posts: 22
Joined: Sat Dec 20, 2003 5:25 am

Post by spektralkat » Tue Apr 27, 2004 4:48 pm

Good idea, I'll do that, just took something that was already there and threw in something very old but functional, kitting in hoh at the moment on other puter, tis nice to have muh Mac up and running again, as they say sometimes ya cant wait for someone else to do it for ya and ya have to do it yourself no? Love the changes btw new mqdata is sharp



Bump, edited as per yur advice thankies /em picks up book and pets her cat the bard is hard at work

theoneandonly
orc pawn
orc pawn
Posts: 26
Joined: Sun Apr 11, 2004 6:39 pm

Post by theoneandonly » Tue Apr 27, 2004 5:33 pm

thought i'd post my final edited verson of Diamond.mac and Circle.mac

Code: Select all

#turbo 
#chat tell 

#event Zoned "You have entered" 
#event StatusReport "status report" 
#event GainExp "You gain" 

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 

   | Experience & Time Variables 
   /declare CurrentExp global 
   /declare CurrentAAXP global 
   /declare CurrentTime global 
   /varset CurrentExp ${Me.PctExp} 
   /varset CurrentAAXP ${Me.PctAAExp} 
   /varset CurrentTime ${Math.Calc[${Macro.RunTime}/60]} 

   | This block of code checks for proper arguments and echos error or initialization messages. 
   /if (!${Defined[Param7]}) { 
      /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. 
      /endmacro 
   } 



   | This block of code sorts out the list of songs to be twisted while running. 
   /varset nSongs ${String[@Param6].Length} 
   /for EachSong 1 to @nSongs 
      /varset Songs(@EachSong) ${String[@Param6].Mid[${Math.Calc[@EachSong]},1]} 
      /echo Song @EachSong: ${Me.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. 
   /keypress autorun 
   :ChantLoop 
   | Face the correct corner of the diamond, given character's current position. 
   /if (${Me.X}<@RubberX && ${Me.Y}>@RubberY) /face fast loc @RubberY,${Math.Calc[@RubberX-@Param4]} 
   /look -90 
   /if (${Me.X}<@RubberX && ${Me.Y}<@RubberY) /face fast loc ${Math.Calc[@RubberY-@Param3]},@RubberX 
   /look -90 
   /if (${Me.X}>@RubberX && ${Me.Y}<@RubberY) /face fast loc @RubberY,${Math.Calc[@RubberX+@Param5]} 
   /look -90 
   /if (${Me.X}>@RubberX && ${Me.Y}>@RubberY) /face fast loc ${Math.Calc[@RubberY+@Param2]},@RubberX 
   /look -90 
   /if (${Target.Distance}>200) /keypress esc

   | Do stuff if not in a holding phase. 
   /if (@StopMe==0) { 
      /doevents 
      /if (!${Me.Casting.ID}) { 
         /varset CurSong @PrevSong 
         /call Event_Timer 
      } 
      | If a GM zones in, shut down for 30 minutes. 
      /if (${Spawn[gm].ID}) { 
         /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 (@ProximityTimer<100) { 
         | If an ungrouped PC comes within specified range, shut down until they leave. 
         /if (${Spawn[pc noalert 1 radius @Param7].ID}) { 
            /echo ${Spawn[pc noalert 1 radius @Param7].CleanName} is inside @Param7 ft., going into standby at ${Time.Time12}. 
            /g ${Spawn[pc noalert 1 radius @Param7].CleanName} is inside @Param7 ft., going into standby at ${Time.Time12}. 
            /stopsong 
            /varset StopMe 2 
            /varset StopTimer 200 
         } 
         /varadd ProximityTimer 1m 
      } 

      | Get a new target if the current one is no good. 
      /if (!${Target.ID}) /call GetTarget 
      /if (${Target.Name.Find[corpse]}) /call GetTarget 
      /if (${Target.Type.Equal[PC]}) /call GetTarget 
   } 

   | Quit the ChantLoop and go into a holding phase if criteria are met. 
   /if (@StopTimer<10 && @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 
   /keypress back 
   /alt activate 212    

   | If a GM is in zone, set a timer for 30 minutes. 
   /if (@StopMe==1) { 
      /varset StopTimer 18000 
   } 
   | If someone came within specified range, set a timer for 5 minutes. 
   /if (@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 (@StopMe==1) { 
      /if (@StopTimer==0) { 
         /echo It's been 30 minutes since a GM was sighted, resuming chant-kiting at ${Time.Time12}. 
         /g It's been 30 minutes since a GM was sighted, resuming chant-kiting at ${Time.Time12}. 
         /varset StopMe 0 
         /keypress autorun 
         /goto :ChantLoop 
      } 
   } 
   /if (@StopMe==2) { 
      /if (@StopTimer>0 && ${Me.CurrentMana}>1000) { 
         /if (!${Spawn[pc noalert 1 radius @Param7].ID}) { 
            /echo No PCs within @Param7 ft., resuming chant-kiting at ${Time.Time12}. 
            /g No PCs within @Param7 ft., resuming chant-kiting at ${Time.Time12}. 
            /varset StopMe 0 
            /keypress autorun 
            /goto :ChantLoop 
         } else { 
            /varset StopTimer 1m 
         } 
      } 
   } 
   /goto :StopLoop 
/return 

Sub Event_Chat(ChatType,Sender,ChatText) 
   /declare MyMob local 
   /varset MyMob $target(id) 
   /if (${String[@ChatText].Lower.Equal[group me]}) { 
      /target range 1 22000 @Sender 
      /if (${Group}<6) { 
         /tell @Sender I'm kiting at ${Me.Y}, ${Me.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 
      } 
   } 
   /if (${String[@ChatText].Lower.Equal[status report]}) { 
      /tell @Sender TARGET: ${Target.CleanName} (${Target.PctHPs}%) SELF: ${Me.Name} (${Me.PctHPs}%) EXP: ${Me.Level} (${Me.PctExp}%) AAXP: ${Me.AAPoints} (${Me.PctAAExp}%) 
   } 
    
   /target npc range 1 200 id @MyMob 
/return 

Sub Event_Timer(TimerName) 
      /delay 2 
      /stopsong 
      /cast @Songs(@CurSong) 
      /varset PrevSong @CurSong 
      /varset SongTimer 31 
      /varadd CurSong 1 
      /if (@CurSong>@nSongs) /varset CurSong 1 
/return 

Sub GetTarget 
   /if (${Spawn[npc radius 200].ID}) /target npc radius 200 
   /if (${Target.Level}<7) /keypress esc 
   /if (${Target.Distance}>200) /keypress esc 
/return 

Sub Event_Zoned 
   /sit 
   /camp desktop 
   /endmacro 
/return 

Sub Event_StatusReport 
   /declare LoopCounter local 
   /declare GroupMembers local 
   /varset GroupMembers "" 

   /for LoopCounter 0 to ${Math.Calc[${Group}-1]} 
   /varcat GroupMembers ${Group[@LoopCounter].Name} 
   /varcat GroupMembers " " 
   /next LoopCounter 

      /echo TARGET: ${Target.CleanName} (${Target.PctHPs}%) 
   /echo SELF: ${Me.Name} (${Me.PctHPs}%) 
   /echo EXP: ${Me.Level} (${Me.PctExp}%) 
   /echo AAXP: ${Me.AAPoints} (${Me.PctAAExp}%) 
   /echo GROUP: @GroupMembers 
   /echo RUNTIME: ${Math.Calc[${Macro.RunTime}/60]} 
/return 

Sub Event_GainExp 
   /varset CurrentExp ${Math.Calc[${Me.PctExp}-@CurrentExp]} 
   /varset CurrentAAXP ${Math.Calc[${Me.PctAAExp}-@CurrentAAXP]} 
   /varset CurrentTime ${Math.Calc[${Math.Calc[${Macro.RunTime}/60]}-@CurrentTime]} 

   /echo EXP: ${Me.PctExp}% (@CurrentExp%) AAXP: ${Me.PctAAExp}% (@CurrentAAXP%) TIME: ${Math.Calc[${Macro.RunTime}/60]} (@CurrentTime) 

   /varset CurrentExp ${Me.PctExp} 
   /varset CurrentAAXP ${Me.PctAAExp} 
   /varset CurrentTime ${Math.Calc[${Macro.RunTime}/60]}
   /Popup I am at : ${Me.PctExp}    You Gained : @CurrentExp 
/return 
and the much prefered circle.mac

Code: Select all

#turbo 
#chat tell 

#event Zoned "You have entered" 
#event StatusReport "status report" 
#event GainExp "You gain" 

Sub Main 
   /zapvars 

   | These variables are related to movement and AI control. 
   /declare RubberX global 
   /declare RubberY global 
   /declare CirX global 
   /declare CirY global 
   /declare CirR global 
   /declare StopMe global 
   /declare StopTimer timer 
   /declare ProximityTimer timer 
   /varset RubberX @Param1 
   /varset RubberY @Param0 
   /varset CirX @Param0 
   /varset CirY @Param1 
   /varset CirR @Param2 
   /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 

   | Experience & Time Variables 
   /declare CurrentExp global 
   /declare CurrentAAXP global 
   /declare CurrentTime global 
   /varset CurrentExp ${Me.PctExp} 
   /varset CurrentAAXP ${Me.PctAAExp} 
   /varset CurrentTime ${Math.Calc[${Macro.RunTime}/60]} 

   | This block of code checks for proper arguments and echos error or initialization messages. 
   /if (!${Defined[Param4]}) { 
      /echo Usage: /mac circle <Y> <X> <Radius> <Song list> <TooClose> 
      /echo <Y>         -- Y-coordinate of the center point. 
      /echo <X>         -- X-coordinate of the center point. 
      /echo <Radius>    -- Radius from center point to kite. 
      /echo <Song list> -- List of songs to be sung, include Selo's if needed. 
      /echo <TooClose   -- Distance at which non-friendly players halt kiting. 
      /endmacro 
   } 



   | This block of code sorts out the list of songs to be twisted while running. 
   /varset nSongs ${String[@Param3].Length} 
   /for EachSong 1 to @nSongs 
      /varset Songs(@EachSong) ${String[@Param3].Mid[${Math.Calc[@EachSong]},1]} 
      /echo Song @EachSong: ${Me.Gem[@Songs(@EachSong)]} 
   /next EachSong 
   /varset CurSong 1 
   /call Event_Timer 
   /echo Running a Circle with center at @RubberY, @RubberX and chant-kiting mobs. 



   | The main loop, this iterates unless some AI warning is reached. 
   /keypress autorun 
   :ChantLoop 
   | Maintain distance from centerpoint, given character's current position. 
   /if (${Math.Distance[@CirX,@CirY]}<${Math.Calc[@CirR/2]}) { 
      /face heading ${Math.Calc[${Heading[@CirX,@CirY].DegreesCCW}+180]} 
   } else { 
      /face heading 

${Math.Calc[${Heading[@CirX,@CirY].DegreesCCW}+${Math.Calc[90*${Math.Calc[@CirR/${Math.Distance[@

CirX,@CirY]}]}]}]} 
   } 

   | Do stuff if not in a holding phase. 
   /if (@StopMe==0) { 
      /doevents 
      /if (!${Me.Casting.ID}) { 
         /varset CurSong @PrevSong 
         /call Event_Timer 
      } 
      | If a GM zones in, shut down for 30 minutes. 
      /if (${Spawn[gm].ID}) { 
         /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 (@ProximityTimer<100) { 
         | If an ungrouped PC comes within specified range, shut down until they leave. 
         /if (${Spawn[pc noalert 1 radius @Param4].ID}) { 
            /echo ${Spawn[pc noalert 1 radius @Param4].CleanName} is inside @Param4 ft., going 

into standby at ${Time.Time12}. 
            /g ${Spawn[pc noalert 1 radius @Param4].CleanName} is inside @Param4 ft., going into 

standby at ${Time.Time12}. 
            /stopsong 
            /varset StopMe 2 
            /varset StopTimer 200 
         } 
         /varadd ProximityTimer 1m 
      } 

      | Get a new target if the current one is no good. 
      /if (!${Target.ID}) /call GetTarget 
      /if (${Target.Name.Find[corpse]}) /call GetTarget 
      /if (${Target.Type.Equal[PC]}) /call GetTarget 
   } 

   | Quit the ChantLoop and go into a holding phase if criteria are met. 
   /if (@StopTimer<10 && @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 
   /keypress back 
   /alt activate 212    

   | If a GM is in zone, set a timer for 30 minutes. 
   /if (@StopMe==1) { 
      /varset StopTimer 18000 
   } 
   | If someone came within specified range, set a timer for 5 minutes. 
   /if (@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 (@StopMe==1) { 
      /if (@StopTimer==0) { 
         /echo It's been 30 minutes since a GM was sighted, resuming chant-kiting at 

${Time.Time12}. 
         /g It's been 30 minutes since a GM was sighted, resuming chant-kiting at ${Time.Time12}. 
         /varset StopMe 0 
         /keypress autorun 
         /goto :ChantLoop 
      } 
   } 
   /if (@StopMe==2) { 
      /if (@StopTimer>0 && ${Me.CurrentMana}>1000) { 
         /if (!${Spawn[pc noalert 1 radius @Param4].ID}) { 
            /echo No PCs within @Param4 ft., resuming chant-kiting at ${Time.Time12}. 
            /g No PCs within @Param4 ft., resuming chant-kiting at ${Time.Time12}. 
            /varset StopMe 0 
            /keypress autorun 
            /goto :ChantLoop 
         } else { 
            /varset StopTimer 1m 
         } 
      } 
   } 
   /goto :StopLoop 
/return 

Sub Event_Chat(ChatType,Sender,ChatText) 
   /declare MyMob local 
   /varset MyMob $target(id) 
   /if (${String[@ChatText].Lower.Equal[group me]}) { 
      /target range 1 22000 @Sender 
      /if (${Group}<6) { 
         /tell @Sender I'm kiting at ${Me.Y}, ${Me.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 
      } 
   } 
   /if (${String[@ChatText].Lower.Equal[status report]}) { 
      /tell @Sender TARGET: ${Target.CleanName} (${Target.PctHPs}%) SELF: ${Me.Name} 

(${Me.PctHPs}%) EXP: ${Me.Level} (${Me.PctExp}%) AAXP: ${Me.AAPoints} (${Me.PctAAExp}%) 
   } 
    
   /target npc range 1 200 id @MyMob 
/return 

Sub Event_Timer(TimerName) 
      /delay 2 
      /alt activate 199 
      /stopsong 
      /cast @Songs(@CurSong) 
      /varset PrevSong @CurSong 
      /varset SongTimer 31 
      /varadd CurSong 1 
      /if (@CurSong>@nSongs) /varset CurSong 1 
/return 

Sub GetTarget 
   /if (${Spawn[npc radius 200].ID}) /target npc radius 200 
   /if (${Target.Level}<7) /keypress esc 
   /if (${Target.Distance}>200) /keypress esc 
/return 

Sub Event_Zoned 
   /sit 
   /camp desktop 
   /endmacro 
/return 

Sub Event_StatusReport 
   /declare LoopCounter local 
   /declare GroupMembers local 
   /varset GroupMembers "" 

   /for LoopCounter 0 to ${Math.Calc[${Group}-1]} 
   /varcat GroupMembers ${Group[@LoopCounter].Name} 
   /varcat GroupMembers " " 
   /next LoopCounter 

      /echo TARGET: ${Target.CleanName} (${Target.PctHPs}%) 
   /echo SELF: ${Me.Name} (${Me.PctHPs}%) 
   /echo EXP: ${Me.Level} (${Me.PctExp}%) 
   /echo AAXP: ${Me.AAPoints} (${Me.PctAAExp}%) 
   /echo GROUP: @GroupMembers 
   /echo RUNTIME: ${Math.Calc[${Macro.RunTime}/60]} 
/return 

Sub Event_GainExp 
   /varset CurrentExp ${Math.Calc[${Me.PctExp}-@CurrentExp]} 
   /varset CurrentAAXP ${Math.Calc[${Me.PctAAExp}-@CurrentAAXP]} 
   /varset CurrentTime ${Math.Calc[${Math.Calc[${Macro.RunTime}/60]}-@CurrentTime]} 

   /echo EXP: ${Me.PctExp}% (@CurrentExp%) AAXP: ${Me.PctAAExp}% (@CurrentAAXP%) TIME: 

${Math.Calc[${Macro.RunTime}/60]} (@CurrentTime) 

   /varset CurrentExp ${Me.PctExp} 
   /varset CurrentAAXP ${Me.PctAAExp} 
   /varset CurrentTime ${Math.Calc[${Macro.RunTime}/60]}
   /popup I am at : ${Me.PctExp}   You Gained : @CurrentExp 
/return 
Enjoy..! Happy Leveling.

gehenna
orc pawn
orc pawn
Posts: 17
Joined: Fri Apr 16, 2004 10:03 pm

Post by gehenna » Sat Jun 12, 2004 2:58 am

Is this macro not working with the new mq version? thanks

P.s. I am a retard and incapable of understanding the diff between $param and Param so I am not sure if this is broken

Pwn me now plz (but tell me if it's working) :D