• 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

Request - Appending an Auto Loot/Auto Sell macro to this hunter.

Maze_EQ

New member
Joined
Nov 8, 2013
RedCents
30¢
I've been using this Hunter mac for use with an old private server.

What I'm trying to figure out is if theres a way to automatically detect when the inventory is full, do a /merchant and sell everything in bags.

Would greatly appreciate help or tips.

Rich (BB code):
#turbo 10 
Sub Main 
|------------------------------------------------------------ 
|Should the macro use warp for movement, if 0, then use moveto or navi (next setting)? 
|------------------------------------------------------------ 
/declare UseWarp int outer 1
|------------------------------------------------------------ 
|Should the macro use MQ2Navigate for movement, if 0, then use moveto? 
|------------------------------------------------------------ 
/declare UseNavi int outer 0 
|------------------------------------------------------------ 
|How many times should aquire target fail before delaying? 
|------------------------------------------------------------ 
/declare RV_FailMax int outer 100 
|------------------------------------------------------------ 
|How far would you like to target a mob? 
|------------------------------------------------------------ 
/declare RV_MaxRadius int outer 800000
|------------------------------------------------------------ 
|How far is the combat range? 
|------------------------------------------------------------ 
/declare RV_Range int outer 10 
|------------------------------------------------------------ 
|What is the minimum Z Value of mobs I should target? 
|------------------------------------------------------------ 
/declare RV_MinZRange int outer -1000 
|------------------------------------------------------------ 
|What is the maximum Z Value of mobs I should target? 
|------------------------------------------------------------ 
/declare RV_MaxZRange int outer 1000 
|------------------------------------------------------------ 
|Should I loot all items? 
|------------------------------------------------------------ 
/declare RV_LootAllItems int outer 1 
|------------------------------------------------------------ 
|Should I display stats? 
|------------------------------------------------------------ 
/declare RV_DisplayStats int outer 1 
|------------------------------------------------------------ 
|Loot Array Information. 
|------------------------------------------------------------ 
/call ReadINI huntermob.ini "${Zone.Name}" Mob 
/if (!${Defined[RV_MobArray]}) { 
/echo Mob Array Creation Error, ending macro... 
/endmacro 
} 
|------------------------------------------------------------ 
|Mob Array Information. 
|------------------------------------------------------------ 
/call ReadINI hunterloot.ini "${Zone.Name}" Loot 
/if (!${Defined[RV_LootArray]}) { 
/echo No Loot Array Created... 
} 
|------------------------------------------------------------ 
|Variables that you don't need to worry about. 
|------------------------------------------------------------ 
/declare RV_FailCounter int outer 0 
/declare RV_MyTargetID int outer 0 
/declare RV_MyTargetName string outer 
/declare RV_MyTargetDead int outer 0 
/declare RV_InvalidTargetID int outer 0 
/declare RV_HasTarget int outer 0 
/declare RV_RandomWait int outer 0 
/declare RV_LootSlot int outer 0 
/declare RV_CheckLook int outer 0 
/declare RV_Fighting int outer 0 
/declare RV_TargetDead int outer 0 
/declare RV_MyXLOC int outer 0 
/declare RV_MyYLOC int outer 0 

/declare RV_FastRange int outer 
/declare RV_RangeMax int outer 
/declare RV_RangeMin int outer 
/varcalc RV_FastRange ${RV_Range}+3 
/varcalc RV_RangeMax ${RV_Range}+1 
/varcalc RV_RangeMin ${RV_Range}-1 
:Start 
/doevents 
|/call GMCheck 
/call GetTarget 
:KillAdds 
/if (${RV_HasTarget}) /call MoveToMob 
/if (${RV_HasTarget}) /call CombatSub 
/if (${RV_HasTarget}) /call MoveToMob 
/if (${RV_HasTarget} && (${Defined[RV_LootArray]} || ${RV_LootAllItems})) {
/call LootMob 
/look center
}
/if (${RV_DisplayStats}) /call DisplayStats 
/call ResetSub 

