Lazy Pally

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

Moderator: MacroQuest Developers

Nazgul[NL]
decaying skeleton
decaying skeleton
Posts: 2
Joined: Thu Feb 05, 2004 1:23 pm

Lazy Pally

Post by Nazgul[NL] » Thu Feb 05, 2004 1:25 pm

This is my first serious attempt at creating my own macro.. I'm pretty prould of it myself sofar. If anyone has any tips, please let me know

Code: Select all


| Lazy Pally by Nazgul
| 1.0
| Usage, /macro LazyPally [1/0]
| 1 = use autotaunt
| 0 = do not use autotaunt

Sub Main
/echo Lazy Pally Started...
/declare Taunt Global
/declare Bash Global
/declare Fastrange Global
/declare Combatrangefar Global
/declare Combatrangeclose Global
/declare Outofrange Global
/declare Targettemp Global
/varset Taunt @Param0
/varset Bash 1
/varset Fastrange 15
/varset Combatrangefar 12
/varset Combatrangeclose 10
/varset Outofrange 150
/varset Targettemp 0

/if @Taunt==1 {
	/echo Autotaunt enabled
	/goto :Macrostart
}
/if @Taunt==0 {
	/echo Autotaunt disabled
	/goto :Macrostart
}

/echo Illegal argument. Autotaunt disabled
/varset Taunt 0

:Macrostart
	/if $target()=="TRUE" {
		/if $combat=="TRUE" {
				
			/if n $target(distance)>@Outofrange {
				/Goto :Endif1
			}
			/if n $target(distance)>@Fastrange {
				/Call MoveToTarget
				/Goto :Endif1
			}
			/Call CombatLoop
			:Endif1
		}
	}
	/Goto :Macrostart
/return

Sub MoveToTarget
	:Startmovetoloop
	
	/sendkey down up
		
	/face fast
	
	/if $target()=="FALSE" {
		/sendkey up up
		/return
	}
	/if $combat=="FALSE" {
		/sendkey up up
		/return
	}
	/if n $target(distance)<@Fastrange-5 {
		/sendkey up up
		/return
	}
	/call Everycycle
	/Goto :Startmovetoloop
/return

Sub Combatloop
	:Startcombatloop
	/call Everycycle
	/if $target()=="TRUE" {
		/if $combat=="TRUE" {
			/face fast
			/if n $target(distance)>@Combatrangefar /press up
			/if n $target(distance)<@Combatrangeclose /press down
			/if n $target(distance)>@Fastrange /return
			/if n @Bash==1 /if n $char(ability,bash)>0 /doability bash
			/if n @Taunt==1 /if n$char(ability,taunt)>0 /doability taunt
			/if n @Taunt==1 /if n$char(ability,disarm)>0 /doability disarm
		}
	}
	/call Everycycle
	/goto :Startcombatloop
/return

Sub Everycycle
	/if n $char(hp,pct)<50 {
		/if n $char(gem,"Light of Nife")>0 {
			/if n $char(mana,pct)>=50 {
				/varset Targettemp $target(id)
				/sendkey up up
				/press f1
				/cast "Light of Nife"
				/target id @Targettemp
				/delay 1.5s
			}
		}
	}
	
	/if n @Taunt==1 {
		/if $target()=="TRUE" {
			/if $combat=="TRUE" {
				/if n $char(gem,"Cease")>0 {
					/if n $char(mana,pct)>=30 {
						/sendkey up up
						/cast "Cease"
						/delay 1.7s
					}
				}
			}
		}
	}
	
	/if n @Taunt==1 {
		/if $target()=="TRUE" {
			/if $combat=="TRUE" {
				/if n $char(gem,"Desist")>0 {
					/if n $char(mana,pct)>=30 {
						/sendkey up up
						/cast "Desist"
						/delay 2.2s
					}
				}
			}
		}
	}

	/if n @Taunt==1 {
		/if $target()=="TRUE" {
			/if $combat=="TRUE" {
				/if n $char(gem,"Force of Akera")>0 {
					/if n $char(mana,pct)>=30 {
						/sendkey up up
						/cast "Force of Akera"
						/delay 1.2s
					}
				}
			}
		}
	}

	/if n @Taunt==1 {
		/if $target()=="TRUE" {
			/if $combat=="TRUE" {
				/if n $char(gem,"Force of Akilae")>0 {
					/if n $char(mana,pct)>=30 {
						/sendkey up up
						/cast "Force of Akilae"
						/delay 1.2s
					}
				}
			}
		}
	}
	
	/if $gm=="TRUE" {
		/echo GM in zone, ending macro
		/endmacro
	}
/return

Again, any sugestions, let me know.

Gumby
a ghoul
a ghoul
Posts: 99
Joined: Sat Jan 24, 2004 5:27 pm

Post by Gumby » Thu Feb 05, 2004 7:01 pm

Quick run through but a few things:

You don't seem to have an exit condition on your Combatloop with the exception of if the target is outside of @Fastrange... but that's only going to get called if your initial conditions are met (valid target, in combat).

You do a lot of sanity checking on target; some could be consolidated, but you probably want to add at least two more filters:

1) /if "$target(type)"!="NPC" or something along those lines

and

2) /if "$target(state)"!="DEAD"

If you're going to be at the keyboard paying fairly rigorous attention then simply press esc and /shrug if you get stuck on a PC or a corpse; otherwise extra flags are a good thing.

Personally I recommend tossing your exit testing at the beginning of every loop rather than in the middle somewhere nothing suggests you must do that.

Sub Combatloop, no need to call EveryCycle twice... if you watch script processing via echo's you'll see it looping at a ridiculous speed. Also some syntax errors that need fixing; I'd probably just rewrite as this (and this is a quicky, could do better... it's also untested heh):

Code: Select all

Sub Combatloop 
   :Startcombatloop 
   /if ("$target(type)!="NPC" || "$target(state)"=="DEAD") /return
   /if $target()=="TRUE" { 
      /if $combat=="TRUE" {
         /if n $target(distance)>@Fastrange /return 
         /face fast 
         /if n $target(distance)>@Combatrangefar /press up 
         /if n $target(distance)<@Combatrangeclose /press down 
         /if n @Bash==1 /if n $char(ability,bash)>0 /doability bash 
         /if n @Taunt==1 {
            /if n $char(ability,taunt)>0 /doability taunt 
            /if n $char(ability,disarm)>0 /doability disarm 
         }
      }
   } else {
      /return
   }
   /call Everycycle
   /goto :Startcombatloop 
/return
Actually in relooking at it, you need to change all these lines:

/if $target()=="TRUE"
/if $combat=="TRUE"

To, respectively:

/if "$target()"=="TRUE"
/if "$combat"=="TRUE"

G