MQ2AdvLoot v1.0

/squelch blocks any echo's resulting from the command

You might want to fine tune that loot sub btw, it was only an example

ex. check corpse count, distance etc.
 
Latest version is in the first post, I sent the latest source to htw so it should make the next compile at the latest.
 
Hey unity, thanks for this bro. I've been using it recently and have to say it fucking rocks. This will definately save a keyboard or 2 'cause I dont have to hit my loot hotbutton 500 times.


Thanks man-BB
 
No, the ini file is checked each time for the item's setting.
 
weird i keep getting interupted in looting even if an item is in the ini file, any clue ?
 
after getting the last version i got the same problem, happened in pofire after headshoting C2.
 
How are you using the plugin? (Single target looting, warp, stealth)
Where does it freeze? (once the corpse is open, after a few items, etc)
Are you lagging? (ping,cpu, etc)

There are 2 delay options you can try,
ItemsDelay = Numeric Value - Sets the delay that the plugin will wait before looting, once the corpse is open.
CorpseOpenDelay = Numeric Value - Sets the delay that the plugin will wait for the corpse to open.
 
advloot range

is there a way to set the range or something so i'm not looting corpses on the other side of a zone? i'm sure it's probably posted somewhere but i can't seem to find it lol..thanks
 
whats the loot.ini ment to be called and were to put it i cant seem to get it to work :p
 
is there a way to set the range or something so i'm not looting corpses on the other side of a zone? i'm sure it's probably posted somewhere but i can't seem to find it lol..thanks

whats the loot.ini ment to be called and were to put it i cant seem to get it to work :p

If either of you haven't found the answer by now, here you go; both of these questions could have been easily found if you had looked at the wiki first (http://www.mmobugs.com/wiki/index.php/MQ2AdvLoot).
 
Here is an example of a more complex macro than the one in the wiki on how you can utilize MQ2AdvLoot.
Code:
Sub Main
	| ***START CONFIGURATION***

	| The "CampRadius" variable sets the max distance corpses will be looted in your camp (Number)
	/declare CampRadius int outer 200

	| The "ReturnHome" variable determines if you will return home after looting (TRUE/FALSE)
	/declare ReturnHome bool outer TRUE

	| The "IgnoreLoS" variable determines if Line of Sight will be ignored when locating a corpse to loot (TRUE/FALSE)  
	/declare IgnoreLoS bool outer FALSE

	| ***END CONFIGURATION***
	/declare ReturnX float outer ${Me.X}
	/declare ReturnY float outer ${Me.Y}
	/declare ReturnH float outer ${Me.Heading.DegreesCCW}
	/declare TempID int outer 0
	/squelch /alert clear 7
	/call PluginCheck MQ2AdvLoot
	/if (${Macro.Return.Equal[FAILED]}) {
		/echo MQ2AdvLoot is required to run this macro, now ending.
		/endmacro
	}
	/squelch /target clear
	/echo Loot macro has been loaded.
	:MainLoop
		/if (${SpawnCount[npccorpse radius 15 noalert 7]} > 0) {
			/varset TempID ${Spawn[npccorpse radius 15 noalert 7].ID}
		} else {
		/if (${SpawnCount[npccorpse radius ${CampRadius} loc ${ReturnX} ${ReturnY} noalert 7]} > 0) {
			/varset TempID ${Spawn[npccorpse radius ${CampRadius} loc ${ReturnX} ${ReturnY} noalert 7].ID}
			}
		}
		/if (${TempID} != 0) {
			/if (${IgnoreLoS} && !${Spawn[${TempID}].LineOfSight}) {
				/squelch /alert add 7 id ${TempID}
				/varset TempID 0
			} else {
				/if (${Spawn[${TempID}].Distance} > 15) /call MoveToSpawn ${TempID}
				/if (${Macro.Return.NotEqual[FAILED]}) /call LootCorpse ${TempID}
				/if (${Spawn[${TempID}]}) /squelch /alert add 7 id ${TempID}
				/squelch /target clear
				/varset TempID 0
				/if (${ReturnHome} && ${SpawnCount[npccorpse radius ${CampRadius} loc ${ReturnX} ${ReturnY} noalert 7]} == 0) /call ReturnHome
			}
		}
	/goto :MainLoop
/return
 
 Sub PluginCheck(string PluginName)
	/if (!${Plugin[${PluginName}].Name.Length}) {
		/echo ${PluginName} was not found, attempting to load it.
		/squelch /plugin ${PluginName}
		/if (!${Plugin[${PluginName}].Name.Length}) {
			/echo ${PluginName} could not be loaded.
			/return FAILED
		}
	}
/return