/if (${Target.ID}) { 
/echo Looks like something is attacking us, killing it... 
/delay 1s 
/varset RV_HasTarget 1 
/varset RV_Fighting 1 
/goto :KillAdds 
} 

/goto :Start 

/return 
|-------------------------------------------------------------------------------- 
|SUB: Aquire Target 
|-------------------------------------------------------------------------------- 
Sub GetTarget 
/declare RV_CurrentRadius int local 
/declare RV_TargetSub int local 
/declare BadMeTarget int local 0
/declare BadPCTarget int local 0

:Acquire 
/if (${Target.Type.Equal[Corpse]}) /squelch /target clear
/for RV_CurrentRadius 100 to ${RV_MaxRadius} step 100 
/for RV_TargetSub 1 to ${RV_MobArray.Size} 
:BadTarget
/if (${Target.ID}==${Me.ID}) {
/if (!${BadMeTarget}) /echo Hunter.mac: You have yourself on target, pausing macro until /tar clear
/varset BadMeTarget 1
/delay 1s
/goto :BadTarget
}
/if (${Target.Type.Equal[PC]}) {
/if (!${BadPCTarget}) /echo Hunter.mac: You have a PC on target, pausing macro until /tar clear
/varset BadPCTarget 1
/delay 1s
/goto :BadTarget
}
/varset BadMeTarget 0
/varset BadPCTarget 0
| /echo Will use: /target radius ${RV_CurrentRadius} nopcnear notid ${RV_InvalidTargetID} npc "${RV_MobArray[${RV_TargetSub}]}" 
/squelch /target radius ${RV_CurrentRadius} nopcnear notid ${RV_InvalidTargetID} npc "${RV_MobArray[${RV_TargetSub}]}" 
/delay 3s ${Target.ID}
/varset RV_MyTargetID ${Target.ID} 
/varset RV_MyTargetDead 0 
/if (${Target.ID}) { 
/if (${Int[${Target.PctHPs}]}<60) { 
/echo Mob NOT a Full Health, picking another... 
/varset RV_InvalidTargetID ${Target.ID} 
/call ResetSub 
/goto :Acquire 
} 
/if (${Int[${Target.Z}]}<${RV_MinZRange}) { 
/echo Mob is BELOW Min Z Range, picking another... 
/varset RV_InvalidTargetID ${Target.ID} 
/call ResetSub 
/goto :Acquire 
} 
/if (${Int[${Target.Z}]}>${RV_MaxZRange}) { 
/echo Mob is ABOVE Max Z Range, picking another... 
/varset RV_InvalidTargetID ${Target.ID} 
/call ResetSub 
/goto :Acquire 
} 
/varset RV_HasTarget 1 
/varset RV_MyTargetName ${Target.CleanName} 
/echo Acquired ${Target.CleanName} at range ${Int[${Target.Distance}]} 
/return 
} 
/next RV_TargetSub 
/delay 2s 
/next RV_CurrentRadius 

/if (!${Target.ID}) { 
/delay 2s 
/varcalc RV_FailCounter ${RV_FailCounter}+1 
/echo Failed to Acquire Target in Range ${RV_MaxRadius} ${RV_FailCounter} Time(s) 
/if (${RV_FailCounter}>=${RV_FailMax}) { 
/echo Waiting for Respawns, Resetting Failure Counter... 
/delay 5s 
/varset RV_FailCounter 0 
} 
/goto :Acquire 
} 
/return 
|-------------------------------------------------------------------------------- 
|SUB: Moving 
|-------------------------------------------------------------------------------- 
Sub MoveToMob 
/varset RV_MyXLOC ${Int[${Me.X}]} 
/varset RV_MyYLOC ${Int[${Me.Y}]} 
/declare RV_DistanceTimer timer 15 
/declare MovementStarted int local 0
/doevents 
/varset MovementStarted 0
:MovementLoop 
/if (${MovementStarted}) /doevents
/if (${Int[${Target.Distance}]}>${RV_FastRange}) {
/if (${UseWarp}) {
/if (${Plugin[MQ2RWarp].Version}) {
/if (!${MovementStarted}) /echo Warping to ${Target.CleanName}
/varset MovementStarted 1
/if (!${Me.Moving}) /warp t
} else {
/echo Hunter.mac movement error - you need MQ2MMOWarp loaded before you can define UseWarp!
/endmac
}
} else {
/if (${Plugin[MQ2Navigation].Version} && ${UseNavi}) {
/if (!${MovementStarted}) /echo Navigating to ${Target.CleanName}
/varset MovementStarted 1
/if (!${Me.Moving}) {
/navi stop
/navi target
}
} else {
/if (${Plugin[MQ2MoveUtils].Version}) {
/if (!${MovementStarted}) /echo Moving to ${Target.CleanName}
/if (!${MoveTo.Moving}) {
/moveto id
}
/varset MovementStarted 1
} else {
/if (!${MovementStarted}) {
/echo Hunter.mac movement error - you need MQ2Navigation or MQ2MoveUtils loaded, or MQ2MMOWarp plus define UseWarp!
/endmac
}
}
}
}
} 
/if (${Int[${Target.Distance}]}>${RV_FastRange}) /goto :MovementLoop 
/return

