Hunter.mac - Hunting script --- Updated

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Hunter.mac - Hunting script --- Updated

Post by Fippy » Sun Sep 22, 2002 5:47 pm

Inspired by arantius I modded his script quite a bit, mainly adding a 3 tiered approach to target selection, a list of mobs to avoid targeting near, an easier way of managing looting and some other things I cant remember. I can't get the events to work so if anybody spots why let me know. I am gonna add some form of area avoidance code soon but I am going on my holiday now so I thought id post what i have done so far.

Edit 05/10/02
Fixed annoying bug that made you run around the mob in circle if you couldnt see it.
Added Running back to a home point when low on health.
Added some ability stuff for lowbie monk easy to change for other melee's
Added code to hopefully target any aggro mobs you might pick up.

Edit 07/10/02
Squashed a few bugs with alert priority and removed some debugging logging that is no longer required.
Added a couple more melee /doability's

Edit 07/10/02 a
Fixed TooFar event

Edit 10/10/02
Added area avoidance code. Still a bit unsightly atm but it works. Look at the CheckObstacles and AvoidLoc subs for more info. Uses $heading from IRC20021001a release.

Edit 13/10/02
Moved zone specific stuff into a seperate file. To set up your own zone specific file just edit the one I have included here then save it as yourzone.mac (no spaces in name) and change the name in the #include near the top of the main script.

Code: Select all

| Hunter.mac 
| 
| The ultimate melee class.zone farming script 
| 
#turbo 
#include routines.mac
#include eastcommons.mac

#define LootTotal v50 
#define KSRadius v51 
#define NoLOS v38 
#define TooFarAway v39 
#define MyTarget v40 
#define MyHeading v41 
#define TargetHeading v42 
#define HeadingDelta v43 
#define TargetDead v44 
#define MyXLoc v46 
#define MyYLoc v47 
#define KSCheck v49 
#define TargetLooted v52 
#define LootSlot v54 
#define CheckLoot v55 
#define AttackedMe v56 
#define BackHome v57 
#define HomeY v58 
#define HomeX v59 
#define Attacker v60 


#event CannotSee "You cannot see your target" 
#event TooFar "Your target is too far away" 
#event HitsYou "YOU for" 

sub Main 

/zapvars 
   /mqlog Hunter script v 20021007a started 

   | Set up Alert lists
   /call SetAlerts

   | Set up List of Loot to keep
   /call SetLootList

   | Set Home Point
   /call SetHomePoint

   | Set KS radius below. The script will not target a mob if a PC is within this radius of it. 
   /varset KSRadius 60 
    
   | Set Loot nodrop 
   /lootn never 
    
| 
| First off put clean up any open windows and make sure modifier keys are reset 
   /press esc 
   /press esc 
   /press esc 
   /press esc 
   /press alt 
   /press shift 
   /press ctrl 

| Start of main Loop 
| 
:Start 

   | RestUp 
   /call RestUp 

   | Aquire nearest target to attack 
   /call GetTarget 

   | Advance 
   /call Advance 

   | Loot 
   /call Loot 

   /delay 0 
/goto :Start 

/return 



| RestUp 
sub RestUp 
    
   | Run to Home Base if needed 
   /if n $char(hp,pct)>50 /goto :NoRest 

   |Low on HP's running home    
   /mqlog HPs at $char(hp,pct) heading home 
   /call HomeBase 
    
   | If we didnt make it home we dont want to rest 
   /if n $return!=1 { 
      /mqlog Didnt make it home aborting run home 
      /goto :NoRest 
   } 
    
   | Make sure we are sat down. 
   /mqlog Reached home base resting 
   /sit on 
   :Rest 
      | Check if something has aggroed and attack it if it has. 
      /if n $AttackedMe==1 { 
         /mqlog aggroed whilst sitting 
         /sit off 
         /goto :NoRest 
      } 
      /delay 5 
      /if $char(ability,"Mend")>0 /doability "Mend" 
   /if n $char(hp,pct)<100 /goto :Rest 
   /mqlog Hps at $char(hp,pct) Off hunting again 
} 
:NoRest 
/stand 
/return 

