Quick Hand Please

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

I R monk
orc pawn
orc pawn
Posts: 28
Joined: Tue Dec 10, 2002 4:29 pm

Quick Hand Please

Post by I R monk » Fri Apr 09, 2004 10:16 pm

Code: Select all

 | Modified rogue.mac 
| Credits to Jay (rogue.mac) and Lasher et. al. (genbot.mac) 
| 
| Cleaned up some of the code, tossed the xp stuff and fixed events, 
| evade and getbehind. 
| 
| ** Added go back to starting loc, this is good for pulling to a set spot. 
| Version 1.09 ** Added Strike Discipline in beginning - You must have 
| the Discipline in slot 3. 
| Usage: /macro rogue.mac <Assist> <AssistHealth> <AssistRange> <Master>

#chat tell
#Event Enraged "has become ENRAGED" 
#Event Offrage "is no longer enraged" 
#Event Slainby "You have been slain by" 

#include advpath.inc
#include routines.mac 

#turbo 380 

Sub main
/Declare Following global
/Declare Master global
/Declare assisthealth global 
/Declare sneakhide global 
/Declare engagedistance global 
/Declare countdown global 
/Declare MyXLoc global 
/Declare MyYLoc global 
/Declare BaseXLoc global 
/Declare BaseYLoc global 
/Declare targetname global 
/Declare targetid global 
/Declare tankname global 
/Declare attacktarget global 
/Declare tempvar global 
/Declare behindtarget global | 1 = True, 0 = False 
/Declare targetenrage global | 1 = True, 0 = False 
/Declare mobdetail array2 | Mob details array 
/Declare FollowTarget global

/Varset assisthealth @Param1 | Wait until mob is below this health trigger. 
/Varset sneakhide 1 | Sneak Hide between kills; 1 = Yes, 0 = No 
/Varset engagedistance @Param2 | How close mob must be to engage 
/varset tankname @Param0 
/varset tempvar 0 
/varset BaseXLoc $char(x) 
/varset BaseYLoc $char(y)
/varset Master @Param3
/echo "Gretings @Master I'll Assist @tankname at a range of @engagedistance and health of @assisthealth." 


:Wait 
   /if n @sneakhide==1 { 
     /if n $char(ability,Sneak)>0 {
          /doability "Sneak" 
     }
     /if n $char(ability,Hide)>0 {
          /doability "Hide"
    }
   }
   /DoEvents
   /assist @tankname 
   /delay 1s 
   /attack off 
   /delay 1s 
   /if "$target()"=="FALSE" { 
      /target @tankname 
      /face 
      /goto :Wait 
   } 
   /if "$target(type)"!="NPC" { 
      /target @tankname 
      /face 
      /goto :Wait 
   } 
   /if n @tempvar!="$target(hp,pct)" { 
      /echo $target(name,clean) targeted at $target(hp,pct)% at distance $target(distance). 
   } 
   /varset tempvar "$target(hp,pct)" 
   /face 
   /if n "$target(hp,pct)"<=@assisthealth { 
      /if n "$target(distance)<=@engagedistance" { 
      /goto :Attack 
      } 
   } 
   /DoEvents 
   /goto :Wait 

:Attack 
   /echo Fighting $target(name,clean). It is a level $target(level) $target(race). 
   /varset attacktarget 1 
   /varset behindtarget 0 
   /varset targetenrage 0 
   /if $char(sneaking)=="TRUE" /doability "Sneak" 

:AttackLoop 
   /if n @attacktarget==0 /Attack off 
   /if "$target()"=="FALSE" /goto :AttackEnd 
   /if "$target(id)"!="@targetid" /goto :AttackEnd  
   /call GetBehind 
   /if n @attacktarget==1 {  
      /if n $target(distance)<$target(maxrange) { 
         /doability backstab 
         /if n $char(ability,hide)!=-2 {
            /attack off
            /delay 1 
         }
         /if $char(ability,hide)!=-2 {
            /doability hide 
         }
      } 
   } 
   /attack on
   /face fast 
   /if n $target(distance)>18 /sendkey down up |If target is farther then 18 move forward 
   /if n $target(distance)<8 /sendkey down down |If target is closer then 8 move back 
   /if n $target(distance)<10 /sendkey up up |If target is closer then 10 stop moving forward 
   /if n $target(distance)>9 /sendkey up down |If target is farther then 9 stop moving back 
   /face fast 
   /doevents 
   /goto :AttackLoop 
