bard stickmob + twisting w downtime and combat v2.1

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

Moderator: MacroQuest Developers

rzmonk76
a hill giant
a hill giant
Posts: 165
Joined: Sat Jan 31, 2004 1:37 pm
Contact:

bard stickmob + twisting w downtime and combat v2.1

Post by rzmonk76 » Fri Feb 13, 2004 12:00 pm

*EDITED 03 MAR 04*

i didnt get alot of comments on v1, mostly because the stickmob code was bugged to hell do to my dawldling w the origonal code. I dindt test the code before i posted it and abandoned the public project. I hope this one works out better for you all.

and now to your regulary sceduled program:

yes yes

i know what your gona think, yet another twist macro. there are alot of twist macros out there. Alot of them are good. but they all leave out one or two important things. above all the most important thing is the ability to cast downtime and combat twists. next important,...support for twists ques longer than 4 songs. next stickmob support. next enrage support. i've seen alot of macros out there but none of them have all of the above features. i've seen some combos incuding boastfull bellow. i chose not to include it because the stun portion doesnt work on the mobs i hunt and the dmg output of the skilll is trival. im sure in pvp the stun might be of some value though. when i get some more time ill incude it in.

this is my first script. i dont take credit for it. i just spliced two scripts together and tried to debugg it best i could. please make comments and corrections.

FEATURES
edit stick*.ini's for rampage raid mobs, no need to make these files they will be created automaticaly the firs time.
-group follows when invited
-turns off attack when enraged
-turns off attack when attack turned on with mob more than 150 meters away
-turns off attack when mob gates
-turns off attack when you switch to another target
-turns off attack when you target a player
-human like /face so your feet twist instead of turret like traversing
-turns off attack when mob dies
-combat and non combat twists

future additions/need help/more time, with
-adding xp report -will figure out this soon, just needs testing
-adding toggleable assist - need help, badly
-adding togglable move behind code- should figure this out within the next 2 weeks. move behind code loops on itsself and doesnt give the stick to the other parts, specifily twisting work.
-putting in BB aa skill now that stun will work on higher lvl mobs - soon

Code: Select all

#turbo 
#define NPCini "stick-NPC.ini"  | file  autocreated edit for enrage npcs
#define PCini "stick-PC.ini       | file  autocreated edit for enrage npcs
#include turn.inc 
| Twist4.mac  Flexible bard song twister using timers by BrainDozer, 
| combat code, and funtionality by m0nk 
| Updated by Drax, rzmonk76
| 
|   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 
| 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
#event EXP "experience!!" 
#event RageON "has become ENRAGED." 
#event RageOFF "is no longer enraged" 
#event MobGate " Gates." 
#event Invited "To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel" 
#event StunON "You are stunned" 
#event StunOFF "You are unstunned" 
#event MissedNote "You miss a note, bringing your song to a close!" 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub main 
   :setupDeclare 
      /zapvars 
      /declare MobID global 
      /declare MeleeDistance global 
/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 MeleeDistance global
/declare MobID global
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
  /stopsong 
  /call initVars @Param0 @Param1
  :Mainloop 
     /if $combat==TRUE /call attack
     /if @attackct==0 /if $combat==TRUE /if @attack==0 /call AttackOn 
     /if @attackct==0 /if $combat==FALSE /if @attack==1 /call AttackOff 
     /if @v9@attack!=-1 /if $char(state)==STAND /call TwistSong @attack 
     /if @attackct==0 /varset attackct 10    
                                            
       
     /doevents 
  /goto :Mainloop 
/endmacro  
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 

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 32                     | 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 
  /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   | 
/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
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub attack 
   :attackCheck 
      /varset MobID $target(id) 

   :attackSetup 
      /if $target(type)!=NPC { 
         /attack off 
         /delay 5 
         /return 
         } 
      /if n $target(distance)>150 { 
         /attack off 
         /delay 5 
         /return 
         } 

   :attackPreFight 
      /call ClearReturn 
      /varset MeleeDistance $ini("NPCini","$zone","$target(name,clean).DistanceMelee") 
      /if "@MeleeDistance"=="NOTFOUND" { 
         /ini "NPCini" "$zone" "$target(name,clean).DistanceMelee" 15 
         /delay 0 
         /varset MeleeDistance $ini("NPCini","$zone","$target(name,clean).DistanceMelee") 
         } 

   :attackMeleeLoop 
      /doevents exp 
      /doevents RageOn 
      /doevents MobGate 
      /doevents StunON 
      /doevents ToggleTaunt 
      /if n $target(id)!=@MobID /goto :attackend 
      /if $return==EndATK /goto :attackEnd 
      /if $combat!=TRUE /goto :attackend 
      /call turn
      /if n $target(distance)>@MeleeDistance /sendkey down up 
      /if n $target(distance)<=@MeleeDistance /sendkey up up 
      /if n $target(id)==@MobID /if n $target(distance)<=$calc(@MeleeDistance-5) /press down 
   /return

   :attackend 
      /doevents exp 
      /varset MobID NULL 
      /sendkey up up 