Sub MoveToSpawn(int MoveToSpawnID)
	/declare StuckTimer timer local 5s
	/declare DistanceBefore float local ${Spawn[${MoveToSpawnID}].Distance} 
	/declare DistanceCurrent float local
	:MoveTo
	/varset DistanceCurrent ${Spawn[${MoveToSpawnID}].Distance}
	/if (!${StuckTimer}) {
		/keypress back
		/return FAILED
		}
	/if (!${Me.Stunned} && !${Debuff.Rooted} || ${DistanceCurrent} < (${Math.Calc[${DistanceBefore} + 3]}) ) /varset StuckTimer 5s
	/if (${Spawn[${MoveToSpawnID}].ID} && ${Spawn[${MoveToSpawnID}].Distance} > 15) {
		/squelch /face fast nolook id ${MoveToSpawnID}
		/keypress forward hold
		/goto :MoveTo
	}
	/keypress back
/return

Sub LootCorpse(int LootCorpseID)
	/call Target ${LootCorpseID}
	/if (${Macro.Return.Equal[FAILED]}) /return FAILED
	/squelch /advloot
	/delay 5s ${Window[LootWnd].Open}
	:Looting
	/delay 1
	/if (${AdvLoot.Active}) /goto :Looting
	/delay 5
	/if (${Window[LootWnd].Open}) /nomodkey /notify LootWnd DoneButton leftmouseup
/return

Sub Target(int TargetID)
	/squelch /target clear
	/squelch /target id ${TargetID}
	/delay 5s ${Target.ID}
	/if (!${Target.ID} || (${Target.ID} != ${TargetID})) /return FAILED
/return

Sub ReturnHome
	:ReturnHome
	/if (${Math.Distance[${ReturnY}, ${ReturnX}]} > 10) {
		/squelch /face fast loc ${ReturnY},${ReturnX} nolook
		/keypress forward hold
		/goto :ReturnHome
	}
	/squelch /face fast heading ${ReturnH} nolook
	/keypress back
/return
 
Last edited:
Updated to version 1.62, the download is in the first post.
 
Macro we were screwing around with in IRC for someone, skips on past corpses you can't loot, and be warned, the way it's set up here it warps you around.

Code:
Sub Main
 | ***START CONFIGURATION***
 | The "CampRadius" variable sets the max distance corpses will be looted in your camp (Number)
 /declare CampRadius int outer 2000
 | The "ReturnHome" variable determines if you will return home after looting (TRUE/FALSE)
 /declare ReturnHome bool outer TRUE
 | The "IgnoreLoS" variable determines if Line of Sight will be ignored when locating a corpse to loot (TRUE/FALSE)  
 /declare IgnoreLoS bool outer FALSE
 | ***END CONFIGURATION***
 /declare ReturnX float outer ${Me.X}
 /declare ReturnY float outer ${Me.Y}
 /declare ReturnZ float outer ${Me.Z}
 /declare ReturnH float outer ${Me.Heading.DegreesCCW}
 /declare TempID int outer 0
 /squelch /alert clear 7
 /call PluginCheck MQ2AdvLoot
 /if (${Macro.Return.Equal[FAILED]}) {
  /echo MQ2AdvLoot is required to run this macro, now ending.
  /endmacro
 }
 /squelch /target clear
 /echo Loot macro has been loaded.
 :MainLoop
  /if (${SpawnCount[npccorpse radius 15 noalert 7]} > 0) {
   /varset TempID ${Spawn[npccorpse radius 15 noalert 7].ID}
  } else {
  /if (${SpawnCount[npccorpse radius ${CampRadius} loc ${ReturnX} ${ReturnY} noalert 7]} > 0) {
   /varset TempID ${Spawn[npccorpse radius ${CampRadius} loc ${ReturnX} ${ReturnY} noalert 7].ID}
   }
  }
  /if (${TempID} != 0) {
   /if (${IgnoreLoS} && !${Spawn[${TempID}].LineOfSight}) {
    /squelch /alert add 7 id ${TempID}
    /varset TempID 0
   } else { 
    /if (${Spawn[${TempID}].Distance} > 15) /call WarpToSpawn ${TempID}
    /if (${Macro.Return.NotEqual[FAILED]}) /call LootCorpse ${TempID}
    /if (${Spawn[${TempID}].ID}) /squelch /alert add 7 id ${TempID}
    /squelch /target clear
    /varset TempID 0
    /if (${ReturnHome} && ${SpawnCount[npccorpse radius ${CampRadius} loc ${ReturnX} ${ReturnY} noalert 7]} == 0) /call ReturnHome
   }
  }
 /goto :MainLoop
/return
 
 Sub PluginCheck(string PluginName)
 /if (!${Plugin[${PluginName}].Name.Length}) {
  /echo ${PluginName} was not found, attempting to load it.
  /squelch /plugin ${PluginName}
  /if (!${Plugin[${PluginName}].Name.Length}) {
   /echo ${PluginName} could not be loaded.
   /return FAILED
  }
 }
/return
Sub WarpToSpawn(int WarpToSpawnID)
 /declare DistanceBefore float local ${Spawn[${WarpToSpawnID}].Distance} 
 /declare DistanceCurrent float local
 :WarpTo
 /varset DistanceCurrent ${Spawn[${WarpToSpawnID}].Distance}
 /if (${Spawn[${WarpToSpawnID}].ID} && ${Spawn[${WarpToSpawnID}].Distance} > 15) {
  /squelch /face fast nolook id ${WarpToSpawnID}
  /warp loc ${Spawn[${WarpToSpawnID}].Y} ${Spawn[${WarpToSpawnID}].X} ${Spawn[${WarpToSpawnID}].Z}
  /goto :WarpTo
 }
 /keypress back
