• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Freeport faction macro

Joined
May 21, 2014
RedCents
994¢
I modified EasyBot to work Freeport Militia faction (as well as several others). Each task gives 20 faction hits, so evil races will need to do this MANY times. It goes through the task one time and then ends. It gets the task, runs to area, kills 15 a sand giant elite, the runs back to task giver and ends. It does not loot anything as it is right now. It only casts things through Holyshits. It should probably only be used with a character of high enough live there is no chance of dying with.

Macro should be started standing next to Tacots Silentblade.

Macro

Rich (BB code):
|------------------------------------------------------------|
|	EASY BOT v1.0 (Levels 1 to 5)	   	               |
|								               |
|	By: WoopWoop (3/12/13)			               |
|------------------------------------------------------------|

|------------------------------------------------------------|
|		    Includes
|------------------------------------------------------------|

#turbo

|------------------------------------------------------------| 
|          Events 
|------------------------------------------------------------| 

#Event MobDeath "#*#You gain experience!!#*#" 
#Event Death "You have entered#*#"
#Event Death "You have been slain#*#"  
#Event KnockOut "You have been knocked unconscious!#*#"
#Event TaskComplete   "You have successfully defeated the elite#*#"

|------------------------------------------------------------| 
|          Declares
|------------------------------------------------------------| 

Sub Declares

	/declare Filename string outer Elites.ini

	|---- Health Check and Retreat Locs ----|
	
	/declare RetreatLoc[2] string outter 
	
	/varset RetreatLoc[1] 299  |-- X Loc
	/varset RetreatLoc[2] 118  |-- Y Loc
	
										   
	|---- End Health Check / Retreat Locs ----|
	
	/declare MobKillCount int outer 0 
	/declare RankCount	int outer 1
	/declare LastLocX int outer 956
	/declare LastLocY int outer 79
	
	|---- Target Aquisition Variables ----|
   
        /declare NoMobs int outer 0
        /declare Counter int outer 
        /declare CurrentMobID int outer
        /declare FirstMobID int outer
   
	/declare MobArray[5] string outer
	
	|---- End Target Aquisition Variables----|
		
	|---- Kill Rankings ----|
	
	/declare MobKillRank[10] string outer
	
	/varset MobKillRank[1] "A Naughty Noob"
	/varset MobKillRank[2] "A Big Boy Bat"
	/varset MobKillRank[3] "A Silly Skeleton"
	/varset MobKillRank[4] "A Booger Burglar "
	/varset MobKillRank[5] "A Wacky Weasel"
	/varset MobKillRank[6] "Sassy Classy Clown"
	/varset MobKillRank[7] "Mega Master Man
	/varset MobKillRank[8] "Insane Brain!"
	/varset MobKillRank[9] "M-M-M-Monster!"
	/varset MobKillRank[10] "!!GODLIKE!!"
	
	|---- End Kill Rankings ----|
	
/return

Sub MobList

|** This is a Mob List that you can edit to determine which mobs you attack. 
	Note that the current MobArray is set only to handle 5 unique mobs	 **|

	/varset MobArray[1] "a sand giant elite"
	/varset MobArray[2] "a decaying skeleton"
	/varset MobArray[3] "a decaying skeleton"
	/varset MobArray[4] "a large rat"
	/varset MobArray[5] "a grass snake"
	
/return

Sub MobListPlus

|** This is the Advanced (lvl 3-4) Mob List that you can edit to determine which mobs you attack. 
	Note that the current MobArray is set only to handle 5 unique mobs	 **|
	
	/varset MobArray[1] "a sand giant elite"
	/varset MobArray[2] "a klicnik worker"
	/varset MobArray[3] "a decaying skeleton"
	/varset MobArray[4] "a large rat"
	/varset MobArray[5] "a grass snake"
	
/return

	

|------------------------------------------------------------| 
|        	Main Routine
|------------------------------------------------------------| 

Sub Main
	/declare tempLevel int local 	
	/call Declares
	/echo Easy Bot v. 1.0 - Good Luck!
	
	/call ReadINIA ${Filename} "South Ro" 
		/if (!${Defined[LocArray]}) { 
			/echo No Loc Array Created...
		/endmacro 
	} 
	
		/call GetTask
		
	:MainLoop

		/doevents
		
		
		|--- Check Level Function ---|
		
		
		/varset tempLevel ${Me.Level}
				
		/if (${Math.Calc[${tempLevel}<3]} == 1.00) {
			/call MobList  
		} else {
			/call MobListPlus 
		}
		
		|--- Check Level Function ---|		
		
		/call AcquireTarget  
		
		|--- Check Health Function ---|
		/if (${Me.PctHPs}<35) {
			/varset LastLocX ${Me.X}
			/varset LastLocY ${Me.Y}     
		} 
		|--- Check Health Function ---|
		
		/if (${Me.Combat}) {
		
		/echo I'm slaying these jerks!
		
		} else { 
		
|			/target corpse radius 17
			/delay 1s
|			/loot
|			/delay 3s
|			/notify LootWnd DoneButton leftmouseup 
|		    /delay 1s
		
		}
		
		/delay 1
			/doevents
		/squelch /taget clear
			/call Movement 3 3	
		/goto :MainLoop