| Acquire Target subroutine 
sub GetTarget 
   :Acquire 
      /if AttackedMe==1 { 
         /mqlog Targeted "$v13" who jumped me 
         /target "$v13" 
         /varset AttackedMe 0 
      } else /if "$alert(1)"=="TRUE" { 
         /target npc alert 1 notnearalert 4 nopcnear $KSRadius 
         /mqlog Targeted $target(name) range $target(distance) on alert list 1 
      } else /if "$alert(2)"=="TRUE" { 
         /target npc alert 2 notnearalert 4 nopcnear $KSRadius 
         /mqlog Targeted $target(name) range $target(distance) on alert list 2 
      } else { 
         /target npc alert 3 notnearalert 4 nopcnear $KSRadius 
         /mqlog Targeted $target(name) range $target(distance) on alert list 3 
      } 
      /varset MyTarget $target(id) 
      /varset TargetDead 0 
      /doevents 
      /delay 0 
   /if n $target(id)==0 /goto :Acquire 
/return 

| Advance to mob subroutine 
sub Advance 

   :Engage 

         |Process any events 
         /doevents 
          
         |Work on sense heading skill 
         /if $char(ability,"Sense Heading")>0 /doability "Sense Heading"          
          
         | Turn towards target 
         /face nopredict 
          
         | If we are not within melee range then make sure we are on autorun 
         /if n $target(distance)>15 /call autorun2 1 
          
         | If we are still a distance away from target search for a closer one 
         /if n $target(distance)>200 { 
            /call GetTarget 
         } 
          

         | Save our current x,y loc 
         /varset MyXLoc $char(x) 
         /varset MyYLoc $char(y) 
         | Wait a then check loc again if we are on same spot call the obstacle routine to try and get around it 
         /delay 1 
         /if n $MyXLoc==$char(x) /if $MyYLoc==$char(y) /call Obstacle 
          
         | If we are within melee range stop running check Target again for other players engaged and attack if all OK. 
         /if n $target(distance)<15 { 
            /mqlog In melee range 
            /call autorun2 0 
            /varset KSCheck $target(id) 
            /call GetTarget 
            /if n $KSCheck==$MyTarget /call Melee 
            } 
            
         /call checkobstacles 
         /delay 0 
   /if n $TargetDead!=1 /goto :Engage 
   /mqlog Target is dead 
   /target id $MyTarget 
/return 

| Melee with mob subroutine 
sub Melee 

   /mqlog Started melee 
   /attack on 

   :Combat 
      | Check events 
      /doevents flush 
      
      | Make sure were staring the critter out 
      /face nopredict 
      
      | If we are too far away close in 
      /if n $target(distance)>15 { 
         /face nopredict 
         /delay 2 
         /call autorun2 1 
         /mqlog $target(distance,nopredict) from $target(name) 
      } 
        
      | If we are in melee range stop running 
      /if n $target(distance)<15 { 
         /call autorun2 0 
         /delay 2 
         /face fast nopredict 
         /mqlog In melee with $target(name) at $target(hp,pct) I am at $char(hp,pct) 
      } 
      
      /doevents 
      
      | If we cannot see the target backup and face it again. 
      /if n $NoLOS==1 { 
         /mqlog Cannot see 
         /face nopredict 
         /sendkey down down 
         /delay 4 
         /sendkey up down 
         /varset NoLOS 0 
         /delay 3 
      } 
      
      | If we are too far away close in 
      /if n $TooFarAway==1 { 
         /face nopredict 
         /delay 2 
         /call autorun2 1 
         /varset TooFarAway 0 
      } 
      
      /if $char(ability,"Round Kick")>0 /doability "Round Kick" 
      /if $char(ability,"Kick")>0 /doability "Kick" 
      /if $char(ability,"Mend")>0 /doability "Mend" 
      /if $char(ability,"Slam")>0 /doability "Slam" 
      
      
      | Check if target is dead or we have lost it 
      /if n $target(id)==0 /varset TargetDead 1 

      | Check for any obstacles we are supposed to avoid 
      /call checkobstacles 
      
      | If target is still alive keep at it 
      /if n $TargetDead!=1 /goto :Combat 
      
      | Target is dead so stop attacking 
      /attack off 
      
      /varset AttackedMe 0 
      
