Bard Twist2

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

Moderator: MacroQuest Developers

xviisualx
orc pawn
orc pawn
Posts: 22
Joined: Mon Nov 18, 2002 3:08 pm
Contact:

Post by xviisualx » Sat Dec 13, 2003 1:14 am

This is prolly my favorite twist I use. I added in code to twist in Voice of the Serpant wich gives a .mod to singing so if you have one of thsoe you might wanna use this version

Code: Select all

| Twist2.mac  Flexible bard song twister using timers by BrainDozer. 
| Updated by Drax. 
| 
|   Syntax:  /macro Twist2.mac [block 1] [block 2] 
| 
|     Parameter block 1 indicates non-combat songs 
|     Parameter block 2 indicates combat songs 
| 
|   Choose any combination of songs in any sequance to twist for each mode. 
| 
|     Example:  /macro Twist2.mac 256 1234234 
| 
|   This would repeat songs 2, 5 and 6 durring non-combat and songs 1, 2, 3 
|   and 4 in the above sequence while in combat.  In this instance, song 1 
|   is only twisted 1 for 7, which comes in handy for long duration songs 
|   like amplification. 
| 
|     Other Examples: /macro Twist2.mac 0 123      | Twists on attack only 
|                     /macro Twist2.mac 12345 0    | non-attack twisting only 
|                     /macro Twist2.mac 12345      | same as above 
|                     /macro Twist2.mac 9804 11    | twists 84 and 1 
| 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
#turbo 10 
#event MissedNote "You miss a note, bringing your song to a close!" 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub Main 
/zapvars 
/declare CSong  global   | keeps track of current song number 1-max 
/declare CSongf global   | break and play song toggle (break=0 play=1) 
/declare attack global    | debug: @combat glitch work-around 
/declare CSongt timer    | break and play song timer 
/declare attackct timer  | debug: @combat glitch work-around check timer 
/declare v90 global 
/declare v91 global 
/declare l0 global 
/declare l1 global 
/declare l2 global 
/declare l3 global 
/declare a array2 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
  /stopsong 
  /call initVars @Param0 @Param1 
  :Mainloop 
     /if $char(buff,"resonance")<=0 /if $combat==FALSE /call TwistSong VOS
     /if @attackct==0 /if $combat==TRUE /if @attack==0 /call AttackOn 
     /if @attackct==0 /if $combat==FALSE /if @attack==1 /call AttackOff 
     /if @attackct==0 /varset attackct 10     | adjustable attack check delay 
                                                           | Debug: work-around 
     /if n @v9@attack!=-1 /if $char(state)==STAND /call TwistSong @attack 
     /doevents 
  /goto :Mainloop 
/return 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub TwistSong 
   /if @CSong>@v9@Param0 /varset CSong 0               | Restart twist when end of list 
   /if (@Param0==VOS && @CSongt==0) /call VOS
   /if (@CSongf==0 && @CSongt==0) /call TS2 @Param0    | Start next song in list 
   /if (@CSongf==1 && @CSongt==0) /call TS3        | Stop song and advance index 
/return                          | Debug: conditionals wern't playing nice with brackets 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub VOS
    /cast item "Voice of the Serpent"
    /varset CSongt 35
/return
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub TS2 
   /cast @a(@Param0,@CSong) 
   /varset CSongf 1 
   /varset CSongt 35                     | adjustable play delay 
/return 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub TS3 
   /stopsong 
   /varset CSong $int($calc(@CSong+1))   | Debug: Force integer 
   /varset CSongf 0 
   /varset CSongt 1                      | adjustable break delay 
/return 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub initVars 
  /if @Param1=="" /varset Param1 "0" 
  /varset v90 0                                  | v90,v91 max song index lengths 
  /varset v91 0                                  | l0 combat mode index 
  /for l0 0 to 1                                 | l1 parameter index 
      /for l1 0 to $int($calc($strlen(@Param@l0)-1)) | l2 hold 
        /varset l2 $mid(@l1,1,@Param@l0) 
   /varset l3 @v9@l0              | Debug: array didn't like the fancy stuff 
        /if (@l2>=1 && @l2<=8) /varset a(@l0,@l3) @l2  | Debug: Bracket trouble 
   /if (@l2>=1 && @l2<=8) /varset v9@l0 $int($calc(@v9@l0+1)) 
     /next l1                            | Debug: it thinks it's a float-forcing 
  /next l0  
  /varset v90 $int($calc(@v90-1))   | over increment fix 
  /varset v91 $int($calc(@v91-1))   | 
  /varset CSong 0 
  /varset CSongt 0 
  /varset CSongf 0 
  /if $combat==TRUE /varset attack 1    | debug: inital combat values 
  /if $combat==FALSE /varset attack 0   | 
