Ninjadvloot seems to have an issue where if you have an item marked to sell in your main inventory (not in a bag) it will select the NEXT top level inventory slot and sell it. In my case that was an empty WR bag that it sold to the vendor. Not cool, so lets fix that.
In the Sub SellToVendor(ItemToSell)
[CODE title="Sub SellToVendor Original" highlight="8"]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[/CODE]
Change to :
[CODE title="Sub SellToVendor Modified" highlight="9"]Sub SellToVendor(ItemToSell)
/if (${Window[MerchantWnd].Open}) {
:sell
/echo Selling ${ItemToSell}
| ${FindItem[=${ItemToSell}].InvSlot}
/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 ${Math.Calc[${FindItem[=${ItemToSell}].InvSlot}-1]} 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[/CODE]
Now that Ninjaadvloot is using custom loot tables, and selling the correct item slots, we need the stand alone macros to check to see if we are using a custom file instead of using the global Loot.ini
Sellstuff.mac:
| Sellstuff.mac v2.0 by DriveCrash 07/21/2022
| Original work by Maskoi 11/27/2010
| Target the vendor you want to sell to and type /mac sellstuff
| Required Ninjadvloot.inc v1.8 and a loot.ini file with items marked as sell
| 7/21/2022 added support for custom loot files passed from KA character ini files
#include Ninjadvloot.inc
#Event plattotal "#*#You receive #1# platinum#*#"
| --------------------------------------------------------------------------------------------
| SUB: Main
| --------------------------------------------------------------------------------------------
Sub Main
/declare IniFileName string outer
/declare LootFileName string outer
/declare Ptotal int outer 0
| Check if Kiss_server_name or Kiss_name ini files exist
| If no custom loot file is defined, use default Loot.ini
/if (${Ini[KissAssist_${EverQuest.Server}_${Me.CleanName}.ini,General,LootFileName].Length}) {
/varset IniFileName KissAssist_${EverQuest.Server}_${Me.CleanName}.ini
/varset LootFileName ${Ini[${IniFileName},General,LootFileName]}
/echo KissAssist ini file detected using ${IniFileName}
/call SetupAdvLootVars ${LootFileName}.ini
} Else {
/if (${Ini[KissAssist_${Me.CleanName}.ini,General,LootFileName].Length}) {
/varset IniFileName KissAssist_${Me.CleanName}.ini
/varset LootFileName ${Ini[${IniFileName},General,LootFileName]}
/echo KissAssist ini file detected using ${IniFileName}
/call SetupAdvLootVars ${LootFileName}.ini
} Else {
/call SetupAdvLootVars
}
/call DoLootStuff sell
:sell
/doevents
/if (${Target.ID} && ${Target.Distance}<25) /goto :sell
}
/echo You made ${Ptotal} plat selling vender trash
/return
Sub Event_plattotal(S0,S1)
/varcalc Ptotal ${Ptotal}+${S1}
/return
and Loot.mac:
| loot.mac 2.0 by DriveCrash 07/21/2022 Redguides.com
| Original work by Maskoi 01/22/2014
#include ninjadvloot.inc
| --------------------------------------------------------------------------------------------
| SUB: main
| --------------------------------------------------------------------------------------------
sub main
/declare CampZone int outer ${Zone.ID}
/declare CampXLoc int outer ${Me.X}
/declare CampYLoc int outer ${Me.Y}
/declare CampZLoc int outer ${Me.Z}
/declare LookForward int outer ${Me.Heading.DegreesCCW}
/declare IniFileName string outer
/declare LootFileName string outer
/echo Starting Loot macro. I will check for corpses to loot every 30s.
| Check if Kiss_server_name or Kiss_name ini files exist
| If no custom loot file is defined, use default Loot.ini
/if (${Ini[KissAssist_${EverQuest.Server}_${Me.CleanName}.ini,General,LootFileName].Length}) {
/varset IniFileName KissAssist_${EverQuest.Server}_${Me.CleanName}.ini
/varset LootFileName ${Ini[${IniFileName},General,LootFileName]}
/echo KissAssist ini file detected using ${IniFileName}
/call SetupAdvLootVars ${LootFileName}.ini
} Else {
/if (${Ini[KissAssist_${Me.CleanName}.ini,General,LootFileName].Length}) {
/varset IniFileName KissAssist_${Me.CleanName}.ini
/varset LootFileName ${Ini[${IniFileName},General,LootFileName]}
/echo KissAssist ini file detected using ${IniFileName}
/call SetupAdvLootVars ${LootFileName}.ini
} Else {
/call SetupAdvLootVars
}
/varset CorpseRadius 100
/varset MobsTooClose 10
:top
/doevents
/moveto mdist 10
/call LootMobs
/delay 2s
/moveto loc ${CampYLoc} ${CampXLoc}
/delay 2s ${MoveTo.Stopped}
/face heading ${LookForward}
/delay 30s
/goto :top
/return
I made this for myself, but on the off chance someone else would like to use it I wanted to share it with the community.
Happy Hunting!