Afk Exp Farmer

Have a macro idea but not sure where to start? Ask here.

Moderator: MacroQuest Developers

BloodyMutt
decaying skeleton
decaying skeleton
Posts: 2
Joined: Fri Nov 11, 2011 1:56 pm

Afk Exp Farmer

Post by BloodyMutt » Sat Nov 12, 2011 12:25 am

Hi all. I'm just dipping my toes into macroing outside of the in game set up of setting up an incoming message XD
I've been nibbling all day trying things out in order to get what I'm looking for, so I'll get right down to explaining it;
I play on an eqemu server (THF) where they have built in bots. Well, I basically want to park a character in a corner and consistently tell him to go whack a mob for steady exp gain while I'm off at work.

Code: Select all

Sub Main
   :combatloop
   }
   /if (!${Me.Casting.ID}) /nomodkey /keypress 1
   /doevents
   /if (${Target.Distance}<15 && !${Me.Combat}) /keypress `
   /goto :combatloop
/return
I snipped this and cut out a few lines that I didn't need out from another macro and it is "sort" of working for me. Basically it targets nearest with ` and presses 1 which is #bot group attack macro hotkey and off it goes to whack away. I tried to tweak it so that if I get hit I'll sit down once the combat is actually over and it ended up just sitting me down every time I got hit bellow x% hp ^-^;
Some things I was trying to add in other than that was that when I leveled I would target my bot if out of combat, and tell him to update his level, I'm sure that it is in the html guide somewhere and I'm currently nibbling my way through it. The other thing is looting; I was tweaking with a few different ones here, some just opened the loot window, others made me run off into a wall o.O?? Anyhow, I'm sure when I have the chance I might be able to figure this all out, but some assistance would be very much appreciated.
~Mutt

ultrax
orc pawn
orc pawn
Posts: 12
Joined: Tue May 04, 2010 1:55 pm

Re: Afk Exp Farmer

Post by ultrax » Tue Dec 13, 2011 3:25 pm

Have you looked for examples? Like:

viewtopic.php?f=43&t=7135&hilit=hunter.mac
or
viewtopic.php?f=43&t=13262&p=111226&hil ... ro#p111226
or

Code: Select all

| ## huntnloot.mac 
| ## Farm Experience or Items 
| jonesalot@gmail.com 
| 
| ## Plugins Required: MQ2Melee, MQ2MoveUtils, MQ2Cast 
| ## Other Files Required: Ninjadvloot.inc, Loot.ini (if Looting is Enabled) 

| # UNCOMMENT FOLLOWING LINE WOULD LIKE TO LOOT. COMMENT IT OUT IF NOT LOOTING OR IF YOU DON'T HAVE Ninjadvloot.inc 
|#include Ninjadvloot.inc 

#event mydeath "You have been slain by #*#!" 
#event zoned "You have entered#*#" 

sub Main 
   /call Initialize 
   :Main_Loop 
      /delay 1 
      /doevents 
      /call GetTarget 
      /call TimeOut 
   /goto :Main_Loop 
/return 

Sub Configuration 

| ## BEGIN CONFIGURATION SECTION 
|   - ALERT HUNTING PRIORITY IS FROM LOWEST TO HIGHEST NUMBER. 1 IS SET TO CORPSE IF LOOTING IS PRIORITY. 
|   - ALERT SYNTAX IS: /alert add # [pc|npc|corpse|any] [radius #] [range lowerlevel upperlevel] "spawnname" [clear|list #] 

/alert clear 1 
   /alert add 1 corpse radius 50 

/alert clear 2 
   /alert add 2 npc radius 500 "#" 

/alert clear 3 
   /alert add 3 npc radius 400 "crystalline golem" 
   /alert add 3 npc radius 400 "crystalline crawler" 
   /alert add 3 npc radius 400 "crystalline arachnae 
   /alert add 3 npc radius 400 "luminii crawler" 
   /alert add 3 npc radius 400 "watchman" 

/alert clear 4 
   /alert add 4 npc radius 3000 "crystalline golem" 
   /alert add 4 npc radius 3000 "crystalline crawler" 
   /alert add 4 npc radius 3000 "crystalline arachnae 
   /alert add 4 npc radius 3000 "luminii crawler" 
   /alert add 4 npc radius 3000 "watchman" 

| ## END HUNTING TARGETS 

|| SHOULD WE LOOT? TRUE OR FALSE 
/varset DoLoot FALSE 

|| # DO WE WANT TO RETURN TO HOME POINT IF TIME TO KILL TIMER IS REACHED? TRUE OR FALSE 
/varset ReturnHome TRUE 

| # TIME TO KILL LIMIT IN SECONDS, WHEN REACHED WE MOVE TO HOME POINT. VALUE IS INTEGER ONLY. 
/varset TimeLimit 60 

| # RETURN HOME COORDINATES, REMEMBER X,Y IN EQ IS REVERSED 
/varset y 1000 
/varset x -100 

| ## END CONFIGURATION SETTINGS ## | 

/return 

Sub GetTarget 
   /declare s   int local 0 
   /declare i   int local 1 
   /declare n   int local 1 
   /for n 1 to 4 { 
      /squelch /target clear 
      /if (${NearestSpawn[alert ${n}].ID}) { 
         /for i 1 to 30 { 
            /varset s ${NearestSpawn[${i}, alert ${n}].ID} 
            /squelch /target id ${s} 
            /delay 1s (${Target.ID}) 
            /if (${Target.Type.Equal[npc]}) { 
               /call Attack 
               /return 
               }    
            /if (${DoLoot} && ${Target.Type.Equal[corpse]}) { 
               /moveto ID ${Target.ID} 
               /call LootCorpse 
               /return 
               } 
            } 
         /next i 
         } 
   /next n 
/return 

sub Attack 
   /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<1200) { 
      /squelch /moveto ID ${Target.ID} 
      /echo Attacking ${Target.CleanName} 
      :AttackLoop 
         /delay 5 
         /if   (!${Target.ID}) { 
            /varset Time2Kill ${TimeLimit}s 
            /return 
         /if (${Target.Type.Equal[NPC]} && ${Target.Distance}<30) { 
            /squelch /attack on 
            /squelch /stick uw 5 
            } 
         /if (${Time2Kill}==0) { 
            /squelch target clear 
            /call TimeOut 
            /return 
            } 
      /goto :AttackLoop 
      } 
/return 

sub TimeOut 
   /if (${ReturnHome} && !${Me.CombatState.Equal[COMBAT]} && ${Time2Kill}==0) { 
      /squelch stick off 
      /squelch /target clear 
      /moveto loc ${y} ${x} 
      /echo Timed Out. Attempting to return to Y:${y}, X:${x}. 
      /varset Time2Kill ${TimeLimit}s 
      } 
/return 

Sub Initialize 
   /call DelcareOuterVariables 
   /call Configuration 
   /if (${DoLoot}) { 
      /call SetupAdvLootVars 
      /hidecorpse looted 
       
   /moveto 5 
   /echo Macro Initialized. 
   /varset Time2Kill ${TimeLimit}s 
/return 

sub DelcareOuterVariables 
   /declare DoLoot bool outer FALSE 
   /declare ReturnHome bool outer FALSE 
   /declare TimeLimit int outer 0 
   /declare Time2Kill timer outer 0 
   /declare y int outer 0 
   /declare x int outer 0 
/return 

Sub event_death 
   /echo Oh no, you died. Macro ending. 
   /endmacro 
/return 

Sub event_zoned 
   /echo Unexpected zoning encounterd. Macro ending. 
   /endmacro 
/return