my mac so far

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

botofall
decaying skeleton
decaying skeleton
Posts: 8
Joined: Thu Oct 14, 2004 2:01 am

my mac so far

Post by botofall » Wed Oct 27, 2004 7:58 pm

heres what i got so far,, with chills addition ~~~

i think its owrking now, changed the mode style > agin < , and moving shit around,
looking to get events to work and add more options,
also looking to learn how to use timers so that i can put in spells like...
2 min timer cast spell one
5 min timer cast spell two
and they keep casteing after timers maby ?

any hel pis appreciated

Code: Select all



#event RageOn "#1# has become ENRAGED"
#event RageOff "#1# is no longer enraged"
#event StunOn "You are stunned."
#event StunOff "You are unstunned."

Sub Main(int Mode,string MA,float view)

	/declare LastAAExp float outer ${Me.PctAAExp}
	/declare TotalAAExp float outer 0
	/declare LastLvl float outer ${Me.PctExp}
	/declare TotalLvl float outer 0
	/declare StartY float outer ${Me.Y}
	/declare StartX float outer ${Me.X}


/echo 1 makes me follow but i dont taunt
/echo 2 makes me follow and i will taunt
/echo 3 makes me stay and i will taunt
/echo 4 name radius makes me assist and follow mob but i wont taunt



:Start 
/if (${Mode}==1) { 
   /popup Attacking ${Target.Name}..... Wont let it Escape 
   /goto :Follow 
} else /if (${Mode}==2) { 
   /popup Tanking ${Target.Name}..... No Moving ! 
   /goto :Tank 
} else /if (${Mode}==3) { 
   /popup Aggroing ${Target.Name} ...... Not letting it Escape 
   /goto :Aggro 
} else /if (${Mode}==4) { 
   /popup Assisting .................. 
   /delay 4s 
   /goto :Assist 
} else { 
   /echo try again........ and pick a mode slacker ! 
   /endmac 
}

/attack off

/return

:Assist

	/assist ${MA}
	/delay 1s
	/if (${Target.Type.Equal[NPC]} && ${Target.Distance}<${View} && ${Target.LineOfSight}) {
		/popup Fighting a ${Target.Level} ${Target.Name} 
		/delay 1s
		/goto :Follow
		} 
	/goto :Assist

/return

:Aggro

	/face fast nolook
		/if (${Target.Distance}>24) /keypress up hold
		/if (${Target.Distance}<14) /keypress up 
	
	/doevents
	/if (${Target.Distance}<25) {
		/if (${Me.AbilityReady[Kick]}) /doability "Kick" 
		/if (${Me.AbilityReady[Disarm]}) /doability "Disarm" 
		/if (${Me.AbilityReady[Taunt]}) /doability "Taunt" 
		}
	
	/if (${Target.Type.Equal[NPC]}) {
		/goto :Aggro
		} else {
		/attack off
		/popup Done Tanking
		}

	/if (${Me.PctExp}!=${LastLvl} || ${Me.PctAAExp}!=${LastAAExp}) {
		/call ExpGain
		}

/return

:Tank

	/face nolook
	/doevents
	/if (${Target.Distance}<25) {
		/if (${Me.AbilityReady[Kick]}) /doability "Kick" 
		/if (${Me.AbilityReady[Disarm]}) /doability "Disarm" 
		/if (${Me.AbilityReady[Taunt]}) /doability "Taunt" 
		}
	/doevents
	/if (${Target.Type.Equal[NPC]}) {
		/goto :Tank
		} else {
		/attack off
		/popup Done Tanking
		}

	/if (${Me.PctExp}!=${LastLvl} || ${Me.PctAAExp}!=${LastAAExp}) {
		/call ExpGain
		}

/return