/return


|------------------------------------------------------------| 
|          Attack Rountines 
|------------------------------------------------------------| 

Sub AttackNow
    	/doevents
    /if (${Me.PctHPs}>35) {
    /popup Now Attacking: ${Target}!
    /stick 10
	} else {
		/goto :EndofAttack
	
	}
		
	/if (${Target.Type.Equal[NPC]} && ${Me.PctHPs}<35) { 
		/stick off
			/attack off
			/varset LastLocX ${Me.X}
			/varset LastLocY ${Me.Y} 
						
	} else {
			:AttackLoop
				/if (${Target.Type.Equal[NPC]}) {		
					/doevents
					/attack on
					/Delay 5s									 
					/goto :AttackLoop
				} 

	}
	:EndofAttack
	
	
/return

|------------------------------------------------------------| 
|         Target Acquisition Routines
|------------------------------------------------------------| 

Sub AcquireTarget
   
   /doevents
   
   /squelch /echo Aquiring Targets |-- For Testing purposes
   
   /varset FirstMobID ${Me.NearestSpawn[1,npc ${MobArray[1]}].ID}
   
   /for Counter 1 to 1
         
      /varset CurrentMobID ${Me.NearestSpawn[1,npc ${MobArray[${Counter}]}].ID}

      /if (${Spawn[${CurrentMobID}].Distance}<${Spawn[${FirstMobID}].Distance} && ${Bool[${CurrentMobID}]}) {
         
         /delay 1s
         /varset FirstMobID ${CurrentMobID}
      
      }
   /next Counter
   
   /if (${Spawn[${FirstMobID}].Distance} < 550 && ${Bool[${FirstMobID}]}) {
   		/delay 1s
   		/target ${Spawn[${FirstMobID}].Name}
   		/echo Target Acquired: ${Target}
   		/delay 1s
		/call AttackNow
   	} else {
   		/squelch /echo Nothing in Range |-- For Testing purposes
   		/delay 5s
   	}

/return

|------------------------------------------------------------| 
|          Health Check Rountines 
|------------------------------------------------------------| 

|** These are unused ideas that I had for the macro, but I decided
to keep them included just to give people ideas**|

Sub CheckHealth 
	
	/if (${Me.PctHPs}<35) { 
			/MoveTo loc ${RetreatLoc[1]} ${RetreatLoc[2]}
			/delay 1
	} 
	
	:MovingLoop
		/if (${MoveTo.Moving}) {
			/delay 2s
			/doevents
			/goto :MovingLoop
		}
	/call WaitTilHealed
/return 

Sub WaitTilHealed
	/echo Waiting to heal up
	:LoopTilHealed
		/if (${Me.PctHPs}<100) { 
			/docommand ${If[${Me.Standing},/sit,/echo I am not sitting down]}
			/delay 10s
			/doevents
			/goto :LoopTilHealed
		}
	
	/MoveTo loc ${LastLocY} ${LastLocX}
		:MovingLoop
		/if (${MoveTo.Moving} && !${Me.Combat}) {
			/delay 2s
			/doevents
			/goto :MovingLoop
		}
/return


|------------------------------------------------------------| 
|        Events 
|------------------------------------------------------------| 

|** I put this in just for fun. If you want a kill count update, 
just remove the squelch **|

Sub Event_MobDeath 

/varset MobKillCount ${Math.Calc[${MobKillCount}+1]} 
/squelch /echo You've Slain: ${MobKillCount} mobs!
/squelch /echo Your Rank: ${MobKillRank[${RankCount}]}

/return 

|------------------------------------------------------------|
|		Death 
|------------------------------------------------------------|

Sub MobKillRank
	/declare MobKillCounter int local 1
	/declare Sum1 int local 0
	/declare Sum2 int local 0
	/varset RankCount 1
			
	/for MobKillCounter 1 to 10
		/varset Sum1 ${Math.Calc[${MobKillCounter}*5]}
		/varset Sum2 ${MobKillCount}
				
	
		/if (${Sum1}<${Sum2}) {
			/varset RankCount ${MobKillCounter}	
		}		
	/next MobKillCounter
	
