• 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
Ninjadvloot.inc

Release Ninjadvloot.inc 2022-06-23

No permission to download
If lag is the issue, wouldn't a redundant double-check of all nearby bodies with a set interval (every 5 minutes or so) clear up the issue almost entirely?
I know that doesn't really fix the issue, but it would work as a solution.
 
I have 30-35ms almost always ;P Should not be lag. I know i can or should switch to advloot, but currently i am to lazy to set it up :-) (means set who will get what).


One thing which would be nice: NinjaAdvloot should add the AG Flag the item if you want to keep/sell/destroy it. And the Never flag if you want to ignore it. That way you get an populated advloot list (not ninjaadvloot!).
Wut?
 
Hm, was it that unclear ?

There is ninjaadvloot (mq2) and advloot (ingame).

If you use ninjaadvloot + advloot the advloot list never gets populated, because ninjaadvloot just gives the item to the ML.

If you want to sell/keep an item, and maybe even if you destroy an item you should set the AG (always greed) flag in the advloot window, so that the advloot list gets populated (i talk about the ingame advloot list, not the ninjaadvloot list).

edit: played around a bit.
You can set the AG flag for items you want to keep/sell and ninjaadvloot works without problems, so thats an easy change. Cant set it for items ninjaadvloot is supposed to destroy, he wont do it after.

I removed the lines where ninjaadv left the items on the corpse (=ignore), and that fixed the problem. Just that the advloot window gets populated with no drop items for the 30 minutes till the corpse rotts..
 
playing around with this to add a safety net to my looting, and i have to wonder, is there a way to add a delay for looting to give the /advloot time to random etc? ideally i would like to use both systems with this running as a safety net to catch things like say the 24 slot bag that dropped today that aren't already in the adv loot filters
 
Attempting to update how ninjadvloot handles lore items and noticed this error:

Rich (BB code):
[2016/05/14 09:18:46] XP Gained: 1 (0.303%) || XP Total: 21 (6.364%) 

[2016/05/14 09:18:50] [MQ2] SharedList: Pristine Gorilla Canine is Lore and I have one. Giving to another group member.

[2016/05/14 09:18:51] [MQ2] SharedList: Pristine Gorilla Canine is Lore and everyone has one. Skipping item.

[2016/05/14 09:18:51] Woah! hold your horses there little filly... You better add a !${AdvLoot.LootInProgress} check in your macro to make sure loot is not in progress.

[2016/05/14 09:18:51] MyNinjadvloot.inc@643 (UseAdvLoot): /advloot shared ${i} giveto ${Group.Member[${g}].Name}

[2016/05/14 09:18:51] ca.mac@429 (looting): /call UseAdvLoot

[2016/05/14 09:18:51] CAcombat.cai@302 (endcombat(from1,from2)): /if (${Window[AdvancedLootWnd]} && ${Me.ID}==${MasterLooterID}) /call looting

[2016/05/14 09:18:51] ca.mac@419 (Event_endcombat(S0)): /call endcombat CAmain ${Macro.CurLine}slainevent

[2016/05/14 09:18:51] ca.mac@288 (main): /if (${AuraSpell1.NotEqual[0]} && !${AuraCheckTimer} && ${Me.CombatState.NotEqual[combat]}) /call castaura

[2016/05/14 09:18:52] [MQ2] SharedList: Patch of Gorilla Fur is Lore and everyone has one. Skipping item.

[2016/05/14 09:18:52] Woah! hold your horses there little filly... You better add a !${AdvLoot.LootInProgress} check in your macro to make sure loot is not in progress.

[2016/05/14 09:18:52] MyNinjadvloot.inc@643 (UseAdvLoot): /advloot shared ${i} giveto ${Group.Member[${g}].Name}

[2016/05/14 09:18:52] ca.mac@429 (looting): /call UseAdvLoot

[2016/05/14 09:18:52] CAcombat.cai@302 (endcombat(from1,from2)): /if (${Window[AdvancedLootWnd]} && ${Me.ID}==${MasterLooterID}) /call looting

[2016/05/14 09:18:52] ca.mac@419 (Event_endcombat(S0)): /call endcombat CAmain ${Macro.CurLine}slainevent

original ninjadvloot code:
Rich (BB code):
                | skip item if its lore and I have one
                /if (${FindItem[${ITPName}].Lore}) {
                    /if (${Debugloot}) /echo SharedList: ${ITPName} is Lore and I have one. Skipping item.
                    | /advloot shared ${i} leave
                    /goto :NextItem
                }

changes I made:
Rich (BB code):
                | skip item if its lore and I have one
                /if (${FindItem[${ITPName}].Lore}) {
                    /if (${Debugloot}) /echo SharedList: ${ITPName} is Lore and I have one. Giving to another group member.
					/for g 1 to ${Group.Members}
					/advloot shared ${i} giveto ${Group.Member[${g}].Name}
/echo SharedList: ${ITPName} is Lore and I have one. Giving item to ${Group.Member[${g}].Name}
					/delay 10
					/if (!${AdvLoot.SList[${i}].ID}) {
                                        /goto :NextItem
					} else /next g
					/if (${Debugloot}) /echo SharedList: ${ITPName} is Lore and everyone has one. Skipping item.
/echo SharedList: ${ITPName} is Lore and everyone has one. Skipping item.
					/advloot shared ${i} leave
                    /goto :NextItem
                }

The error does not stop the macro. I am concerned nonetheless. How do I fix this?

Second problem: Something is causing a problem with loot list count. ei. The master looter is not completely clearing the shared list nor his personnel list?
 
The error message is a warning the mq2 devs put into MQ2. It means you are trying to do something while advloot is still active and you should wait until its done.

LootInProgress

- I think I got Advloot under control now, go for it, test it as hard as u can.
- Added a new Member .LootInProgress to the AdvLoot TLO
use it or face imminent doom!
Usage Example:
Rich (BB code):
  /if (!${AdvLoot.LootInProgress}) {
		/echo its safe to loot
		if (${AdvLoot.SCount}>=1) {
			/echo im going to give 1 ${AdvLoot.SList[1].Name} to myself
			/advloot shared 1 giveto ${Me.Name} 1
		}
  } else {
		/echo do something else, loot is in progress...
  }
 
I found that info in the change.txt, problem is can't seem to find the right way to code it in the macro. Still working on it. I have the ninjadvloot macro passing out lore items to each group member if the lore item is Keep in the ini file. The error only seems to occur if I give an item to someone in the group.

still working on how to only keep a limited number of items and pass the rest out group members until everyone has the desired amount. I will post the final updates when I get it all working.

Adding progress so far with changes in red:

Rich (BB code):
| Ninjadvloot.inc v5.3 08/16/2015 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
| Updated: Crystane with Looting while on mount (no overshooting on corpserun), added some conditional checks to skip unecessary delay I found. Announcement routine reworked. 05/13/2014
| Updated: TreeHuginDruid hard coded 1 second delay between loot and corpse item retrieval to resolve loot latency issue.
| Updated: Maskoi added suppot for Advanced Looting system  05/18/2015
|
| 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
|
| Assign differnent ini files. Default is Loot.ini
|   /call SetupAdvLootVars "MyToonLoot.ini"
|   /call SetupAdvLootVars "LootMesa.ini"
|
| Commands
| Usage. Grab the item and put it on your cursor then use one of the following commands
|     /lootdestroy - Mark item on cursor to Destroy in Loot.ini file
|     /lootignore - Mark item on cursor to Ignore in Loot.ini file
|     /lootkeep - Mark item on cursor to Keep in Loot.ini file
|     /lootsell - Mark item on cursor to Sell in Loot.ini file
|     /sellstuff - Target a vendor and this command will sell any item in your inventory marked sell. 
|     /depositstuff - Target your guildbanker and this command will deposit any item in your inventory marked keep into the guild bank.

#Event CantLoot         "#*#may not loot this corpse#*#"
#Event Sell             "#*#You receive#*# for the #1#(s)#*#"
#Event EditIniItem      "[MQ2] LootIniItem #1# #2#"
#Event SellStuff        "[MQ2] NinjadvLoot selling items to vendor"
#Event Broke            "#*#you cannot afford#*#" 
#Event Broke            "#*#you can't afford#*#" 
#Event Forage           "Your forage mastery has enabled you to find something else!"
#Event Forage           "You have scrounged up #*#"
#Event InventoryFull    "#*#Your inventory appears full!#*#"
#Event Novalue          "#*#give you absolutely nothing for the #1#.#*#"
#Event NullSlot         "#*#Invalid item slot 'null#*#"
#Event Lore             "#*#You cannot loot this Lore Item.#*#"

