Best farming outfit script.

izchak

Member
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?
 

hippymon

Member
Point's taken into consideration, and script updated. Now it is indented, SOOOO much easier to read. :D Also, accessory equipping has been modified.
 

izchak

Member
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

  • farming_outfitter.ash
    7.4 KB · Views: 85
  • farming_gear.txt
    2.5 KB · Views: 100

hippymon

Member
Just posting the portions of the script for a friend.
 

Attachments

  • Acc1.ash
    4.9 KB · Views: 50
  • Acc2.ash
    4.9 KB · Views: 50
  • Acc3.ash
    4.9 KB · Views: 50
  • Familiar.ash
    1.9 KB · Views: 52
  • Hat.ash
    502 bytes · Views: 50
  • Off-hand.ash
    410 bytes · Views: 50
  • Pants.ash
    370 bytes · Views: 49
  • Shirt.ash
    478 bytes · Views: 62
  • Weapons.ash
    437 bytes · Views: 59
Top