/return 

| Loot mob 
sub Loot 
    
   /varset TargetLooted 0 

   :Approach 
    
      /mqlog Advancing to corpse 
      |Process any events 
      /doevents 
      
      | Check we still have a target if not dont try to  loot it 
      /if n $target(id)==0 /goto :Looted 
                  
      | Turn towards target 
      /face nopredict 
      
      | If we are within range loot corpse 
      /if n $target(distance)<15 { 
         /call autorun2 0 
         /loot 
         /goto :AtTarget 
         } 

      | If we are not within range then make sure we are on autorun 
      /if n $target(distance)>12 /call autorun2 1 

      | Save our current x,y loc 
      /varset MyXLoc $char(x) 
      /varset MyYLoc $char(y) 
      
      | Wait and then check loc again if we are on same spot call the obstacle routine to try and get around it 
      /delay 1 
      /if n $MyXLoc==$char(x) /if $MyYLoc==$char(y) /call Obstacle 

      | Check for any obstacles we are supposed to avoid 
      /call checkobstacles 
      
      /delay 0 
   /goto :Approach 
   :AtTarget          
    
   |Begin Looting 
    
   /mqlog starting to loot 
   /delay 10 
    
   | Cycle through each loot slot 
   /varset LootSlot 0 
   :LootLoop 
      /delay 1 
      /click left corpse $LootSlot 
      /delay 3 
      /if "$cursor()"!="TRUE" /goto :NoLoot 

      | Scan list of loot to keep and auto drop it if we are keeping it. 
      /varset CheckLoot 0 
      :GetLoot 
         /if "$cursor(name)"~~"$a(1,$CheckLoot)" { 
            /mqlog  Looted $cursor(name) 
            /click left auto 
            /goto :Looted 
         } 
          
         /varadd CheckLoot 1 
         /delay 0 
         /if n $CheckLoot<$LootTotal /goto :GetLoot 
          
         | Checked list of loot to keep with no matches so destroy (must turn on fast destroy) 
         /mqlog Destroying $cursor(name) 
         /click left destroy 
          
         :Looted 
         /varadd LootSlot 1 
      /delay 0 
      /goto :LootLoop 
   :NoLoot        
      
   /delay 3 
   /press esc 
   /delay 2 
/return 



sub HomeBase 

   /mqlog Heading Home 

   :RunHome 

         |Process any events 
         /doevents 
          
         |Work on sense heading skill 
         /if $char(ability,"Sense Heading")>0 /doability "Sense Heading"          
          
         |Check if we have aggroed something and stop running home if we have 
         /if n $AttackedMe==1 { 
            /mqlog $v13 Atacked be on the way home 
            /return 
         } 
          
         | Turn towards target 
         /face loc $HomeY,$HomeX 
          
         | If we are not within melee range then make sure we are on autorun 
         /if n $distance($HomeY,$HomeX)>15 /call autorun2 1 

         | Save our current x,y loc 
         /varset MyXLoc $char(x) 
         /varset MyYLoc $char(y) 

         | Wait a then check loc again if we are on same spot call the obstacle routine to try and get around it 
         /delay 1 
         /if n $MyXLoc==$char(x) /if $MyYLoc==$char(y) /call Obstacle 
          
         | Check for any obstacles we are supposed to avoid 
         /call checkobstacles 
          
         | If we are within melee range stop running check Target again for other players engaged and attack if all OK. 
         /if n $distance($HomeY,$HomeX)<15 { 
            /mqlog Reached Home 
            /call autorun2 0 
            /varset BackHome 1 
         } 
            
          /delay 0 
   /if n $BackHome!=1 /goto :RunHome 
   /varset BackHome 0 