/return 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub ClearReturn 
/return NULL 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub event_exp 
   /if n $target(hp,pct)>0 /return 
/return EndATK 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub event_RageOn 
   /if n $target(hp,pct)>15 /return 
   /if n $target(hp,pct)==0 /return 
   /if $target(id)==@MobID /sendkey up up 
   /call ClearReturn 
   /echo Rage On 
   /attack off 
   /call ClearReturn 

   :waitRage 
      /doevents 
      /if $target(id)!=@MobID /return EndATK 
      /if $return==EndATK /return EndATK 
      /if $return==RageOFF /return 
/goto :waitRage 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub event_RageOFF 
   /echo Rage OFF 
   /attack on 
/return RageOFF 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub event_MobGate 
   /echo MOB GATED! 
   /attack off 
/return EndATK 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub event_Invited 
   /invite 
/return 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub event_StunON 
   /doevents flush StunOFF 
   /call ClearReturn 

   :LoopStunOFF 
      /doevents StunOFF 
      /if "$return"=="StunOFF" { 
         /call ClearReturn 
         /return 
         } 
/goto :LoopStunOFF 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
Sub event_StunOFF 
/return StunOFF 
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 




Code: Select all

| Turn.inc -  Created by GD 
| 
| Usage: #Include it into your current macro, then call it as follows: 
| 
|     To turn towards Target: /call Turn 
|     To turn towards Location: /call LocY LocX 
|        IE: /call Turn -460 500 

#turbo 

Sub Turn(THeadingY,THeadingX) 
   /declare PHeading local 
   /declare THeading local 
   /declare Bearing local 
   /declare TurnKey local 
   /declare IsTurning local 

:TurnLoop 
   /sendkey up up 
   /delay 0 
   /if $char(state)=="SIT" /sit off 
   /varset PHeading $int($char(heading)) 
   /if "$defined(THeadingX)"=="TRUE" { 
      /varset THeading $int($heading(@THeadingY,@THeadingX)) 
   } else { 
      /varset THeading $int($target(headingto)) 
   } 

   /varset Bearing $int($calc($calc(@PHeading-@THeading+540)%360-180)) 

   /if (n @Bearing>=-7 && n @Bearing<=7) { 
      /if "@TurnKey"!="" /sendkey up @TurnKey 
      /face heading @THeading nolook 
      /return 
   } else /if (n @Bearing>=-180 && n @Bearing>=7) { 
      /if "@TurnKey"!="RIGHT" /varset TurnKey RIGHT 
   } else /if (n @Bearing<=180 && n @Bearing<=7) { 
      /if "@TurnKey"!="LEFT" /varset TurnKey LEFT 
   } 

   /if n @IsTurning!=1 { 
      /sendkey down @TurnKey 
      /varset IsTurning 1 
   } 
   /goto :TurnLoop 

/return 

rzmonk76
a hill giant
a hill giant
Posts: 165
Joined: Sat Jan 31, 2004 1:37 pm
Contact:

bump

Post by rzmonk76 » Wed Mar 03, 2004 8:52 am

updateed try it out

Mutter
a ghoul
a ghoul
Posts: 105
Joined: Sat Nov 16, 2002 1:09 pm

Trying

Post by Mutter » Sun Mar 07, 2004 8:56 pm

Checking it out now... frankly see very little new in this, but I will try it!

Krozana
decaying skeleton
decaying skeleton
Posts: 1
Joined: Wed Mar 31, 2004 1:35 pm
Contact:

Post by Krozana » Wed Mar 31, 2004 1:38 pm

I am not sure why but the one you had written never worked for me (the biggest area I had problems in was in sticking to the MOB). I also needed some funcationality to turn on and off downtime mode so if I needed to pull I could.

I took your script, compared it to a bare twist.mac, and stick.mac and tried to merge things together adding what I neded into it at the time.

This is my first attempt at writing a macro at all (or modifying one) for MQ, so feel free to point out anything stupid I may have done.

I'll be modifying this to the new data structures in the next week or so as I work to understand them.

Edit - Did some additional debugging and addded in functionality to have you returned to your anchor spot if turned on after attack is turned off for whatever reason.

