Follow / loot bot

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

Moderator: MacroQuest Developers

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Follow / loot bot

Post by Chill » Tue Dec 26, 2006 1:43 am

I would like a simple looped macro to have a bot follow me around and loot corpses, keeping certain items and dropping/destroying the rest.

As a bonus, the bot could send his pet to attack mobs of interest in range and help me kill, if it wouldnt be hard to add in.

I was trying to write this myself, but its not really working how I had hoped and I was curious if someone had something similiar to this already?

Thanks

wakkedup
a ghoul
a ghoul
Posts: 114
Joined: Tue Apr 11, 2006 5:25 am

Post by wakkedup » Tue Dec 26, 2006 2:00 am

http://www.macroquest2.com/phpBB2/viewtopic.php?t=9076

Certainly, this could be easily modded. Change it to your group mates, and add in an assist sub
|------------------------------------------------------------
| Name: Loot.mac
|------------------------------------------------------------
| Description: Loots mobs that you or your pet kills.
| http://www.macroquest2.com/phpBB2/viewtopic.php?t=9076
|------------------------------------------------------------
| Author: TheWarden (helped by DKAA)
|------------------------------------------------------------
| Example Uses:
| /macro loot.mac
|------------------------------------------------------------


#Event MobDied "#*# has been slain by |${Me.Pet.CleanName}|!"
#Event MobDied "#*#You have slain #*#"

Sub Main

|------------------------------------------------------------
|Should I loot all items? (1 for yes, 0 for no)
|------------------------------------------------------------
/declare LootAllItems int outer 1


|------------------------------------------------------------
|Loot Array Information.
|------------------------------------------------------------
/call ReadINI HunterLoot.ini "${Zone.Name}" Loot
/if (!${Defined[LootArray]}) {
/echo No Loot Array Created...
}


|------------------------------------------------------------
|Variables that you don't need to worry about.
|------------------------------------------------------------
/declare LootSlot int outer 0



/echo Starting Looting Macro.
/lootnodrop never

:eventloop
/doevents
/delay 5
/goto :eventloop
/return


|--------------------------------------------------------------------------------
|Event: MobDied
|--------------------------------------------------------------------------------
Sub Event_MobDied

/squelch /declare LootSlot int inner 0
/declare LootCheck int inner 0
/declare LootTotal int inner 0

/target npc corpse radius 200

:MovementLoop
/face fast nolook
/if (${Int[${Target.Distance}]}>13) {
/keypress forward hold
}
/if (${Int[${Target.Distance}]}<13&&${Int[${Target.Distance}]}>11) {
/keypress forward
}
/if (${Int[${Target.Distance}]}<9) {
/keypress back
}
/if (${Int[${Target.Distance}]}>13) {
/goto :MovementLoop
}
/keypress forward
/keypress back

/delay 5
/loot

:NotOpen
/if (${Window[LootWnd].Open}) {
/goto :Lalala
}
/goto :NotOpen

:Lalala
/delay 5
/if (!${Corpse.Items}) {
/echo NO LOOT! Cheap Bastard!
/notify LootWnd DoneButton leftmouseup
/delay 5
/return
}

/varset LootTotal ${Corpse.Items}
/for LootSlot 1 to ${LootTotal}
/itemnotify loot${LootSlot} leftmouseup

:LootWait
/if (!${Cursor.ID}) {
/goto :LootWait
}
/delay 5
/if (${LootAllItems}) {
/echo Keeping a ${Cursor.Name}... WOOT!
/autoinventory
/delay 5
} else {
/for LootCheck 1 to ${LootArray.Size}
/if (${Cursor.Name.Find[${LootArray[${LootCheck}]}]}) {
/echo Keeping a ${Cursor.Name}... WOOT!
/autoinventory
/delay 5
}
/next LootCheck
}
/if (${Cursor.ID}) {
/echo Destroying a ${Cursor.Name}...
/destroy
/delay 5
}
/next LootSlot