/return 

Sub Event_KnockOut
	
	/varset LastLocX ${Me.X}
	/varset LastLocY ${Me.Y} 
	
	/echo ============================================
	/echo You've Been Knocked Out!
	/echo Location: ${Me.Y},${Me.X} 
	/echo You've Been Knocked Out!
	/echo ============================================

/return


Sub Event_Death

	/call MobKillRank
	/echo ============================================
	/echo You Have Died!
	/echo Your Corpse Location: ${Me.Y},${Me.X} (most likely)
	/echo You managed to kill ${MobKillCount} mobs!
	/Echo Your Rank: ${MobKillRank[${RankCount}]}
	/echo You Have Died!
	/echo ============================================
	
	/endmacro
/return

| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| TaskComplete
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Event_TaskComplete
	/echo Task Complete!!!
			/squelch /target clear
		/call Movement 3 5
	/endmacro
/return

| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Get Task
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sub GetTask
|	/target ${Spawn[npc radius 15 Tacots]}
		/delay 10
	/keypress h
		/delay 10
	/say I am here to aid the city of Freeport
		/delay 10
	/say What great giants?
		/delay 10
	/say  I would be interesting in hunting the elite 
	/squelch /target clear
		/call Movement 1 3
/return

|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|Read INI file for Loc array
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sub ReadINIA(FileName,SectionName) 
   /echo Attempting to Read Section "${SectionName}" Zone Information from ${FileName}... 

    
 	/if (${Ini[${FileName},${SectionName}].Count[|]}==0) { 
      /echo "${SectionName}" is not a Valid Section for FILE:${FileName}, ending macro... 
 
      /return
	}
   } 
   /declare nValues     int local 
   /declare nArray      int local  0 

|~~~~~~~~~~~~~~~~~~~~~~ Locs ~~~~~~~~~~~~~~~~~
   /Varset nValues ${Ini[${FileName},${SectionName},Value]}
   /echo ${nValues} Locs
   :MakeArraylo 
   /if (!${nValues}) /return
   /if (${nValues}) { 
|      /echo Declaring Loc Array... 
      /declare LocArray[${nValues}]  string outer
   }
   /for nArray 1 to ${nValues}
      /varset LocArray[${nArray}] ${Ini[${FileName},${SectionName},Loc${nArray}]}
|	  /echo  loc ${nArray} defined ${LocArray[${nArray}]}

   /next nArray
|   /echo "${SectionName}" Zone Information Read Successfully from ${FileName}... 

/return 


|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Movement Sub
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sub Movement(Start,Finish,Door)
  /declare Location int inner

  /for Location ${Start} to ${Finish}
     :MoveLoop
     /face nolook loc ${LocArray[${Location}]}
     /if (${Math.Distance[${LocArray[${Location}]}]}>4) {
        /nomodkey /keypress forward hold
        /face nolook loc ${LocArray[${Location}]}

        /if (${Location}==${Door}) {
        /nomodkey /keypress USE
        /nomodkey /keypress USE
         }
     }
     /if (${Math.Distance[${LocArray[${Location}]}]}<=4) {
        /nomodkey /keypress forward
        /goto :next
     }
     /goto :MoveLoop
     :next
  /next Location
/return


Elites.Ini:


Rich (BB code):
[South Ro]
Value=5
Loc1=3882.68,-2061.77,28.36
Loc2=2480.50,-1529.91,106.90
Loc3=2172.94,-421.17,136.50
Loc4=2480.50,-1529.91,106.90
Loc5=3882.68,-2061.77,28.36
 
Last edited:
Rewrote the macro to use MQ2Navigation for movement. It can be started from anywhere in the zone. It will return to Tacots and get a new mission when it finishes a mission. It will end the macro when it maxxes out Knights of Truth faction (last one to max on my Iksar warrior). The modified mesh will be needed and is in the post.


Rich (BB code):
|------------------------------------------------------------|
|	FFM BOT v1.0 					     |
|	By: Randyleo					     |
|	Based on Easy Bot				     |
|	By: WoopWoop (3/12/13)				     |
|------------------------------------------------------------|

|------------------------------------------------------------|
|		    Includes
|------------------------------------------------------------|

#turbo

|------------------------------------------------------------| 
|          Events 											 |
|------------------------------------------------------------| 