/return 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub AttackOn 
   /stopsong 
   /varset attack 1 
   /varset CSong 0               | reset sequence 
   /varset CSongt 0              | attack mode twist start delay 
   /varset CSongf 0              | force play mode 
/return 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub AttackOff 
   /stopsong 
   /varset attack 0 
   /varset CSong 0               | reset sequence 
   /varset CSongt 0              | attack off mode twist start delay 
   /varset CSongf 0              | force play mode 
/return 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub Event_MissedNote 
   /varset CSongt 0              | missed note try again delay 
   /varset CSongf 0              | switch back to play mode 
/return 
Hoodallali!

User avatar
wilso132
Contributing Member
Contributing Member
Posts: 106
Joined: Thu Oct 17, 2002 11:53 am

Auto-assist

Post by wilso132 » Thu Dec 25, 2003 1:29 am

EDIT: DON'T USE THIS CODE! USE THE CODE ON THE MAIN PAGE!


Edit: Revised to work smoothly now, no more annoying parsing error.

Me and my friends have a bard at our disposal we'd like to use to slow the mob and haste the group, but not actually go up and attack (seeing as how it's 2 beasts and a shammy... he'd grab aggro). So I modified the code to send it the person you want to assist. This way he knows to slow a mob once it gets under 95%. If you leave the field blank, it also works like normal Twist2... which helps me use the same macro for 2 different purposes (either bot'ing or playing). Sorry if the code is sloppy... never claimed to be an expert.

Usage:
/macro Twist2 [non-combat songs] [combat songs] [person to assist]
e.g. /macro Twist2 123 456 wilso132

Code: Select all

| Twist2.mac  Flexible bard song twister using timers by BrainDozer. 
| Updated by Drax. 
| Assist feature added by wilso132.
| 
|   Syntax:  /macro Twist2.mac [block 1] [block 2] [block 3] 
| 
|     Parameter block 1 indicates non-combat songs 
|     Parameter block 2 indicates combat songs 
|     Parameter block 3 indicates target to assist
| 
|   Choose any combination of songs in any sequence to twist for each mode. 
| 
|     Example:  /macro Twist2.mac 256 1234234 wilso132
| 
|   This would repeat songs 2, 5 and 6 durring non-combat and songs 1, 2, 3 
|   and 4 in the above sequence while in combat.  In this instance, song 1 
|   is only twisted 1 for 7, which comes in handy for long duration songs 
|   like amplification. 
| 
|     Other Examples: /macro Twist2.mac 0 123      | Twists on attack only 
|                     /macro Twist2.mac 12345 0    | non-attack twisting only 
|                     /macro Twist2.mac 12345      | same as above 
|                     /macro Twist2.mac 9804 11    | twists 84 and 1 
|          /macro Twist2.mac 9804 11 wilso132 | same as above but assists “wilso132”
| 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
#turbo 10 
#event MissedNote "You miss a note, bringing your song to a close!" 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub Main 
/zapvars 
/declare CSong  global   | keeps track of current song number 1-max 
/declare CSongf global   | break and play song toggle (break=0 play=1) 
/declare attack global   | debug: @combat glitch work-around 
/declare CSongt timer    | break and play song timer 
/declare attackct timer  | debug: @combat glitch work-around check timer 
/declare v90 global 
/declare v91 global 
/declare l0 global 
/declare l1 global 
/declare l2 global 
/declare l3 global 
/declare a array2 
/declare person_to_assist global
/declare need_to_assist global
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
  /stopsong 
  /if @Param2~~"Param2" {
    /varset need_to_assist 0
    /echo Not assisting anyone, just twisting.
    } else {
    /varset person_to_assist @Param2
    /echo You will now be assisting @person_to_assist
   /varset need_to_assist 1 }

   /call initVars @Param0 @Param1
  
  :Mainloop 
     
     /if @need_to_assist==1 /if $target(type)=="NPC" /assist @person_to_assist
            /if n $target(hp,pct)<=95 /if n $target(distance)<100 { 
          /attack on}
     } else {
       /attack off
     }
     /if @attackct==0 /if $combat==TRUE /if @attack==0 /call AttackOn 
     /if @attackct==0 /if $combat==FALSE /if @attack==1 /call AttackOff 
     /if @attackct==0 /varset attackct 10     | adjustable attack check delay 
                                                           | Debug: work-around 
     /if n @v9@attack!=-1 /if $char(state)==STAND /call TwistSong @attack 
     /doevents 
  /goto :Mainloop 
/return 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub TwistSong 
   /if @CSong>@v9@Param0 /varset CSong 0               | Restart twist when end of list 
   /if (@CSongf==0 && @CSongt==0) /call TS2 @Param0    | Start next song in list 
   /if (@CSongf==1 && @CSongt==0) /call TS3        | Stop song and advance index 