Code: Select all

| - twist.mac - 
| /mac twist <non combat songs> <combat songs> 
| Shamelessly Modified/Merged Version of twist.mac and stick.mac as written by rzmonk76 and M0nk respectively.
| Modiffied to current form 3/31/2004
|
| Additions:  Added Help hints if you forget which set comes in which order, just type the name of the macro
|             Added Pull Modes (Toggled via /echo Pull), to temporarily stop downtime twists.
|             Added Anchor Mode (Toggled via /echo Anchor), to automatical return to starting spot after combat

#define MOBini "stick-npc.ini" 
#define PCini "stick-pc.ini 

#event MissedNote "You miss a note, bringing your song to a close!" 
#event Recovered "You haven't recovered yet..." 
#event EXP "experience!!" 
#event RageON "has become ENRAGED." 
#event RageOFF "is no longer enraged" 
#event MobGate " Gates." 
#event StunON "You are stunned" 
#event StunON "You lose control of yourself!" 
#event StunOFF "You are unstunned" 
#event StunOFF "You have control of yourself again."
#event Pull "[MQ2] Pull"
#event Anchor "[MQ2] Anchor

#turbo 


Sub Main(Param0) 
  :setupDeclare 
     /zapvars 
     /declare MA_SB global 
     /declare MobID global 
     /declare CharX global 
     /declare CharY global 
     /declare MeleeDistance global 
     /declare DefaultMeleeDistance global 
     /declare Pull global
     /declare Anchor global
     /declare AnchorX global
     /declare AnchorY global
     /declare AnchorHeading global
     /declare Debug global
     /varset Debug 0


  :setPCiniOther 
    /varset DefaultMeleeDistance $ini("PCini","$char(name)","DefaultMeleeDistance") 
    /if "@DefaultMeleeDistance"=="NOTFOUND" { 
      /ini "PCini" "$char(name)" "DefaultMeleeDistance" "15" 
      /delay 0 
      /varset DefaultMeleeDistance $ini("PCini","$char(name)","DefaultMeleeDistance") 
    } 
    /if $defined(Param0)==false {
      /echo "Usage:  /macro twist <non combat songs> <combat songs>"
      /echo ""
      /echo "Example:  /macro twist 123 0  (twist only during downtime)"
      /echo "          /macro twist 0 123 (twist only during combat)"
      /echo "          /macro twist 123 456 (twist during both downtime and combat)"
      /echo ""
      /echo "/echo Pull On (stop twisting downtime songs until combat is engaged)"
      /echo "/echo Pull Off (starts singing any downtime songs again)
      /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 Anchor 0
    /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 
    /if n @Debug==1 {
      /echo "Initiating Main Loop"
    }
  :Loop 
    /if "$char(state)"!="SIT" { 
      /if $combat==TRUE {
        /varset cursong 1
        /if n @Debug==1 {
          /echo "Combat Mode Detected, calling attack routine"
        }
        /call Attack 
        /doevents 
      }
      /if "$combat"!="TRUE" /if n @SingTime<=0 {
        /varset cursong 1
        /if n @Debug==1 {
          /echo "Combat is off, and its time to sing, so calling no combat sing routine"
        }
        /call Sing @ncSongArray(@cursong) @nncsongs
      }
    } 
    /if $char(state)=="DUCK" /press d 
    /doevents
    /goto :Loop 
/return 

Sub Sing 
  /varset SingTime @CASTTIME 
  /if (n @Param0<1 || n @Param0>8) {
    /if n @Debug==1 {
      /echo "Returning without singing, you want to sing a song lower than 0 or higher than 8, @Param0"
    }
    /return
  }
  /if ("$combat"!="TRUE" && n @Pull==1) {
    /varset cursong 1
    /if n @Debug==1 {
      /echo "In Pull Mode outside combat, not singing"
    }
    /return
  }
  /stopsong 
  /cast @Param0 
  /if n @Debug==1 {
    /echo "Singing Song in Gem #@Param0 which is song @cursong out of @Param1"
  }
  /varset prevsong @cursong 
  /varadd cursong 1 
  /if n @cursong>@Param1 /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 

Sub attack 
  :attackCheck 
    /varset MobID $target(id) 
    /if n @Debug==1 {
      /echo "I'm ready to attack Mob ID# @MobID"
    }  
  :attackSetup 
    /if $target(type)!=NPC { 
      /attack off 
      /delay 5 
      /return 
    } 
    /if n $target(distance)>150 { 
      /if n @Debug==1 {
        /echo "$target(name,clean) is too far away to engage"
      }
      /attack off 
      /delay 5 
      /return 
    } 
  :attackPreFight 
    /call ClearReturn 
    /varset MeleeDistance $ini("MOBini","$zone","$target(name,clean).DistanceMelee") 
    /if "@MeleeDistance"=="NOTFOUND" { 
      /ini "MOBini" "$zone" "$target(name,clean).DistanceMelee" @DefaultMeleeDistance 
      /delay 0 
      /varset MeleeDistance $ini("MOBini","$zone","$target(name,clean).DistanceMelee") 
    } 
    /if ("$combat"=="TRUE" && @Pull==1) {
      /varset cursong 1
      /varset Pull 0
      /if n @Debug==1 {
        /echo "Pull Mode Disabled due to Combat Starting"
      }
    }
  :attackMeleeLoop 
    /doevents exp 
    /doevents RageOn 
    /doevents MobGate 
    /doevents StunON 
    /if n $target(id)!=@MobID {
      /if n @Debug==1 {
        /echo "MOb ID has changed, ending attack"
      }
      /goto :attackend 
    }
    /if $return==EndATK {
      /if n @Debug==1 {
        /echo "Event Requested End of Attack"
      }
      /goto :attackend 
    }
    /if $combat!="TRUE" {
      /varset cursong 1
      /if n @Debug==1 {
        /echo "Attack Mode not enabled"
      }
      /goto :attackend 
    }
    /if n $char(feetwet)!=0 /face fast 
    /if n $char(feetwet)==0 /face fast nolook 
    /if n $target(id)==@MobID /if n $target(distance)>@MeleeDistance /sendkey down up 
    /if n $target(id)==@MobID /if n $target(distance)<=@MeleeDistance /sendkey up up 
    /if n $target(id)==@MobID /if n $target(distance)<=$calc(@MeleeDistance-5) /press down 
    /if "$combat"=="TRUE" {
       /if n @SingTime<=0 {
         /if n @Debug==1 {
           /echo "Calling Combat Songs Routine"
         }
         /call Sing @cSongArray(@cursong) @ncsongs
       }
    }
    }
    /if "$combat"!="TRUE" {
      /if n @SingTime<=0 {
        /if n @Debug==1 {
          /echo "Calling Non Combat Songs Routine"
        }
        /call Sing @ncSongArray(@cursong) @nncsongs
      }
    }
    /goto :attackMeleeLoop 
  :attackend 
    /varset MobID NULL 
    /attack off 
    /sendkey up up 
    /varset SingTime 0 
    /if n @Debug==1 {
      /echo "Starting Attack ending routines"
    }
    /if "$combat"!="TRUE" /if n @SingTime<=0 /call Sing @ncSongArray(@cursong) @nncsongs
    /if n @Anchor==1 {
      /if n @Debug==1 {
        /echo "Returning to Anchor Point"
      }
      /call MoveToAnchor
    }