#Event Death "You have entered#*#"
#Event Death "You have been slain#*#"  
#Event Finished "#1#Knights of Truth could not possibly get any better."

|------------------------------------------------------------| 
|          Declares											 |
|------------------------------------------------------------| 

Sub Declares

	/declare TacotsLocX int outer -2060.94
	/declare TacotsLocY int outer 3880.57
	/declare TacotsLocZ int outer 28.12
	
	/declare HuntLocX int outer -421.17
	/declare HuntLocY int outer 2172.94
	/declare HuntLocZ int outer 136.50

	/declare MobKillCount int outer 0 
	/declare RankCount	int outer 1
	/declare LastLocX int outer 956
	/declare LastLocY int outer 79
	
	|---- Target Aquisition Variables ----|
   
        /declare NoMobs int outer 0
        /declare Counter int outer 
        /declare CurrentMobID int outer
        /declare FirstMobID int outer
   
	/declare MobArray[5] string outer
	
	|---- End Target Aquisition Variables----|
		
	
/return

|Sub MobList

|** This is a Mob List that you can edit to determine which mobs you attack. 
	Note that the current MobArray is set only to handle 5 unique mobs	 **|

|	/varset MobArray[1] "a sand giant elite"
|	/varset MobArray[2] "Gregan, Overseer of the Sands"
|	/varset MobArray[3] "a decaying skeleton"
|	/varset MobArray[4] "a large rat"
|	/varset MobArray[5] "a grass snake"
	
|/return


|------------------------------------------------------------| 
|        	Main Routine
|------------------------------------------------------------| 

Sub Main


	/call Declares
	/echo Freeport Faction Bot v. 1.0 - Good Luck!
	
| -------------------------------------------------------------------------------------
| Check if required plugins are loaded		Stolen from KissAssist
| -------------------------------------------------------------------------------------
		/echo Checking Plugins
		/call CheckPlugin MQ2Melee
		/call CheckPlugin MQ2Moveutils
		/call CheckPlugin MQ2Navigation
		/call MissionCheck1
	:MainLoop	

		/call AcquireTarget  
		/call Adds
		/doevents
		/call MissionCheck2
			/goto :MainLoop
/return


|	---------------------------------------------------------
|	Adds
|	---------------------------------------------------------

Sub Adds
	:checkagain
	/if (${Me.XTarget} > 0 && ${SpawnCount[npc radius 45]} > 1) {
	/call AcquireTarget
			/squelch /look
			/delay 2s	
			/goto :checkagain
		} else {
			/delay 2
		}
/return

| ------------------------------------------------------------
|  MissionCheck1
| ------------------------------------------------------------

Sub MissionCheck1
	/if (${String[${Window[TaskWnd].Child[TASK_TaskList].List[1,2]}].Equal[Giants in the Desert]})  {
		/echo "I have a Giant mission!"
		/nav ${HuntLocX} ${HuntLocY} ${HuntLocZ}
		:waitForMove
			/delay 10
		/if (${Navigation.MeshLoaded} && ${Navigation.Active})  {
				/goto :waitForMove
		}

		} else {
		/echo "I need a mission!"
			/squelch /target clear
		/nav ${TacotsLocX} ${TacotsLocY} ${TacotsLocZ}
			:waitForMove
				/delay 10
		/if (${Navigation.MeshLoaded} && ${Navigation.Active})  {
			/goto :waitForMove

		}
		/call GetTask
		}
		/delay 5s
/return		

| ------------------------------------------------------------
|  MissionCheck2
| ------------------------------------------------------------

Sub MissionCheck2
	/if (${String[${Window[TaskWnd].Child[TASK_TaskList].List[1,2]}].Equal[Giants in the Desert]})  {
			/delay 10
		} else {
		/echo "I need a mission!"
			/squelch /target clear
		/nav ${TacotsLocX} ${TacotsLocY} ${TacotsLocZ}
			:waitForMove
				/delay 10
		/if (${Navigation.MeshLoaded} && ${Navigation.Active})  {
			/goto :waitForMove

		}
		/call MissionCheck1
		}
		/delay 5s
/return		

| ------------------------------------------------------------
| SUB: Check Plugin		Stolen from KissAssist
| ------------------------------------------------------------
    Sub CheckPlugin(string pluginname)
	
        /if (!${Bool[${Plugin[${pluginname}]}]}) {
            /squelch /plugin ${pluginname}
            /echo ${pluginname} not detected! This macro requires it! Loading ...
        }
        
    /return


|------------------------------------------------------------| 
|          Attack Rountines 
|------------------------------------------------------------| 

