MonkHunter 3.1 (Template)

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

Moderator: MacroQuest Developers

kirre
orc pawn
orc pawn
Posts: 16
Joined: Wed Dec 17, 2003 1:53 am

MonkHunter 3.1 (Template)

Post by kirre » Sat Feb 07, 2004 4:26 am

KNOWN PROBLEM: the destroying $cursor(name) /echo has been | Commented | out. When you loot an item you have on keeper list it would say "keepering #####" and then say "destroying NULL" and i could not figgure out how to fix it. any idea's?

Code: Select all

|======================================================================|
| MonkHunter.mac  - Template                                           |
| Version 3.1 - Originly Gnolls.mac                                    |
| Created by: kirre                                                    |
|                                                                      |
| This is my 2nd Real script, put together of parts of other scripts   |
| and some stuff I managed to come up with.  This Version is made      |
| Specificly for Monks In Open Area's. This script will work for any   |
| Level w/ Lil Modification.  By Default it uses Mend and Bindwound    |
| when HP is low, and Disarm and Flying kick durring Combat. That      |
| Can be Changed Below.                                                |
|                                                                      |
| Would Like to Thank and say Sorry to the Poor Basterds that had      |
| To Listen to me in the Chat today while i worked on this script.     |
| Approx 6-8 hours to make this script, and Get the buggs out.  Yes    |
| It took that long again for this n00b to do it.  So thank you to     |
| those Of you that put up with me durring that time.                  |
|                                                                      |
| This Script Best Works in open Area's rather then with places        |
| where you bust Turn.  When returning to Anchor it Runs in a          |
| Straight Line to get thier.  Also Don't use near water or lava.      |
| You have Been Warned!                                                |
|                                                                      |
| WARNING: You must edit parts of this script.                         |
| If you are getting to much spam do-to Spawn Times being slow         |
| Comment out the /echo regarding No Mobs Within Said Searchsphere     |
|                                                                      |
| Chow                                                                 |
| Kirre                                                                |
|======================================================================|

#turbo 50                                         | Turbo Speed - Don't touch
#define ENEMY "#####"                             | What you want to hunt. Name or Partial Name.
#define AnchorX "######.##"                       | LOC for your Anchor Point X 
#define AnchorY "######.##"                       | LOC for your Anchor Point Y 
#define SearchSphere "Radius ## ZRadius ##"       | This is the Radius in which it searchs for Said NPC's 
#define MaxBW "50"                                | Max you can Bind Wound to.

Sub Main 
/declare Keeper1 Global                           | Loot Settings. 
/declare Keeper2 Global                           | Loot Settings. 
/declare Keeper3 Global                           | Loot Settings. 
/declare AnchorX Global                           | Achor Setting.  Don't Touch
/declare AnchorY Global                           | Achor Setting.  Don't Touch
/declare LootSlot Global                          | Loot Settings.  Don't Touch
/varset Keeper1 "Item Name Here"                  | Item to Keep.  Edit Here or ingame with /varset
/varset Keeper2 "Item Name Here"                  | Item to Keep.  Edit Here or ingame with /varset
/varset Keeper3 "Item Name Here"                  | Item to Keep.  Edit Here or ingame with /varset
/varset LootSlot 0                                | Loot Settings.  Don't Touch
   
:MainLoop 
   /call CheckHP                                | Checks to Make sure your not almost dead.
   /call GMCheck                                | Checks if GM's in the Zone.  Camps if thier are.
   /call GetTarget                              | Target closest Enemy within Said Radius.
   /call KillMob                                | Walks to and kills Mob.  Will follow it the best it can.
   /call LootMob                                | Loots Mob You Just killed
   /call MoveToAnchor                           | Returns to Anchor Point Defined above.
   /goto :MainLoop 
/return 

Sub CheckHP 
 /if n $char(hp,pct)<=25 { 
  /doability "Mend" 
  /echo Used Mend skill Do to Low Hit Points 
  /echo [HP: $char(hp,pct)%] 
 /if n $char(hp,pct)<MaxBW
  /call BindWound
} 
/return 