Sub SetupAdvLootVars(string ChangeIniFile)

    /declare CantLootID                         int                 outer 
    /declare NinjadVersion                      string              outer   5.2
    /declare InventoryFull                      int                 outer   0
    /declare NinjaIniFile                       string              outer   Loot.ini
    /declare MasterCorpseList                   string              outer   
    /declare Debugloot                          int                 outer   0
    /declare GlobalCount                        int                 outer   5
    /declare GlobalList[${GlobalCount}]         string              outer  
    /varset GlobalList[1]                       string              outer  empty   
    /declare AutoHater                          int                 outer
    /if (${ChangeIniFile.Length}) {
        /varset NinjaIniFile ${ChangeIniFile}
        /echo Ninja Advance Loot in now writing all info to the ${ChangeIniFile} file.
    }
    /declare NALVersion                           string             outer   ${Ini[${NinjaIniFile},Settings,Version]}
    /if (!${Ini[${NinjaIniFile},Settings,Version].Length}) {
        /call CreateIni
        /ini "${NinjaIniFile}" "Settings" "Version" "0.0"
    }
    /if (${NALVersion.NotEqual[${NinjadVersion}]}) {
        /echo NINJADVLOOT: Version mismatch detected. Writing aliases.
        /noparse /squelch /alias /lootignore    /echo LootIniItem Ignore ${Cursor.Name}
        /noparse /squelch /alias /lootsell      /echo LootIniItem Sell ${Cursor.Name}
        /noparse /squelch /alias /lootkeep      /echo LootIniItem Keep ${Cursor.Name}
        /noparse /squelch /alias /lootdestroy   /echo LootIniItem Destroy ${Cursor.Name}
        /squelch /alias /sellstuff              /echo NinjadvLoot selling items to vendor
        /squelch /alias /depositstuff           /echo NinjadvLoot depositing items to guildbank
        /ini "${NinjaIniFile}" "Settings" "Version" "${NinjadVersion}"
    }

    | Loot ini settings
    /call NALLoadVar Settings AddNewSales        1                   int
    /call NALLoadVar Settings LootForage         1                   int
    /call NALLoadVar Settings LootMobs           TRUE                bool
    /call NALLoadVar Settings CorpseRadius       100                 int
    /call NALLoadVar Settings MobsTooClose       40                  int
    /call NALLoadVar Settings ReportLoot         FALSE               bool
    /call NALLoadVar Settings LootChannel        g                   string
    /call NALLoadVar Settings LootForageSpam     1                   int
    /call NALLoadVar Settings GlobalLootOn       1                   int
    /call NALLoadVar Settings LootForageSpam     1                   int
    /call NALLoadVar Settings CombatLooting      0                   int
    /call FindAutoHate
    /echo NINJADVLOOT: Variables are set.

/return

Sub NALLoadVar(IniSection,IniVar,IniValue,VarType)
    /if (!${Defined[${IniVar}]} && ${Defined[VarType]}) /declare ${IniVar} ${VarType} outer
    /declare IniString string local ${Ini[${NinjaIniFile},${IniSection},${IniVar},NOTFOUND]}
    /varset ${IniVar} ${IniString}
    /if (${IniString.Equal["NOTFOUND"]}) {
        /if (${IniString.Equal["NOTFOUND"]}) /varset ${IniVar} ${IniValue}
        /ini "${NinjaIniFile}" "${IniSection}" "${IniVar}" "${${IniVar}}"
    } 
/return

Sub FindAutoHate
    /declare i int local
    /for i 1 to 10
        /if (${Me.XTarget[${i}].TargetType.Equal[Auto Hater]}) {
            /varset AutoHater ${i}
            /echo NINJADVLOOT: AutoHater set to Xtarget${i}
            /return
        }
    /next i
/return

| ****************  Loot Mobs Section ******************** |

Sub LootMobs
    /declare DeadCount int local ${SpawnCount[corpse radius ${CorpseRadius} zradius 50]}
    /if (${Debugloot}) /echo DEBUGLOOT There are ${DeadCount} corpses in range.
    /if (${Debugloot}) /echo DEBUGLOOT !${LootMobs} || ${SpawnCount[npc radius ${MobsTooClose} zradius 50]} || !${DeadCount} || ${Me.Combat} || !${Me.FreeInventory} || ${Me.XTarget[${AutoHater}].ID} && !${CombatLooting})
    /if (!${LootMobs} || ${SpawnCount[npc radius ${MobsTooClose} zradius 50]} || !${DeadCount} || ${Me.Combat} || !${Me.FreeInventory} || ${Me.XTarget[${AutoHater}].ID} && !${CombatLooting}) /return
    /declare i int local
    /declare CorpseList string local 
    /declare CorpseToLoot int local
    /declare ZDist float local ${Math.Distance[${Target.Z}:${Me.Z}]}
    /declare ClosestCorpse int local
    /declare CorpseCount int local 0
    /for i 1 to ${DeadCount}
        /varset ClosestCorpse ${NearestSpawn[${i},corpse radius ${CorpseRadius} zradius 50].ID}
        /if (!${Spawn[${ClosestCorpse}].Deity.ID}) {
            /varset CorpseList ${CorpseList}${ClosestCorpse}|
            /if (!${MasterCorpseList.Find[${ClosestCorpse}]}) /varset MasterCorpseList ${MasterCorpseList}${ClosestCorpse}|
            /varcalc CorpseCount ${CorpseCount}+1
        }
    /next i
    /if (${Debugloot}) /echo DEBUGLOOT Trying to loot ${CorpseCount} corpses. ID's ${CorpseList}
    /for i 1 to ${CorpseCount} 
    /varset CorpseToLoot ${CorpseList.Arg[${i},|]}
    /if (!${Defined[CorpseLocked${CorpseToLoot}]}) /declare CorpseLocked${CorpseToLoot} timer outer 0
        /if (${Spawn[${CorpseToLoot}].Deity.ID} || !${Spawn[${CorpseToLoot}].ID} || !${Spawn[${CorpseToLoot}].LineOfSight} || ${CorpseLocked${CorpseToLoot}} || ${Me.XTarget[${AutoHater}].ID} && !${CombatLooting}) /goto :SkipCorpse
            /if (${Target.ID}!=${CorpseToLoot}) /target id ${CorpseToLoot}
            /if (!${Me.Standing}) /stand
            /delay 3s ${Target.ID}==${CorpseToLoot} && ${Me.Standing}
            /if (${Target.Distance}>5) {
                /if (${Debugloot}) /echo DEBUGLOOT move to corpse
                /moveto mdist 10
                /moveto loc ${Target.Y} ${Target.X} ${Target.Z} 
        /if (${Me.Mount.ID}) {
            /delay 3s ${Math.Distance[${Target.Y},${Target.X}]}<25
            /keypress back
        }
                /delay 3s ${MoveTo.Stopped} && !${Me.Moving}
                /call ZCheck ${ZDist} 8
                /if (${Target.ID}) /face fast
            }
            /if (${Target.Distance}<12) {
                /if (${Debugloot}) /echo DEBUGLOOT /Call LootCorpse
                /call LootCorpse ${Target.ID}
                /call RemoveCorpseID ${CorpseToLoot}
            }
        :SkipCorpse
    /next i
    /if (${Debugloot}) /echo DEBUGLOOT Leave Sub LootMobs 
/return