/return 1 

sub Obstacle 

   | We appear to be stuck so try and backup and strafe sideways 
   /mqlog Ouch! ran into something 
   /sendkey up up 
   /sendkey down down 
   /delay 2 
   /doevents 
   /sendkey up down 
   /sendkey down ctrl 
   /if n $rand(99)>50 { 
      /sendkey down right 
   } else { 
      /sendkey down left 
   } 
   /delay 3 
   /doevents 
   /sendkey up right 
   /sendkey up left 
   /sendkey up ctrl 
   /sendkey down up 
/return 


sub AvoidLoc 
| Pass in 3 numbers first two are the Y and X locs of the point to avoid third one is the distance you want to keep from it. 
| This sub will check if you are within the distance specified and turn you away from the loc and run you until you are the correct
| distance away. Too many calls to this sub will slow your main loop down badly so keep the areas large and infrequent for best results. 
| i.e. if there are a few huts together set a loc and radius that will cover the whole area rather than each individual hut. 

/if n $distance($p0,$p1)>$p2 /goto :OK 
    /mqlog close to $p0 $p1 
    /if n $calc($heading($p0,$p1)-$char(heading)<0 { 
       /face heading $calc($heading($p0,$p1)-95) 
    } else { 
       /face heading $calc($heading($p0,$p1)+95) 
    } 
    :RunAway 
    /call autorun2 1 
    /delay 1 
    /if n $distance($p0,$p1)<$p2 /goto :RunAway 
:OK 
  
/return 

Sub AutoRun2 
   /if $p0==1 /sendkey down up 
   /if $p0==0 /sendkey up up 
/return 


sub Event_TooFar 
   /varset TooFarAway 1 
/return 

sub Event_CannotSee 
   /varset NoLOS 1 
/return 

sub Event_HitsYou 
   /if "$combat"=="TRUE" /goto :StillEngaged 
    /varset AttackedMe 1 
    /varset v10 "$left($calc($instr("YOU","$p0")-1),"$p0")" 
    /varset v11 $strlen("$v10") 
    :WalkString 
       /if "$mid($v11,1,"$v10")"==" " { 
          /varset v12 $v11 
          /goto :DoneWalkString 
      } 
    /varsub v11 1 
    /delay 0 
    /goto :WalkString 
    :DoneWalkString 
   /varset Attacker "$left($v12,"$v10")" 
   /mqlog Being Hit by $Attacker 
   :StillEngaged 
/return 

And the zone specific stuff

Code: Select all

| EastCommons.mac
|
| Zone specific Info for Hunter Script
#define HomeY v58 
#define HomeX v59 

| This Sub sets up the alert lists for the mobs we want to hunt
|
sub SetAlerts
| Setup Alerts for the most important mobs here (rare) 
| 
   /alert clear 1 
   /alert add 1 npc radius 500 lion 
   /alert add 1 npc radius 500 kodiak 
   /alert add 1 npc radius 500 bear 
   /alert add 1 npc radius 500 puma 
   /alert add 1 npc radius 500 spiderling 

| Setup Alerts for the next most important mobs here (uncommon) 
| 

   /alert clear 2 
   /alert add 2 npc radius 1000 lion 
   /alert add 2 npc radius 1000 kodiak 
   /alert add 2 npc radius 1000 bear 
   /alert add 2 npc radius 1000 puma 
   /alert add 2 npc radius 1000 spiderling 
    
| Setup Alerts for the next most important mobs here (common) 
| 
   /alert clear 3 
   /alert add 3 npc lion 
   /alert add 3 npc kodiak 
   /alert add 3 npc bear 
   /alert add 3 npc puma 
   /alert add 3 npc spiderling 
    

| Setup Alerts for Scary mobs here 
| 
   /alert clear 4 
   /alert add 4 npc radius 500 griffin 

/return


| This sub sets up the list loot we wish to keep.
|
sub SetLootList

   /varset a(1,0) "silk" 
   /varset a(1,1) "quality" 
  
   | Put number of items in list here. 
   /varset LootTotal 2 

/return



| This sub sets our home point we return to if low on health
|
sub SetHomePoint    

   | Set home to be entrance of tunnel
   /varset HomeX 854.02, 
   /varset HomeY -1091.77 
   /mqlog Home Point is $HomeX, $HomeY 

/return


| This sub does the checks to make sure we avoid certain specified areas
sub CheckObstacles 

| this sub just calls avoidloc for each area i want to avoid in EC 
      
   | Single Hut Near WF Zone 
   /call avoidloc 184 -856 30 
    
   | 2 Huts Near WF Zone 
   /call avoidloc -154 -816 75 

   | Inn 1 Complex 
   /call avoidloc -137 118 165 
    
   | Guard Post 
   /call avoidloc 564 973 125 

   | Single Hut on path between inn1 and inn2 
   /call avoidloc -106 1670 50 
    
   | Inn 2 Complex 
   /call avoidloc -320 3042 130 
    
   | Undead Ruins 
   /call avoidloc -963 2841 180 
    
   | Orc 1 
   /call avoidloc 1004 2642 180 
    
   | Druids 
   /call avoidloc 418 3800 100 

   | Hut Near Druids 
   /call avoidloc 337 4063 30 
    
   | Orc 2 
   /call avoidloc 974 4627 60 
    
   | Hidden Inn 
   /call avoidloc 997 3692 90 
    
   | Altunic Jartins Hut 
   /call avoidloc -118 4732 30 
    
   | Inn 3 
   /call avoidloc 221 4835 140    
    
/return
Last edited by Fippy on Tue Oct 22, 2002 5:38 am, edited 10 times in total.

boldor
a ghoul
a ghoul
Posts: 94
Joined: Tue Sep 10, 2002 11:46 am

Post by boldor » Tue Sep 24, 2002 2:03 pm

Gawd Fippy j00 a l33t cod3ing bugger.

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Post by loadingpleasewait » Tue Sep 24, 2002 9:35 pm

I like it.. only thing I dont like is.. if somthing comes up and whacks me.. I still target an alert instead of turning to fight whatever whacked me.. How can I turn target and fight whatever whacked me? right now I'm having to end the macro and do it manually..
LOADING PLEASE WAIT...

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Mon Oct 07, 2002 11:03 am

Made a few updates changes see edit's in first post.

Fippy

Genoius
a lesser mummy
a lesser mummy
Posts: 49
Joined: Sat Jul 13, 2002 8:20 am

Post by Genoius » Mon Oct 07, 2002 2:23 pm

Nice work!

---Genoius---

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Mon Oct 07, 2002 4:43 pm

Hey Fipp..spectacular job! Actually I have another mod u could do to this to make it a bit better (not exactly sure how to go about it but i'll give what i think would work)

If you added either a #include zone.mac or something OR just added the zones yourself..but for each zone you could set a home point.

This seems like it would be more efficient just adding a zone.mac with

Code: Select all

/if $zone()=="East Commonlands"  { /varset $home(x, 2782, 1232), $home(y,2342,1233) 
}else /if $zone()=="North Karana" { /varset $home(x, -123, 342) ((etcetcetcetc))

you get the idea, but anyway just an idea :) think it would be neat if your code determined a proper place to park  your guy depending on zone.

Also you could add a /if $char(race)=="Ogre"  ((**Dont go to the guard, but somewhere else relatively safe**)) <-- whatever that code might be..too lazy to think about it right now..just an idea hehe
Thats just random numbers..not even sure if thats what your loc code is..its just an idea hehe

Anyway i think that'd be kewl and i'd even be willing to try programming it if you'd consider the idea is useful enough.

Draekz

rootmoth
orc pawn
orc pawn
Posts: 27
Joined: Fri Oct 04, 2002 9:27 pm

Post by rootmoth » Mon Oct 07, 2002 6:22 pm

Cool, it looks like you've read my hacked version of your code and added home point stuff similar to mine. What did you think of my factiongrind.mac code?

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Mon Oct 07, 2002 6:46 pm

hehe yeah in true scripting author style I saw you mods to my code, liked the idea so I nicked it. There were a few bugs in my original script that you might want to review and put the fixed into your own mod.

As for the zone specific stuff, well ya read my mind there Draekz once I have finished on the area avoidance code I am gonna go back and change things a bit so that you can pass in the zone name to the macro and it will #include the relevant bits. Not sure if this will work but what I thought was I could do.

/alias /hunter /macro hunter $zone()

then in the script

#include "$p0.mac"

probably have problems with spaces with that maybe the short zone name would be better but i dont think $zone returns that. Anyway thats the initial thought process.

As for the home point, beacause of the many different spots that could be safe depending on race\class\faction its will be easist to just set this up yourself. rootmoth has his script setting the home point to where you are stood when the script starts which is one idea but i found it awkward when i had to stop and restart the script for some reason i ended up setting somewhere in appropriate as the home point, hence the hard coded bit.

Anyway hopefully will have the area avoidance stuff finished tomorrow or the day after and ill have to test it a bit first so look for another update this week.
Fippy

rootmoth
orc pawn
orc pawn
Posts: 27
Joined: Fri Oct 04, 2002 9:27 pm

Post by rootmoth » Mon Oct 07, 2002 7:18 pm

I think the spinning in circles because you can't see the mob is more easily fixed with a Strafe + backup move.

shift + left/right + down for /delay 1 then /face nopredict.

I could be wrong though

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Mon Oct 07, 2002 7:53 pm

Hey here's some more code things for ya

This is to determine what skills to use depending on class/race

(I only used Shadowknight, monk, ranger, warrior and paladin) was the only tank skills I could think of..and its only using the basic skills..not any class specialties)

PS this might be buggy as im not going to test it..but if you can think of a cleaner way of doing it..feel free to post your ideas ;) this is very basic for now..just to see if it would work..might get more indepth later..but im first gonna work on a zonelocs.mac for safe points in zones (first basic ones..then race/class specific ones)


