Adding clicks to twists

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

Benev0lent
Placid Leech
Placid Leech
Posts: 19
Joined: Fri Dec 26, 2003 9:01 am

Adding clicks to twists

Post by Benev0lent » Fri Dec 26, 2003 9:33 am

I've been using mutters update of the colonel's twist.mac as seen in twisting mac since the varible update and have steadily tweaked it enough times to get it to the point of it not running anymore =)

just for the basis here's the code before I messed with it

Code: Select all

| - twist.mac - 
| /mac twist <GEMs> 
| Modified from Colonel's Macro 
|Modiefied to current form 11/7/2003 
| <GEMs> is an any length song list of the gem slots. 12345678 or 213457 or 78 
| hint make sure selos is in the gem list if you are kiting 

#event MissedNote "You miss a note, bringing your song to a close!" 
#event Recovered "You haven't recovered yet..." 
#turbo 

Sub Main(Param0) 
   /if $defined(Param0)==false /endmacro 
   /declare CASTTIME   global 
   /declare cursong    global 
   /declare nncsongs   global 
   /declare ncsongs   global 
   /declare prevsong   global 
   /declare ncSongList   global 
   /declare cSongList   global 
   /declare SingTime   timer 
   /declare I      global 
   /declare J      global 
   /declare ncSongArray   array 
   /declare cSongArray   array 

   /varset CASTTIME   33 
   /varset cursong    1 
   /varset nncsongs $strlen(@Param0) 
   /varset ncsongs $strlen(@Param1) 
   /varset ncSongList @Param0 
   /varset cSongList @Param1 

   /for I 1 to @nncsongs 
      /varcalc J $int(@I-1) 
      /varset ncSongArray(@I) $mid(@J,1,@ncSongList) 
   /next I 
   /for I 1 to @ncsongs 
      /varcalc J $int(@I-1) 
      /varset cSongArray(@I) $mid(@J,1,@cSongList) 
   /next I 
   /varset CASTTIME 33 
   :Loop 
    /if "$char(state)"!="SIT" { 
       /if "$combat"=="TRUE" /if n @SingTime<=0 /call Sing @cSongArray(@cursong) 
       /if "$combat"!="TRUE" /if n @SingTime<=0 /call Sing @ncSongArray(@cursong) 
    } 
    /if $char(state)=="DUCK" /press d 
   /doevents 
   /goto :Loop 

/return 

Sub Sing 
   /varset SingTime @CASTTIME 
   /stopsong 
   /cast @Param0 
   /varset prevsong @cursong 
   /varadd cursong 1 
   /if n @cursong>@nncsongs /varset cursong 1 
   /doevents 
/return 

Sub Event_MissedNote 
   /varset cursong @prevsong 
   /varset SingTime 0 
   /doevents 
/return 

Sub Event_Recovered 
   /varset SingTime 0 
   /varset cursong @prevsong 
   /doevents 
/return

All I'm trying to do is allow for a click based song to be included into the twist.

So then assuming it's the BoH which instant clicks "nivs"...

change basic input to either include 'click' or a blank field for when I can afford to sacrifice melee for the click or bypass the click altogether.

/macro twist <song list1> <song list2> <blank|"click">

example
/macro twist 123 456 click
/macro twist 123 456

I just hot key the click item and slave it to function F6

so when it's time to click said item at the end of the twist

Code: Select all

Sub clickit
   /stopsong
   /press F6
   /delay 2m
/return
then return to main and reset the twist song count.

So then I'm having trouble getting the macro to properly read the click/blank and even when forcing the click, getting it to fire off at the end of each cycle... once lol

I'm sure it's merely syntax giving me the run arounds as per my usual as for the first part but how to make click a "4th" (or"5") song is throwing me for the loop - no pun intended - honestly.

any help? =/

+Benev0

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

Post by wilso132 » Fri Dec 26, 2003 12:58 pm

A much simpler way to do it would be to modify the existing code to do something like this:

/macro Twist2 123 45C

With "C" meaning click. Then you can probably just put in a few if statements and change around his code a little so that if it encounters a "C" you use your click item that round.

Benev0lent
Placid Leech
Placid Leech
Posts: 19
Joined: Fri Dec 26, 2003 9:01 am

right!

Post by Benev0lent » Sat Dec 27, 2003 3:46 am

ok so good idea on the C flag.... so scrap it all and look up some stuff. I decide to go with ml2517's modified script as it's a bit cleaner to my eyes...

Code: Select all

| - twist.mac - 
| 
| Modified from Colonel's Macro 
| Modified to current form 12/7/2003 
| 
|  Combat Twist Order ------------+ 
|  NonCombat Twist Order -----+   | 
|                             |   | 
| Usage:                      v   v 
|           /macro twist.mac ### ### 
| 
| # represents the spell gem number you'd like to sing 
| 
| Example: 
| /macro twist.mac 4567 123456 
| 

#event twistMissedNote "You miss a note, bringing your song to a close!" 
#event twistRecovered "You haven't recovered yet..." 
#turbo 