Sub LootCorpse(CorpseID)
    /if (${Debugloot}) /echo DEBUGLOOT Enter Sub LootCorpse
    /declare i              int    local
    /declare j              int    local
    /declare LootList       string local
    /declare FirstLetter    string local
    /declare GCheck            string local
    /call CheckCursor
    /varset CantLootID 0
    /if (${Debugloot}) /echo DEBUGLOOT /loot
    | Open Loot window
    /loot
    /if (${Debugloot}) /echo DEBUGLOOT /doevents CantLoot
    /delay 3s ${Window[LootWnd]}
    /delay 1s
    /doevents CantLoot
    /delay 3s ${CantLootID} || ${Window[LootWnd]}
    /if (${Target.ID}==${CantLootID} && !${Window[LootWnd]}) {
        /echo NINJADVLOOT: I can't loot ${Target.CleanName} ID:${CorpseID} right now.
        /if (${Defined[CorpseLocked${CorpseID}]}) /varset CorpseLocked${CorpseID} 150s
        /return
    }
    /if (${Debugloot}) /echo DEBUGLOOT Loot Window Open:${Window[LootWnd]} - # Loot Items:${Corpse.Items}
    /if (${Window[LootWnd].Open} && ${Corpse.Items}) {
        /declare loottotal int  local
        :LootLag
        /varset loottotal ${Corpse.Items}
             /if (${Debugloot}) /echo DEBUGLOOT :LootLag ${loottotal}!=${Corpse.Items} LagCount${LagCount}
        /delay 1s ${loottotal}!=${Corpse.Items}
        /if (${loottotal}!=${Corpse.Items}) /goto :LootLag
        /echo NINJADVLOOT: Looting ${Target.CleanName} ID:${CorpseID}.
        /for i 1 to ${loottotal}
            /if (${Corpse.Item[${i}].Lore} && ${FindItem[=${Corpse.Item[${i}]}].ID}) {
                /varset LootList ${LootList}${Corpse.Item[${i}]},
                /goto :LootedInGlobal
            }
            /if (${Debugloot}) /echo DEBUGLOOT Looting ${Corpse.Item[${i}].Name} ${i} of ${loottotal} 
            | Global loot section
            /if (${GlobalLootOn}) {
                /for j 1 to ${GlobalCount}
                    /varset GCheck ${Ini[${NinjaIniFile},"Global","Global${j}"]}
                    | /echo ${GCheck.Arg[1,|]} ${GCheck.Arg[2,|]}
                    /if (${Corpse.Item[${i}].Name.Find[${GCheck.Arg[1,|]}]}) {
                        /if (${Select[${GCheck.Arg[2,|]},sell,keep]} && (!${Corpse.Item[${i}].Lore} || !${FindItem[=${Corpse.Item[${i}]}].ID}) && (${Me.FreeInventory} || (${FindItemCount[=${Corpse.Item[${i}].Name}]} && ${Corpse.Item[${i}].Stackable} && ${Corpse.Item[${i}].FreeStack}))) /call LootItem ${i} Keep Right
                        /if (${GCheck.Arg[2,|].Equal[Ignore]}) /varset LootList ${LootList}${Corpse.Item[${i}]},
                        /if (${GCheck.Arg[2,|].Equal[Destroy]}) /call LootItem ${i} Destroy left
                        /goto :LootedInGlobal
                    }
                /next j
            }
            /varset FirstLetter ${Corpse.Item[${i}].Name.Left[1]}
            /if (${Corpse.Item[${i}].ID} && !${Select[${Ini[${NinjaIniFile},"${FirstLetter}","${Corpse.Item[${i}]}"]},Ignore,Keep,Destroy,Sell]}) {
                /if (${Corpse.Item[${i}].NoDrop})  /ini "${NinjaIniFile}" "${FirstLetter}" "${Corpse.Item[${i}]}" Ignore
                /if (!${Corpse.Item[${i}].NoDrop}) /ini "${NinjaIniFile}" "${FirstLetter}" "${Corpse.Item[${i}]}" Keep
            }  
            /if (${Ini[${NinjaIniFile},"${FirstLetter}","${Corpse.Item[${i}]}"].NotEqual[Destroy]} && !${Me.FreeInventory} && (!${FindItemCount[=${Corpse.Item[${i}].Name}]} || (${FindItemCount[=${Corpse.Item[${i}].Name}]} && ${Corpse.Item[${i}].Stackable} && !${Corpse.Item[${i}].FreeStack})) || (${Corpse.Item[${i}].Lore} && ${FindItem[=${Corpse.Item[${i}]}].ID}) || ${Ini[${NinjaIniFile},"${FirstLetter}","${Corpse.Item[${i}]}"].Equal[Ignore]}) /varset LootList ${LootList}${Corpse.Item[${i}]},
            /if ((${Ini[${NinjaIniFile},"${FirstLetter}","${Corpse.Item[${i}]}"].Equal[Keep]} || ${Ini[${NinjaIniFile},"${FirstLetter}","${Corpse.Item[${i}]}"].Equal[Sell]}) && (!${Corpse.Item[${i}].Lore} || !${FindItem[=${Corpse.Item[${i}]}].ID}) && (${Me.FreeInventory} || (${FindItemCount[=${Corpse.Item[${i}].Name}]} && ${Corpse.Item[${i}].Stackable} && ${Corpse.Item[${i}].FreeStack}))) /call LootItem ${i} Keep Right
            /if (${Ini[${NinjaIniFile},"${FirstLetter}","${Corpse.Item[${i}]}"].Equal[Destroy]}) /call LootItem ${i} Destroy left
            :LootedInGlobal
        /next i
        /if (${Corpse.Items}) {
            /if (${ReportLoot} && ${LootList.Length}) {
                /keypress /
                /delay 3
                /call Type "${LootChannel}"
                /keypress Space chat
                /notify LootWND LW_BroadcastButton leftmouseup 
                /delay 3
                /call Type " ,left on corpse."
                /keypress Enter chat
                /if (${Defined[CorpseLocked${CorpseID}]}) /varset CorpseLocked${CorpseID} 440s
            }
        }
    }
    :clickdoneffs
        /nomodkey /notify LootWnd LW_DoneButton leftmouseup
        /if (${Debugloot}) /echo DEBUGLOOT :clickdoneffs 
        /delay 5s !${Window[LootWnd].Open}
        /if (${Debugloot}) /echo DEBUGLOOT :clickdoneffs LootWin Open:${Window[LootWnd]}
    /if (${Window[LootWnd].Open}) /goto :clickdoneffs
    /call RemoveCorpseID ${CorpseID}
    /if (${Debugloot}) /echo DEBUGLOOT Leave Sub LootCorpse
/return

Sub Event_CantLoot
   /if (${Debugloot}) /echo DEBUGLOOT Enter Sub Event_CantLoot
   /varset CantLootID ${Target.ID}
   /if (${Debugloot}) /echo DEBUGLOOT  Event_CantLoot Can't loot ${Target.CleanName} ${Target.ID}
   /if (${Debugloot}) /echo DEBUGLOOT Leave Sub Event_CantLoot
/return

Sub RemoveCorpseID(CListID)
    /if (${Defined[CorpseLocked${CListID}]}) {
        /if (!${CorpseLocked${CListID}} && ${MasterCorpseList.Find[${CListID}]}) {
            /deletevar CorpseLocked${CListID}
            /varset MasterCorpseList ${MasterCorpseList.Replace[${CListID}|,]}
        }
    }
/return

