Best farming outfit script.

Code:
void Get_best_acc1(){
if(item_amount($item[Jekyllin hide belt]) > 0 && !have_equipped($item[Jekyllin hide belt])){
equip($slot[acc1], $item[Jekyllin hide belt]);
}
Code:
void Get_best_acc2(){
if(item_amount($item[Jekyllin hide belt]) > 0 && !have_equipped($item[Jekyllin hide belt])){
equip($slot[acc2], $item[Jekyllin hide belt]);
}
Code:
void Get_best_acc3(){
if(item_amount($item[Jekyllin hide belt]) > 0 && !have_equipped($item[Jekyllin hide belt])){
equip($slot[acc3], $item[Jekyllin hide belt]);
}
Looking at this, it looks to me that if one happens to possess three jek belts, it will fail to equip all three of them, even though that is what you intend to do.
In my experience, when you equip() an item, its item_amount is decremented, so simply checking if you have one of them should be enough. I may be wrong on this, but I do recall having to work around that when writing a boolean got_item() function. Its simple enough to find out if its true.

I'm mostly posting because I recently wrote some code to handle equipping the 'best' of a set of accessories, and I ran into similar problems. (do I have this? is it already equipped elsewhere? do I have a spare one?). Smart accessory outfitting is surprisingly tricky, but I think I found a good solution.

BTW: indentation is good, m'kay?
 
Point's taken into consideration, and script updated. Now it is indented, SOOOO much easier to read. :D Also, accessory equipping has been modified.
 
SHAMELESS PLUG:
It was trivial to write a 'outfits' file for my already existing script, outfit_changer.
This should do exactly what you want, and a little more.
I just rewrote the outfits file according to your script, and altered two lines in my outfit_changer script.
Give it a try!

P.S. you dont need to do any of the complicated 'namespace-y' stuff I talk about on my introduction to casual outfitter post. Just save the files, and run the .ash one!
 

Attachments

Back
Top