PPS -- I included as the first part and last part of the code..pieces of code in your hunter.mac so you'd know where i put this code...

Code: Select all


| If we are too far away close in 
      /if n $TooFarAway==1 { 
         /face nopredict 
         /delay 2 
         /call autorun 1 
         /varset TooFarAway 0 
      } 
      |Determines your class
      :class
      
      /if $char(class)=="Monk" { /goto :monk
      }else /if $char(class)=="Warrior" {
            /if $char(class)=="Shadow Knight" {
      |After determining these 2 classes, this determines your race and if you are a large class /goto's :largeclass
            /if $char(race)=="Ogre" { 
            /if $char(race)=="Barbarian"  
            /if $char(race)=="Troll"
            
            /goto :largeclass
            }
            /goto :warrior
            }
            }else /if $char(class)=="Ranger" { /goto :warrior
            }else /if $char(class)=="Paladin" { /goto :warrior
            }
            
       /return
      |Class abilities set up..only 2 here..one for basic melee warrior abilities and the monk abilities
      Sub Monk
      
      :monk
      
      /if $char(ability,"Round Kick")>0 /doability "Round Kick" 
      /if $char(ability,"Kick")>0 /doability "Kick" 
      /if $char(ability,"Mend")>0 /doability "Mend" 
      /if $char(ability,"Slam")>0 /doability "Slam" 
      /goto :checktarg
      
      /return
     
     Sub Warrior
      
      :largeclass
      
      /if $char(ability,"Taunt")>0 /doability "Slam"
      /if $char(ability,"Bash")>0 /doability "Bash"
      /if $char(ability,"Kick")>0 /doability "Kick"
      /if $char(ability,"Slam")>0 /doability "Taunt"
      /goto :checktarg
      
      /return
      
      :warrior
      
      
      /if $char(ability,"Bash")>0 /doability "Bash"
      /if $char(ability,"Kick")>0 /doability "Kick"
      /if $char(ability,"Slam")>0 /doability "Taunt"
      
      /goto :checktarg
      
      /return
      
      :checktarg
      | Check if target is a corpse or not 
      |/if "$target(name)"~~"corpse" /varset TargetDead 1 
      /if n $target(id)==0 /varset TargetDead 1 

Believe it or not..i do this stuff for fun ;) so if it sucks..dont blame me..im just doing it for the fun of it :P but if it inspires..try writing your own :)

Draekz

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

UPDATED 07/10/02 23:58

Post by Draekz » Mon Oct 07, 2002 8:15 pm

EDITEDIT: I recommend putting the code into Textpad as its impossible to see on these boards lol..with the colors on textpad its much more organized looking

Draekz

EDIT: I changed $zone(name) to just $zone() LOL woops..guess this code woulda sucked if i hadnt noticed that huh :\ hehe
-------------------------------------------------------

Made a new file Zoneloc.mac and added

Code: Select all

#include Zoneloc.mac 
to your hunter.mac

So far i've only programmed in East Commons (which is where im presuming your macro is actually being run originally.

Once i've visited the other zones, i'll grab the locs of safe points and put them into my zoneloc.mac

I've replaced your

Code: Select all

/varset HomeX 854.02, 
/varset HomeY -1091.77 
/mqlog Home Point in $zone() is $HomeX, $HomeY 
with

Code: Select all

/call Zoneloc
which is in the zoneloc.mac file

The following is what i've currently written in zoneloc.mac..its nothing big..as i just started it about 5 mins ago..but its still a start..if you find any less complex ways of doing it (or more compact ways) let me know and post your thoughts on here.

