Twist.mac - Non Combat/Combat Bard Song Twister

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

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

Twist.mac - Non Combat/Combat Bard Song Twister

Post by ml2517 » Thu Apr 29, 2004 7:06 pm

twist.mac

Code: Select all

| - twist.mac -
|
| Modified from Colonel's Macro by ml2517
|
| Modified to current form 5/3/2004
|
|  Combat Twist Order (Optional) --+   <- If you don't feed it a second
|  NonCombat Twist Order -----+    |      spell set it works with just
|                             |    |      one set.
| Usage:                      v    v
|           /macro twist.mac ### [###]
| # represents the spell gem number you'd like to sing
|
| Example:
| /macro twist.mac 4567 123456
| /macro twist.mac 123458


Sub Main(NonCombatGems,CombatGems)
    /if (!${Defined[NonCombatGems]}) /endmacro

|
|  Variable Declarations
|
    /declare CombatCurSong int outer
    /declare NonCombatCurSong int outer
    /declare NNonCombatSongs int outer
    /declare NCombatSongs int outer
    /declare NonCombatSongList string outer
    /declare CombatSongList string outer
    /declare TwistI int outer
    /declare DynamicBuffer int outer
    /declare NonCombatSongArray[30] int outer
    /declare CombatSongArray[30] int outer

|
|  Timer Declarations
|
    /declare SingTime timer outer


    /varset CombatCurSong 1
    /varset NonCombatCurSong 1
    /varset NNonCombatSongs ${Int[${String[${NonCombatGems}].Length}]}
    /if (${Defined[CombatGems]}) /varset NCombatSongs ${Int[${String[${CombatGems}].Length}]}
    /varset NonCombatSongList ${NonCombatGems}
    /if (${Defined[CombatGems]}) /varset CombatSongList ${CombatGems}
    /varset DynamicBuffer 5

    /for TwistI 1 to ${NNonCombatSongs}
        /varset NonCombatSongArray[${TwistI}] ${String["${NonCombatSongList}"].Mid[${TwistI},1]}
    /next TwistI

    /if (${Defined[CombatGems]}) {
        /for TwistI 1 to ${NCombatSongs}
            /varset CombatSongArray[${TwistI}] ${String["${CombatSongList}"].Mid[${TwistI},1]}
        /next TwistI
    }
    :Loop
    /if (${Me.Standing}) {
        /if (${Defined[CombatGems]}) /if (${Me.Combat}) /call CombatSing ${CombatSongArray[${CombatCurSong}]}
        /if ((!${Me.Combat})||(!${Defined[CombatGems]})) /call NonCombatSing ${NonCombatSongArray[${NonCombatCurSong}]}
    }
   /if (${Me.State.Equal["DUCK"]}) /keypress DUCK
   /if (!${Me.Standing}) /stand
   /goto :Loop
/return


Sub CombatSing(Song)
     /declare Buffer int local
     /declare Duration int local
     /varset Duration 0
 
  :CombatSing1
    /call CheckSong ${Song}
    /varset Duration ${Macro.Return}
    /varset SingTime 30
    /varset Buffer 0   
    /cast "${Me.Gem[${Song}]}"
  :CombatSing2
    /delay 1
    /if (${Me.Casting.ID}) {
        /if (${SingTime}<=0) /goto :CombatSingBreak
        /goto :CombatSing2
    }
    :CombatSingBreak
    /if (${SingTime}>0) /goto :CombatSing1
    /if (${Duration}==0) {
        /delay ${DynamicBuffer}
        /stopsong
    } else {
      :CombatSing3
        /varcalc Buffer ${Buffer}+1
        /delay 1
        /if (${Buffer}>8) {
        /stopsong
        /goto :CombatSing1
        }
        /if ((!${Me.Song["${Me.Gem[${Song}]}"].ID})&&(!${Me.Buff["${Me.Gem[${Song}]}"].ID})) /goto :CombatSing3
        /if ((${Me.Song["${Me.Gem[${Song}]}"].Duration}<${Math.Calc[${Duration}-1]})&&(${Me.Buff["${Me.Gem[${Song}]}"].Duration}<${Math.Calc[${Duration}-1]})) /goto :CombatSing3
        /varset DynamicBuffer ${Buffer}
        /stopsong
    }
|    /echo Dynamic Buffer: ${DynamicBuffer}
    /varcalc CombatCurSong ${CombatCurSong}+1
    /if (${CombatCurSong}>${NCombatSongs}) /varset CombatCurSong 1
/return


Sub NonCombatSing(Song)
     /declare Buffer int local
     /declare Duration int local
     /varset Duration 0
 
  :NonCombatSing1
    /call CheckSong ${Song}
    /varset Duration ${Macro.Return}
    /varset SingTime 30
    /varset Buffer 0   
    /cast "${Me.Gem[${Song}]}"
  :NonCombatSing2
    /delay 1
    /if (${Me.Casting.ID}) {
        /if (${SingTime}<=0) /goto :NonCombatSingBreak
        /goto :NonCombatSing2
    }
    :NonCombatSingBreak
    /if (${SingTime}>0) /goto :NonCombatSing1
    /if (${Duration}==0) {
        /delay ${DynamicBuffer}
        /stopsong
    } else {
      :NonCombatSing3
        /varcalc Buffer ${Buffer}+1
        /delay 1
        /if (${Buffer}>8) {
        /stopsong
        /goto :NonCombatSing1
        }
        /if ((!${Me.Song["${Me.Gem[${Song}]}"].ID})&&(!${Me.Buff["${Me.Gem[${Song}]}"].ID})) /goto :NonCombatSing3
        /if ((${Me.Song["${Me.Gem[${Song}]}"].Duration}<${Math.Calc[${Duration}-1]})&&(${Me.Buff["${Me.Gem[${Song}]}"].Duration}<${Math.Calc[${Duration}-1]})) /goto :NonCombatSing3
        /varset DynamicBuffer ${Buffer}
        /stopsong
    }
