Page 2 of 2

Re: Feature: Macrosupport for the new AdvLoot system

Posted: Sat Dec 26, 2015 10:36 pm
by JudgeD
I tried, good luck :)

Re: Feature: Macrosupport for the new AdvLoot system

Posted: Sun Dec 27, 2015 9:36 am
by Ralindal
I've changed the Loot module to use names instead of numbers, and now it is quite obvious from the logs that something is going wrong.

From my EQ log:

Code: Select all

[15:20:05 2015] 1 item(s): Plain-Looking Scroll given to  you. It has been removed from your Shared Loot List.
[15:20:10 2015] 1 item(s): Diamond given to  you. It has been removed from your Shared Loot List.
[15:20:10 2015] --You have looted a Diamond.--
And this is the debug log from the Loot module. Notice that it never issues a command to give the "Plain-Looking Scroll" to XXXXXX, but still it was given...

Code: Select all

[FINEST 15:20:01.465] $1055-${If[${Group.MasterLooter.ID}==${Me.ID},TRUE,FALSE]} -> TRUE
[FINEST 15:20:04.481] $1056-${AdvLoot.SCount} -> 5
[FINEST 15:20:04.491] $1057-${AdvLoot.SList[5].Name} -> Decaying Zombie Flesh
[FINEST 15:20:04.501] $1058-${AdvLoot.SList[5].ID};${AdvLoot.SList[5].NoDrop};${AdvLoot.SList[5].StackSize};${AdvLoot.SList[5].No} -> 102668;TRUE;1;TRUE
[FINEST 15:20:04.511] $1059-${AdvLoot.SList[4].Name} -> Plain-Looking Scroll
[FINEST 15:20:04.521] $1060-${AdvLoot.SList[4].ID};${AdvLoot.SList[4].NoDrop};${AdvLoot.SList[4].StackSize};${AdvLoot.SList[4].No} -> 81180;TRUE;1;FALSE
[INFO 15:20:04.530] CMD: /advloot shared "Plain-Looking Scroll" no
[FINEST 15:20:05.042] $1061-${AdvLoot.SList[3].Name} -> Diamond
[FINEST 15:20:05.052] $1062-${AdvLoot.SList[3].ID};${AdvLoot.SList[3].NoDrop};${AdvLoot.SList[3].StackSize};${AdvLoot.SList[3].No} -> 10037;FALSE;1;FALSE
[FINEST 15:20:05.074] $1063-${FindItem[=Diamond].Lore} -> FALSE
[INFO 15:20:05.074] CMD: /advloot shared "Diamond" giveto XXXXXXX
[FINEST 15:20:05.586] $1064-${AdvLoot.SList[2].Name} -> Decaying Zombie Flesh
[FINEST 15:20:05.596] $1065-${AdvLoot.SList[2].ID};${AdvLoot.SList[2].NoDrop};${AdvLoot.SList[2].StackSize};${AdvLoot.SList[2].No} -> 102668;TRUE;1;TRUE
[FINEST 15:20:05.606] $1066-${AdvLoot.SList[1].Name} -> Decaying Zombie Flesh
[FINEST 15:20:05.616] $1067-${AdvLoot.SList[1].ID};${AdvLoot.SList[1].NoDrop};${AdvLoot.SList[1].StackSize};${AdvLoot.SList[1].No} -> 102668;TRUE;1;TRUE
[INFO 15:20:05.616] CMD: /advloot shared set "enable free grab"
Now the Diamond was not given to XXXXXX, but instead the Plain-Looking Scroll. The next time the Loot module checks, it sees a Diamond again, and
gives it again:

Code: Select all

[FINEST 15:20:06.582] $1068-${If[${Group.MasterLooter.ID}==${Me.ID},TRUE,FALSE]} -> TRUE
[FINEST 15:20:09.594] $1069-${AdvLoot.SCount} -> 4
[FINEST 15:20:09.604] $1070-${AdvLoot.SList[4].Name} -> Diamond
[FINEST 15:20:09.615] $1071-${AdvLoot.SList[4].ID};${AdvLoot.SList[4].NoDrop};${AdvLoot.SList[4].StackSize};${AdvLoot.SList[4].No} -> 10037;FALSE;1;FALSE
[FINEST 15:20:09.628] $1072-${FindItem[=Diamond].Lore} -> FALSE
[INFO 15:20:09.628] CMD: /advloot shared "Diamond" giveto XXXXXXX
This last part corresponds with the 2nd line in the EQ log above.

