Pointers appreciated

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

GeoffreyF67
a lesser mummy
a lesser mummy
Posts: 70
Joined: Tue Nov 04, 2003 6:07 pm

Pointers appreciated

Post by GeoffreyF67 » Wed Apr 21, 2004 6:01 pm

I've got the following macro that was working before today's patch. I've read through the new information on the MQ2Data stuff but, to be honest, I'm confused and not really sure what I need to change in my macro.

Tips and help would be appreciated.

Thanks!

G-Man

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 
/declare Resonance global
/declare Symphony global
/declare Marr global

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
  /stopsong 
  /call initVars @Param0 @Param1 @Param2 @Param3 @Param4
  :Mainloop 
     /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 

     /if @Resonance==1 {
       /if n $char(buff,"Resonance")<1 {
          /cast item "Voice of the Serpent" 
          /delay 4s 
          /varset CSongt 0
        }
      }

     /if @Symphony==1 {
       /if n $char(buff,"Symphony of Battle")<1 {
          /cast item "Songblade of the Eternal" 
          /delay 4s 
          /varset CSongt 0
        }
      }

     /if @Marr==1 {
       /if n $char(song,"Wind of Marr")<1 {
          /cast item "Lute of the Flowing Waters" 
          /delay .1s 
|          /varset CSongt 0
        }
      }

     /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 
  /varset Symphony 0
  /varset Resonance 0
  /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   | 

  /if @Param2=="1" /varset Resonance 1
  /if @Param3=="1" /varset Symphony 1
  /if @Param4=="1" /varset Marr 1
/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 

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Wed Apr 21, 2004 6:02 pm

read up on the new /if
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

GeoffreyF67
a lesser mummy
a lesser mummy
Posts: 70
Joined: Tue Nov 04, 2003 6:07 pm

Post by GeoffreyF67 » Wed Apr 21, 2004 7:04 pm

That helped some...got me a bit farther :) Now when I try to run it, it stops on the first varset below:

Code: Select all

      /for l1 0 to $int($calc($strlen(@Param@l0)-1))
        /varset l2 $mid(@l1,1,@Param@l0) 
        /varset l3 @v9@l0              | Debug: array didn't like the fancy stuff 
Says: Ending macro: /varset a(0,0) $mid(0,1,123)

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Wed Apr 21, 2004 7:06 pm

now read up on mq2data
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

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

Post by ml2517 » Wed Apr 21, 2004 7:30 pm

HAHAHA