Page 1 of 8

Twist.mac - Non Combat/Combat Bard Song Twister

Posted: Thu Apr 29, 2004 7:06 pm
by ml2517
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 < >

good work

Posted: Thu Apr 29, 2004 7:13 pm
by utrero
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

Posted: Thu Apr 29, 2004 8:10 pm
by Walter Melon
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?

Posted: Thu Apr 29, 2004 8:16 pm
by Batman
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"

Posted: Thu Apr 29, 2004 8:26 pm
by ml2517
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?

Posted: Thu Apr 29, 2004 8:27 pm
by Batman
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

Posted: Thu Apr 29, 2004 8:29 pm
by ml2517
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?

Posted: Thu Apr 29, 2004 8:31 pm
by Batman
Should be using latest version. Going to download and recompile and try again.

Posted: Thu Apr 29, 2004 8:46 pm
by Batman

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

kk

Posted: Thu Apr 29, 2004 8:50 pm
by Huggles
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

Posted: Thu Apr 29, 2004 8:56 pm
by ml2517
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.

Posted: Thu Apr 29, 2004 9:00 pm
by Batman
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!

Posted: Thu Apr 29, 2004 9:03 pm
by ml2517
Hehhe.. that is what I figured was happening from your first post. No biggy it happens.

Posted: Thu Apr 29, 2004 11:37 pm
by p00pey
/macro twist 1

redtext >------ twist.mac

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

Posted: Thu Apr 29, 2004 11:49 pm
by ml2517
Haha.

/macro twist.mac 11111

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