Sub AttackNow
    	/doevents
    /if (${Me.PctHPs}>35) {
    /popup Now Attacking: ${Target.CleanName}!
		/nav target
	} else {
		/goto :EndofAttack
	}
		
	/if (${Target.Type.Equal[NPC]} && ${Me.PctHPs}<35) { 
		/stick off
			/attack off
			/nav ${HuntLocX} ${HuntLocY} ${HuntLocZ}
	} else {
			:AttackLoop

		/if (${Target.Type.Equal[NPC]}) {		
			/doevents
			:waitForMove
	/delay 5
	/if (${Navigation.MeshLoaded} && ${Navigation.Active})  {
		/nav target
				/goto :waitForMove
		}
			/stick 15
|			/face fast
			/attack on
		/delay 5s	
		/goto :AttackLoop
				} 
	}
	:EndofAttack
	
	
/return

|------------------------------------------------------------| 
|         Target Acquisition Routines
|------------------------------------------------------------| 

Sub AcquireTarget

	/varset MobArray[1] "a sand giant elite"
	/varset MobArray[2] "Gregan, Overseer of the Sands"
	/varset MobArray[3] "a decaying skeleton"
	/varset MobArray[4] "a large rat"
	/varset MobArray[5] "a grass snake"
	
   
   /doevents
   /squelch /echo Aquiring Targets |-- For Testing purposes
   /varset FirstMobID ${Me.NearestSpawn[1,npc ${MobArray[1]}].ID}
   /for Counter 1 to 2
      /varset CurrentMobID ${Me.NearestSpawn[1,npc ${MobArray[${Counter}]}].ID}
    /if (${Spawn[${CurrentMobID}].Distance}<${Spawn[${FirstMobID}].Distance} && ${Bool[${CurrentMobID}]}) {
         /delay 1s
         /varset FirstMobID ${CurrentMobID}
		}
   /next Counter
   
   /if (${Spawn[${FirstMobID}].Distance} < 550 && ${Bool[${FirstMobID}]}) {
   		/delay 1s
   		/target ${Spawn[${FirstMobID}].Name}
   		/echo Target Acquired: ${Target}
   		/delay 1s
		/call AttackNow
   	} else {
   		/squelch /echo Nothing in Range |-- For Testing purposes
   		/delay 5s
   	}

/return


|------------------------------------------------------------| 
|        Events 											 |
|------------------------------------------------------------| 

Sub Event_Finished
	/echo "Faction maxxed, returning to Tacots Silentblade"
		/nav ${TacotsLocX} ${TacotsLocY} ${TacotsLocZ}
			:waitForMove
				/delay 10
		/if (${Navigation.MeshLoaded} && ${Navigation.Active}) {
			/goto :waitForMove
			}
	/echo "Faction maxxed, ending macro!!"
		/endmacro
/return


Sub Event_Death

	/call MobKillRank
	/echo ============================================
	/echo You Have Died!
	/echo ============================================
	
	/endmacro
/return


|** I put this in just for fun. If you want a kill count update, 
just remove the squelch **|

Sub Event_MobDeath 

/varset MobKillCount ${Math.Calc[${MobKillCount}+1]} 
/squelch /echo You've Slain: ${MobKillCount} mobs!
/squelch /echo Your Rank: ${MobKillRank[${RankCount}]}

/return 

|------------------------------------------------------------|
|		Death 
|------------------------------------------------------------|

Sub MobKillRank
	/declare MobKillCounter int local 1
	/declare Sum1 int local 0
	/declare Sum2 int local 0
	/varset RankCount 1
			
	/for MobKillCounter 1 to 10
		/varset Sum1 ${Math.Calc[${MobKillCounter}*5]}
		/varset Sum2 ${MobKillCount}
	/if (${Sum1}<${Sum2}) {
			/varset RankCount ${MobKillCounter}	
		}		
	/next MobKillCounter
	
/return 

Sub Event_KnockOut
	
	/varset LastLocX ${Me.X}
	/varset LastLocY ${Me.Y} 
	
	/echo ============================================
	/echo You've Been Knocked Out!
	/echo Location: ${Me.Y},${Me.X} 
	/echo You've Been Knocked Out!
	/echo ============================================

/return

| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Get Task
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sub GetTask
	/target Tacots
		/delay 10
	/keypress h
		/delay 10
	/say I am here to aid the city of Freeport
		/delay 10
	/say What great giants?
		/delay 10
	/say  I would be interesting in hunting the elite 
	/squelch /target clear
	/nav ${HuntLocX} ${HuntLocY} ${HuntLocZ}
		:waitForMove
		/delay 10
	/if (${Navigation.MeshLoaded} && ${Navigation.Active})  {
				/goto :waitForMove
		}
