PDA

View Full Version : Best farming outfit script.



hippymon
09-03-2007, 07:42 PM
I made this script here... Simply designed to equip items that are good for farming... Not going to call it the best, because I am sure some people may disagree, it is favors neither item nor meat farming, it just equips item by there % according to http://kol.coldfront.net/thekolwiki/index.php/Meat_from_Monsters AND http://kol.coldfront.net/thekolwiki/index.php/Items_from_Monsters .

izchak
09-03-2007, 08:09 PM
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]);
}


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]);
}


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
09-03-2007, 08:37 PM
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
09-03-2007, 09:05 PM
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!

hippymon
10-20-2007, 08:10 PM
Just posting the portions of the script for a friend.