|    /echo Dynamic Buffer: ${DynamicBuffer}
    /varcalc NonCombatCurSong ${NonCombatCurSong}+1
    /if (${NonCombatCurSong}>${NNonCombatSongs}) /varset NonCombatCurSong 1
/return

Sub CheckSong(GemNumber)
/if (${Me.Gem[${GemNumber}].SpellType.Find["Beneficial"]}) {
    /if (${Me.Gem[${GemNumber}].TargetType.Find["Group"]} || ${Me.Gem[${GemNumber}].TargetType.Find["Self"]} || ${Me.Gem[${GemNumber}].TargetType.Find["PC"]}) {
        /if ((${Me.Gem[${GemNumber}].Name.Equal[Cassindra`s Chant of Clarity]}) || (${Me.Gem[${GemNumber}].Name.Equal[Cassindra's Chorus of Clarity]})) {
            /return 3
        }
        /return ${Me.Gem[${GemNumber}].Duration}
    } else {
        /return 0
    }
} else {
    /return 0
}
/return

edit: dkaa for < >
Last edited by ml2517 on Mon May 03, 2004 6:38 pm, edited 3 times in total.

utrero
orc pawn
orc pawn
Posts: 28
Joined: Tue Apr 20, 2004 11:30 am

good work

Post by utrero » Thu Apr 29, 2004 7:13 pm

like all you do ml nice job :)O hope you can fix old chant with static anchor soon :) ill track your work like ever :P

Walter Melon
decaying skeleton
decaying skeleton
Posts: 2
Joined: Thu Apr 29, 2004 8:06 pm

Post by Walter Melon » Thu Apr 29, 2004 8:10 pm

Is it possible/easy to add a feature for twisting with right clicky instruments? Like war drums of the rathe, the right clicky song, could you make it to use that and save a spell gem somehow?

Batman
orc pawn
orc pawn
Posts: 16
Joined: Fri Feb 06, 2004 1:52 am

Post by Batman » Thu Apr 29, 2004 8:16 pm

Why is it cussing at me when I try to run it? =)

And then it spams:

"You do not seem to have that spell memorized"

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

Post by ml2517 » Thu Apr 29, 2004 8:26 pm

I can probably add something like that in the future but I have other macros to work on before that.

Umm do you have a spell memmed in the slot number you are trying to use?

Batman
orc pawn
orc pawn
Posts: 16
Joined: Fri Feb 06, 2004 1:52 am

Post by Batman » Thu Apr 29, 2004 8:27 pm

LoL Of course.

/mac twist.mac 2341

It says Song1: Null also.

Scrolling up it shows a ton of other errors:

Couldn't parse /zapvars
/declare array failed
/declare nsongs failed
/declare cursongs failed
/varset failed. variable 'a(1)' not found
Last edited by Batman on Thu Apr 29, 2004 8:30 pm, edited 1 time in total.

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

Post by ml2517 » Thu Apr 29, 2004 8:29 pm

No clue what to tell you it works fine for me.

What version of MQ2 are you on?


What songs do you have, and it which slots?

Batman
orc pawn
orc pawn
Posts: 16
Joined: Fri Feb 06, 2004 1:52 am

Post by Batman » Thu Apr 29, 2004 8:31 pm

Should be using latest version. Going to download and recompile and try again.

Batman
orc pawn
orc pawn
Posts: 16
Joined: Fri Feb 06, 2004 1:52 am

Post by Batman » Thu Apr 29, 2004 8:46 pm

Code: Select all

Couldn't parse /zapvars 
/declare array failed 
/declare nsongs failed 
/declare cursongs failed 
/varset failed. variable 'a(1)' not found
Song 1: NULL
Nope, still getting all those errors ><

/mac twist.mac 2341

Marr, Zek, Muse, and PoV is the lineup. I don't get it heh. It's like they don't want me to play EQ anymore =P

Huggles
orc pawn
orc pawn
Posts: 11
Joined: Wed Apr 21, 2004 6:13 pm

kk

Post by Huggles » Thu Apr 29, 2004 8:50 pm

similar things wer ehappening to me, delete your entire old directory, and save any amcros ect you might want re download and to a completly fresh compile should work then

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

Post by ml2517 » Thu Apr 29, 2004 8:56 pm

Hey Batman, get your head out of your ass and save the actual file I have up at the top of this thread over your pre-existing twist.mac.

Show me where I have /zapvars in that macro? That's right, it isn't there.

Batman
orc pawn
orc pawn
Posts: 16
Joined: Fri Feb 06, 2004 1:52 am

Post by Batman » Thu Apr 29, 2004 9:00 pm

Dude I am so SORRY! I was using my old file twist instead of yours that i saved as twist2. Sorry for all the useless threads! It works great! Thanks!

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

Post by ml2517 » Thu Apr 29, 2004 9:03 pm

Hehhe.. that is what I figured was happening from your first post. No biggy it happens.

p00pey
orc pawn
orc pawn
Posts: 15
Joined: Wed Apr 21, 2004 12:39 pm

Post by p00pey » Thu Apr 29, 2004 11:37 pm

/macro twist 1

redtext >------ twist.mac

YOU stupid or something fucker get a brain.
the macro ended

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

Post by ml2517 » Thu Apr 29, 2004 11:49 pm

Haha.

/macro twist.mac 11111

Or something like that. It works. So if it isn't working for you, its user error.