Sub LootItem(int i,DoWhat,WhichButton)
    /if (${Debugloot}) /echo DEBUGLOOT Enter Sub LootItem ${i} ${DoWhat} ${WhichButton}
    /declare CorpseItemID int local ${Corpse.Item[${i}].ID}
    /nomodkey /shift /itemnotify ${Corpse.Item[${i}].InvSlot} ${WhichButton}mouseup
    /delay 5s ${Window[ConfirmationDialogBox].Open} || !${Corpse.Item[${i}].NoDrop}
    /if (${Window[ConfirmationDialogBox].Open}) /nomodkey /notify ConfirmationDialogBox Yes_Button leftmouseup
    /delay 5s ${Cursor.ID} || ${WhichButton.NotEqual
} /if (${DoWhat.Equal[Destroy]} && ${Cursor.ID}==${CorpseItemID}) /destroy /delay 5s !${Corpse.Item[${i}].ID} /if (${Cursor.ID}) /call CheckCursor /if (${Debugloot}) /echo DEBUGLOOT Leave Sub LootItem /return Sub CheckCursor /if (${Debugloot}) /echo DEBUGLOOT Enter Sub CheckCursor :ALauto_inv /if (${Cursor.ID}) { /if (${Cursor.NoDrop} && !${Me.FreeInventory}) /return /timed 5 /autoinventory /delay 2s !${Cursor.ID} /goto :ALauto_inv } /if (${Debugloot}) /echo DEBUGLOOT Leave Sub CheckCursor /return | **************** Foraged Items Section ******************** | Sub Event_Forage /if (!${LootForage}) /return /declare ForagedItem string local :MoreToAutoInventory /if (${Cursor.ID}) { /varset ForagedItem ${Cursor.Name} /if (!${Select[${Ini[${NinjaIniFile},"${Cursor.Name.Left[1]}","${Cursor.Name}"]},Ignore,Keep,Destroy,Sell]}) { /if (${Cursor.ID}) /ini "${NinjaIniFile}" "${Cursor.Name.Left[1]}" "${Cursor.Name}" Keep /if (${LootForageSpam}) /echo New foraged item >> ${Cursor.Name} << added to ini file. } /if (${Ini[${NinjaIniFile},"${Cursor.Name.Left[1]}","${Cursor.Name}"].Equal[Destroy]} || ${Ini[${NinjaIniFile},"${Cursor.Name.Left[1]}","${Cursor.Name}"].Equal[Ignore]}) { /if (${Cursor.Name.Equal[${ForagedItem}]}) /destroy /delay 5 !${Cursor.ID} /if (${LootForageSpam}) /echo NINJADVLOOT -- Destroyed foraged ${ForagedItem}. } else /if ((${Ini[${NinjaIniFile},"${Cursor.Name.Left[1]}","${Cursor.Name}"].Equal[Keep]} || ${Ini[${NinjaIniFile},"${Cursor.Name.Left[1]}","${Cursor.Name}"].Equal[Sell]}) && (!${Cursor.Lore} || !${FindItem[=${Cursor.Name}].ID}) && (${Me.FreeInventory} || (${FindItemCount[=${Cursor.Name}]} && ${Cursor.Stackable} && ${Cursor.FreeStack}))) { /if (${LootForageSpam}) /echo NINJADVLOOT ++ Kept foraged ${ForagedItem}. /autoinventory /delay 5 !${Cursor.ID} } } /if (${Cursor.ID}) /goto :MoreToAutoInventory /return | **************** Search Loot Section ******************** | Sub DoLootStuff(LootAction) /declare i int local /declare j int local /declare k int local /declare LootItem string /call NPC "${Target.CleanName}" | Top level inv has its own loop since ${FindItem[=${ItemToSell}].InvSlot} looks at top lev inv slots first in Sub SellToVendor for the item to sell. | Loop through top level inventory slots for sellable items /for k 1 to 10 | Check if top level inv slot is not a container/bag /if (${InvSlot[pack${k}].Item.Container}==0) { | If top level inv slot is empty check for an item marked sell /if (${InvSlot[pack${k}].Item.ID}) { /varset LootItem ${InvSlot[pack${k}].Item} /if (${LootAction.Equal[sell]}) { /if (${Ini[${NinjaIniFile},"${LootItem.Left[1]}","${LootItem}"].Equal[Sell]}) /call SellToVendor "${LootItem}" } /if (${LootAction.Equal[deposit]}) { /if (${Ini[${NinjaIniFile},"${LootItem.Left[1]}","${LootItem}"].Equal[Keep]}) /call DepositToGuildBank "${LootItem}" } } } /next k | Loop through top level inventory slots for containers /for i 1 to 10 | Check if top level inv slot has a bag /if (${InvSlot[pack${i}].Item.Container}==0) /next i | Set j 1 to number of bag slots and loop through slots looking for items marked sell /for j 1 to ${InvSlot[pack${i}].Item.Container} /if (${InvSlot[pack${i}].Item.Item[${j}].ID}) { /varset LootItem ${InvSlot[pack${i}].Item.Item[${j}].Name} /if (${LootAction.Equal[sell]}) { /if (${Ini[${NinjaIniFile},"${LootItem.Left[1]}","${LootItem}"].Equal[Sell]}) /call SellToVendor "${LootItem}" } /if (${LootAction.Equal[deposit]}) { /if (${Ini[${NinjaIniFile},"${LootItem.Left[1]}","${LootItem}"].Equal[Keep]}) /call DepositToGuildBank "${LootItem}" } } /next j /next i | Prevent spam from Sell event after selling items in Sub SellStuff /doevents flush Sell /if (${Window[MerchantWnd].Open}) { /echo Closing merchant window /nomodkey /notify MerchantWnd MW_Done_Button LeftMouseUp } /if (${Window[GuildBankWnd].Open}) { /echo Closing guildbank window /keypress esc } /return Sub NPC(string NPCName) /if (${NPCName.Equal[null]} && ${Target.Type.Equal[npc]}) /varset NPCName ${Target.CleanName} /target npc ${NPCName} /delay 10 /if (!${Select[${Target.Type},npc,pet]} || !${Target.ID} || ${Target.Type.Equal[pet]} && !${Target.CleanName.Find[familiar]}) { /echo Please target a vendor or guildbanker /return } /delay 1s /echo Doing business with ${NPCName} /target id ${Spawn[${NPCName}].ID} /delay 3s ${Target.ID}==${Spawn[${NPCName}].ID} /if (${Target.Distance}>15) { /moveto id ${Spawn[${NPCName}].ID} /delay 250 ${MoveTo.Stopped} } /face nolook /delay 1s /echo Opening merchant/guildbank window /nomodkey /click right target /echo Waiting 5s for merchant/guildbank window to populate /delay 5s /return | **************** Sell Loot Section ******************** | Sub Event_Sell(string soldstr, string ItemName) /if (${Ini[${NinjaIniFile},"${ItemName.Left[1]}","${ItemName}"].Equal[Sell]}) /return /if ( ${AddNewSales} ) { /echo Setting ${ItemName} to sell /ini "${NinjaIniFile}" "${ItemName.Left[1]}" "${ItemName}" Sell } /return Sub SellToVendor(ItemToSell) /if (${Window[MerchantWnd].Open}) { :sell /echo Selling ${ItemToSell} /if (${InvSlot[pack${Select[${FindItem[=${ItemToSell}].ItemSlot},23,24,25,26,27,28,29,30,31,32]}].Item.Container}) { /nomodkey /itemnotify in Pack${Math.Calc[${FindItem[=${ItemToSell}].ItemSlot}-22]} ${Math.Calc[${FindItem[=${ItemToSell}].ItemSlot2}+1]} leftmouseup } else { /nomodkey /itemnotify ${FindItem[=${ItemToSell}].InvSlot} leftmouseup } /delay 5 /nomodkey /shiftkey /notify merchantwnd MW_Sell_Button leftmouseup /doevents /if (${Macro.Return.Equal[TRUE]}) /return /delay 2s /if (${FindItemCount[=${ItemToSell}]}) /goto :sell } /return | **************** Deposit Loot Section ******************** Sub DepositToGuildBank(ItemToDeposit) /if (${Window[GuildBankWnd].Open}) { :deposit /if (${Window[GuildBankWnd].Child[GBANK_DepositCountLabel].Text.Arg[2,:]}==0) { /echo Guildbank Deposited Items is full. /return } /if (${FindItem[=${ItemToDeposit}].InvSlot}<=22) /return /echo Depositing ${ItemToDeposit} /if (!${InvSlot[pack${Float[${Math.Calc[${Select[${FindItem[=${ItemToDeposit}].ItemSlot},22,23,24,25,26,27,28,29,30,31,32]}-1]}].Int}].Item.Container}) { /nomodkey /shift /itemnotify ${FindItem[=${ItemToDeposit}].InvSlot} leftmouseup } else { /nomodkey /shift /itemnotify in Pack${Math.Calc[${FindItem[=${ItemToDeposit}].ItemSlot}-22]} ${Math.Calc[${FindItem[=${ItemToDeposit}].ItemSlot2}+1]} leftmouseup } /delay 5 /nomodkey /notify GuildBankWnd GBANK_DepositButton leftmouseup /delay 2s /if (${FindItem[=${ItemToDeposit}].InvSlot}) /goto :deposit } /return | **************** Item set ini file event ******************** Sub Event_EditIniItem(ItemString,ItemAction,ItemName) /if (${Cursor.ID}) { /echo -- Setting ${ItemName} to ${ItemAction} /ini "${NinjaIniFile}" ${ItemName.Left[1]} "${ItemName}" ${ItemAction} } else { /echo No item on cursor. } /return | **************** Sell Stuff Event ******************** Sub Event_SellStuff /call DoLootStuff sell /return | **************** Deposit Stuff Event ******************* Sub Event_DepositStuff /call DoLootStuff deposit /return | **************** Broke Event ******************** Sub Event_Broke /if (!${Window[MerchantWnd].Open}) /return /echo You are out of money! /endmacro /return | **************** Type Stuff ******************** | Lifted from commonsubs.inc by Armysoldier Sub Type(InStr) /declare char string local /declare loopctr int local /for loopctr 1 to ${InStr.Length} /varset char ${InStr.Mid[${loopctr},1]} /if (!${char.Length}) { /nomodkey /keypress space chat } else { /nomodkey /keypress ${char} chat } /next loopctr /return | **************** Buy Stuff ******************** Sub Buy(string ItemToBuy, int amount) /if (!${Select[${Target.Type},npc,pet]} || !${Target.ID} || ${Target.Type.Equal[pet]} && !${Target.CleanName.Find[familiar]}) /return /declare i int local | /echo Buying ${ItemToBuy}! /declare QTY int local /declare ListItem int local /varcalc QTY ${amount}-${FindItemCount[${ItemToBuy}]} /delay 3 /if (${FindItemCount[${ItemToBuy}]}>=${amount}) { /echo I already have ${FindItemCount[${ItemToBuy}]} ${ItemToBuy}. /return } /varset ListItem ${Window[MerchantWnd].Child[ItemList].List[=${ItemToBuy},2]} /if (!${ListItem}) { /echo couldn't find ${ItemToBuy} /return } else { /notify MerchantWnd ItemList listselect ${ListItem} /delay 5 } i /echo Buying ${ItemToBuy} Till I get ${amount} :Loop /doevents /if (${InventoryFull}) /return /if (${QTY}>0) { /if (${QTY}>19) { /Shiftkey /notify merchantwnd MW_Buy_Button leftmouseup /delay 5 ${FindItemCount[B${ItemToBuy}]}>=${QTY} /echo ${FindItemCount[${ItemToBuy}]}/${amount} ${ItemToBuy} in inventory /varcalc QTY ${amount}-${FindItemCount[${ItemToBuy}]} /if (${QTY}<=0) { /if (${Window[MerchantWnd].Open}) { /echo Closing merchant window /nomodkey /notify MerchantWnd MW_Done_Button LeftMouseUp } /return } /delay 5 /if (${QTY}>19) /goto :Loop } /if (${QTY}>0 && ${QTY}<20) { /for i 1 to ${QTY} /Ctrlkey /notify merchantwnd MW_Buy_Button leftmouseup /delay 1s ${FindItemCount[${ItemToBuy}]}>=${Math.Calc[${FindItemCount[${ItemToBuy}]}+${i}]} /echo Buying ${ItemToBuy} ${i} of ${QTY} /if (${i}>=${QTY}) { /echo ${FindItemCount[${ItemToBuy}]} ${ItemToBuy} in inventory /if (${Window[MerchantWnd].Open}) { /echo Closing merchant window /nomodkey /notify MerchantWnd MW_Done_Button LeftMouseUp } /return } /next i /varcalc QTY ${amount}-${FindItemCount[${ItemToBuy}]} } } /return Sub ZCheck(float Zcur, float Zdiff) | Move down if Z distance more than Zcheck due to levitation /if (${Zcur}>=${Zdiff}) { /keypress end hold /delay 10 /keypress end } /return Sub Event_InventoryFull /echo Your Inventory is full. Turning off looting functions. /varset LootMobs FALSE /varset InventoryFull 1 /return Sub CreateIni /if (${Ini[${NinjaIniFile}].Length}) /return /declare a local Settings|Global|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z /echo Creating ini file ${NinjaIniFile} /declare i int local /declare j int local /for i 1 to 27 /ini ${NinjaIniFile} "${a.Arg[${i},|]}" "|===================================" "==================================|" /if (${i}==2) { /for j 1 to ${GlobalCount} /ini ${NinjaIniFile} "Global" "Global${j}" "Item Name|Ignore/Destroy/Keep/Sell" /next j } /next i /return Sub Event_Novalue(string nvmstring, string nvItem) /declare NVSection ${nvItem.Left[1]} /declare NVTemp string local ${Ini[${NinjaIniFile},${NVSection},${nvItem}]} /if (${NVTemp.Equal[Sell]}) { /ini "${NinjaIniFile}" "${NVSection}" "${nvItem}" KEEP /delay 5 /echo NINJADVLOOT: ${nvItem} is marked SELL but has no value. marking KEEP } /return TRUE Sub Event_NullSlot /echo NINJADVLOOT: Opening all bags to correct null slot /keypress OPEN_INV_BAGS /timed 30 /keypress CLOSE_INV_BAGS /return | **************** AdvLoot Stuff ******************** Sub UseAdvLoot /if (!${Me.FreeInventory}) /return /if (${Debugloot}) /echo Enter UseAdvLoot /if (${Me.UseAdvancedLooting}) { /if (${Debugloot}) /echo Start Loot Check /delay 30 ${Window[AdvancedLootWnd].Open} /declare g int local /declare i int local /declare j int local /declare k int local /declare ItemsToProcess string local /declare ITSCount int local 0 /declare ITPCount int local 0 /declare ITPName string local /declare ITPList string local /declare IniEntry string local /declare KeepAmount int local :FinishLooting | Check Shared loot for Keep,Destroy,Sell and que for Personal List if found /if (${AdvLoot.SList[1].ID} && !${Group.MasterLooter.ID}) /echo NINJADVLOOT: Please Assign a player the Master Looter Role in the group window. /if (${Group.MasterLooter.ID}==${Me.ID}) { /varset ITSCount ${AdvLoot.SCount} /for i ${ITSCount} downto 1 /varset ITPName ${AdvLoot.SList[${i}].Name} /if (${AdvLoot.SList[${i}].ID} && !${Select[${Ini[${NinjaIniFile},"${ITPName.Left[1]}","${ITPName}"]},Ignore,Keep,Destroy,Sell]}) { | Add item to ini if it not in there /if (${AdvLoot.SList[${i}].NoDrop}) { /ini "${NinjaIniFile}" "${ITPName.Left[1]}" "${ITPName}" Ignore /echo NINJADVLOOT: Adding ${ITPName}=Ignore to ini file. } else { /ini "${NinjaIniFile}" "${ITPName.Left[1]}" "${ITPName}" Keep /echo NINJADVLOOT: Adding ${ITPName}=Keep to ini file. } } /if (${Select[${Ini[${NinjaIniFile},"${ITPName.Left[1]}","${ITPName}"]},Ignore]}) { /if (${Debugloot}) /echo SharedList: ${ITPName} is set to Ignore. Leaving item. /advloot shared ${i} leave /delay 5 /goto :NextItem } | skip item if its lore and I have one /if (${FindItem[${ITPName}].Lore}) { /if (${Debugloot}) /echo SharedList: ${ITPName} is Lore and I have one. Giving to ${Group.Member[${g}].Name} /for g 1 to ${Group.Members} /if (!${AdvLoot.LootInProgress}) /advloot shared ${i} giveto ${Group.Member[${g}].Name} /echo SharedList: ${ITPName} is Lore and I have one. Giving item to ${Group.Member[${g}].Name} /delay 10 /if (!${AdvLoot.SList[${i}].ID}) { /goto :NextItem } else /next g /if (${Debugloot}) /echo SharedList: ${ITPName} is Lore and everyone has one. Skipping item. /echo SharedList: ${ITPName} is Lore and everyone has one. Skipping item. /advloot shared ${i} leave /goto :NextItem } | handling quest items /if (${AdvLoot.SList[${i}].ID}) { /varset IniEntry ${Ini[${NinjaIniFile},"${ITPName.Left[1]}","${ITPName}"]} /if (${Debugloot}) /echo SharedList: ${i} ${ITPName}=${IniEntry} /if (${IniEntry.Arg[1,|].Equal[Quest]}) { /varset KeepAmount ${IniEntry.Arg[2,|]} /if (${FindItemCount[=ITPName]} < ${KeepAmount}) { /advloot shared ${i} giveto ${Me.Name} /delay 10 } else { /gsay ${Me.Name} has all the quest item ${ITPName}, select who should get it now. } /goto :NextItem } /if (${AdvLoot.SList[${i}].ID}) { /varset IniEntry ${Ini[${NinjaIniFile},"${ITPName.Left[1]}","${ITPName}"]} /if (${Debugloot}) /echo SharedList: ${i} ${ITPName}=${IniEntry} /if (${Select[${IniEntry},Keep,Destroy,Sell]}) { /advloot shared ${i} giveto ${Me.Name} /delay 10 /if (${Debugloot}) /echo SharedList: ${i} ${ITPName} giveto ${Me.Name} } } :NextItem /next i } | Loot/destroy anything in personal list /if (${AdvLoot.PCount}) { /varset ITPCount ${AdvLoot.PCount} /for k ${ITPCount} downto 1 /varset ITPName ${AdvLoot.PList[${k}].Name} /varset IniEntry ${Ini[${NinjaIniFile},"${ITPName.Left[1]}","${ITPName}"]} | Add item to ini if it not in there /if (${AdvLoot.PList[${k}].ID} && !${Select[${Ini[${NinjaIniFile},"${ITPName.Left[1]}","${ITPName}"]},Ignore,Keep,Destroy,Sell]}) { /if (${AdvLoot.PList[${k}].NoDrop}) { /ini "${NinjaIniFile}" "${ITPName.Left[1]}" "${ITPName}" Ignore /echo NINJADVLOOT: Adding ${ITPName}=Ignore to ini file. /goto :NextPItem } else { /ini "${NinjaIniFile}" "${ITPName.Left[1]}" "${ITPName}" Keep /echo NINJADVLOOT: Adding ${ITPName}=Keep to ini file. } } | skip item if its lore and i have one /if (${FindItem[${ITPName}].Lore}) { /if (${Debugloot}) /echo PList: ${ITPName} is Lore and I have one. Skipping item. /advloot personal ${k} leave /goto :NextPItem } /if (${Select[${Ini[${NinjaIniFile},"${ITPName.Left[1]}","${ITPName}"]},Ignore]}) { /if (${Debugloot}) /echo PList: ${ITPName} is Lore and I have one. Skipping item. /advloot personal ${k} leave /delay 5 /goto :NextPItem } /if (${Select[${Ini[${NinjaIniFile},"${ITPName.Left[1]}","${ITPName}"]},Keep,Destroy,Sell]}) { /if (${Debugloot}) /echo PList: ${k} ${ITPName}=${IniEntry} /advloot personal ${k} loot /delay 10 /if (${Window[ConfirmationDialogBox].Open}) { /nomodkey /notify ConfirmationDialogBox Yes_Button leftmouseup /delay 10 } /if (${Select[${IniEntry},Destroy]}) { /call HandleItem "${ITPName}" Destroy } } :NextPItem /next k } } /if (${AdvLoot.SCount} || ${AdvLoot.PCount}) /goto :FinishLooting /if (${Debugloot}) /echo Leave UseAdvLoot /return Sub HandleItem(ItemName, DoWhat) /if (${Debugloot}) /echo DEBUGLOOT Enter Sub HandleItem ${ItemName} ${DoWhat} /declare HandleTimer timer local 5s /if (${DoWhat.Equal[Destroy]} && ${FindItem[=${ItemName}].ID}) { :GetItem /nomodkey /shift /itemnotify in Pack${Math.Calc[${FindItem[=${ItemName}].ItemSlot}-22]} ${Math.Calc[${FindItem[=${ItemName}].ItemSlot2}+1]} leftmouseup /delay 1s ${Cursor.ID} /if (!${Cursor.ID} && ${HandleTimer}) /goto :GetItem /if (${Cursor.ID}==${FindItem[=${ItemName}].ID}) { /echo NINJADVLOOT: Destroying ${Cursor.Name} /destroy /delay 5 /if (${Window[ConfirmationDialogBox].Open}) { /delay 10 /nomodkey /notify ConfirmationDialogBox Yes_Button leftmouseup } /delay 1s !${Cursor.ID} } } /if (${Debugloot}) /echo DEBUGLOOT Leave Sub HandleItem /return Sub CheckGlobalList(GItemName,int GListNum, LootSystem) /declare i int local /declare j int local /declare GItem string local | Create global list from ini file /if (${GlobalLootOn} && ${GlobalList[1].Equal[empty]}) { /for i 1 to ${${GlobalCount}} /varset GItem ${Ini[${NinjaIniFile},"Global","Global${i}"]} /if (!${GItem.Find[item name]} && !${GItem}) { /varset GlobalList[${i}] ${GItem} } /next i } | Check if item is in global list /echo ${GCheck.Arg[1,|]} ${GCheck.Arg[2,|]} /for j 1 to ${${GlobalCount}} /if (${GlobalList[${i}].Arg[1,|].Find[${GItemName}]}) { /if (${LootSystem.Equal[SList}}) { /if (${GlobalList[${i}].Arg[2,|].Equal[Ignore]}) /advloot shared ${GListNum} leave /if (${Select[${GlobalList[${i}].Arg[2,|]},sell,keep,destroy]} ) { /advloot shared ${GListNum} giveto ${Me.Name} /delay 10 } } /if (${LootSystem.Equal[PList}}) { /if (${GlobalList[${i}].Arg[2,|].Equal[Ignore]}) /advloot shared ${GListNum} leave /if (${Select[${GlobalList[${i}].Arg[2,|]},sell,keep,destroy]} ) { /advloot personal ${GListNum} loot /delay 10 /if (${Window[ConfirmationDialogBox].Open}) { /nomodkey /notify ConfirmationDialogBox Yes_Button leftmouseup /delay 10 } /if (${Select[${IniEntry},Destroy]}) { /call HandleItem "${GItemName}" Destroy } } } } /next j /return​
 
[2016/05/14 09:18:51] Woah! hold your horses there little filly... You better add a !${AdvLoot.LootInProgress} check in your macro to make sure loot is not in progress.

Saw this first time last night in the exact scenario you mentioned. Up to now, yes it would pass it out to each member of the group until everyone had one and then just let the item rot. Last night I manually attempted to 'give' an item only I had to another grp member and saw that msg.

Thx for working on it Hoosier!
 
Still working on this macro:
Round 2 updates:

NOTE: These updates only apply if you are using the advloot system.

| Updates by Hoosierbilly, May 2016
| 1. Group Leader will automatically be assigned as Master Looter if there is no Master Looter.
| 2. Lore items marked Keep/Sell will automatically be distributed to everyone in the group, then left on the corpse.
| 3. Added Quest|xx to the ini file, allows all group members to autoroll for items until they have xx number of said item.
| Requires the following command in main loop of macro >> /if ((${AdvLoot.SCount}||${AdvLoot.PCount}) && !${LootTimer}) /call UseAdvLoot <<
| Added new command /lootquest will set item to =Quest|default value.
| Added new setting to ini file: QuestKeep=default value is 10
| 4. Added check for item stack platinum value, item will keep if above selected ini value, else item will be ignored, default is 50 platinum.
| Added new setting to ini file: StackPlatValue=default value is 50


I haven't had much time for testing. Please check it out and provide feedback. The quest|xx part will only work if the following command is somewhere in the main loop of your macro. You will have to manually add the command to kissassist and any other macro's you are using.
EDIT: 18 May, It occurred to me this morning if you use the plugin MQ2melee the following command could be added as a downshift/downflag, whatever it's called.
Rich (BB code):
 /if ((${AdvLoot.SCount}||${AdvLoot.PCount}) && !${LootTimer}) /call UseAdvLoot

I think I got rid of the LootInProgress spam.

I am not totally happy with the Quest|xx using /advloot shared ${I} autoroll. I would prefer using ask/roll but can't find an AdvLoot TLO member to determine when the ask part is complete and the roll can be initiated. It would be awesome if one of the moderators could get the MQ2 developers to figure out how to determine the action status of a shared item; none/askcountdown/readytoroll.

Attached a new NinjAdvLoot file below

You can mostly ignore the follow from the other day:
Rich (BB code):
I have been trying to update Ninjadvloot in two ways:

1. Will automatically distribute LORE items (marked Keep in ini file) to every member of the group then leave them on the corpse.
2. Will loot only a given number of an item and distribute additional items among group members using autoroll until everyone has desired number, then leave any others on corpse

Everyone gets a lore item seems to be working.

To make second part work you have to manually mark the item in the ini file...  Quest|1
The number at the end is how many to keep.
ei:
Aviak Feathers=Quest|2
Adder Egg=Quest|5

Will keep 2 Aviak feathers and 5 adder egg.
The master looter is suppose to leave quest items on the corpse after everyone has desired number, but that is unreliable.

Perhaps one of coders will fix it so a slash command will work.... /lootquest|3
I am too braindead to even think about it today.

The macro occasionally spams a warning about  you need to add !${AdvLoot.LootInProgress}. I have not been able to make this completely go away, but it doesn't seem to bother anything.

While I would certainly like to see this working as flawlessly as any other macro available, I simple don't have the required coding skill.
Good Luck with it.

It attached funny, click on the link below to download... I think


The timer is 5s to slow down spamming.

New file added 17 May 2016
EDIT: 20 May 2016 not working properly yet.
 

Attachments

Last edited:
Updated on 5/29/16 and consolidated with second post:

|
| Updates by Hoosierbilly, advloot system only, May 2016
| 1. Group Leader will automatically assign a Master Looter if there is no Master Looter.
| Group Leader will replace Master Looter if shared list count increases more then three times in a row without a decrease.
| Added new setting GMLSelect=1 to ini file, 0=off, 1=on, default is on
| 2. Lore items marked Keep/Sell will automatically be distributed to everyone in the group, then left on the corpse.
| 3. Added Quest|xx to the ini file, allows all group members to autoroll for items until they have xx number of said item.
| Added new command /lootquest will set item to =Quest|default value
| Added new setting to ini file: QuestKeep=default value is 10
| Requires the following command in your macro's main loop or MQ2melee downflag

Rich (BB code):
/if (${Me.UseAdvancedLooting} && (${AdvLoot.SCount}||${AdvLoot.PCount}) && !${LootTimer} && ${Me.CombatState.NotEqual[combat]}) /call UseAdvLoot
| Note: Items set to "Never" in the Master Looters advloot filters will be treated simular to Quest items without a quantity limit.
| Advloot filters AlwaysNeed/AlwaysGreed/Never will autoselect else the loot.ini settings will determine if individual group member will roll or not.
| 4. Added check for item stack platinum value when adding new items to ini file.
| Item will Keep if above selected ini value, else item will be Ignored.
| Added new setting to ini file: StackPlatValue=default value is 50
| StackSize is limited to 20.
| 5. Added free container slot check. Will automatically stop looting if container space is < 3.
| Added new setting to ini file to exclude up to two special/limited containers from free container slot check.
| example: ExcludeBag1=Extraplanar Trade Satchel
|


Here is a list of the new loot.ini file heading with the new settings colored red:

Rich (BB code):
[Settings]
|======================================================================|
Version=6.0
AddNewSales=1
LootForage=1
LootMobs=TRUE
CorpseRadius=100
MobsTooClose=40
ReportLoot=FALSE
LootChannel=g
LootForageSpam=1
GlobalLootOn=1
CombatLooting=0
QuestKeep=10
StackPlatValue=50
GMLSelect=1
ExcludeBag1=Extraplanar Trade Satchel
ExcludeBag2=NULL


QuestKeep=10 this is the default amount the command /lootquest will update in the loot.ini file.
if you want to keep more or less you have to manually adjust the amount in the loot.ini file

StackPlatValue=50 the amount of platinum a stack must equal in value to be set to Keep instead of Ignore
StackSize is limited to a maximum of 20 items for this check
StackPlatValue=0 will turn this feature off, adding all new items as Keep, except NoDrop they are always Ignore
This only applies when new items are added to the loot.ini file

GMLSelect=1 0/off, 1/on, default is on, group leader will automatically select a Master Looter if you don't already have one and change Master Looter if shared loot list count increases more then 3x in a row without a decrease.
EDIT: Added individual group members can be exclude from being selected for Master Looter Role by using LootOn=0 in the KissAssist_charactorname.ini settings. They will however, still receive LORE items.

ExcludeBag1=Extraplanar Trade Satchel Always you to pick two containers to exclude from your Free.Inventory count.


Processing loot:
Master Looter looks at each item in the shared loot list and checks it against the loot.ini file
items set to Ignore he leaves on the corpse
items set to Keep/Sell/Destroy he moves it to his personal loot list except
LORE items set to Keep/Sell will be giveto each member of the group in turn, first to the Master Looter, then backwards down the Group.Member list
if everyone has the item it will be left on the corpse
LORE items set to Destroy will be looted and destroy or left on the corpse if Master Looter is unable to loot
items set to Quest will be flagged for autoroll and stay in the shared loot list until rolled for

Everyone checks the shared list for items set to Quest
if they need the item (have fewer than listed in the loot.ini file) they will select Greed
if they have enough of the item they will select No
An autoroll will determine who actually gets the item
if no one wants the item (everyone selects No) the Master Looter will leave the item on the corpse

Note: Items set to "Never" in the Master Looters advloot filters will be treated simular to Quest items without a quantity limit, ei set to AutoRoll
advloot filters AlwaysNeed/AlwaysGreed/Never will autoselect else the loot.ini file settings will determine if individual group member will roll or not.

Everyone processes their own personal loot list
if an item not already in the loot.ini is found:
NoDrop items are left on the corpse and added =Ignore to the loot.ini file
New items will be looted to determine the Stack Value and added to the Loot.ini file either =Keep or =Ignore
NOTE: make sure any low value tradeskill item are included in your loot.ini file as =Keep or they may well become =Ignore
then
LORE items will be left on the corpse if you can't loot it, ie. already have one
items set to Ignore will be left on corpse
items set to Quest will be checked to see how many you already have and either looted or left on the corpse
items set to Keep/Sell/Destroy will be looted, and items set to Destroy will be destroyed


Uploaded a new file on 5/30/16
Removed a troubleshooting variable that caused error
 

Attachments

Last edited:
Found this thread again, thought I'd update with possible fix.

Before every /advloot command in my macro I added this delay... /delay 3s !${AdvLoot.LootInProgress}

Seems to be working, so far
 
I have been using this and it works brilliantly. I like that it autoselects a looter, and that I can override it if I want to. I like the autoroll feature.

I like it. I dont have feedback on specific functions because of how well it has been working, it just does what I hope it would. I will download the new version when I get home from work.

Genius.
 
Nice... I DEFINITELY want to set this up to simplify distributing quest items to all my toons. Dealing with that manually is a pain in the ass lol.

Fantastic job, dude!
 
I was seeing the message 'There is no item in slot 23' about 5 times in a row. An item I have set to destroy wasn't being destroyed. I had an unexpanded bag (I had NOT expanded it yet) on me so I'm guessing some code somewhere was expecting the container to be bigger than it was and messing up the destroy. It's such an isolated incident I'm not sure we want to do anything but I wanted to report it merely for due diligence.
 
Been wondering when someone was going to try and make these type of changes to NAL. Good work. I found that the "Group Leader will replace Master Looter if shared list count exceeds 10 items." doesn't play well with chain pulling. When first pulling a camp it will exceed this number after the first couple of minutes. There is no time for the master looter to loot, even though they have plenty of space in their inventory.
 
I was seeing the message 'There is no item in slot 23' about 5 times in a row. An item I have set to destroy wasn't being destroyed. I had an unexpanded bag (I had NOT expanded it yet) on me so I'm guessing some code somewhere was expecting the container to be bigger than it was and messing up the destroy. It's such an isolated incident I'm not sure we want to do anything but I wanted to report it merely for due diligence.

Been wondering when someone was going to try and make these type of changes to NAL. Good work. I found that the "Group Leader will replace Master Looter if shared list count exceeds 10 items." doesn't play well with chain pulling. When first pulling a camp it will exceed this number after the first couple of minutes. There is no time for the master looter to loot, even though they have plenty of space in their inventory.

Unexpanded bags.... chain pulling.... ya'll playin on a whole nother level.
I still have toons using Deluxe Toolbox. Last week a greeny mob wandered away with low health undetected and found couple bored light blue's and I suffered a total party wipe....

If I can get my hands on an unexpanded bag will try to reproduce error.

Chain pullin is a kissassist thing, right? I'm guessing... puller grabs mobA and brings it to camp, tank grabs agro from puller, puller grabs mobB while group finishes mobA...
I handle changing looters in my main macro differently, but was trying to avoid any chat messages in keeping with the kissassist theme.

One problem I encountered was ${AdvLoot.SCount} refused to count higher than 15 or 20, I forget. Lowered the limit to 10 to get the thing to actually work.

Will kissassist allow looting during combat?
Try setting CombatLooting=1 in the loot.ini file

Rich (BB code):
EDIT: Thinking about it.... doubt CombatLooting does anything at all when using the /call advloot sub. I think it will depend on how/when your macro calls looting. I do it during the EndOfCombat routine
 
Last edited:
You are correct on chain pulling.

There is a danger with in-combat looting in that if the grp is in a high risk setting, meaning: content that requires all member participation at all times. I've seen the loot routines take several seconds (up to 10?) between combat ending and returning to camp-loc (which is one of the last if not the last function before the cycle starts over). If the ML is the healer, someone could die in that time. However, caveat emptor, the onus could fall on the user to know when to turn that on or not, just something to think about. I actually have to research to see if KA will even allow it.

/em parcels hoosierbilly an unexpanded tailored supreme rucksack (because no one is selling Transcendent on my server anymore)
 
/em parcels hoosierbilly an unexpanded tailored supreme rucksack (because no one is selling Transcendent on my server anymore)

/em Hoosierbilly Thanks Icognito for unexpanded tailored supreme rucksack...

Bags of any kind are rarely on sale on my server, need to farm some more silks, sigh.

I set this up using my playstyle.... pull single mob, kill it, loot, rest until ready for next pull. I rarely AFK and usually manually pull. I'll have to think about how to speed things up.

I have noticed slightly delays occasional while advloot system processes. I think that must have been the motivation for AdvLoot.LootInProgress Not sure there is anything to do about it.
 
I was thinking is a way to check the number of items in the shared loot window(SCount) when there is no x-targets(No Group Agro) keeps checking to see if the SCount decreases while there is no group agro. If the numbers keep increasing for a certain amount of time, or even stays the same, while there is no group agro, then switch to another looter. That way chain pulling would not matter, because you would only be checking when there is no agro and that is when the looter should be looting.
 
I was thinking is a way to check the number of items in the shared loot window(SCount) when there is no x-targets(No Group Agro) keeps checking to see if the SCount decreases while there is no group agro. If the numbers keep increasing for a certain amount of time, or even stays the same, while there is no group agro, then switch to another looter. That way chain pulling would not matter, because you would only be checking when there is no agro and that is when the looter should be looting.

You just blew my mind.... The few tired brain cells that I have left barely talk to each other. Limiting the check to no XTargets is easy enough but tracking over time. I will contemplate this over the weekend.


Edit: Testing the time to complete looting sub routine. It appears to take 2-3 seconds per item with a decent box running full group. Gonna have to look at the delays again.
 
My left eye is twitching, but I think I worked out a better check for changing master looter, based on the an ever increasing SCount. Just need to determine how many checks it increases before trigger a change. I'll post another file tomorrow if it works.

Looking back at my original post... I added ${Me.CombatState.NotEqual[combat]} to the loot check command in my macro.

Rich (BB code):
/if (${Me.UseAdvancedLooting} && (${AdvLoot.SCount}||${AdvLoot.PCount}) && !${LootTimer} && ${Me.CombatState.NotEqual[combat]}) /call UseAdvLoot
 
hoosier, I am still getting the 'There was no container in slot 23' msg when it's trying to delete the looted item marked for delete. I have since expanded that bag so that isn't the problem. What can I do to provide more info? Like is there a way to turn on debug or something? I am using Tailored Supreme Pack which is 16 slot.
 
hoosier, I am still getting the 'There was no container in slot 23' msg when it's trying to delete the looted item marked for delete. I have since expanded that bag so that isn't the problem. What can I do to provide more info? Like is there a way to turn on debug or something? I am using Tailored Supreme Pack which is 16 slot.

There is a Debugloot variable declared in the inc file that will turn on a lot of /echo status lines. Set it to 1 either by edited the /declare section near the top of the ninjadvloot.inc before turning on the macro or type this command after the macro is running /varset Debugloot 1

slot 23 is actually Pack1 the first top-level pack slot. Looking at the macro the Sub HandleItem(ItemName, DoWhat) around line 915 that actually collects the item to your curser and /destroy it is not one that I changed.

Curious where the item is after you loot it when it is being collected for destruction, which top-level slot/bag slot.
Might also be interesting what the item in slot 23 identifies as ... try typing /echo ${InvSlot[Pack1].Item.Type} or ${InvSlot[23].Item.Type} they should be the same
I also wonder can you reproduce the issue using ninjadvloot 5.2 from the compile.

Here is my working copy with some extra debugloot verbiage around both places where bags/packs/slots are looked at.
 

Attachments

/echo ${InvSlot[Pack1].Item.Type} returns 'Regular'
/echo ${InvSlot[23].Item.Type} returns 'Regular'

I have moved The destroy Item to various bags and slots to see if it was isolated to one particular bag/slot and its not. I get the same msg regardless of where I put it, and regardless of how many stacks I now have.

I will try the RG compile version, as well as the debug one you posted and report back.
 
hoosier, I am still getting the 'There was no container in slot 23' msg when it's trying to delete the looted item marked for delete. I have since expanded that bag so that isn't the problem. What can I do to provide more info? Like is there a way to turn on debug or something? I am using Tailored Supreme Pack which is 16 slot.

This might be an mq2 error. I am seeing it in the regular version of well.
 
Rich (BB code):
EDIT: nevermind... see Maskio's reply above

/echo ${InvSlot[Pack1].Item.Type} returns 'Regular'
/echo ${InvSlot[23].Item.Type} returns 'Regular'

I have moved The destroy Item to various bags and slots to see if it was isolated to one particular bag/slot and its not. I get the same msg regardless of where I put it, and regardless of how many stacks I now have.

I will try the RG compile version, as well as the debug one you posted and report back.

Maskio is right you are a gremlin.
the actual command for checking the free inventory is ${FreeBagSpace}+(${InvSlot[Pack${k}].Item.Container}-${InvSlot[Pack${k}].Item.Items})
try typing the following to see what it gives you
Rich (BB code):
/echo ${InvSlot[Pack1].Item.Container}-${InvSlot[Pack1].Item.Items}
you should get *total number slots-number of free slots* for the container in slot 1

the actual command for picking an item to destroy is /nomodkey /shift /itemnotify in Pack${Math.Calc[${FindItem[=${ItemName}].ItemSlot}-22]} ${Math.Calc[${FindItem[=${ItemName}].ItemSlot2}+1]} leftmouseup
try typing the following to see what you get
Rich (BB code):
/echo ${InvSlot[Pack${Math.Calc[${FindItem[=name of an item here].ItemSlot}-22]}]}  ${InvSlot[${Math.Calc[${FindItem[=name of same item here].ItemSlot2}+1]}]}
this is part of the original macro, I'm not even sure what you should get other then it appears to the location of the item you are trying to destroy

- - - Updated - - -

New file uploaded to original post.

- - - Updated - - -

This might be an mq2 error. I am seeing it in the regular version of well.

I'm becoming very curious about this error.... I'm working on quest so currently have most of the items I'm looting being destroyed, haven't seen the error yet after about 8 hours of playing?
 
I use the amazing loot plugin, alongside the in game autoloot feature. Of course I have historically told my guys what to loot and what not to loot. But since using Ninja the main looter gets caught up on one item every now and again that is in his don't loot list, now other toons can pick the item up, and often it works perfectly. But when it does get stuck, the main looter (who I have to manually change to one of the three wizards I have in the group - if it happens on the bard/tank or clr then the group's fucked) just hangs up and won't cast till I manually fix the issue (assign the item (often some fine steel shit) to a toon that isn't doing something... like casting or fighting.

I have your latest file. Any suggestions?

Thanks on the heads up on the afktools too btw.
 
Release Ninjadvloot.inc

Users who are viewing this thread

Back
Top
Cart