:Follow

	/face fast nolook
		/if (${Target.Distance}>25) /keypress up hold
		/if (${Target.Distance}<14) /keypress up 

	/doevents
	/if (${Target.Distance}<25) {
		/if (${Me.AbilityReady[Kick]}) /doability "Kick" 
		/if (${Me.AbilityReady[Disarm]}) /doability "Disarm" 
		}		
     	
	/if (${Target.Type.Equal[NPC]}) {
		/goto :Follow
		}	
	
	/if (${Me.PctExp}!=${LastLvl} || ${Me.PctAAExp}!=${LastAAExp}) {
		/call ExpGain
		}

	/if (${Mode.Equal[anchor]}) {	
		/popup Assisting ${MA} ..................
		/delay 4s
		/call MoveToLoc ${StartY} ${StartX}
		/goto :Assist		
		}

/return



Sub event_RageOn 
|Turn attack off, and have pet hold when target becomes enraged.
	/attack off 
	/pet hold
/return 

Sub event_RageOff 
|Turn attack on, and tell pet to attack when target is no longer enraged.
	/attack on 
	/pet kill
/return 

Sub event_StunOn
|Turn off attack while stunned to decrease spam.
	/attack off 
/return 

Sub event_StunOff 
|Turn attack on after you're unstunned.
	/attack on 
/return 

|---- Following Subs borrowed from IceIsFun


Sub MoveToLoc(float MoveToY,float MoveToX)
   :MoveToLoop
      /face fast nolook loc ${MoveToY},${MoveToX}
      /if (${Math.Distance[${MoveToY},${MoveToX}]}>5) {
         /keypress up hold
         /delay 1
         /keypress up
      } else {
         /goto :Arrived
      }
   /goto :MoveToLoop
   :Arrived
/return

Sub ExpGain

	/if (${Me.PctExp}<${LastLvl}) {
		/varset TotalLvl ${Math.Calc[${TotalLvl}+${Math.Calc[100+${Me.PctExp}-${LastLvl}]}]}
		/varset LastLvl ${Me.PctExp}
	} else {
		/varset TotalLvl ${Math.Calc[${TotalLvl}+${Math.Calc[${Me.PctExp}-${LastLvl}]}]}
		/varset LastLvl ${Me.PctExp}
	}

	/if (${Me.PctAAExp}<${LastAAExp}) {
		/varset TotalAAExp ${Math.Calc[${TotalAAExp}+${Math.Calc[100+${Me.PctAAExp}-${LastAAExp}]}]}
		/varset LastAAExp ${Me.PctAAExp}
	} else {
		/varset TotalAAExp ${Math.Calc[${TotalAAExp}+${Math.Calc[${Me.PctAAExp}-${LastAAExp}]}]}
		/varset LastAAExp ${Me.PctAAExp}
	}
	
	/call Formatted_RunTime
	/if (${Me.PctExp}!=${LastLvl} || ${Me.PctAAExp}!=${LastAAExp}) /call ExpGain
	
	/popup ${Macro.Name} has generated ${TotalAAExp}% AA Exp and ${TotalLvl}% Regular Exp in ${Macro.Return}.
/return

Sub Formatted_RunTime
|Create variables to track run time.
	/declare Hours int local ${Math.Calc[${Macro.RunTime}/3600].Int}
	/declare Minutes int local ${Math.Calc[${Math.Calc[${Macro.RunTime}-${Math.Calc[${Hours}*3600]}]}/60].Int}
	/declare Seconds int local ${Math.Calc[${Macro.RunTime}-${Math.Calc[${Hours}*3600]}-${Math.Calc[${Minutes}*60]}]}
	/declare Zero int local 0
	/declare S_Total string local ${Hours}:

	/if (${Minutes}>9) {
		/varset S_Total ${S_Total}${Minutes}:
	} else {
		/varset S_Total ${S_Total}${Zero}${Minutes}:
	}

	/if (${Seconds}>9) {
		/varset S_Total ${S_Total}${Seconds}
	} else {
		/varset S_Total ${S_Total}${Zero}${Seconds}
	}
/return ${S_Total}


|---------Previous Subs Borrowed from IceIsFu