/return
Sub LootCorpse(int LootCorpseID)
 /call Target ${LootCorpseID}
 /if (${Macro.Return.Equal[FAILED]}) /return FAILED
 /squelch /advloot
 /delay 2s ${Window[LootWnd].Open}
 :Looting
 /delay 1
 /if (${AdvLoot.Active}) /goto :Looting
 /delay 2
 /if (${Window[LootWnd].Open}) /nomodkey /notify LootWnd DoneButton leftmouseup
/return
Sub Target(int TargetID)
 /squelch /target clear
 /squelch /target id ${TargetID}
 /delay 5s ${Target.ID}
 /if (!${Target.ID} || (${Target.ID} != ${TargetID})) /return FAILED
/return
Sub ReturnHome
  :ReturnHome
 /if (${Math.Distance[${ReturnY}, ${ReturnX}]} > 10) {
  /squelch /face fast loc ${ReturnY},${ReturnX} nolook
  /warp loc ${ReturnY} ${ReturnX} ${ReturnZ}
  /goto :ReturnHome
 }
 /squelch /face fast heading ${ReturnH} nolook
 /keypress back
/return
 
Thanks again htw, it works great...just gotta be careful if anyone else is in zone! thanks for all your help!
 
Please help me solve the problem, thank you very much.
how do I set advloot.ini to loot all items with minvalue > 50pp and all traderskill items?

Here is my mq2advloot.ini settings, it only works on looting minvalue > 50 pp items like blue diamonds, etc, but can not loot items with minvalue < 50pp which i set want to loot in [items].

Please help

[Settings]
AllowStealth=False
AllowWarp=False
EchoDestroy=True
EchoKeep=True
EchoLootMSG=True
AllowAutoDestroy=False
EchoLoreMSG=True
ItemsDelay=150
CorpseOpenDelay=500
NoDrop=True
MustStack=False
IgnoreDuplicateLoreCorpse=True
MinValue=50
DefaultAction=Ignore

[Items]
Fantastic Animal Pelt=Keep
Fantastic Silk=Keep
Dream Dust=Keep
Miragestone=Keep
Greater Nebulous Dream Fragment=Keep
Glowing Nebulous Dream Fragment=Keep
Minor Nebulous Dream Fragment=Keep
Median Nebulous Dream Fragment=Keep
Osmium Ore=Keep
Fantastic Marrow=Keep
Fantastic Spinneret Fluid=Keep
Shimmering Loam=Keep
Porous Loam=Keep
Immaculate Spinneret Fluid=Keep
Exquisite Spinneret Fluid=Keep
Chronal Resonance Dust=Keep
Dream Meat=Keep
 
The dll in the first post has the ability to do that, if you set an item to be kept, it will be kept regardless of any other setting.
 
Somehow I've never used this plugin and it looks fantastic. I will have to write a .inc for it for folks to include some easy snippets to add it to any macro.

After just briefing glancing at the above macro, you should be able to not warp with this pretty easily. If you replace the warp snippet with this one, it should /navigate you to the target instead of warp. I put it for targets from 15-150 range, but I can tie it to mobs youve actually killed if i get around to it. Of course MQ2Navigation require lifetime on this site, so it wont be for everyone.

Changes highlighted in yellow.
Code:
Sub WarpToSpawn(int WarpToSpawnID)
 /declare DistanceBefore float local ${Spawn[${WarpToSpawnID}].Distance} 
 /declare DistanceCurrent float local
 :WarpTo
 /varset DistanceCurrent ${Spawn[${WarpToSpawnID}].Distance}
 /if (${Spawn[${WarpToSpawnID}].ID} && ${Spawn[${WarpToSpawnID}].Distance} > 15[COLOR=Yellow] && ${Spawn[${WarpToSpawnID}].Distance} < 150 && !${Navigation.Active}[/COLOR]) {
  [COLOR=Yellow] /nav loc ${Spawn[${WarpToSpawnID}].X} ${Spawn[${WarpToSpawnID}].Y} ${Spawn[${WarpToSpawnID}].Z}[/COLOR]
  /goto :WarpTo
 }
 /keypress back
/return

Then you would need to /nav back to your camp, follow pc, or to the next corpse, but that requires a few additional lines or variables that youd need in a macro. Will write something out when i get the chance that maybe of use for people. Anyway, thanks for the (apparently couple years old) plugin!
 
The dll in the first post has the ability to do that, if you set an item to be kept, it will be kept regardless of any other setting.

I feel this may be a stupid question, but would that mean i could leave the item list blank, and just set a value, and it'd loot anything based on that?

Trying to use this on a couple newbies being PLed, to loot more expensive items on the mass corpses laying around. So much plat loot, and other items just rotting, figured this would be useful.