/notify LootWnd DoneButton leftmouseup
/delay 5

/return


|--------------------------------------------------------------------------------
|SUB: Reading from an INI File
|--------------------------------------------------------------------------------
Sub ReadINI(FileName,SectionName,ArrayType)

/echo Attempting to Read Section "${SectionName}" Zone Information from ${FileName}...
/delay 10

/if (${Ini[${FileName},${SectionName},-1,NO].Equal[NO]}) {
/echo "${SectionName}" is not a Valid Section for FILE:${FileName}, ending macro...
/delay 10
/return
}
/declare nValues int local 1
/declare nArray int local 0
/declare KeySet string local ${Ini[${FileName},${SectionName}]}

:CounterLoop
/if (${Ini[${FileName},${SectionName},${ArrayType}${nValues},NOTFOUND].Equal[NOTFOUND]}) {
/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 MobArray[${nValues}] string outer
/declare MobStats[${nValues}] string outer
}
/if (${FileName.Equal["HunterLoot.ini"]}&&${nValues}>0) {
/echo Declaring Loot Array...
/declare LootArray[${nValues}] string outer
/declare LootStats[${nValues}] string outer
}
/for nArray 1 to ${nValues}
/if (${FileName.Equal["HunterMob.ini"]}) {
/varset MobArray[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]}
/varset MobStats[${nArray}] 0
}
/if (${FileName.Equal["HunterLoot.ini"]}) {
/varset LootArray[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]}
/varset LootStats[${nArray}] 0
}
/next nArray

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

/return

Nightmare327
a lesser mummy
a lesser mummy
Posts: 54
Joined: Mon Nov 06, 2006 3:01 am

Post by Nightmare327 » Tue Feb 27, 2007 11:24 am

I use the modbot.mac for doing this, all loot is done from the loot.ini file, so I have it destroy stuff like the mirrored masks in Anguish and other stuff. I also use 2 ini files, 1 with it set to loot and 1 with it set to not loot, so I can turn it on and off at will. Maybe make a toggle command for it though, hmm, may have to look at that :)

Kroak
a grimling bloodguard
a grimling bloodguard
Posts: 1801
Joined: Thu Sep 15, 2005 4:10 am

Post by Kroak » Tue Feb 27, 2007 11:32 am

Nightmare327 wrote:I use the modbot.mac for doing this, all loot is done from the loot.ini file, so I have it destroy stuff like the mirrored masks in Anguish and other stuff. I also use 2 ini files, 1 with it set to loot and 1 with it set to not loot, so I can turn it on and off at will. Maybe make a toggle command for it though, hmm, may have to look at that :)
Make a toggle command? It's already in there as part of the macro...
/mb doloot on
or
/mb doloot off

See the wiki for a full list of commands. You don't need a seperate .ini file for what you're doing. :)
http://www.macroquest2.com/wiki/index.php/ModBot

xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Follow / loot bot

Post by xyilla » Wed Aug 06, 2025 11:22 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Follow / loot bot

Post by xyilla » Wed Aug 06, 2025 11:23 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Follow / loot bot

Post by xyilla » Wed Aug 06, 2025 11:24 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Follow / loot bot

Post by xyilla » Wed Aug 06, 2025 11:25 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Follow / loot bot

Post by xyilla » Wed Aug 06, 2025 11:26 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Follow / loot bot

Post by xyilla » Wed Aug 06, 2025 11:27 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Follow / loot bot

Post by xyilla » Wed Aug 06, 2025 11:28 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Follow / loot bot

Post by xyilla » Wed Aug 06, 2025 11:30 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Follow / loot bot

Post by xyilla » Wed Aug 06, 2025 11:31 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Follow / loot bot

Post by xyilla » Wed Aug 06, 2025 11:32 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Follow / loot bot

Post by xyilla » Wed Aug 06, 2025 11:33 am