twisting/casting songs in a series

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

Moderator: MacroQuest Developers

shuttle
a lesser mummy
a lesser mummy
Posts: 62
Joined: Mon Nov 11, 2002 6:08 am

twisting/casting songs in a series

Post by shuttle » Thu Apr 17, 2003 3:46 pm

I see most of the bard twisting scripts you have to have a fixed # of song parameters. is there a way to have all songs show up as a single parameter?

/macro twist 1 2 3 4

how I would like to see it

/macro twist 123453453452345345345

which would allow us to have any order we wanted and as many songs in a particular order that we wanted... like in the example above slot 1 could be 49 selo's slot 2 could be amp and 345 the combat mix

I have tried to do something like this:

#define Songlist $p0
#Define SongNum v1

/varset $SongNum 1

Sub Main
/delay 3
/stopsong
/delay 3

/if $Songlist=="" /endmacro


:Sing
/if n $int($SongNum) > $strlen ($songList) /varset SongNum 1

/varset v0 mid($SongNum,1,$Songlist)

/cast $v0
/delay 4
/doevents
/delay 27
/stop
/delay 3

/varadd SongNum 1
/goto :Sing
/return

but it seems like I am getting and invalid compare.

any ideas?

shuttle
a lesser mummy
a lesser mummy
Posts: 62
Joined: Mon Nov 11, 2002 6:08 am

almost solved.

Post by shuttle » Fri Apr 18, 2003 2:35 pm

I got most of this to work. here is the snipit from my code. however I am getting a Comparision operator error when this runs and the /if clause never executes.

/varset v1 1

Sub Main
/delay 3
/stopsong
/delay 3

/if $p0=="" /endmacro


:Sing
|debug code
/1 $int($v1)
/1 $strlen($p0)
|end debug code
/if n $int($v1) > $strlen($p0) /varset v1 1

/varset v3 $mid($v1,1,$p0)

/cast $v3
/delay 4
/doevents
/delay 27
/stop
/delay 3

/varadd v1 1
/goto :Sing
/return

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Fri Apr 18, 2003 2:59 pm

Salutations,
No spaces

Code: Select all

:Sing 
|debug code 
/1 $int($v1) 
/1 $strlen($p0) 
|end debug code 
/if n $int($v1)>$strlen($p0) /varset v1 1 

/varset v3 $mid($v1,1,$p0) 

shuttle
a lesser mummy
a lesser mummy
Posts: 62
Joined: Mon Nov 11, 2002 6:08 am

Post by shuttle » Fri Apr 18, 2003 3:35 pm

Thanks,

That worked.

mark0tz
decaying skeleton
decaying skeleton
Posts: 1
Joined: Sat Aug 09, 2003 10:04 pm

Post by mark0tz » Sat Aug 09, 2003 10:07 pm

OK, I really do like this script, however, I am getting an error upon termination:

twist.mac@18 (Main): /varset v3 $mid($v1,1,$p0)



I'm wondering if someone can make this script so that it repeats indefinitely until user executes a command or something.

so, /macro twist 1233233 would repeat
1233233->1233233->1233233 etc...

Thanks!

di28889
a hill giant
a hill giant
Posts: 296
Joined: Sat Jul 12, 2003 11:36 pm

Post by di28889 » Sat Aug 09, 2003 10:51 pm

i think if you add goto :sing it would be an standerd loop
until you hit /endmacro :arrow:

Code: Select all

:Sing 
|debug code 
/1 $int($v1) 
/1 $strlen($p0) 
|end debug code 
/if n $int($v1)>$strlen($p0) /varset v1 1 
/varset v3 $mid($v1,1,$p0)
/goto :Sing