|-------------------------------------------------------------------------------- 
|SUB: Combat 
|-------------------------------------------------------------------------------- 
Sub CombatSub 
/echo Attacking Mob NOW! 
/varset RV_Fighting 1 
/varset RV_TargetDead 0 

:CombatLoop 
/doevents 
/attack on 

/call MoveToMob 
/call SpecialIT 

/if (!${Target.ID}) {
/if (${Target.Type.Equal[Corpse]}) /squelch /target clear 
/attack off 
/keypress forward 
/keypress back 

/varset RV_TargetDead 1 
/varset RV_Fighting 0 
/delay 1s 
/target radius 30 corpse 
/delay 1s 
/if (!${Target.ID}) { 
/call ResetSub 
/return 
} 
/face fast 
} 
/if (!${RV_TargetDead}) { 
/goto :CombatLoop 
} 
/return 

|-------------------------------------------------------------------------------- 
|SUB: Special Combat 
|-------------------------------------------------------------------------------- 
Sub SpecialIt 

/return 

|-------------------------------------------------------------------------------- 
|SUB: Looting 
|-------------------------------------------------------------------------------- 
Sub LootMob 
/declare LootSlot int inner 0 
/declare LootCheck int inner 0 
/declare LootTotal int inner 0 


/keypress forward 
/keypress back 

/fastdrop on 
/lootn never 
/delay 2s 
/loot 
| Don't make this too low, or ${Corpse.Items} will be wrong, since win has not populated
/delay 2s
/if (!${Corpse.Items}) { 
/echo NO LOOT! Cheap Bastard! 
/return 
} 
/varset LootTotal ${Corpse.Items} 
/for LootSlot 1 to ${LootTotal} 
/timed 1 /shift /itemnotify ${Corpse.Item[${LootSlot}].InvSlot} leftmouseup

/delay 3s ${Cursor.ID}
/if (${RV_LootAllItems}) { 
/echo Keeping a ${Cursor.Name}... WOOT! 
/timed 1 /autoinv
/delay 3s !${Cursor.ID}
} else { 
/for LootCheck 1 to ${RV_LootArray.Size} 
/if (${Cursor.Name.Find[${RV_LootArray[${LootCheck}]}]}) { 
/echo Keeping a ${Cursor.Name}... WOOT! 
/varcalc RV_LootStats[${LootCheck}] ${RV_LootStats[${LootCheck}]}+1 
/timed 1 /autoinv
/delay 3s !${Cursor.ID}
} 
/next LootCheck 
} 
/if (${Cursor.ID}) { 
/echo Destroying a ${Cursor.Name}... 
/timed 1 /destroy
/delay 3s !${Cursor.ID}
} 
/next LootSlot 

/notify LootWnd DoneButton leftmouseup 
/delay 2s !${Window[LootWnd].Open}

/return 
|-------------------------------------------------------------------------------- 
|SUB: Reset 
|-------------------------------------------------------------------------------- 
Sub ResetSub 
/keypress esc 
/keypress esc 
/keypress esc 
/keypress esc 