/return                          | Debug: conditionals wern't playing nice with brackets 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub TS2 
   /cast @a(@Param0,@CSong) 
   /varset CSongf 1 
   /varset CSongt 35                     | adjustable play delay 
/return 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub TS3 
   /stopsong 
   /varset CSong $int($calc(@CSong+1))   | Debug: Force integer 
   /varset CSongf 0 
   /varset CSongt 1                      | adjustable break delay 
/return 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub initVars 
  /if @Param1=="" /varset Param1 "0" 
  /varset v90 0                                  | v90,v91 max song index lengths 
  /varset v91 0                                  | l0 combat mode index 
  /for l0 0 to 1                                 | l1 parameter index 
      /for l1 0 to $int($calc($strlen(@Param@l0)-1)) | l2 hold 
        /varset l2 $mid(@l1,1,@Param@l0) 
   /varset l3 @v9@l0              | Debug: array didn't like the fancy stuff 
        /if (@l2>=1 && @l2<=8) /varset a(@l0,@l3) @l2  | Debug: Bracket trouble 
   /if (@l2>=1 && @l2<=8) /varset v9@l0 $int($calc(@v9@l0+1)) 
     /next l1                            | Debug: it thinks it's a float-forcing 
  /next l0  
  /varset v90 $int($calc(@v90-1))   | over increment fix 
  /varset v91 $int($calc(@v91-1))   | 
  /varset CSong 0 
  /varset CSongt 0 
  /varset CSongf 0 
  /if $combat==TRUE /varset attack 1    | debug: inital combat values 
  /if $combat==FALSE /varset attack 0   | 
/return 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub AttackOn 
   /stopsong 
   /varset attack 1 
   /varset CSong 0               | reset sequence 
   /varset CSongt 0              | attack mode twist start delay 
   /varset CSongf 0              | force play mode 
/return 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub AttackOff 
   /stopsong 
   /varset attack 0 
   /varset CSong 0               | reset sequence 
   /varset CSongt 0              | attack off mode twist start delay 
   /varset CSongf 0              | force play mode 
/return 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub Event_MissedNote 
   /varset CSongt 0              | missed note try again delay 
   /varset CSongf 0              | switch back to play mode 
/return 
Last edited by wilso132 on Tue Jan 13, 2004 1:21 am, edited 1 time in total.

blamstick
orc pawn
orc pawn
Posts: 27
Joined: Sat Sep 06, 2003 6:50 pm

Post by blamstick » Sat Dec 27, 2003 6:32 pm

need to remove the emotes from the code hehe

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Thu Jan 08, 2004 8:37 am

can anyone please post the the two lines without emotes i cant remove them for some reason.
thank you

Done it, no need to reply

TheAFKBard
a ghoul
a ghoul
Posts: 133
Joined: Tue Dec 30, 2003 9:48 pm

Post by TheAFKBard » Thu Jan 08, 2004 4:20 pm

change all 8) to 8 followed by ). I think there's just 2 of them. That's how it works for me, anyway.

El
a ghoul
a ghoul
Posts: 108
Joined: Mon Dec 29, 2003 12:34 pm

Post by El » Mon Jan 12, 2004 12:23 pm

I tried wilso123's update, and had problems getting out of attack mode.

Usage: /macro twist2 45656 123

Where 4=Amp, 5=Manasong, 6=Hymn, 1=CoB, 2=Slow/Snare, 3=Psalm.

I would start it out, and the macro would immediately put me into attack mode and start twisting the attack songs. Hitting 'Q' to get out of attack would work for a second, but the macro would put me back into it again.

I tried this both with and without a target. I also added in the assist block in the call, but that seemed to make no difference, either.

Am I using it wrong?

Ghecko
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon Nov 17, 2003 9:28 pm

Post by Ghecko » Mon Jan 12, 2004 2:00 pm

El,


I had the same difficulty you mentioned. I commented out the code that dealt with assisting and all is fine now. I have not had a chance to check things line by line to understand why that fixed the trouble.

User avatar
wilso132
Contributing Member
Contributing Member
Posts: 106
Joined: Thu Oct 17, 2002 11:53 am

Post by wilso132 » Mon Jan 12, 2004 6:33 pm

Yea sorry guys, don't use that code of mine.

It worked fine the night I tested it, then somehow between tweaking and posting here it messed up. I haven't had the time to fix it to be honest, mostly because I haven't even had time to play my bard.

User avatar
Bad Karma
a snow griffon
a snow griffon
Posts: 346
Joined: Sat Nov 22, 2003 9:34 pm
Contact:

Post by Bad Karma » Mon Jan 12, 2004 10:52 pm

When posting code, make sure you turn Smilies off in your post.
[b]- Bad Karma
________________________________________[/b]

In our own quest for excellence, we should strive to take the time to help those who help themselves.

All others should [b]RTFM[/b]!!!!!!!!!