Re: Feature: Macrosupport for the new AdvLoot system

Posted: Sun Dec 27, 2015 11:39 am
by JudgeD
I would suggest moving away from using strings in your giveto's and instead using the index number. I've seen some weird behavior in how EQ combines drops from multiple enemies into a single stack (and I've even seen it require 2 giveto's for the same stack).

Re: Feature: Macrosupport for the new AdvLoot system

Posted: Sun Dec 27, 2015 3:10 pm
by Ralindal
It was using index before, it bugged then also.

Re: Feature: Macrosupport for the new AdvLoot system

Posted: Sun Dec 27, 2015 3:32 pm
by Ralindal
I checked the MacroQuest source code, and if there is a problem there, then I suspect that DoAdvLootAction's (which seems to be an EQ function) first parameter is not what it appears to be.

Since the Shared Loot table is sortable (by clicking on the columns), EQ might be keeping track of two index numbers. This would be a pretty subtle bug because the amount of items would be correct, just the index numbers could be in a slightly different order.

The code that searches by name would have the same problem if this is the case.

I don't have any idea how to look into this further, but perhaps this will help find the culprit.

Re: Feature: Macrosupport for the new AdvLoot system

Posted: Sun Dec 27, 2015 3:34 pm
by Ralindal
Also spotted a small bug that may access an item that doesn't exist.

Code: Select all

				if (pAdvLoot && pAdvLoot->pCLootList && pAdvLoot->pCLootList->pLootItem && pAdvLoot->pCLootList->ListSize >= index) {
					DWORD addr = (DWORD)pAdvLoot->pCLootList->pLootItem;
					pitem = (PLOOTITEM)(addr + (sizeof(LOOTITEM)*index));//leave/giveto
The index here is zero based, but the check is not. Should be "ListSize > index".

Re: Feature: Macrosupport for the new AdvLoot system

Posted: Tue Jan 12, 2016 3:45 pm
by EqMule
I use this in my macros:

Code: Select all

Sub LootStuff
   /declare prevcount int local 0
   /declare thecount int local 0
   /declare l int local

   /if (${Bool[${Group}]}==TRUE) {
      /if (${Group.MasterLooter.ID}==${Me.ID}) {
         /if (${AdvLoot.SCount}>0 && ${AdvLoot.SWantCount}>0) {
            /echo looting
            /varset prevcount ${AdvLoot.SCount}
            /advloot shared set ${Me.Name}
            /delay 30 ${AdvLoot.SCount}!=${prevcount}
         }
         |still more stuff in list?
:morestuffinsloot
         /if (${AdvLoot.SCount}>0) {
            /varset thecount ${AdvLoot.SCount}
            /echo going to roll through ${thecount} items in shared list
            /for l 1 to ${thecount}
               /if (${AdvLoot.SList[${l}].No}==TRUE || ${AdvLoot.SList[${l}].Never}==TRUE) {
                  /echo [${l}] leaving ${AdvLoot.SList[${l}]} on corpse we dont want that crap
                  /varset prevcount ${AdvLoot.SCount}
                  /advloot shared "${AdvLoot.SList[${l}]}" leave
                  /delay 30 ${AdvLoot.SCount}!=${prevcount}
                  /if (${AdvLoot.SCount}) {
                     /echo there is more stuff in the slist im looping up
                     /goto :morestuffinsloot
                  }
               }
            /next l
         }
         /delay 30 ${AdvLoot.PCount}==0
         /if (${AdvLoot.SCount}>0) {
            /beep
            /echo you have unfiltered SLoot to attend to...
         }
         /if (${AdvLoot.PCount}>0) {
            /beep
            /echo you have unfiltered PLoot to attend to...
         }
      }
   } else {
      |loot personal stuff?
      |if needed it's not exactly hard to add with the new command available:   
      |/advloot personal blah blah
   }
/return

Re: Feature: Macrosupport for the new AdvLoot system

Posted: Sun Jul 30, 2017 1:39 am
by Norrathian
I'd donate for a documented way to add this to macros.

ATM, I've done it manually - mostly for items I've never seen or missed marking everyones loot choices. You can edit the files directly in the userdata folder. Just add the item #, icon #, and item name - all easy to get from Alla's Lucy, for example.

It'd be nice to say /advloot never "spell: levant" to never loot old school spells, just as an example.