twisting mac

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

Moderator: MacroQuest Developers

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

Post by ml2517 » Tue Apr 20, 2004 10:00 pm

Tested and fixed:

Also fixed a problem dealing with your song buff box. Before if your song buff box filled up and you got overflow to your normal buff box it wouldn't work properly. Should work fine now.

See below.
Last edited by ml2517 on Fri Apr 23, 2004 7:34 pm, edited 2 times in total.

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

GREEEEEEAT JOB :)

Post by utrero » Tue Apr 20, 2004 10:21 pm

great job :) now works perfectly.the transition between non combat and combat is perfectly :)

(why dont you make a look on my post on advchant too you look like you know a lot on programing so you cna help me :):):)

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

Post by ml2517 » Fri Apr 23, 2004 7:35 pm

Here ya go, updated this to work with one set of songs or with two sets.

See below.

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

Post by ml2517 » Fri Apr 23, 2004 10:18 pm

Updated:
twist.mac

Cleaned this up and fixed an error. I also made this completely dynamic based on the spell durations and types.

See below.
Last edited by ml2517 on Sat Apr 24, 2004 6:49 pm, edited 1 time in total.

desnts
RTFM, then ask again
Posts: 58
Joined: Wed Apr 30, 2003 4:40 pm

Post by desnts » Sat Apr 24, 2004 11:09 am

on this macro how do u make it to where u only twist while attacking or only twist while not attacking? like /macro twist.mac 0 123. where 0 would be dont twist when not attacking.

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

Post by ml2517 » Sat Apr 24, 2004 12:04 pm

Code: Select all

|  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 
That isn't clear enough?

desnts
RTFM, then ask again
Posts: 58
Joined: Wed Apr 30, 2003 4:40 pm

Post by desnts » Sat Apr 24, 2004 12:14 pm

plenty clear. guess i didnt make my question clear.

as example im pulling ldon. well i dont want the macro to twist while im pulling only when im attacking.

/macro twist.mac 123 does when attack is off.
/macro twist.mac 0 123 gives error of dont have that song mem'd
/macro twist.mac [123] gives dont have that song mem'd

maybe im readding it wrong but to me it looks liek there is no spot in there where u can just have it twist during fighting and not play anything while not attacking. thats what i was asking.

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

Post by ml2517 » Sat Apr 24, 2004 12:55 pm

Just put:

/mqpause

In a hotkey and use that to pause the macro.

If you are only wanting one song set then just start the macro with:

/macro 12345

If you want to switch songs based on when you are combat or not:

/macro 12345 678

desnts
RTFM, then ask again
Posts: 58
Joined: Wed Apr 30, 2003 4:40 pm

Post by desnts » Sat Apr 24, 2004 4:24 pm

thanks. although i really enjoyed the last one that had the option for 0 meaning dont do anything.

/macro twist.mac 0 123 means only twist while in combat. or
/macro twist.mac 123 0 only twist when not attacking.

although thanks for the help that will solve my problem of haveing it running while not wanting to twist.

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

Post by ml2517 » Sat Apr 24, 2004 6:50 pm

Update:
twist.mac

Found some bugs and *hopefully* squashed them.

Code: Select all

| - twist.mac - 
| 
| Modified from Colonel's Macro by ml2517 
| 
| Modified to current form 4/24/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 global 
    /declare NonCombatCurSong global 
    /declare NNonCombatSongs global 
    /declare NCombatSongs global 
    /declare NonCombatSongList global 
    /declare CombatSongList global 
    /declare TwistI global 
    /declare TwistJ global 
    /declare DynamicBuffer global 
    /declare NonCombatSongArray array 
    /declare CombatSongArray array 
    /declare ArrSong array 

| 
|  Timer Declarations 
| 
    /declare SingTime timer 


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

    /for TwistI 1 to @NNonCombatSongs 
        /varcalc TwistJ @TwistI 
        /varset NonCombatSongArray(@TwistI) ${String["@NonCombatSongList"].Mid[@TwistJ,1]} 
    /next TwistI 
    /if (${Defined[CombatGems]}) {
        /for TwistI 1 to @NCombatSongs 
            /varcalc TwistJ @TwistI 
            /varset CombatSongArray(@TwistI) ${String["@CombatSongList"].Mid[@TwistJ,1]} 
        /next TwistI
    }
    :Loop 
    /if (${Me.State.NotEqual["SIT"]}) { 
        /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.State.Equal["SIT"]}) /stand 
   /goto :Loop 
/return 


Sub CombatSing(Song) 
     /declare Buffer local
     /declare Duration 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
        /varadd 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 
    /varadd CombatCurSong 1 
    /if (@CombatCurSong>@NCombatSongs) /varset CombatCurSong 1 
/return 


Sub NonCombatSing(Song) 
     /declare Buffer local
     /declare Duration 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
        /varadd 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 
    /varadd 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"]}) { 
        /return ${Me.Gem[@GemNumber].Duration}
    } else { 
        /return 0 
    } 
} else { 
    /return 0 
} 
/return 

desnts
RTFM, then ask again
Posts: 58
Joined: Wed Apr 30, 2003 4:40 pm

Post by desnts » Sun Apr 25, 2004 10:35 am

thanks ML for your work on this btw.