Edited as code has been updated:
First - Thank you very much @MB! The code is much, much smaller now. Your comment was really helpful!
This is now sorting for the following: BRSK, HRSK, SRSK, CBD, and Footwear for 4, 5 and 6 part large and small bods. It should be pretty complete, I think. (I hope?)
What I could really use at this point is someone willing to test and provide some feedback.
I've added in some messages as you sort like 'FivePartBod 4 CBD' that let you know what it was trying if there is a failure.
Usage:
1. put your book to sort from in your backpack
2. open all the containers your bod books are in (be sure you're in range)
3. hit play
4. target them as required
Troubleshooting:
1. It isn't reading the bod correctly or piling up bods
If you stopped it in the middle or something went wrong, like lag:
2. It isn't pulling any bods and just cycling over and over.
There may be things I've missed as this is still new. Please post a message with the following:
In addition it would be helpful if you could do the following:
I hope this ends up helping someone with a tedious task.
Thanks!
Sevenz
First - Thank you very much @MB! The code is much, much smaller now. Your comment was really helpful!
This is now sorting for the following: BRSK, HRSK, SRSK, CBD, and Footwear for 4, 5 and 6 part large and small bods. It should be pretty complete, I think. (I hope?)
What I could really use at this point is someone willing to test and provide some feedback.
I've added in some messages as you sort like 'FivePartBod 4 CBD' that let you know what it was trying if there is a failure.
Usage:
1. put your book to sort from in your backpack
2. open all the containers your bod books are in (be sure you're in range)
3. hit play
4. target them as required
Troubleshooting:
1. It isn't reading the bod correctly or piling up bods
If you stopped it in the middle or something went wrong, like lag:
- Stop the macro
- Click on the active objects button and remove "bod", "found", "moveto<something>" from the Aliases list if they're there. You will also need to remove the respective Aliases from that list if you change books or containers.
- Save
- Hit play
2. It isn't pulling any bods and just cycling over and over.
- Check that the filter on your sort book is set to all.
There may be things I've missed as this is still new. Please post a message with the following:
- BOD Properties
- Where it was sorted to
- Where it should have been sorted to
In addition it would be helpful if you could do the following:
- put just that bod in a book
- clear the aliases
- save
- run the macro
- post below with the message that shows up over your characters head when its sorting. That should help me find the issue in the code.
I hope this ends up helping someone with a tedious task.
Thanks!
Sevenz
Code:
// ---------------------------------------------
// Footwear
// ---------------------------------------------
if not @listexists "Footwear"
createlist "Footwear"
pushlist "Footwear" "Sandals" //Footwear Collection
pushlist "Footwear" "Shoes" //Footwear Collection
pushlist "Footwear" "Boots" //Footwear Collection
pushlist "Footwear" "Thigh Boots" //Footwear Collection
endif
// ---------------------------------------------
// 4 Part outfits
// ---------------------------------------------
if not @listexists "FourPart"
createlist "FourPart"
pushlist "FourPart" "Bandana" //Gypsy
pushlist "FourPart" "Shirt" //Gypsy
pushlist "FourPart" "Skirt" //Gypsy
pushlist "FourPart" "Skullcap" //Pirate
pushlist "FourPart" "Doublet" //Pirate
pushlist "FourPart" "Kilt" //Pirate
pushlist "FourPart" "Jester Hat" //Jester
pushlist "FourPart" "Jester Suit" //Jester
pushlist "FourPart" "Cloak" //Jester
pushlist "FourPart" "Straw Hat" //Farmer
pushlist "FourPart" "Tunic" //Farmer
pushlist "FourPart" "Long Pants" //Farmer
pushlist "FourPart" "Wizards Hat" //Wizard
pushlist "FourPart" "Body Sash" //Wizard
pushlist "FourPart" "Robe" //Wizard
pushlist "FourPart" "Floppy Hat" //Fishergirl
pushlist "FourPart" "Full Apron" //Fishergirl
pushlist "FourPart" "Plain Dress" //Fishergirl
pushlist "FourPart" "Bonnet" //Lady
pushlist "FourPart" "Half Apron" //Lady
pushlist "FourPart" "Fancy Dress" //Lady
pushlist "FourPart" "Tricorne Hat" //Hat Collection
pushlist "FourPart" "Cap" //Hat Collection
pushlist "FourPart" "Wide-Brim Hat" //Hat Collection
pushlist "FourPart" "Tall Straw Hat" //Hat Collection
endif
// ---------------------------------------------
// 5 Part outfits
// ---------------------------------------------
if not @listexists "FivePart"
createlist "FivePart"
pushlist "FivePart" "studded gorget"
pushlist "FivePart" "studded gloves"
pushlist "FivePart" "studded sleeves"
pushlist "FivePart" "studded leggings"
pushlist "FivePart" "studded tunic"
pushlist "FivePart" "bone helmet"
pushlist "FivePart" "bone gloves"
pushlist "FivePart" "bone arms"
pushlist "FivePart" "bone leggings"
pushlist "FivePart" "bone armor"
pushlist "FivePart" "feathered hat"
pushlist "FivePart" "surcoat"
pushlist "FivePart" "fancy shirt"
pushlist "FivePart" "short pants"
endif
// ---------------------------------------------
// 6 Part outfits
// ---------------------------------------------
if not @listexists "SixPart"
createlist "SixPart"
pushlist "SixPart" "leather gorget"
pushlist "SixPart" "leather skirt"
pushlist "SixPart" "leather cap"
pushlist "SixPart" "leather gloves"
pushlist "SixPart" "leather sleeves"
pushlist "SixPart" "leather leggings"
pushlist "SixPart" "leather tunic"
pushlist "SixPart" "leather bustier"
pushlist "SixPart" "leather shorts"
pushlist "SixPart" "female leather armor"
pushlist "SixPart" "studded bustier"
pushlist "SixPart" "studded armor"
endif
// ---------------------------------------------
// Book we want to sort through
// ---------------------------------------------
if not @findobject "toSort"
headmsg "Select BOD book to sort" "100"
promptalias "toSort"
endif
// ---------------------------------------------
// Container that holds book of each type
// ---------------------------------------------
if not @findobject "BRSKcont"
headmsg "Select container where BRSK book is" "100"
promptalias "BRSKcont"
endif
if not @findobject "HRSKcont"
headmsg "Select container where HRSK book is" "100"
promptalias "HRSKcont"
endif
if not @findobject "SRSKcont"
headmsg "Select container where SRSK book is" "100"
promptalias "SRSKcont"
endif
if not @findobject "CBDcont"
headmsg "Select container where CBD book is" "100"
promptalias "CBDcont"
endif
//if not @findobject "TPScont"
// headmsg "Select container where TPS book is" "100"
// promptalias "TPScont"
//endif
if not @findobject "Footwearcont"
headmsg "Select container where Footwear book is" "100"
promptalias "Footwearcont"
endif
if not @findobject "TrashBODcont"
headmsg "Select container where TrashBod book is" "100"
promptalias "TrashBODcont"
endif
// ---------------------------------------------
// Book of each type reward
// ---------------------------------------------
if not @findobject "BRSK"
headmsg "Select BRSK book" "100"
promptalias "BRSK"
endif
if not @findobject "HRSK"
headmsg "Select HRSK book" "100"
promptalias "HRSK"
endif
if not @findobject "SRSK"
headmsg "Select SRSK book" "100"
promptalias "SRSK"
endif
if not @findobject "CBD"
headmsg "Select CBD book" "100"
promptalias "CBD"
endif
//if not @findobject "TPS"
//headmsg "Select TPS book" "100"
//promptalias "TPS"
//endif
if not @findobject "Footwear"
headmsg "Select Footwear book" "100"
promptalias "Footwear"
endif
if not @findobject "TrashBOD"
headmsg "Select TrashBOD book" "100"
promptalias "TrashBOD"
endif
// ---------------------------------------------
// Get first bod from Bulk Source
// ---------------------------------------------
while not @property 'Deeds In Book: 0' 'toSort'
// If we have a tailoring bod in backpack
// get its properties
// otherwise get a new bod
useobject "toSort"
waitforgump 0x54f555df 2000
replygump 0x54f555df 5
pause 1000
if @findtype 0x2258 1155 "backpack" "any"
@setalias "bod" "found"
waitforproperties "bod" 5000
endif
// ---------------------------------------------
// Find the outfit this bod belongs to
// ---------------------------------------------
// if we don't have any sort flags set
// find the outfit set this bod belongs to
if not findalias "movetoSRSK" and not findalias "movetoCBD"
if not findalias "movetoHRSK" and not findalias "movetoBRSK"
// check fourpart first as we'll get most
// of our bods here
for 1 to FourPart
//headmsg "Checking FourPartBod" "33"
if @property FourPart[] "bod" and not @property "Leather Skirt" "bod"
if not @property "Leather Cap" "bod" and not @property "Leather Tunic" "bod"
if not @property "Fancy Shirt" "bod" and not @property "Studded Tunic" "bod"
//headmsg "Found FourPartBod" "3"
@setalias "FourPartBod" "bod"
//headmsg "FourPartBod" "33"
break
endif
endif
endif
endfor
// if we found the outfit
// stop checking otherwise check
// five parts
if not @findalias "FourPartBod"
for 1 to FivePart
//headmsg "Checking FivePartBod" "33"
if @property FivePart[] "bod"
//headmsg "Found FivePartBod" "33"
@setalias "FivePartBod" "bod"
//headmsg "FivePartBod" "33"
break
endif
endfor
endif
// if we found the outfit
// stop checking otherwise check
// six parts
if not @findalias "FourPartBod" and not @findalias "FivePartBod"
for 1 to SixPart
//headmsg "Checking SixPartBod" "33"
if @property SixPart[] "bod"
//headmsg "Found SixPartBod" "33"
@setalias "SixPartBod" "bod"
//headmsg "SixPartBod" "33"
break
endif
endfor
endif
if not @findalias "FourPartBod" and not @findalias "FivePartBod"
if not findalias "SixPartBod"
for 1 to Footwear
//headmsg "Checking FootwearBod" "33"
if @property Footwear[] "bod"
//headmsg "Found Footwear" "10"
@setalias "FootwearBod" "bod"
break
endif
endfor
endif
endif
endif
endif
pause 1000
// ---------------------------------------------
// Start filtering for reward
// ---------------------------------------------
//check fourpart
if @findalias "FourPartBod"
//headmsg "Filtering FourPartBod" "33"
if @property "Barbed" "bod" and @property "Exceptional" "bod"
if @property "Make: 20" "bod"
@setalias "movetoHRSK" "bod"
headmsg "FourPartBod 1 HRSK" "33"
endif
elseif @property "Barbed" "bod" and @property "Exceptional" "bod"
if @property "Make: 10" "bod"
@setalias "movetoCBD" "bod"
headmsg "FourPartBod 2 CBD" "33"
endif
elseif @property "Horned" "bod" and @property "Exceptional" "bod"
if @property "Make: 20" "bod"
@setalias "movetoCBD" "bod"
headmsg "FourPartBod 3 CBD" "33"
endif
elseif @property "Spined" "bod" and @property "Large" "bod"
if not @property "Exceptional" "bod" and @property "Make: 10" "bod"
@setalias "movetoSRSK" "bod"
headmsg "FourPartBod 4 SRSK" "33"
endif
elseif @property "Spined" "bod" and @property "Large" "bod"
if not @property "Exceptional" "bod" and @property "Make: 15" "bod"
@setalias "movetoSRSK" "bod"
headmsg "FourPartBod 5 SRSK" "33"
endif
elseif @property "Spined" "bod" and not @property "Large" "bod"
if @property "Make: 10" "bod"
@setalias "movetoSRSK" "bod"
headmsg "FourPartBod 6 SRSK" "33"
endif
elseif @property "Spined" "bod" and not @property "Large" "bod"
if @property "Make: 15" "bod"
@setalias "movetoSRSK" "bod"
headmsg "FourPartBod 7 SRSK" "33"
endif
elseif not @property "Spined" "bod" and not @property "Horned" "bod"
if not @property "Barbed" "bod" and @property "Make: 20" "bod"
if not @property "Exceptional" "bod" and @property "Large" "bod"
@setalias "movetoSRSK" "bod"
headmsg "FourPartBod 8 SRSK" "33"
endif
endif
elseif not @property "Spined" "bod" and not @property "Horned" "bod"
if not @property "Barbed" "bod" and @property "Make: 20" "bod"
if @property "Small Bulk" "bod"
@setalias "movetoSRSK" "bod"
headmsg "FourPartBod 9 SRSK" "33"
endif
endif
endif
elseif @findalias "FivePartBod"
//headmsg "Filtering FivePartBod" "33"
if @property "Barbed" "bod" and @property "Exceptional" "bod"
if @property "Make: 20" "bod"
@setalias "movetoBRSK" "bod"
headmsg "FivePartBod 1 BRSK" "33"
endif
elseif @property "Horned" "bod" and @property "Exceptional" "bod"
if @property "Make: 10" "bod"
@setalias "movetoHRSK" "bod"
headmsg "FivePartBod 2 HRSK" "33"
endif
elseif @property "Horned" "bod" and @property "Exceptional" "bod"
if @property "Make: 15" "bod"
@setalias "movetoHRSK" "bod"
headmsg "FivePartBod 3 HRSK" "33"
endif
elseif @property "Spined" "bod" and @property "Exceptional" "bod"
if @property "Make: 20" "bod"
@setalias "movetoHRSK" "bod"
headmsg "FivePartBod 4 HRSK" "33"
endif
elseif @property "Spined" "bod" and @property "Exceptional" "bod"
if @property "Make: 10" "bod"
@setalias "movetoCBD" "bod"
headmsg "FivePartBod 5 CBD" "33"
endif
elseif @property "Exceptional" "bod" and @property "Make: 20" "bod"
if not @property "Spined" "bod" and not @property "Horned" "bod"
if not @property "Barbed" "bod"
@setalias "movetoCBD" "bod"
headmsg "FivePartBod 6 CBD" "33"
endif
endif
elseif not @property "Exceptional" "bod" and @property "Make: 20" "bod"
if @property "Barbed" "bod"
@setalias "movetoHRSK" "bod"
headmsg "FivePartBod 7 HRSK" "33"
endif
elseif not @property "Exceptional" "bod" and @property "Make: 10" "bod"
if @property "Barbed" "bod"
@setalias "movetoCBD" "bod"
headmsg "FivePartBod 8 CBD" "33"
endif
elseif not @property "Exceptional" "bod" and @property "Make: 20" "bod"
if @property "Horned" "bod"
@setalias "movetoCBD" "bod"
headmsg "FivePartBod 9 CBD" "33"
endif
endif
elseif @findalias "SixPartBod"
//headmsg "Filtering SixPartBod" "200"
if @property "Exceptional" "bod" and @property "Barbed" "bod"
@setalias "movetoBRSK" "bod"
headmsg "SixPartBod 1 BRSK" "33"
elseif @property "Exceptional" "bod" and @property "Horned" "bod"
@setalias "movetoBRSK" "bod"
headmsg "SixPartBod 2 BRSK" "33"
elseif @property "Exceptional" "bod" and @property "Spined" "bod"
if @property "Make: 20" "bod"
@setalias "movetoBRSK" "bod"
headmsg "SixPartBod 3 BRSK" "33"
endif
elseif @property "Barbed" "bod" and not @property "Exceptional" "bod"
if @property "Make: 20" "bod"
@setalias "movetoBRSK" "bod"
headmsg "SixPartBod 4 BRSK" "33"
endif
elseif @property "Exceptional" "bod" and @property "Make: 10" "bod"
@setalias "movetoHRSK" "bod"
headmsg "SixPartBod 5 HRSK" "33"
elseif @property "Exceptional" "bod" and @property "Make: 15" "bod"
@setalias "movetoHRSK" "bod"
headmsg "SixPartBod 6 HRSK" "33"
elseif @property "Horned" "bod" and not @property "Exceptional" "bod"
if @property "Make: 10" "bod"
@setalias "movetoHRSK" "bod"
headmsg "SixPartBod 7 HRSK" "33"
endif
elseif @property "Horned" "bod" and not @property "Exceptional" "bod"
if @property "Make: 15" "bod"
@setalias "movetoHRSK" "bod"
headmsg "SixPartBod 8 HRSK" "33"
endif
elseif @property "Spined" "bod" and not @property "Exceptional" "bod"
if @property "Make: 20" "bod"
@setalias "movetoHRSK" "bod"
headmsg "SixPartBod 9 HRSK" "33"
endif
elseif @property "Spined" "bod" and not @property "Exceptional" "bod"
if @property "Make: 10" "bod"
@setalias "movetoCBD" "bod"
headmsg "SixPartBod 10 CBD" "33"
endif
elseif @property "Make: 20" "bod" and not @property "Exceptional" "bod"
if not @property "Spined" "bod" and not @property "Horned" "bod"
if not @property "Barbed" "bod"
@setalias "movetoCBD" "bod"
headmsg "SixPartBod 11 CBD" "33"
endif
endif
endif
elseif @findalias "FootwearBOD"
if @property "Large" "bod" and not @property "Exceptional" "bod"
if @property "Make: 20" "bod"
@setalias "movetoFootwear" "bod"
headmsg "Footwear 1" "33"
endif
elseif @property "Small Bulk" "bod" and @property "Make: 20" "bod"
@setalias "movetoFootwear" "bod"
headmsg "Footwear 2" "33"
endif
endif
pause 500
// ---------------------------------------------
// Move to correct book
// ---------------------------------------------
// World save pause
if @injournal 'The world will save'
clearjournal
sysmsg 'Pausing macro for Server Save'
waitforjournal 'World save complete' 20000 'system'
sysmsg 'Resuming macro'
endif
// Too many items check
if @injournal 'That container cannot hold'
clearjournal
headmsg "Can't hold anymore items" "33"
stop
endif
// Weight check
if weight > maxweight
headmsg "Overweight" "33"
stop
endif
if @findobject "movetoBRSK" 1155 "backpack"
//find BRSK book
if not @findobject "BRSK" 0 "backpack"
@findobject "BRSK" 0 "ground" "any" 3
@moveitem "BRSK" "backpack" 0 0 0 1
pause 500
endif
@moveitem "movetoBRSK" "BRSK"
pause 500
@moveitem "BRSK" "BRSKcont" 0 0 0 1
pause 500
endif
if @findobject "movetoHRSK" 1155 "backpack"
//find HRSK book
if not @findobject "HRSK" 0 "backpack"
@findobject "HRSK" 0 "ground" "any" 3
@moveitem "HRSK" "backpack" 0 0 0 1
pause 500
endif
@moveitem "movetoHRSK" "HRSK"
pause 500
@moveitem "HRSK" "HRSKcont" 0 0 0 1
pause 500
endif
if @findobject "movetoSRSK" 1155 "backpack"
if not @findobject "SRSK" 0 "backpack"
@findobject "SRSK" 0 "ground" "any" 3
@moveitem "SRSK" "backpack" 0 0 0 1
pause 500
endif
@moveitem "movetoSRSK" "SRSK"
pause 500
@moveitem "SRSK" "SRSKcont" 0 0 0 1
pause 500
endif
if @findobject "movetoCBD" 1155 "backpack"
//find CBD book
if not @findobject "CBD" 0 "backpack"
@findobject "CBD" 0 "ground" "any" 3
@moveitem "CBD" "backpack" 0 0 0 1
pause 500
endif
@moveitem "movetoCBD" "CBD"
pause 500
@moveitem "CBD" "CBDcont" 0 0 0 1
pause 500
endif
if @findobject "movetoFootwear" 1155 "backpack"
if not @findobject "Footwear" 0 "backpack"
@findobject "Footwear" 0 "ground" "any" 3
@moveitem "Footwear" "backpack" 0 0 0 1
pause 500
endif
@moveitem "movetoFootwear" "Footwear"
pause 500
@moveitem "Footwear" "Footwearcont" 0 0 0 1
pause 500
endif
// ---------------------------------------------
// Trash if we didn't find any of our filters
// ---------------------------------------------
if not @findalias "movetoHRSK" and not @findalias "movetoBRSK"
if not @findalias "movetoSRSK" and not @findalias "movetoCBD"
if not @findalias "movetoFootwear"
if not @findobject "TrashBOD" 0 "backpack"
@findobject "TrashBOD" 0 "ground" "any" 3
@moveitem "TrashBOD" "backpack" 0 0 0 1
pause 500
endif
@moveitem "bod" "TrashBOD"
headmsg "Item put in Trash book" "100"
pause 500
@moveitem "TrashBOD" "TrashBODcont" 0 0 0 1
pause 500
endif
endif
endif
// ---------------------------------------------
// Clean up
// ---------------------------------------------
@unsetalias "movetoSRSK"
@unsetalias "movetoHRSK"
@unsetalias "movetoBRSK"
@unsetalias "movetoCBD"
@unsetalias "movetoFootwear"
@unsetalias "FourPartBod"
@unsetalias "FivePartBod"
@unsetalias "SixPartBod"
@unsetalias "FootwearBod"
@unsetalias "bod"
@unsetalias "Found"
pause 500
endwhile
@unsetalias "toSort"
Last edited: