playlist.mac - song twisting - MQ2Data compliant

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

playlist.mac - song twisting - MQ2Data compliant

Post by Guest » Fri Apr 23, 2004 2:42 am

Comments welcome.

Code: Select all

| playlist.mac -  by IceIsFun
| Version 1.0 2004-04-23 3:00am EST
| Adapted from stwist.mac (SimpleTwist) by Raebis
| usage: /mac playlist <Songs> 
| 
| This example will twist the songs in gems 2, 3, 4, 5, 3, 4, and then 5...in that order: 
| /mac stwist 2345345 
| 

#turbo 

Sub Main(SongBlock)
   /zapvars 
   /declare SongTimer timer 
   /declare Songs array 
   /declare CurSong global 
   /declare PrevSong global 
   /declare nSongs global 
   /declare EachSong local 

   /varset nSongs ${String[@SongBlock].Length}
   /for EachSong 1 to @nSongs 
      /varset Songs(@EachSong) ${String[@SongBlock].Mid[@EachSong,1]} 
      /echo Song @EachSong: ${Me.Gem[@Songs(@EachSong)].Name} 
   /next EachSong 
   /echo Found @nSongs in the playlist.

   /varset CurSong 1 

   /call Event_Timer 
   :Loop 
   /doevents 
   /if (!${Window[CastingWindow].Open}) { 
      /varset CurSong @PrevSong 
      /call Event_Timer 
   } 
   /goto :Loop 
/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
Last edited by Guest on Fri Apr 23, 2004 7:47 am, edited 1 time in total.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Fri Apr 23, 2004 6:51 am

Any reason you are trying to subtract 0 from @EachSong? That does nothing.

/varset Songs(@EachSong) ${String[@SongBlock].Mid[${Math.Calc[@EachSong-0]},1]}

Guest

Post by Guest » Fri Apr 23, 2004 7:46 am

ml2517 wrote:Any reason you are trying to subtract 0 from @EachSong? That does nothing.

/varset Songs(@EachSong) ${String[@SongBlock].Mid[${Math.Calc[@EachSong-0]},1]}
Ah yes, actually that snuck in after some testing. No longer necessary, removing it.

MrSmallie
a hill giant
a hill giant
Posts: 167
Joined: Fri Oct 11, 2002 11:18 am

Post by MrSmallie » Fri Apr 23, 2004 2:10 pm

There is still the issue of weapon procs causing the "casting window" to disappear, isn't there?
Me
[img]http://home.comcast.net/~mrsmallie/ches.JPG[/img]