Twisting Macro thanks to Arian

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

Iceassassin
a lesser mummy
a lesser mummy
Posts: 49
Joined: Tue Nov 05, 2002 11:40 am

Twisting Macro thanks to Arian

Post by Iceassassin » Thu Jan 30, 2003 4:23 pm

I can't find out what is wrong. All it says is it cannot find :Mainloop

:twisted:
---------------------------

| - Twist.mac -
| - By Ariain ariain@earthlink.net -
| Twisting with no delays so it can be run in other macros such as a hunting macro.
| If you have an requests please email me.


#define SONG1 t1
#define SONG2 t2
#define SONG3 t3
#define SONG4 t4

#event MissedNote "You miss a note, bringing your song to a close!"
#event Stunned "You are unstunned."

Sub Main
/call sing1
:Mainloop
/doevents
/goto :Mainloop


Sub Sing1
:1
/varset v0 1
/stop song
/delay 2
/cast 5
/varset SONG1 50s
/varset SONG2 31
/goto :Mainloop



Sub Sing2
:2
/varset v0 2
/stop song
/delay 2
/cast 4
|/click left hotkey 6
|/click left hotkey 8
|/click left hotkey 9
|/click left hotkey 7
/varset SONG2 50s
/varset SONG3 31
/goto :Mainloop


Sub Sing3
:3
/varset v0 3
/stop song
/delay 2
/cast 2
|/click left hotkey 7
|/click left hotkey 9
|/click left hotkey 8
|/click left hotkey 6
/varset SONG3 50s
/varset SONG4 31
/goto :Mainloop


Sub Sing4
:4
/varset v0 4
/stop song
/delay 2
/cast 1
/varset SONG4 50s
/varset SONG1 31
/goto :Mainloop


Sub Event_Timer

/if n $SONG1==0 /call Sing1
/if n $SONG2==0 /call Sing2
/if n $SONG3==0 /call Sing3
/if n $SONG4==0 /call Sing4
/doevents
/goto :Mainloop

Sub Event_Missednote
/varset SONG1 50s
/varset SONG2 50s
/varset SONG3 50s
/varset SONG4 50s
/goto :$v0


Sub Event_Stunned
/varset SONG1 50s
/varset SONG2 50s
/varset SONG3 50s
/varset SONG4 50s
/goto :$v0

Ariain
a ghoul
a ghoul
Posts: 88
Joined: Fri Oct 11, 2002 10:35 am

...

Post by Ariain » Fri Jan 31, 2003 2:32 am

Havent run this in forever but just looking at it I do not know why you would get that error.

insanitywiz
a hill giant
a hill giant
Posts: 250
Joined: Mon Jul 08, 2002 7:50 am

Post by insanitywiz » Fri Jan 31, 2003 6:42 am

Should do everything you need it to do. I use it for my bard bot, and you can of course edit out the parts you don't need. Can't see why you would be getting a can't find mainloop in the one you were using.

Code: Select all

| - Twist.mac - 
| twists the song #'s passed through params, (example: /macro twist 1 2 4 will twist songs 1 2 and 4). | Accepts up to 3 songs.

#Event Loading "LOADING, PLEASE WAIT..." 
#Event Slainby "You have been slain by a" 
#event MissedNote "You miss a note, bringing your song to a close!" 
#Event Invited "To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel"



Sub Main 
   /assist off

   /stopsong 
   /delay 3

   :Sing 

| Song 1 
   /if n $char(hp,pct)<=50 /1 remedy me
   /varset v0 $p0 
|   /echo Playing song #$p0 
   /cast $p0 
   /delay 3
   /doevents 
   /delay 30
   /stop 
   /delay 3

| Song 2 
   /if n $char(hp,pct)<=50 /1 remedy me
   /if "$p1"=="" /goto :Sing 
   /varset v0 $p1 
|   /echo Playing song #$p1 
   /cast $p1 
   /delay 3
   /doevents 
   /delay 30
   /stop 
   /delay 3

| Song 3 
   /if n $char(hp,pct)<=50 /1 remedy me
   /if "$p2"=="" /goto :Sing 
   /varset v0 $p2 
|   /echo Playing song #$p2 
   /cast $p2 
   /delay 5
   /doevents 
   /delay 30
   /stop 
   /delay 3 

   /goto :Sing 

/return 

Sub Event_MissedNote 
   /cast $v0 
   /delay 4 
   /doevents 
/return

Sub Event_Loading 
   /endmacro 
/return 

Sub Event_Slainby 
   /endmacro 
/return 

Sub Event_Invited 
   /delay 20 
   /invite
/return