Draekz

Code: Select all


|**------------ Zoneloc.mac -----------

This script will be used as an #include for
Fippy's Hunter.mac
, this is purely
experimental and will leave the testing up 
to anyone who thinks it would be useful

Author: Draekz

07/10/02 18:00

EDIT: Im not including diffult zones, such
as highpasshold, or any cavern type zones 
(complex indoor zones) or any zones mainly
comprising of water (such as Lake Rathe) or
OOT

07/10/02 19:05

EDIT: Im only doing basic open area Antonica
zones for the time being

07/10/02 23:51

EDIT: Just finished what i think would work.
I havent tested the code yet so dont know..if
anyone can look it over and see if anythings 
wrong,that'd be great..any comments or fixes
would be welcome

Draekz
   ---------- End of Comment --------- **|
 
 #define whosaid v2
 #define whatsaid v3
 
 #chat say
 
Sub Event_Chat

/varset v2 "$p1"
/varset v3 "$p2"

|This sets it so that if you dont tell it the commands, it wont listen
/if "$whosaid"~~"You say, " /varset v4 1 

|These are the various commands..universal for all zones
/if "$left(4,"$p2")"~~"loc " /varset v5 0
/if "$left(4,"$p2")"~~"goto" /varset v5 1
/if "$arg(2,"$p2")"~~"locations" /varset v6 1
/if "$arg(2,"$p2")"~~"commands" /varset v6 0
/return

|If you didnt say the message, just ignore it
Sub ChanMSG
/if $v4!=1 {

/return
|This checks to see what zone you are in.
Sub Zoneloc

/if $zone(name)~~"East Commonlands" { /call Ecommons
}else /if $zone(name)~~"West Commonlands" { /call Wcommons
}else /if $zone(name)~~"West Freeport" { /call WFreeport
}else /if $zone(name)~~"East Freeport" { /call EFreeport
}else /if $zone(name)~~"North Ro" { /call Nro
}else /if $zone(name)~~"Oasis" { /call OasisofMarr
}else /if $zone(name)~~"South Ro" { /call Sro
}else /if $zone(name)~~"Kithicor" { /call Kith
}else /if $zone(name)~~"East Karana" { /call Ekarana
}else /if $zone(name)~~"North Karana" { /call Nkarana
}else /if $zone(name)~~"South Karana" { /call SKarana

|East Commons Zone stuff
Sub Ecommons

|This sets you "Main" Home location
/varset HomeX 854.02, 
/varset HomeY -1091.77 
/mqlog Home Point in $zone() is $HomeX, $HomeY 

/return

|North Karana zone stuff
Sub Nkarana

/if $v4!=1 {

/return

}

   
|This sets your "Main" Home location for NK
/varset HomeX 1206.10
/varset HomeY -4046.67
/mqlog Home Point in $zone() is $HomeX, $HomeY

|If you said "goto Spires" in say mode it should set the home /loc to Spires
/if $v5==1 {
     "$arg(2,"$p2")"~~"Spires"
     /goto :NKSpires
|If you said "goto Druids" iin say mode it should set home /loc to druids so on and so forth
     }else /if "$arg(2,"$p2")"~~"Druids"
     /goto :NKDruids
     }else /if "$arg(2,"$p2")"~~"Bridge"
     /goto :EKBridge
     }else /if "arg(2, "$p2")"~~"Guards"
     /goto :NKGuards