/return 

Sub ClearReturn 
/return NULL 

Sub event_exp 
  /if n $target(hp,pct)>0 /return 
/return EndATK 

Sub event_RageOn 
  /if n $target(hp,pct)>15 /return 
  /if n $target(hp,pct)==0 /return 
  /if $target(id)==@MobID /sendkey up up 
  /call ClearReturn 
  /echo Rage On 
  /attack off 
  /call ClearReturn 
  :waitRage 
    /doevents 
    /if $target(id)!=@MobID /return EndATK 
    /if $return==EndATK /return EndATK 
    /if $return==RageOFF /return 
     /goto :waitRage 
/return

Sub event_RageOFF 
  /echo Rage OFF 
  /attack on 
/return RageOFF 

Sub event_MobGate 
  /if n $target(distance)<100 /return 
  /echo MOB GATED! 
  /attack off 
/return EndATK 


Sub event_StunON 
  /doevents flush StunOFF 
  /call ClearReturn 
  :LoopStunOFF 
    /doevents StunOFF 
    /if "$return"=="StunOFF" { 
      /call ClearReturn 
      /return 
    } 
    /goto :LoopStunOFF 
/return

Sub event_StunOFF 
/return StunOFF 

Sub event_Pull
  /if n @Pull==0 {
  /if $combat=="FALSE" {
    /varset Pull 1
    /echo "Pulling Mode On"
    /stopsong
  }
  /return
  }
  /if n @Pull==1 {
    /varset Pull 0
    /echo "Pull Mode Off"
  /return
  }
/return