no notes in it yet for various reasons cause im nto done will put ther disclaimers in later
Last edited by botofall on Thu Oct 28, 2004 10:31 am, edited 3 times in total.

botofall
decaying skeleton
decaying skeleton
Posts: 8
Joined: Thu Oct 14, 2004 2:01 am

Post by botofall » Wed Oct 27, 2004 8:17 pm

spell timeres ?
also disc timers too simple ones
ripped this from a friends mac,, wanna make it more simple but i dont under stand how it really works yet

Code: Select all


/assist ${MA}

	/if (${Target.Type.Equal[NPC]} && ${Target.Distance}<${View} && ${Target.LineOfSight}) {
		/varset Prime 5
		/varset Secon 10
		/varset Terit 15
		/varset Quada 20
		/varset Fifth 25
		/varset Sixth 30
		/call Tank
		/goto :MAStuff
	}

	/goto :Attack
/return

Sub Tank

:Attack
|Cast spells on target.
	/if (!${Prime} && ${Me.SpellReady["Ancient: Bite of Chaos"]}) { 
		/call cast "Ancient: Bite of Chaos" 
		/varset Prime 62s 
	}

	/if (!${Secon} && ${Me.SpellReady["Inruku's Bite"]}) { 
		/call cast "Inruku's Bite" 
		/varset Secon 62s 
	} 

	/if (!${Terit} && ${Me.SpellReady["Clinging Darkness"]}) { 
		/call cast "Clinging Darkness" 
		/varset Terit 16s 
	} 

	/if (!${Quada} && ${Me.SpellReady["Theft of Hate"]}) { 
		/call cast "Theft of Hate" 
		/varset Quada 74s 
	} 

	/if (!${Fifth} && ${Me.SpellReady["Aura of Pain"]}) { 
		/call cast "Aura of Pain" 
		/varset Fifth 74s 
	} 

	/if (!${Sixth} && ${Me.SpellReady["Terror of Discord"]}) { 
		/call cast "Terror of Discord" 
		/varset Sixth 7.5s 
	} 


Last edited by botofall on Thu Oct 28, 2004 10:55 am, edited 2 times in total.

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Wed Oct 27, 2004 10:45 pm

.Equal[] is for string comparisons, which you actually have Mode declared as, but you are trying to do integer comparisons in your first check.

If you want to make it an int, then you should be using:

Code: Select all

/if (${Mode}==1)
/if (${Mode}==2)
...
If you really want to use a string for some reason then

Code: Select all

/if (${Mode}!=1)
would be:

Code: Select all

/if (${Mode.NotEqual[1]})but I am still kind of wondering whyyou check for it to not be 1, before checking for 1,2,3,4...
Last edited by Chill on Thu Oct 28, 2004 9:36 am, edited 1 time in total.

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Thu Oct 28, 2004 5:58 am

It's .Equal not .Equals ...

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Thu Oct 28, 2004 9:42 am

Okay I just re-wrote your mode check. Here is what I would suggest:

Code: Select all

Sub Main(int Mode,string MA,float view) 
...
:Start 
/if (${Mode}==1) { 
   /popup Attacking ${Target.Name}..... Wont let it Escape 
   /goto :Follow 
} else /if (${Mode}==2) { 
   /popup Tanking ${Target.Name}..... No Moving ! 
   /goto :Tank 
} else /if (${Mode}==3) { 
   /popup Aggroing ${Target.Name} ...... Not letting it Escape 
   /goto :Aggro 
} else /if (${Mode}==4) {
   /popup Assisting .................. 
   /delay 4s 
   /goto :Assist 
} else { 
   /echo try again and pick a mode 
   /endmac 
}
Hope that helps.

botofall
decaying skeleton
decaying skeleton
Posts: 8
Joined: Thu Oct 14, 2004 2:01 am

Post by botofall » Thu Oct 28, 2004 10:28 am

i like that better,,, couldnt fidn a way to make numbers work but thanks i see what you did its even more simplistic