stwist.mac - Simple Twist REV1

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

Moderator: MacroQuest Developers

Raebis
a ghoul
a ghoul
Posts: 81
Joined: Fri Dec 12, 2003 6:23 am

stwist.mac - Simple Twist REV1

Post by Raebis » Wed Jan 14, 2004 1:08 am

This is the simple song twisting macro I wrote and use when traveling (twists levi, selos, sustenance) and when being a mana battery (twists health, mana, whatever)

I wrote this when looking Gabriela's twist macro. So i guess this mac is dedicated to her :wink:

Tested for a bit, works with as many songs as you throw at it.

Code: Select all

| stwist.mac - SimpleTwist by Raebis 
| Version: REV1 Jan 13 18:45 
| 
| usage: /mac stwist <Songs> 
| 
| This example will twist the songs in gems 3, 4, 5, and 6: 
| /mac stwist 3456 
|
| You can also use it to twist a song only once every other twist, i.e.:
| /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 $strlen(@SongBlock) 
   /for EachSong 1 to @nSongs 
      /varset Songs(@EachSong) $mid($calc(@EachSong-1),1,@SongBlock) 
      /echo Song @EachSong: $char(gem,@Songs(@EachSong)) 
   /next EachSong 

   /varset CurSong 1 

   /call Event_Timer 
   :Loop 
   /doevents 
   /if $char(casting)==FALSE { 
      /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 n @CurSong>@nSongs /varset CurSong 1 
/return
Always say what you want to say. Because those who mind, don't matter. And those who matter, don't mind.