:AttackEnd 
   /echo "@targetname has died" 
   /sendkey up up 
   /sendkey up down 
   /sendkey up ctrl 
   /varset attacktarget 0 
   /varset tempvar 0 
   /attack off 
   /echo "Waiting for @tankname to select a new target..." 
   /call GotoLoc2 @BaseXLoc @BaseYLoc 
   /goto :Wait 
/endmacro 

Sub GetBehind 
   /varset countdown 0 
   /varset MyXLoc $char(x) 
   /varset MyYLoc $char(y) 

   /if n $distance($calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10))<3 { 
      /goto :noneed 
   } 
   /if $target()==FALSE /return 
   /sendkey down up 
:gobehindloop 
   /if $target()==FALSE { 
      /sendkey up up 
      /return 
   } 
   /if n @countdown>=20 { 
      /if n @MyXLoc==$char(x) { 
         /if @MyYLoc==$char(y) { 
            /sendkey up up 
            /return 
         } 
      } 
      /varset MyXLoc $char(x) 
      /varset MyYLoc $char(y) 
      /varset countdown 0 
   } 
   /varadd countdown 1 
   /doevents 
   /if "$char(state)"=="SIT" /stand 
   /face nolook fast loc $calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10) 
   /if n $distance($calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10))>1 /goto :gobehindloop 
   /sendkey up up 
   /if "$char(state)"=="SIT" /stand 
   /face fast 
:noneed 
/return 

Sub GotoLoc2 
   /declare XLoc local 
   /declare YLoc local 
   /varset XLoc @Param0 
   /varset YLoc @Param1 
:GotoLocLoop 
   /face nolook loc @YLoc,@XLoc 
   /sendkey down up 
   /if n $distance(@YLoc,@XLoc)>5 { 
      /goto :GotoLocLoop 
   } 
  /sendkey up up 
/return 


| ----- Events called by /DoEvents ----- 

Sub Event_Chat 

	/if "@Param0"!="TELL" { 
	        /return 
	} 

	/if @Param1==@Master {
		/if "@Param2"=="Buff" {
		        /cleanup
		        /press i
        		/cast item "Stanos' Wicked Gauntlets"
        		/delay 4s
			/finditem "Velium Coldain Insignia Ring"
			/delay 1
			/mouseto rfinger
			/delay 1
			/click left
			/delay 1
			/cast item "Velium Coldain Insignia Ring"
			/delay 1s
			/click left
			/delay 1
			/click left auto
			/delay 1s
			/cleanup
			/return
		}

		/if "@Param2"=="follow" {
			/varset Following 1
			/varset FollowTarget "@Master" 
			/call InitAPFVars 1 15 20
:StartFollow

			/call FollowFunction "@FollowTarget" 
			/doevents
			/if n @following==0 {
				/varset BaseXLoc $char(x) 
				/varset BaseYLoc $char(y)
				/return
			}

			/goto :StartFollow
			/return
		}

		/if "@Param2"=="stop" {
			/varset Following 0
			/return
		}
	/return
	}
/return

Sub Event_Enraged 
   /varset attacktarget 0 
   /attack off 
/return 

Sub Event_Offrage 
   /varset attacktarget 1 
   /attack on 
/return 

Sub Event_Slainby 
   /endmacro 
/return
Made some mods to it but haveing some problem with the advpath function. Any thoughts?

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri Apr 09, 2004 10:57 pm

"Quick Hand"

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Fri Apr 09, 2004 11:17 pm

*clap*
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

I R monk
orc pawn
orc pawn
Posts: 28
Joined: Tue Dec 10, 2002 4:29 pm

Post by I R monk » Fri Apr 09, 2004 11:55 pm

Clap? thay got a shot to cure that Lax hehe

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Sat Apr 10, 2004 12:41 am

dkaa has a quick hand?

/duck