/varset RV_HasTarget 0 
/varset RV_TargetDead 0 
/varset RV_Fighting 0 

/return 

|-------------------------------------------------------------------------------- 
|SUB: GM Check 
|-------------------------------------------------------------------------------- 
Sub GMCheck 
|/beep 
|/beep 
|/beep 

/echo GM has entered the zone! 
/echo FUCK HIM but ending the macro... 
/keypress forward 
/keypress back 
/casting 13624
} 

/return 
|-------------------------------------------------------------------------------- 
|SUB: Reading from an INI File 
|-------------------------------------------------------------------------------- 
Sub ReadINI(FileName,SectionName,ArrayType) 
/echo Attempting to Read Section "${SectionName}" Zone Information from ${FileName}... 
/delay 1s 

/if (${Ini[${FileName},${SectionName},-1,NO].Equal[NO]}) { 
/echo "${SectionName}" is not a Valid Section for FILE{FileName}, ending macro... 
/delay 1s 
/return 
} 
/declare nValues int local 1 
/declare nArray int local 0 
/declare KeySet string local ${Ini[${FileName},${SectionName}]} 
:CounterLoop 
/if (!${KeySet.Arg[${nValues},|].Length}) { 
/varcalc nValues ${nValues}-1 
/goto :MakeArray 
} 
/varcalc nValues ${nValues}+1 
/goto :CounterLoop 
:MakeArray 
/if (!${nValues}) /return 
/if (${FileName.Equal["huntermob.ini"]}&&${nValues}>0) { 
/echo Declaring Mob Array... 
/declare RV_MobArray[${nValues}] string outer 
/declare RV_MobStats[${nValues}] string outer 
} 
/if (${FileName.Equal["hunterloot.ini"]}&&${nValues}>0) { 
/echo Declaring Loot Array... 
/declare RV_LootArray[${nValues}] string outer 
/declare RV_LootStats[${nValues}] string outer 
} 
/for nArray 1 to ${nValues} 
/echo Checking '${FileName}' for zone '${SectionName}'
/if (${FileName.Equal["huntermob.ini"]}) { 
/varset RV_MobArray[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]} 
/varset RV_MobStats[${nArray}] 0 
/echo Set RV_MobArray${nArray} to '${RV_MobArray[${nArray}]}'
} 
/if (${FileName.Equal["hunterloot.ini"]}) { 
/varset RV_LootArray[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]} 
/varset RV_LootStats[${nArray}] 0 
/echo Set RV_LootArray${nArray} to '${RV_LootArray[${nArray}]}'
} 
/next nArray 

/echo "${SectionName}" Zone Information Read Successfully from ${FileName}... 
/delay 1s 

/return 
|-------------------------------------------------------------------------------- 
|SUB: Display Stats 
|-------------------------------------------------------------------------------- 
Sub DisplayStats 
/declare nArray int local 

/if (${Defined[RV_LootArray]}) { 
/for nArray 1 to ${RV_LootArray.Size} 
/echo ${Int[${RV_LootStats[${nArray}]}]} ${RV_LootArray[${nArray}]}'s 
/next nArray 
} 

/return
 
Last edited:
Yes, it is possible. I've seen others do such... I'm still trying to figure out how to do this myself. I have a working hunter macro I've tweaked enough that I'm staying alive most of the time but I have yet to figure out how to do the inventory check, sell to a vendor and then resuming the hunter routine.

Any of you guru's on here who can help? I'd name my first born after you. ;)

Thanks
 
It is really not that hard guy's. The Ninjadvloot.inc file in the macros directory has the instructions on how to use.