|		/echo There
/return

South Ro mesh:

- - - Updated - - -

Would it be possible for someone to test this out give me some feedback please?
 

Attachments

Last edited:
I'm trying to improve the attack routine of this macro to better deal with adds. It seems to be dealing with the adds at this point but it is spamming the pet is attacking mob. Can someone suggest a better way to accomplish this? Here is the subroutine.


Rich (BB code):
|------------------------------------------------------------| 
|          Attack Rountines 
|------------------------------------------------------------| 
Sub AttackNow
	/declare counter int 1
	/declare xTargetCount int ${Me.XTarget} local

		/doevents
    /if (${Me.PctHPs}>35) {
    /popup Now Attacking: ${Target.CleanName}!
		/nav target 20
	} else {
		/goto :EndofAttack
	}
		

	/for counter 1 to ${xTargetCount}
		/if (${Target.Type.Equal[NPC]}) {		
			/doevents
			:waitForMove
	/delay 5
	/if (${Navigation.MeshLoaded} && ${Navigation.Active})  {
		/nav target
				/goto :waitForMove
		}
			/stick 15
	/while (${Me.XTarget}>0 && ${Target.Type.Equal[NPC]} && ${SpawnCount[npc radius 50 zradius 50]}>0 && ${Select[${Me.Class.ShortName},BST,ENC,MAG,NEC,SHD]}>=1 && ${Me.Pet.ID}) {
        /squelch /look
		/pet attack
        /delay 15
        /attack on
    }	
    /while (${Me.XTarget}>0 && ${Target.Type.Equal[NPC]} && ${SpawnCount[npc radius 50 zradius 50]}>0 && !${Select[${Me.Class.ShortName},BST,ENC,MAG,NEC,SHD]}) /attack on
		/delay 5
			/next counter
	}
	:EndofAttack
	
/return
 
Do a check to see if the pet has a target. If no target then /pet attack. Because you put pet attack in a loop, it's going to keep spamming it without a check.

The only way I figured out how to do it on my mage macro was to set an xtarget to Pets Target and do an /if statement based off of that xtarget.

/if (!${Me.XTarget [9].ID} && {Target.Type.Equal [NPC]}) /pet attack

Or whatever
 
I finally got that to work by switching the evaluations around and putting $ in front of : {Target.Type.Equal [NPC]}

/if (${Target.Type.Equal [NPC]} && !${Me.XTarget [9].ID}) /pet attack


No more spam, lol, YAYYYY!!
 
My bad, I forgot the $ lol. I did it on mobile while at work so errors were bound to happen :)
 
No problem, I appreciate the help. Still trying to fine tune it, hehe, a lot of stuff I think it can do better, now I just have to figure out how to do it, lol.
 
Ver. 2.0
Added pet class support and dispatching adds after mission completes.
***** Pet classes need to set XTarget[9] to Pet's Target or edit macro to what you have that set for. *****



Rich (BB code):
|------------------------------------------------------------|
|	FFM BOT v2.0 											 |
|	By: Randyleo											 |
|	Based on Easy Bot										 |
|	By: WoopWoop (3/12/13)				                     |
|------------------------------------------------------------|


|**Ver. 2.0
Added pet class support and dispatching adds after mission completes.
***** Pet classes need to set XTarget[9] to Pet's Target or edit macro 
to what you have that set for. *****

Ver. 1.5
Rewrote the macro to use MQ2Nav for movement. It can be started 
from anywhere in the zone. It will return to Tacots and get a new 
mission when it finishes a mission. It will end the macro when it 
maxxes out Knights of Truth faction (last one to max on my Iksar 
warrior). The modified mesh will be needed and is in the post.

Ver. 1.0
I modified EasyBot to work Freeport Militia faction (as well 
as several others).  Each task gives 20 faction hits, so evil 
races will need to do this MANY times. It goes through the task 
one time and then ends. It gets the task, runs to area, kills 15 
"a sand giant elite", the runs back to task giver and ends. It does 
not loot anything as it is right now. It only casts things through 
Holyshits and downshits. 

It should probably only be used with a character of high enough 
live there is no chance of dying with.**|


|------------------------------------------------------------|
|		    Includes
|------------------------------------------------------------|
#turbo
#include Ninjadvloot.inc
|------------------------------------------------------------| 
|          Events 											 |
|------------------------------------------------------------| 