Sub event_Anchor
  /if n @Anchor==1 {
    /varset Anchor 0
    /echo "No Longer Anchored"
    /return
  }
  /if n @Anchor==0 {
    /varset Anchor 1
    /echo "Anchored to current loc"
    /varset AnchorX $char(x)
    /varset AnchorY $char(y)
    /varset AnchorHeading $char(heading)
    /return
  }
/return


Sub MoveToAnchor 
  :AnchorMoveLoop 
    /if "$combat"!="TRUE" /if n @SingTime<=0 /call Sing @ncSongArray(@cursong) @nncsongs
    /if "$char(state)"=="SIT" /stand 
    /face nolook loc @AnchorY,@AnchorX 
    /if n $distance(@AnchorY,@AnchorX)>11 /sendkey down up 
    /if n $distance(@AnchorY,@AnchorX)<=11 { 
      /sendkey up up 
      /face heading @AnchorHeading
      /return
    } 
    /goto :AnchorMoveLoop 
/return 

Zeit
a lesser mummy
a lesser mummy
Posts: 34
Joined: Sat Jan 24, 2004 5:54 am

Post by Zeit » Tue Apr 06, 2004 3:41 am

Code: Select all

Sub bellowsub 
       /alt activate 199 
       /varset bellowtimer 186 
/return 

Code: Select all

#Event exp "You gain party experience" 
#Event rexp "You gained raid experience" 

Sub Event_exp 
   /delay 1s 
   /varset expvar2 $char(exp) 
   /varset aaexpvar2 $char(aa,exp) 
   /varcalc expgain @expvar2-@expvar1 
   | AA calcs 
   /varcalc aaexpgain @aaexpvar2-@aaexpvar1 
   /varset expset 0 
   /varset autoon 0 
   /varset Combatstatus 0 

   /echo EXP - Gain: @expgain% Total: $char(exp)% 
   /echo AAEXP - Gain: @aaexpgain% Total: $char(aa,exp)% 
/return 

Sub Event_rexp 
   /delay 1s 
   /varset expvar2 $char(exp) 
   /varset aaexpvar2 $char(aa,exp) 
   /varcalc expgain @expvar2-@expvar1 
   | AA calcs 
   /varcalc aaexpgain @aaexpvar2-@aaexpvar1 
   /varset expset 0 
   /varset autoon 0 
   /varset Combatstatus 0 

   /echo EXP - Gain: @expgain% Total: $char(exp)% 
   /echo AAEXP - Gain: @aaexpgain% Total: $char(aa,exp)% 
/return 
pulled that outta the macro im using hope it helps

Banannaboy
a lesser mummy
a lesser mummy
Posts: 43
Joined: Tue Apr 13, 2004 9:59 pm

Post by Banannaboy » Thu Apr 15, 2004 12:36 pm

I type /macro twist 1 5678 and then I get the following errors.

[Thu Apr 15 09:46:16 2004] Cleared the following: Timers Vars Arrays
[Thu Apr 15 09:46:16 2004] Ending macro: Failed to parse /if command
[Thu Apr 15 09:46:16 2004] twist.mac@121 (Sing): /if (n @Param0<1 || n @Param0> {
[Thu Apr 15 09:46:16 2004] twist.mac@111 (Main(Param0)): /call Sing @ncSongArray(@cursong) @nncsongs
[Thu Apr 15 09:46:16 2004] Cleared the following: Timers Arrays
[Thu Apr 15 09:46:16 2004] The current macro has ended.
[Thu Apr 15 09:46:16 2004] Usage:
[Thu Apr 15 09:46:16 2004] /if <condition> <command>
[Thu Apr 15 09:46:16 2004] <condition> : (<condition> && <condition>) or [n] <a>==<b>

Botmaker
orc pawn
orc pawn
Posts: 14
Joined: Mon Jan 26, 2004 11:46 am

Post by Botmaker » Thu Apr 15, 2004 1:46 pm

when posting code, click on the lil box that says "Disable Smilies in this post"... otherwize people like bananaboy that dont look at the code will get confused...


obviously this is not gonna copy-and-past well...
gonna let you figure it out...

Code: Select all

Sub Sing 
  /varset SingTime @CASTTIME 
  /if (n @Param0<1 || n @Param0> { 
    /if n @Debug==1 { 
      /echo "Returning without singing, you want to sing a song lower than 0 or higher than 8, @Param0
(if you cant fingure it out, i answered the exact same question on another thread ;))

Banannaboy
a lesser mummy
a lesser mummy
Posts: 43
Joined: Tue Apr 13, 2004 9:59 pm

Post by Banannaboy » Thu Apr 15, 2004 6:34 pm

Thanks, I realize that the code I copied from had a 8) instead of the actual code.