Sub GMCheck
 :GMChecker
   /if $GM=="TRUE" { /sit on /camp }
/return

Sub GetTarget 
 :TargetLoop 
  /cleanup 
  /echo Searching for a ENEMY 
  /target npc ENEMY SearchSphere
   /if ("$target()"=="FALSE" || n $target(hp,pct)<=95) { 
    /echo Unable to locate any targets nearby... Will try again in 10 seconds. 
    /delay 10s
 /goto :TargetLoop 
 }
/return 

Sub KillMob 
 /face fast 
  /echo killing $target(name,clean) 
   /attack $target(name,clean) 
|    /if "$combat"=="TRUE" {
     :kickinass
      /if "$combat"=="TRUE" { 
      /if n $target(distance)>=15 /sendkey down up | 20 for Regular Mobs, 30 for Giant Size 
        /face fast 
      /if n $target(distance)>=13 /sendkey down up | 18 for Regular Mobs, 28 for Giant Size 
        /face fast 
      /if n $target(distance)<=10 /sendkey up up | 10 for Regular Mobs, 15 for Giant Size 
        /face fast 
      /if n $target(distance)<=8 /sendkey up up | 8 for Regular Mobs, 13 for Giant Size
        /face fast 
    /if $char(ability,"Flying Kick")>0 /doability "Flying Kick" 
    /if $char(ability,"Disarm")>0 /doability "Disarm" }
    /if "$target()"=="TRUE" /goto :kickinass 
/return 

sub LootMob 
   :LootMob
   /target npc corpse
   /loot 
   /delay 1s 
   :lootloop 
   /if n LootSlot>=10 /call DoneLooting 
   /click left corpse @LootSlot 
   /delay 1s 
   :itemchecker 
     /if "$cursor()"!="TRUE" /call DoneLooting 
     /if "$cursor()"!="NULL" { 
      /if "$cursor(name)"=="@Keeper1" {
       /echo Keeping $cursor(name) 
       /autoinventory }
        /if "$cursor(name)"=="@Keeper2" {
         /echo Keeping $cursor(name) 
         /autoinventory }
         /if "$cursor(name)"=="@Keeper3" {
          /echo Keeping $cursor(name) 
          /autoinventory }
|        /echo Destroying $cursor(name) | this was causing a minor Echo problem
        /destroy 
        /varadd LootSlot 1
        /goto :lootloop 
  }
/return

Sub MoveToAnchor 
 :AnchorMoveLoop 
  /if "$char(state)"=="SIT" /stand 
   /face nolook loc AnchorX,AnchorY
    /if n $distance(AnchorX,AnchorY)>11 /sendkey down up 
    /if n $distance(AnchorX,AnchorY)<=11 { 
     /sendkey up up 
      /return } 
    /goto :AnchorMoveLoop 
/return 


| ########## Subroutines ########## 

sub BindWound
 :BW
  /target myself
   /doability "Bind Wound" 
    /if n $char(hp,pct)<MaxBW {
  /goto :BW }
  /call Main
/return

Sub DoneLooting
    :DoneLooting
       /varset LootSlot 0 
          /cleanup 
/return 

| EOF |
I will Now Break Down Each part and Explain it.
#turbo 50
#define ENEMY "#####"
#define AnchorX "######"
#define AnchorY "######"
#define SearchSphere "Radius ## ZRadius ##"
#turbo: This will prevent bad macros from locking up the client by allowing you to limit the number of commands per iteration.
The default is 500. A value of 1 will essentially disable #turbo (Script is based on 50). -- Taken from the Manual.

ENEMY "#####": This Defines what you are attacking. An Example #define ENEMY "giant" will attack anything with Giant in the name.
If you wish to attack anything within a certain range then remove #Define ENEMY Line from you script and just use /target npc SEARCHSPHERE

AnchorX "####.##": This is the X location that you will return to after each kill. Use /loc to get this information.
If your X LOC is a Negitive number then put the -####.##. It should include Decimal places even if they are just ####.00

AnchorY "####.##": This is the Y location that you will return to after each kill. Use /loc to get this information.
If your Y LOC is a Negitive number then put the -####.##. It should include Decimal places even if they are just ####.00

SearchSphere "Radius ## ZRadius ##": This is the distance out it searches for a MOB. Radius is Distance around you. ZRadius
is how high or low you want it to check. Lower Zradius is better in places with multiple floors or ramps (such as towers)

MaxBW: Max HP you can Bind wound upto. Default is 50%
Sub Main
/declare Keeper1 Global
/declare Keeper2 Global
/declare Keeper3 Global
/declare AnchorX Global
/declare AnchorY Global
/declare LootSlot Global
/varset Keeper1 "Item Name Here"
/varset Keeper2 "Item Name Here"
/varset Keeper3 "Item Name Here"
/varset LootSlot 0
NOTHING... should be touched here with the exception of:
/varset Keeper1 "Item Name Here"
/varset Keeper2 "Item Name Here"
/varset Keeper3 "Item Name Here"
This is what we call fill in the blanks. "ITEM NAME HERE" is that you want to loot. this script is setup to loot only 3 items.
I will post a small tutorial on adding more for the scripting impaired. The Item names are case sensitive. One way to do it
is to have an item you want looted on you already. Pick the item up in your cursor while the script is running and type
/varset Keeper# $cursor("name")
:MainLoop
/call CheckHP
/call GMCheck
/call GetTarget
/call KillMob
/call LootMob
/call MoveToAnchor
/goto :MainLoop
/return
Nothing needs to be changed here at all. This is your basic run of the mill Loop. If you want somthing here to not run
you can comment it out.
Example: | /call LootMob
That would stop the script from doing any looting, thus leaving all corpses alone.
Sub CheckHP
/if n $char(hp,pct)<=25 {
/doability "Mend"
/echo Used Mend skill Do to Low Hit Points
/echo [HP: $char(hp,pct)%]
/if n $char(hp,pct)<MaxBW
/call BindWound
}
/return
The only things here that may need changing is
/if n $char(hp,pct)<=25 {
This is a setting for when to use your MEND ability.
Sub GMCheck
:GMChecker
/if $GM=="TRUE" { /sit on /camp }
/return
This is basicly an "If thier is a GM in the zone sit and camp so you don't get your ass Banned."
Sub GetTarget
:TargetLoop
/cleanup
/echo Searching for a ENEMY
/target npc ENEMY SearchSphere
/if ("$target()"=="FALSE" || n $target(hp,pct)<=95) {
/echo Unable to locate any targets nearby... Will try again in 10 seconds.
/delay 10s
/goto :TargetLoop
}
/return
This only needs to be changed if You want to hunt EVERYTHING in said Radius. Read under #define ENEMY for changing to do so.
Sub KillMob
/face fast
/echo killing $target(name,clean)
/attack $target(name,clean)
:kickinass
/if "$combat"=="TRUE" {
/if n $target(distance)>=15 /sendkey down up | 15 for Regular Mobs, 25 for Giant Size
/face fast
/if n $target(distance)>=13 /sendkey down up | 13 for Regular Mobs, 23 for Giant Size
/face fast
/if n $target(distance)<=10 /sendkey up up | 10 for Regular Mobs, 15 for Giant Size
/face fast
/if n $target(distance)<=8 /sendkey up up | 8 for Regular Mobs, 13 for Giant Size
/face fast
/if $char(ability,"Flying Kick")>0 /doability "Flying Kick"
/if $char(ability,"Disarm")>0 /doability "Disarm" }
/if $char(hp,pct)<=25 {
/attack off
/cleanup
/doability "Feign Death" }
/if "$target()"=="TRUE" /goto :kickinass
/return
Listed above commented out lists the numbers used based on Mob size. The only other thing that may need changing is
if you use a monk ability other then flying kick (example: Dragon Punch). Change as needed
sub LootMob
:LootMob
/target npc corpse
/loot
/delay 1s
:lootloop
/if n LootSlot>=10 /call DoneLooting
/click left corpse @LootSlot
/delay 1s
:itemchecker
/if "$cursor()"!="TRUE" /call DoneLooting
/if "$cursor()"!="NULL" {
/if "$cursor(name)"=="@Keeper1" {
/echo Keeping $cursor(name)
/autoinventory }
/if "$cursor(name)"=="@Keeper2" {
/echo Keeping $cursor(name)
/autoinventory }
/if "$cursor(name)"=="@Keeper3" {
/echo Keeping $cursor(name)
/autoinventory }
| /echo Destroying $cursor(name)
/destroy
/varadd LootSlot 1
/goto :lootloop
}
/return
NOTHING here should be touched. If you wish to loot more then 3 items, follow the tutorial to follow.
Sub MoveToAnchor
:AnchorMoveLoop
/if "$char(state)"=="SIT" /stand
/face nolook loc AnchorX,AnchorY
/if n $distance(AnchorX,AnchorY)>11 /sendkey down up
/if n $distance(AnchorX,AnchorY)<=11 {
/sendkey up up
/return }
/goto :AnchorMoveLoop
/return
Again nothing here should be touched. This will walk you in a straight line to your AnchorX,and AnchorY
sub BindWound
:BW
/target myself
/doability "Bind Wound"
/if n $char(hp,pct)<MaxBW {
/goto :BW }
/call Main
/return
Nothing needs to be touched here.
Sub DoneLooting
:DoneLooting
/varset LootSlot 0
/cleanup
/return
NOTHING should be touched here.

That about concludes the explanations. To follow is the tutorial on Adding Loot to the Loot List.
Adding to the Loot List:

First you must make a Global Varible for another Keeper, and a new VarSet for the item.. In this case it will be Keerp4
Sub Main
/declare Keeper1 Global | Loot Settings.
/declare Keeper2 Global | Loot Settings.
/declare Keeper3 Global | Loot Settings.
/declare AnchorX Global | Achor Setting. Don't Touch
/declare AnchorY Global | Achor Setting. Don't Touch
/declare LootSlot Global | Loot Settings. Don't Touch
/varset Keeper1 "Item Name Here" | Item to Keep. Edit Here or ingame with /varset
/varset Keeper2 "Item Name Here" | Item to Keep. Edit Here or ingame with /varset
/varset Keeper3 "Item Name Here" | Item to Keep. Edit Here or ingame with /varset
/varset LootSlot 0 | Loot Settings. Don't Touch
would be edited to look like
Sub Main
/declare Keeper1 Global | Loot Settings.
/declare Keeper2 Global | Loot Settings.
/declare Keeper3 Global | Loot Settings.
/declare Keeper4 Global | This is the NEW KEEPER
/declare AnchorX Global | Achor Setting. Don't Touch
/declare AnchorY Global | Achor Setting. Don't Touch
/declare LootSlot Global | Loot Settings. Don't Touch
/varset Keeper1 "Item Name Here" | Item to Keep. Edit Here or ingame with /varset
/varset Keeper2 "Item Name Here" | Item to Keep. Edit Here or ingame with /varset
/varset Keeper3 "Item Name Here" | Item to Keep. Edit Here or ingame with /varset
/varset Keeper4 "New Item Name Here" | This is out NEW ITEM KEEPER
/varset LootSlot 0 | Loot Settings. Don't Touch
Next we have to head down to:
sub LootMob
:LootMob
/target npc corpse
/loot
/delay 1s
:lootloop
/if n LootSlot>=10 /call DoneLooting
/click left corpse @LootSlot
/delay 1s
:itemchecker
/if "$cursor()"!="TRUE" /call DoneLooting
/if "$cursor()"!="NULL" {
/if "$cursor(name)"=="@Keeper1" {
/echo Keeping $cursor(name)
/autoinventory }
/if "$cursor(name)"=="@Keeper2" {
/echo Keeping $cursor(name)
/autoinventory }
/if "$cursor(name)"=="@Keeper3" {
/echo Keeping $cursor(name)
/autoinventory }
| /echo Destroying $cursor(name)
/destroy
/varadd LootSlot 1
/goto :lootloop
}
/return
This should be changed to look like:
sub LootMob
:LootMob
/target npc corpse
/loot
/delay 1s
:lootloop
/if n LootSlot>=10 /call DoneLooting
/click left corpse @LootSlot
/delay 1s
:itemchecker
/if "$cursor()"!="TRUE" /call DoneLooting
/if "$cursor()"!="NULL" {
/if "$cursor(name)"=="@Keeper1" {
/echo Keeping $cursor(name)
/autoinventory }
/if "$cursor(name)"=="@Keeper2" {
/echo Keeping $cursor(name)
/autoinventory }
/if "$cursor(name)"=="@Keeper3" {
/echo Keeping $cursor(name)
/autoinventory }
/if "$cursor(name)"=="@Keeper4" { | THIS WAS ADDED
/echo Keeping $cursor(name) | THIS WAS ADDED
/autoinventory } | THIS WAS ADDED
| /echo Destroying $cursor(name)
/destroy
/varadd LootSlot 1
/goto :lootloop
}
/return
We added an /if "$cursor(name)"!="@Keeper4" { to check Keeper4 (varible we made above), Then the basic echo, and autoinventory

Save the file and run the MOFO to kill stuff.
Last edited by kirre on Fri Feb 13, 2004 7:07 pm, edited 4 times in total.

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

bugged all to hell

Post by rzmonk76 » Mon Feb 09, 2004 11:29 pm

a lil buggy to me
Last edited by rzmonk76 on Thu Feb 12, 2004 7:48 pm, edited 1 time in total.

kirre
orc pawn
orc pawn
Posts: 16
Joined: Wed Dec 17, 2003 1:53 am

Post by kirre » Wed Feb 11, 2004 6:42 pm

i have had no problems with it, but i have a revised version now that allows looting of Specific items as well. Will test it out soon and post it. Been busy working on another script and have not tested it yet.

chow
kirre

kirre
orc pawn
orc pawn
Posts: 16
Joined: Wed Dec 17, 2003 1:53 am

Post by kirre » Fri Feb 13, 2004 2:02 am

ok i know why urs was doing circles, it was a change i made with /face after i was done using the script LOL. I will post another copy here soon. The new copy will work based on a better looting system (keeps what you tell it to... instead of keeping everything excpet whats on the destroy list).

chow
kirre

kirre
orc pawn
orc pawn
Posts: 16
Joined: Wed Dec 17, 2003 1:53 am

Post by kirre » Fri Feb 13, 2004 3:26 am

Posted a new copy - with manual. Ttry it out

chow
kirre

daerck
a ghoul
a ghoul
Posts: 134
Joined: Mon Jan 12, 2004 8:44 pm

Post by daerck » Fri Feb 13, 2004 9:07 pm

KNOWN PROBLEM: the destroying $cursor(name) /echo has been | Commented | out. When you loot an item you have on keeper list it would say "keepering #####" and then say "destroying NULL" and i could not figgure out how to fix it. any idea's?

Change

Code: Select all

/if "$cursor(name)"=="@Keeper1" { 
       /echo Keeping $cursor(name) 
       /autoinventory } 
        /if "$cursor(name)"=="@Keeper2" { 
         /echo Keeping $cursor(name) 
         /autoinventory } 
         /if "$cursor(name)"=="@Keeper3" { 
          /echo Keeping $cursor(name) 
          /autoinventory } 
|        /echo Destroying $cursor(name) | this was causing a minor Echo problem 
        /destroy 

To

Code: Select all

/if "$cursor(name)"~~"@Keeper1"||"$cursor(name)"~~"@Keeper2"||"$cursor(name)"~~"@Keeper3" {
   /echo Keeping $cursor(name)
   /autoinventory
} else {
   /echo Destroying $cursor(name)
   /destroy
}

kirre
orc pawn
orc pawn
Posts: 16
Joined: Wed Dec 17, 2003 1:53 am

Post by kirre » Sun Feb 15, 2004 2:35 am

is that tested or speculation?

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

Post by ml2517 » Sun Feb 15, 2004 2:40 am

The code didn't look right, this should work I'd think:

Code: Select all

/if (("$cursor(name)"=="@Keeper1" || "$cursor(name)"=="@Keeper2") || "$cursor(name)"=="@Keeper3") { 
   /echo Keeping $cursor(name) 
   /autoinv 
} else { 
   /echo Destroying $cursor(name) 
   /destroy 
} 

daerck
a ghoul
a ghoul
Posts: 134
Joined: Mon Jan 12, 2004 8:44 pm

Post by daerck » Sun Feb 15, 2004 9:19 am

Which hasppens to be the same with added paranthesis. Are those required with multiple || operators?
Since it's not in TFM I wouldn't know

== vs ~~: ~~ is much more flexible when checking for stuff to keep or not.

The original problem was that you didn't put the destroy part in an else statement, i.e. It was executed always, regardless if the previous if statement(s) were true or not.

If you want to stick with your previous nested if's it should be something like this

Code: Select all

/if "$cursor(name)"=="@Keeper1" { 
   /echo Keeping $cursor(name) 
   /autoinventory 
} else /if "$cursor(name)"=="@Keeper2" { 
   /echo Keeping $cursor(name) 
   /autoinventory 
} else /if "$cursor(name)"=="@Keeper3" { 
   /echo Keeping $cursor(name) 
   /autoinventory
} else {
   /echo Destroying $cursor(name) | this was causing a minor Echo problem 
   /destroy 
}
If you want to test it just comment the /destroy. Then it will echo "Destroyiong xyz" but won't actually destroy it.

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

Post by ml2517 » Sun Feb 15, 2004 2:07 pm

Would I have posted the corrected code if it was correct as is?

http://macroquest2.com/phpBB2/viewtopic.php?t=5104

Midnight
a lesser mummy
a lesser mummy
Posts: 68
Joined: Wed Nov 12, 2003 12:51 pm

Post by Midnight » Fri Feb 20, 2004 12:51 pm

I took out Bind Wound and the Looting system since I never use it and can't think of a reason to use the looting system at the moment. Anyhow, this version runs to the mob, stalls for aggro, pulls the mob back to the original anchor spot.. then fights. If it brought adds, it checks radius 50 and kills whatever is left in its radius... If nothing, it runs back to its anchor spot and begins to check its radius again. I found if you don't use the pull method, too many mobs aggo during the fight and you have a much higher recovery time.

I took kirre's basic hunter design, some snippets from Grimjack's avoid obstacle code, some stuff from my attack mac, and added some more. Right now instead of bandaging .. it runs back to the SS (Safe spot anchor) if below 20% HP and FD's at camp.. re FD's if fail, and stays down until the 'Your enemies forget you'.. then promptly stands up, trips your healing disc.. and sits to med.

I tweaked it so I can actually use this AFK to get xp (slow xp.. but any xp AFK is nice) in a couple OPEN zones.. Don't use this in a dungeon or where lots of objects are in front of you. Also not a good idea to use this where camps of 3 or more mobs in a clump lie unless you can obviously over power them.

Few other things in there I added, removed. There's a couple bugs here/there.. the attack code kinda sux IMO, but its 90% clean. Too lazy atm to add any comments to the code. Suggestions welcome, etc etc.

Code: Select all

#turbo 50
| #define ENEMY "#####"
#define AnchorX "####.##"
#define AnchorY "####.##"
#define SearchSphere "Radius ### ZRadius ###"
#event stunned "You are stunned!"
#event unstunned "You are unstunned"
#event fallen "has fallen to the ground"
#event forgotten "Your enemies have forgotten you!"
#event hitsyou "hits YOU for"

Sub Main 
/declare AnchorX Global
/declare AnchorY Global
/declare MyXLOC global
/declare MyYLOC global
/declare ObstacleCount global
/declare stunvar global
/declare atk global
/declare fdfail global
/declare hitfail global

/varset stunvar 0
/varset atk 1
/varset fdfail 0
/varset hitfail 0
/varset MyXLOC $char(x) 
/varset MyYLOC $char(y) 
/varset ObstacleCount 0 
    
:MainLoop 
   /call CheckHP
   /call GMCheck
   /call GetTarget
   /call MovetoMob
   /call KillMob
   /call MoveToAnchor
   /goto :MainLoop 
/return 

| ### SUBS ### |

Sub CheckHP
     /if n $char(hp,pct)<=25 {
     /if n $char(ability,"Feign Death")>0 /doability "Feign Death"
     /call WaitingHP
     }
/return 

Sub GMCheck 
:GMChecker 
   /if $GM=="TRUE" {
    /if n $char(ability,"Feign Death")>0 /doability "Feign Death"
    /quit 
    }
/return 

Sub GetTarget 
:TargetLoop 
  /echo Searching for an ENEMY 
  /target npc SearchSphere
  /delay 1s
   /if ("$target()"=="FALSE" || n $target(hp,pct)<=95) { 
    /echo No locations .. Trying again in 10 seconds. 
    /delay 10s 
/goto :TargetLoop 
} 
/return 

sub MoveToMob 
  /echo Pulling $target(name,clean)
  /if n $target(distance)<=15 { 
    /face 
    /return 
  } 
  /sendkey down up 

  :Movementloop 
    /varadd ObstacleCount 1 
    /if $target()=="FALSE" /return
    /face  
    /if n $target(distance)<=30 { 
      /face 
      /sendkey up up
      /delay 2s
      /call MovetoAnchor
      /delay 3s
      /return 
    } 
    /if @ObstacleCount>=3 { 
      /call CheckObstacle 
      /goto :Movementloop 
    } 
    /if n $target(distance)>20 /goto :MovementLoop 
/return

sub CheckObstacle 
  /if n @MyXLOC==$char(x) /if n @MyYLOC==$char(y) /call HitObstacle 
  /varset MyXLOC $char(x) 
  /varset MyYLOC $char(y) 
  /varset ObstacleCount 0 
/return 

sub HitObstacle 
  /sendkey up up 
  /sendkey down down 
  /delay 3 
  /sendkey up down 
  /sendkey down ctrl 
  /if n $rand(99)>50 { 
    /sendkey down right 
  } else { 
    /sendkey down left 
  } 
  /delay 5
  /sendkey up right 
  /sendkey up left 
  /sendkey up ctrl 
  /sendkey down up 
/return 

Sub KillMob
:KillStart
/if @atk==1 { 
/face fast 
   /attack $target(name,clean) 
     :kickinass 
      /if "$combat"=="TRUE" { 
      /if n $target(distance)>=15 /sendkey down up
        /face fast 
      /if n $target(distance)>=13 /sendkey down up 
        /face fast 
      /if n $target(distance)<=10 /sendkey up up
        /face fast 
      /if n $target(distance)<=8 /sendkey up up
        /face fast 
      /if $char(ability,"Flying Kick")>0 /doability "Flying Kick" 
      /if $char(ability,"Disarm")>0 /doability "Disarm" } 
      /if n $char(ability,"Mend")>=0 { 
       /if n $char(hp,pct)<75 /doability "Mend" 
      } 
        /if n $char(hp,pct)<=20 { 
        /attack off 
        /echo << $char(hp,pct)% LOW HP - SS >>
        /call MoveToAnchor
    } 
    }
    /doevents
    /if "$target()"=="TRUE" /goto :kickinass
    /if $target(id)==0 {
      /target npc radius 50
      /if $target()==FALSE /return
      /delay 1s
      /goto :KillStart
      }
/return 

Sub MoveToAnchor 
:AnchorMoveLoop 
  /if "$char(state)"=="SIT" /stand 
   /face nolook loc AnchorX,AnchorY 
    /if n $distance(AnchorX,AnchorY)>11 /sendkey down up 
    /if n $distance(AnchorX,AnchorY)<=11 { 
     /sendkey up up
:FallenLoop
     /if n $char(hp,pct)<=25 { 
       /attack off
       /if n $char(ability,"Feign Death")>0 /doability "Feign Death"
       /doevents fallen
       /look
       /echo << $char(hp,pct)% LOW HP - FD >>
       /if @fdfail==1 { 
       /varset fdfail 0 
       /stand
       /goto :FallenLoop 
       } 
       /call WaitingHP 
       } 
      /return } 
    /goto :AnchorMoveLoop 
/return 

Sub WaitingHP
/press Esc
:Waiting
  /if @hitfail==1 {
    /varset hitfail 0
    /stand
    /if n $char(ability,"Feign Death")>0 /doability "Feign Death"
    /goto :Waiting
   }
  /if n $char(ability,"Mend")>=0 { 
   /if n $char(hp,pct)<75 /doability "Mend" 
  } 
  /if n $char(hp,pct)<=95 { 
  /echo Medding to full .. HP: $char(hp,pct)%
  /delay 30s
  /doevents forgotten
  /doevents hitsyou
  /goto :Waiting
  }
/stand
/return

| ### EVENTS ### |

Sub Event_stunned 
   /if $target()=="TRUE" { 
      /varset stunvar 1
      /varset atk 0 
      /echo You are stunned - Halting Attack
      /attack off 
   } 
/return 

Sub Event_unstunned 
   /if $target()=="TRUE" { 
         /varset stunvar 0 
         /varset atk 1
         /echo You are no longer stunned - Rengaging
         /stand
         /attack 
      } 
/return

Sub Event_fallen 
   /varset fdfail 1 
/return 

Sub Event_hitsyou 
   /varset hitfail 1 
/return 

Sub Event_forgotten
   /stand
   /disc healing
   /echo Healing Disc Enabled ..
   /delay 2s
   /sit
   /delay 60s
/return

code4food
orc pawn
orc pawn
Posts: 24
Joined: Fri Feb 20, 2004 12:31 pm

Post by code4food » Fri Feb 20, 2004 1:30 pm

hmmm, might need to add a bit to cast rotlc, rotwf, or epic (if available) during the fight (or swap it in, cast it, and swap it out), and once you return to anchor point, check your self buffs, recast if necessary.
bind wound is a PITA to have in there, perhaps a toggle to use a clickie healer if available (velious class armor chest, other various and sundry bits)

kirre
orc pawn
orc pawn
Posts: 16
Joined: Wed Dec 17, 2003 1:53 am

been awhile

Post by kirre » Tue Mar 23, 2004 2:54 am

Wow its been awhile since i been on the forums, and OMG someone uses my script? that surprises me lol. Honestly i have had not problems with it, as for the Epic right click auto thing, its why i was here. i will be lookin into it :) I am 1 fight away from getting it

chow
kirre

Sadistic
orc pawn
orc pawn
Posts: 11
Joined: Mon Jan 19, 2004 1:33 am

just outa curiosity

Post by Sadistic » Wed Mar 31, 2004 7:50 pm

(Taking into assumption that im reading both sets of code correctly)

Wouldnt one want the GM check to be inside the target loop as opposed to outside the loop. It seems as if it checks for the GM initially on run and once the targetloop is called the GM check goes into a holding pattern. Am I mistaken or would it be more prudent to move that code inside the target loop (and possibly the other loops as well).

daerck
a ghoul
a ghoul
Posts: 134
Joined: Mon Jan 12, 2004 8:44 pm

Post by daerck » Wed Mar 31, 2004 8:14 pm

Does't make that much of a difference as a GM (not a Guide) in anon mode won't be recognized by $gm anyways.