#Event Finished "#1#Freeport Militia could not possibly get any better."
|------------------------------------------------------------| 
|          Declares											 |
|------------------------------------------------------------| 
Sub Declares
	/declare TacotsLocX int outer -2060.94
	/declare TacotsLocY int outer 3880.57
	/declare TacotsLocZ int outer 28.12
	
	/declare HuntLocX int outer -421.17
	/declare HuntLocY int outer 2172.94
	/declare HuntLocZ int outer 136.50

	|---- Target Aquisition Variables ----|
   
    /declare NoMobs int outer 0
    /declare Counter int outer 
    /declare CurrentMobID int outer
    /declare FirstMobID int outer
   
	/declare MobArray[5] string outer
	
	|---- End Target Aquisition Variables----|
		
	
/return

|------------------------------------------------------------| 
|        	Main Routine
|------------------------------------------------------------| 
Sub Main
	/call Declares
	/echo Freeport Faction Bot v. 2.0 - Good Luck!
	
| -------------------------------------------------------------------------------------
| Check if required plugins are loaded		Stolen from KissAssist
| -------------------------------------------------------------------------------------
		/echo Checking Plugins
		/call CheckPlugin MQ2Melee
		/call CheckPlugin MQ2Moveutils
		/call CheckPlugin MQ2Nav
		/call SetupAdvLootVars
		/call MissionCheck1
	:MainLoop	
		/doevents
		/call AcquireTarget 
		/call Adds
	/if (${Me.UseAdvancedLooting}) {
			/call UseAdvLoot
		} else {
			/call LootMobs
		}
		/doevents
		/call MissionCheck2
		/doevents
			/goto :MainLoop
/return
|	---------------------------------------------------------
|	Adds
|	---------------------------------------------------------
Sub Adds
/declare counter int 1
/declare xTargetCount int ${Me.XTarget} local
/for counter 1 to ${xTargetCount}
    /if (${Me.XTarget}>0 && ${Target.Type.Equal[NPC]} && ${SpawnCount[npc radius 50 zradius 50]}>0)  /call AttackNow
		/next counter
/return
| ------------------------------------------------------------
|  MissionCheck1
| ------------------------------------------------------------
Sub MissionCheck1
	/if (${Task[giants].Title.Equal[Giants in the Desert]})  {
		/echo "I have a Giant mission!"
		/nav ${HuntLocX} ${HuntLocY} ${HuntLocZ}
		:waitForMove
			/delay 1
		/if (${Navigation.MeshLoaded} && ${Navigation.Active})  {
				/goto :waitForMove
		}
		} else {
		/nav ${TacotsLocX} ${TacotsLocY} ${TacotsLocZ}
			:waitForMove2
				/delay 5
		/if (${Navigation.MeshLoaded} && ${Navigation.Active})  {
			/goto :waitForMove2
		}
			/call GetTask
		}
		/delay 5
/return		
| ------------------------------------------------------------
|  MissionCheck2
| ------------------------------------------------------------
Sub MissionCheck2

	/declare counter int 1
	/declare xTargetCount int ${Me.XTarget} local

	/if (${Task[giants].Title.Equal[Giants in the Desert]})  {
			/delay 10
		} else {
		/echo "I need a mission!"
			/squelch /target clear
		/for counter 1 to ${xTargetCount}
    /if (${Me.XTarget}>0 && ${Target.Type.Equal[NPC]} && ${SpawnCount[npc radius 50 zradius 50]}>0)  /call AttackNow
		/next counter
		/nav ${HuntLocX} ${HuntLocY} ${HuntLocZ}
			:waitForMove1
				/delay 1
		/if (${Navigation.MeshLoaded} && ${Navigation.Active})  {
			/goto :waitForMove1
		}
			:waitForMove2
		/for counter 1 to ${xTargetCount}
    /if (${Me.XTarget}>0 && ${Target.Type.Equal[NPC]} && ${SpawnCount[npc radius 50 zradius 50]}>0)  /call AttackNow
		/next counter
			/delay 5
				/squelch /target clear
		/nav ${TacotsLocX} ${TacotsLocY} ${TacotsLocZ}
				/delay 1
		/if (${Navigation.MeshLoaded} && ${Navigation.Active})  {
			/goto :waitForMove2
		}
			/call GetTask
		}
		/delay 5
/return		
| ------------------------------------------------------------
| SUB: Check Plugin		Stolen from KissAssist
| ------------------------------------------------------------
    Sub CheckPlugin(string pluginname)
	
        /if (!${Bool[${Plugin[${pluginname}]}]}) {
            /squelch /plugin ${pluginname}
            /echo ${pluginname} not detected! This macro requires it! Loading ...
        }
        
    /return