|If you said goto locations, it'll echo the different commands you can use
/if $v6==1 {
     /echo You may type the following locations to go to: Druids, Spires, EKBridge, Guards

|If you said goto commands it'll tell you the commands you can type.
     }else /if $v6==0 {
     /echo The commands you can type are commands, goto, or loc to do the obvious.
     /return

|If you typed "loc spires" it'll give you the Loc of the Spires
/if $v5==0 {
     "$arg(2,"$p2")"~~"Spires"
     /echo Location of NK Spires is -4046.67 by 1206.10 
|If you typed loc druids it'll give you the loc of the druids, so forth and so on
     }else /if "$arg(2,"$p2")"~~"Druids"
     /echo Location of the Druids is -2650.32 by -1426.61 
     }else /if "$arg(2,"$p2")"~~"Bridge"
     /echo Location of the East Karana Bridge is 
     

|These are the /varsets for the various home locations
:NKSpires

/varset HomeX 1206.10
/varset HomeY -4046.67

/return

:NKDruids

/varset HomeX -1426.61
/varset HomeY -2650.32

/return

:NKGuards

/varset HomeX 90.18
/varset HomeY -1233.90

/return

:EKBridge

/varset HomeX -2879.12
/varset HomeY 12.12

/return

EDIT INFORMATION:
----------------------

I added a ton more crap to the "macro"...thought it would be a neat idea..but now starting to wonder if the way i've done it is compatible with hunter.mac?

Ive tried typing the commands i programmed into it to no avail, so i probably have to have it triggered in hunter.mac (using $arg statements) instead of having them trigger in zoneloc.mac

but if anyone can help me get this working,i'll gladly continue it...nice to have a druid to port around and get locs easy :P

Draekz

---------------------------------------------------------------------------
---------------------------------------------------------------------------


As you can see, like i said, i only did Ecommons so far...the rest you can plug in easily enough when u get there..this SHOULD work as it is if you plug in the rest of the zones and their locs (as all my mains are in FG atm i am sorta outta the way to check all safe locs).

But all the same im pretty sure it should work..if it doesnt, do an #include Hunter.mac into the Zoneloc.mac and add a :restofcode loop just after the /call Zoneloc to get back to the rest of the code..

Shouldnt be too hard to figure out.

Draekz

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Thu Oct 10, 2002 7:30 am

updated script in my original post. Added area avoidance code.

Needs to use $heading from IRC20021001a so dont try it unless you have this release.

Fippy

gingertips
a hill giant
a hill giant
Posts: 230
Joined: Wed Jun 26, 2002 3:47 am
Location: Tseu-Qorcam

Post by gingertips » Thu Oct 10, 2002 9:25 am

3 cheers for fippy!

Ariain
a ghoul
a ghoul
Posts: 88
Joined: Fri Oct 11, 2002 10:35 am

Post by Ariain » Fri Oct 11, 2002 6:38 pm

I am new to this sorry if this is dumb. How do I run my bard twisting macro and this at the same time?

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Fri Oct 11, 2002 7:45 pm

You can only run 1 macro at once atm. Youd have to integrate your twisting script into this one.

Fippy