Page 3 of 5

Re: Farming Macro

Posted: Fri Apr 06, 2012 2:51 pm
by spartikus
Thank you very much guys. There was still some screwy logic in my last version of this. I ran some testing last night and have cleaned it up substantially again.

I am going to post the latest cleaned up version of what I had working and then I will add in those two pieces. Thanks for sharing :) (And for not ripping me a new one on my brutally noob scripting)

Want to test the OnDeath event one more time before posting.

Re: Farming Macro

Posted: Fri Apr 06, 2012 3:59 pm
by TheDroidUrLookingFor
So I believe this would work for basic levels/AA gained... still at work so can't test it. If I recall there is a include in the VIP forums to do this.

Code: Select all


#event XPTRACKER "#*#You gain experience!!#*#" 
#event XPTRACKER "#*# You gain party experience#*#" 
#event XPREPORT "#*# report xp#*#"

Sub Main 
/Declare LevelsGained outer
/Declare ExpGained outer
/Declare AAGained outer
/Declare AAExpGained outer

/Declare StartLevel outer
/Declare StartAA outer
/Declare StartExp outer 
/Declare StartAAExp outer 

/varset StartLevel ${Me.Level}
/varset StartAA ${Me.AAExp}
/varset StartExp ${Me.Exp}
/varset StartAAExp ${Me.AAPoints}

:XPTrackLoop
/doevents
/goto :XPTrackLoop
/return

Sub Event_XPTRACKER
/if (${Me.Level}>${StartLevel}) {
/varset LevelsGained (${Me.Level}-${StartLevel})
}
/if (${Me.AAPoints}>${StartAA}) {
/varset AAGained (${Me.AAPoints}-${StartAA})
}
/return

Sub Event_XPREPORT
/echo ${LevelsGained}
/echo ${AAGained}
/return


Re: Farming Macro

Posted: Sat Apr 07, 2012 4:13 am
by spartikus
Thanks Droid. Thats a nice start.

I did a quick recap of the old XP macro that's stickied but I'm not liking what Im getting out of it.

I converted it to Varcalc but the numbers dont add up. I'll read up on the Exp stuff on the wikki tomorrow. I'm bushed :)

Here is a cut and paste of what I copied over frmo the old macro with some adjustments incase anyone is interested:

Code: Select all

Sub Event_Exp
   /declare RunTime int local
   /varcalc RunTime ${Macro.RunTime}/60
   /varcalc AAExp ${Me.PctAAExp}-${AAExp}
   /varcalc Exper ${Me.PctExp}-${Exper}
   /varcalc PrctExp ${Me.PctExp}-${Expstart}
   /varcalc PrctAAExp ${Me.PctAAExp}-${AAstart}
   /echo [EXP]: ${Exper} [AAXP]: ${AAExp} [${PrctExp}% EXP] [${PrctAAExp}% AAXP] in [${RunTime}] Minutes...
/return

Re: Farming Macro

Posted: Sat Apr 07, 2012 2:21 pm
by spartikus
And finally a working version of the XP counter.

*EDIT* Added a divide by zero check on RunTime1 incase something dies within the first 20 seconds of startup

I haven't done AA's etc but Droids script is the bomb for that.

Anyways working XP per kill:

Code: Select all

#event Exp "You gain#*#Experience#*#"

Sub Main
/declare PrctExp float outer
/declare Exper float outer
/declare Exper1 float outer
/declare Exper2 float outer
/declare Expstart float outer
/varset PrctExp 0
/varset Exper ${Me.PctExp}
/varset Exper1 0
/varset Exper2 0
/varset Expstart ${Me.Exp}
:Loop
/doevents
/goto :Loop

Sub Event_Exp
   /declare RunTime int local
   /declare RunTime1 float local
   /varset RunTime1 0
   /varcalc RunTime ${Macro.RunTime}/60
| Exper = XP from last Kill
   /varcalc Exper ${Me.Exp}-${Exper}
| Exper2 is running total of XP gained since start
   /varcalc Exper2 ${Exper2}+${Exper}
| PrctExp is the Percent left to level
   /varcalc PrctExp 100-${Me.PctExp}
   /varcalc RunTime1 ${RunTime}/60
   /if (${RunTime1}<1) /varset RunTime1 1
|Exper1 is Approx XP per hour
   /varcalc Exper1 ${Exper2}/${RunTime1}
   /echo [Last Kill]: ${Exper} [Total EXP]: ${Exper2} in [${RunTime}] Minutes...
   /echo [%EXP to level]: ${PrctExp}%   [Exp per hr]: ${Exper1}
/return
Thanks for the help guys. I'll post in snippets and addit to my bots

Re: Farming Macro

Posted: Sat Apr 07, 2012 6:30 pm
by TheDroidUrLookingFor
So, I finally ran that code I posted for group buffing. Seems you can't read group buffs like I was trying. So here is what I do in my druid pl script. With my PL script when it first starts it buffs all group members. Once those buffs fade the event below picks it up.

Code: Select all


#include spell_routines.inc

#event BuffMe "#*#Your #1# spell has worn off of #2#."

Sub Main
:MainLoop
/doevents
/goto :MainLoop
/return

Sub Event_BuffMe(Line,SpellName,ToonName)
/echo Re-Casting ${SpellName} on ${ToonName}
:Buff_Loop   
      /target ${ToonName}
      /call cast "${SpellName}" 3s
	  /delay 10s !${Me.Casting.ID}
  /if (!${Macro.Return.Equal["CAST_SUCCESS"]}) /goto :Buff_Loop
/return


Re: Farming Macro

Posted: Wed Apr 11, 2012 2:11 pm
by TheDroidUrLookingFor
Here is the code I use for finding the closest spawn I want and then kill it with just melee. I am using MQ2MoveUtils and MQ2Melee but those parts could be removed and replaced with code to work for those that don't have it. /killthis is from MQ2Melee and all the /stick commands which make your life easier are from MQ2MoveUtils. XD

Code: Select all


Sub FindMob 
/target ${NearestSpawn[npc radius ${Radius} zradius 30]}
/delay 10
/if (${Target.Type.Equal[NPC]} && ${Target.Distance}<${Radius}) /call Attack
/return

Sub Attack
:GetClose
/if (${Target.Distance}>20 && ${Target.Type.Equal[NPC]}) {
		/delay 2
			/face fast nolook
				/keypress up hold
			/delay 2
				/keypress up
			/call Checks	
			/goto :GetClose
			}
	 /popup Killing (${Target})!
		/if (${Stick.Status.Equal[ON]}) /stick off
	:AttackLoop
			/if (${Target.Type.Equal[NPC]}) {
				/if (${Stick.Status.Equal[OFF]} && !${Stick.Status.Equal[PAUSED]}) /stick hold 50% 
				/killthis
				/Delay 5	
				/call Checks				
			/goto :AttackLoop
		}
/return


Re: Farming Macro

Posted: Wed Apr 11, 2012 2:34 pm
by spartikus
Don't know if this will help you or not Droid but I've added in the line of sight flag to my /target lines to ensure my pets dont all go rambling off into various rooms of a dungeon and pulling 50 mob trains back on the group :)

I am pretty sure you just tag 'los' without quotes on the end of the /target line.

example:

Code: Select all

/target MyMob npc radius ${x} zradius ${z} los
Upped my survivability on my farming macro substantially.

Re: Farming Macro

Posted: Wed Apr 11, 2012 2:41 pm
by TheDroidUrLookingFor
spartikus wrote:Don't know if this will help you or not Droid but I've added in the line of sight flag to my /target lines to ensure my pets dont all go rambling off into various rooms of a dungeon and pulling 50 mob trains back on the group :)

I am pretty sure you just tag 'los' without quotes on the end of the /target line.

example:

Code: Select all

/target MyMob npc radius ${x} zradius ${z} los
Upped my survivability on my farming macro substantially.
Hehe then the line below should do it all. NearestSpawn will try any non variable as a name from what I read.

Code: Select all


/target ${NearestSpawn[npc radius ${Radius} zradius 30 los ${MyMobName}]}


Re: Farming Macro

Posted: Mon Aug 11, 2025 5:31 pm
by xyilla

Re: Farming Macro

Posted: Mon Aug 11, 2025 5:32 pm
by xyilla

Re: Farming Macro

Posted: Mon Aug 11, 2025 5:33 pm
by xyilla

Re: Farming Macro

Posted: Mon Aug 11, 2025 5:34 pm
by xyilla

Re: Farming Macro

Posted: Mon Aug 11, 2025 5:35 pm
by xyilla

Re: Farming Macro

Posted: Mon Aug 11, 2025 6:13 pm
by xyilla

Re: Farming Macro

Posted: Mon Aug 11, 2025 6:14 pm
by xyilla