|------------------------------------------------------------| 
|         Target Acquisition Routines
|------------------------------------------------------------| 
Sub AcquireTarget
	/varset MobArray[1] "a sand giant elite"
	/varset MobArray[2] "Gregan, Overseer of the Sands"
	/varset MobArray[3] "a decaying skeleton"
	/varset MobArray[4] "a large rat"
	/varset MobArray[5] "a grass snake"
	
   
   /doevents
   /squelch /echo Aquiring Targets |-- For Testing purposes
   /varset FirstMobID ${Me.NearestSpawn[1,npc ${MobArray[1]}].ID}
   /for Counter 1 to 2
      /varset CurrentMobID ${Me.NearestSpawn[1,npc ${MobArray[${Counter}]}].ID}
    /if (${Spawn[${CurrentMobID}].Distance}<${Spawn[${FirstMobID}].Distance} && ${Bool[${CurrentMobID}]}) {
         /delay 5
         /varset FirstMobID ${CurrentMobID}
		}
   /next Counter
   
   /if (${Spawn[${FirstMobID}].Distance} < 650 && ${Bool[${FirstMobID}]}) {
   		/delay 5
   		/target ${Spawn[${FirstMobID}].Name}
   		/echo Target Acquired: ${Target}
   		/delay 5
		/call AttackNow
   	} else {
   		/squelch /echo Nothing in Range |-- For Testing purposes
   		/delay 5
   	}
/return
|------------------------------------------------------------| 
|          Attack Rountines 
|------------------------------------------------------------| 
Sub AttackNow
	/declare counter int 1
	/declare xTargetCount int ${Me.XTarget} local
		/doevents
    /if (${Me.PctHPs}>35) {
    /popup Now Attacking: ${Target.CleanName}!
		/nav target 20
	} else {
		/goto :EndofAttack
	}
		
			:AttackLoop
	/for counter 1 to ${xTargetCount}
		/if (${Target.Type.Equal[NPC]}) {		
			/doevents
			:waitForMove
	/delay 5
	/if (${Navigation.MeshLoaded} && ${Navigation.Active})  {
		/nav target
				/goto :waitForMove
		}
			/stick 15
	/if (${Target.Type.Equal[NPC]} && ${Me.XTarget}>0 && ${SpawnCount[npc radius 50 zradius 50]}>0 && ${Select[${Me.Class.ShortName},BST,ENC,MAG,NEC,SHD]}>=1 && ${Me.Pet.ID}) {
        /squelch /look
	/if (${Target.Type.Equal[NPC]} && !${Me.XTarget[9].ID}) /pet attack
		/delay 5
        /attack on
    } else {
    /if (${Target.Type.Equal[NPC]} && ${Me.XTarget}>0 && ${SpawnCount[npc radius 50 zradius 50]}>0) /attack on
		/delay 5
        /attack on
			/next counter
		}
		/goto :AttackLoop
	}
	:EndofAttack
	
/return

| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Get Task
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub GetTask

	/declare counter int 1
	/declare xTargetCount int ${Me.XTarget} local

	/target Tacots
	/if (${Target.Distance}>15) /moveto id
		/delay 10
	/keypress h
		/delay 10
	/say I am here to aid the city of Freeport
		/delay 10
	/say What great giants?
		/delay 10
	/say  I would be interesting in hunting the elite 
	/squelch /target clear
	/echo "I have a Giant mission!"
		:waitForMove
	/nav ${HuntLocX} ${HuntLocY} ${HuntLocZ}
|		:waitForMove
		/for counter 1 to ${xTargetCount}
    /if (${Me.XTarget}>0 && ${Target.Type.Equal[NPC]} && ${SpawnCount[npc radius 50 zradius 50]}>0)  /call AttackNow
		/next counter
		/delay 10
	/if (${Navigation.MeshLoaded} && ${Navigation.Active})  {
				/goto :waitForMove
		}

/return

|------------------------------------------------------------| 
|        Events 											 |
|------------------------------------------------------------| 
Sub Event_Finished
	/echo "Faction maxxed, returning to Tacots Silentblade"
		/nav ${TacotsLocX} ${TacotsLocY} ${TacotsLocZ}
			:waitForMove
				/delay 10
		/if (${Navigation.MeshLoaded} && ${Navigation.Active}) {
			/goto :waitForMove
			}
	/echo "Faction maxxed, ending macro!!"
		/endmacro
/return


Southro bin file.
 

Attachments

Last edited:
Freeport faction macro

Users who are viewing this thread

Back
Top
Cart