Rich (BB code):
| Ninjadvloot.inc v4.6  02/01/2014 Redguides.com 
| Author A_Druid_00 12/19/2005
| Based on original looting code of toomanynames
| The following updates were all individually posted and consolidated by Maskoi into the current version.
| Updated: Moeymoejoe added strip out comma in item names when accessing ini file 08/02/2006
| Updated: mystikule added sell option to ini file 01/07/2008
| Updated: drkrain for House of Thule 10/23/2010
| Updated: Maskoi with Sell Routines 11/27/2010
| Updated: Maskoi with /item keep/sell/destroy ini commands 07/21/2011
| Updated: Maskoi with Foraged item handling 08/31/2011
| Updated: Maskoi with Buying item handling 07/31/2012
| Updated: Maskoi with Assign different ini file for item handling 01/01/2013
|
| Selling Contributions by
|   drkrain - TLInv item check
|   dewey2461 - Add sold items to ini file Event
|
| Requirements: MQ2Moveutils
| Usage: add the following to your macro for looting
|   #include Ninjadvloot.inc
|   /call SetupAdvLootVars
|   /call LootMobs

Notice the highlighted lines.

What you want to do is put the:

#include Ninjadvloot.inc

In the top of your macro and at the top of your sub main routine you want to add the

/call SetupAdvLootVars

This call only needs to be called 1 time each time you start your macro.

After that you just need to find where in your macro you want to loot mobs. that where you put the

/call LootMobs

You want to run this call in your macro every time you want to loot mobs. This is normally done after you have killed all mobs on your xtarget(s) and there a no mobs in close proxitity to you. Lootmobs is picky about looting corpses with NPC's around.

Well that's about it. Give it a try and let us know how things go.

Have fun.
 
Last edited:
Oh, I've got the looting down. Looting and the whole autosell thing is no problem, I did just as you described... For me, I've not yet figured out how to check for a full inventory, stop hunting, run over to a vendor to autosell everything and then resume hunting... Looting and the whole autosell thing is no problem.
 
You can use this line to test your Free Inventory Space. You can either check if you have none or getting close to not having any. this does not check if you have space in stacks just open inventory slots.

Rich (BB code):
|This line checks for No Inventory space.
|Put this right after the /call LootMobs Line.
/if (!${Me.FreeInventory}) {
|lines of code go here when you are out of inventory.
}

|This line checks 3 or less Inventory spaces. You can change the number to what you want.
|Put this right after the /call LootMobs Line.
/if (${Me.FreeInventory}<=3) {
|lines of code go here when you are close to being out of inventory.
}

Listed below is some code from Kissassist. This code has all the Moveto code needed to do what you want. You can Thank Maskoi this is his code. Just use the parts you need.
This requires the MQ2moveutils plugin to be loaded.

Rich (BB code):
    Sub GiveTo(string GItem, int GTarget)
        /if (${DebugBuffs}) /echo DEBUGBUFFS GiveTo enter
        /declare ItemSummoned int local 0
       /if (${Target.ID}!=${GTarget}) {
            /target id ${GTarget}
            /delay 2s ${Target.ID}==${GTarget}
        }
        /if (${Target.Distance}>10 && ${Target.Distance}<=${CampRadius}) {
            /moveto id ${Target.ID}
            /delay 50 ${MoveTo.Stopped}
        }
        
            /if (${Cursor.ID}==${FindItem[${GItem}].ID} && ${Cursor.ID}) {
                /goto :CursorFree
            } else /if (${FindItemCount[${GItem}]}>0) {
                /shift /itemnotify "${GItem}" leftmouseup
                /delay 20 ${Cursor.ID}
            }
            :CursorFree
                /if (${Cursor.ID} && ${Cursor.NoRent}) {
                    /varset ItemSummoned 1
                    /nomodkey /click left target
                    /delay 5
                }
            /if (${Cursor.ID} && ${Cursor.NoRent}) /goto :CursorFree
         
        /delay 10
            /if (${ItemSummoned}) {
                /notify GiveWnd GVW_Give_Button leftmouseup
                /echo Giving ${GItem} to ${Target.CleanName}
            } else {
                /echo Item is NOT SUMMONED canceling trade
                /notify GiveWnd GVW_Cancel_Button leftmouseup
            }
        /delay 200 !${Window[GiveWnd].Open}
        /if (${DebugBuffs}) /echo DEBUGBUFFS GiveTo leave
    /return
 
jajang can you post the finished hunter.mac after you got it working would love this.

thanks
 
Request - Appending an Auto Loot/Auto Sell macro to this hunter.

Users who are viewing this thread

Back
Top
Cart