Sub Main(Param0) 
   /if $defined(Param0)==false /endmacro 
   /declare twistCASTTIME   global 
   /declare combatcursong    global 
   /declare noncombatcursong    global 
   /declare nncsongs   global 
   /declare ncsongs   global 
   /declare combatprevsong   global 
   /declare noncombatprevsong   global 
   /declare ncSongList   global 
   /declare cSongList   global 
   /declare SingTime   timer 
   /declare twistI      global 
   /declare twistJ      global 
   /declare ncSongArray   array 
   /declare cSongArray   array 

   /varset twistCASTTIME   33 
   /varset combatcursong    1 
   /varset noncombatcursong    1 
   /varset combatprevsong    1 
   /varset noncombatprevsong    1 

   /varset nncsongs $strlen(@Param0) 
   /varset ncsongs $strlen(@Param1) 
   /varset ncSongList @Param0 
   /varset cSongList @Param1 

   /for twistI 1 to @nncsongs 
      /varcalc twistJ $int(@twistI-1) 
      /varset ncSongArray(@twistI) $mid(@twistJ,1,@ncSongList) 
   /next twistI 
   /for twistI 1 to @ncsongs 
      /varcalc twistJ $int(@twistI-1) 
      /varset cSongArray(@twistI) $mid(@twistJ,1,@cSongList) 
   /next twistI 
   /varset twistCASTTIME 32 
   :Loop 
    /if "$char(state)"!="SIT" { 
       /if "$combat"=="TRUE" /if n @SingTime<=0 /call CombatSing @cSongArray(@combatcursong) 
       /if "$combat"!="TRUE" /if n @SingTime<=0 /call NonCombatSing @ncSongArray(@noncombatcursong) 
    } 
    /if $char(state)=="DUCK" /press d 
   /doevents 
   /goto :Loop 

/return 

Sub NonCombatSing 
   /stopsong 
   /cast @Param0 
   /varset SingTime @twistCASTTIME 
   /varset noncombatprevsong @noncombatcursong 
   /varadd noncombatcursong 1 
   /if n @noncombatcursong>@nncsongs /varset noncombatcursong 1 
/return 

Sub CombatSing 
   /stopsong 
   /cast @Param0 
   /varset SingTime @twistCASTTIME 
   /varset combatprevsong @combatcursong 
   /varadd combatcursong 1 
   /if n @combatcursong>@ncsongs /varset combatcursong 1 
/return 

Sub Event_twistMissedNote 
   /varset combatcursong @combatprevsong 
   /varset noncombatcursong @noncombatprevsong 
   /varset SingTime 0 
/return 

Sub Event_twistRecovered 
   /varset combatcursong @combatprevsong 
   /varset noncombatcursong @noncombatprevsong 
   /stopsong 
   /varset SingTime 0 
/return 


so I want to add a "c" in place of a number to signify click....

this is how I modded the script (comments and echo for debug)

Code: Select all

Sub NonCombatSing 
   /stopsong
    [color=red] /if n @param0=="c" {
        /echo click
|       /press f5
        /varset singtime 2
        } else { 
        /cast @Param0
        /varset SingTime @twistCASTTIME
        }[/color]  
   /varset noncombatprevsong @noncombatcursong 
   /varadd noncombatcursong 1 
   /if n @noncombatcursong>@nncsongs /varset noncombatcursong 1
/return

Do the same for the combat sub as well... problems are in the syntax I *know* (syntax is what drove me screaming from coding so many years ago)

if I /macro twist 123c 456

I get first 3 songs then mass spam "click" or "you do not seem to have that spell"

for some reason the "if else" is fubar and gawd knows I've done random combos of if, if n, if <twist of lemon> and it comes out the same.... I get spammed with "click" or trying to /cast c

I even changed c with 9 and get returned that there is not a "9" spell gem.

Honestly lost. The old feeling of throwing a brick at a window is near at hand! ( ok multiple puns intended there)

I know damn well it's obvious, which makes it worse.

+Benev0

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

Post by ml2517 » Sat Dec 27, 2003 4:04 am

Try this:

Just a note also you might have to play with that SingTime 5 and change it lower or higher til the timing is correct. Just because an item is insta-click doesn't necessarily mean you can immediately cast right after clicking it.

Code: Select all

Sub NonCombatSing
   /stopsong
    /if "@Param0"=="c" {
        /press F5
        /varset SingTime 5
        } else {
        /cast @Param0
        /varset SingTime @twistCASTTIME
        } 
   /varset noncombatprevsong @noncombatcursong
   /varadd noncombatcursong 1
   /if n @noncombatcursong>@nncsongs /varset noncombatcursong 1
/return

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

Post by ml2517 » Sat Dec 27, 2003 4:28 am

Btw.. also instead of:

/press F5

you could just:

/cast item "Breath of Harmony"

(or whatever the name of the item is)

Then you wouldn't have to bother mapping keys and/or having a hotkey set up in EQ.

Benev0lent
Placid Leech
Placid Leech
Posts: 19
Joined: Fri Dec 26, 2003 9:01 am

..........................

Post by Benev0lent » Sat Dec 27, 2003 4:49 am

I know! I tried the "param0"=="c".... that's just so frustrating. I'm really not upset easily but damn if a random misplaced ;'s in C gets my goat fast.

sooo many thanks. works the charm.

Great idea on the cast item. I'm still learning this wonderful scripting lang so that idea is completely new to me.

By the by, delay of 2 is actually fine for me it turns out, even at a whopping 8 fps spinning in baz with 100% clip and max particles/opaq.

Regardless, time to update the rest of the ever more twisted basic twist with the new info and clean out my hot keys.

Ldon would have been hell without an auto twist for the 300+ adv's.. it's just not possible for my hands to stand by idle and one song a run.

Thanks a million times over. =)

Time to learn about ferreting out offsets to help out instead of just leech.

+Benev0