BackseatScripter
Active Member
I've been thinking about this for a while now but haven't had a lot of time to work on it. Consequently I've 'appropriated' (read stolen) whole chunks of MMOAddict's code from VGA and done my usual butchery work.
Though I've not yet had a chance to even test it, I thought I may aswell post the concept code for those more experienced than me to give a once over.
I'm definately leaning towards using a text box to add items to the trashlist, as you can't buy back what you destroy. I think the function would be best run as part of the loot code, probably immediately prior to the actual looting. Destroy only works when out of combat.
Anyway here's what I have so far.
Though I've not yet had a chance to even test it, I thought I may aswell post the concept code for those more experienced than me to give a once over.
I'm definately leaning towards using a text box to add items to the trashlist, as you can't buy back what you destroy. I think the function would be best run as part of the loot code, probably immediately prior to the actual looting. Destroy only works when out of combat.
Anyway here's what I have so far.
Code:
function Trash()
{
variable int i = 1
; Loop through the inventory, incrementing "i" by one each time until
; Me.Inventory[i] isn't valid anymore
do
{
if ${doTrash}
{
variable iterator Iterator
Trash:GetSettingIterator[Iterator]
Iterator:First
while ( ${Iterator.Key(exists)} )
{
if ${Me.Inventory[${i}].Name.Equal[${Iterator.Key}]}
{
VGExecute /destroy "${Iterator.Key}"
}
Iterator:Next
}
}
i:Inc
}
while ${Me.Inventory[${i}].ID(exists)}
echo I've taken out the trash, chores complete. PLAY TIME!!
}
;********************************************
/* Add item to the Trash list */
;********************************************
atom(global) AddTrash(string aName)
{
if ( ${aName.Length} > 1 )
{
LavishSettings[VGA_General].FindSet[Trash]:AddSetting[${aName}, ${aName}]
}
else
{
return
}
}
atom(global) RemoveTrash(string aName)
{
if ( ${aName.Length} > 1 )
{
Trash.FindSetting[${aName}]:Remove
}
else
{
}
}
atom(global) BuildTrash()
{
variable iterator Iterator
Trash:GetSettingIterator[Iterator]
UIElement[TrashList@TrashFrm@Trash@MainSubTab@MainFrm@Main@ABot@vga_gui]:ClearItems
while ( ${Iterator.Key(exists)} )
{
UIElement[TrashList@TrashFrm@Trash@MainSubTab@MainFrm@Main@ABot@vga_gui]:AddItem[${Iterator.Key}]
Iterator:Next
}
}