Saving your outfit

darius180

Member
Is there still a function for saving your current outfit, for easy switching into one outfit and back? I'm looking for something that would save my outfit, so i can switch into rollover cloths - then with my breakfast script, I would be switched back. Anyone have input, or scripts that would do this? I've found that the intrinsic CLI "checkpoint" command seems to not do anything in the last several versions. Anyways, thanks for all y'all's input in advance!
 
Sounds like for your purposes you should just manually create a custom outfit for rollover, and another for daily adventuring and use the outfit command to switch between them.
 

darius180

Member
See, i guess that would work - but I had hoped for more robustness. I already have a script to decide the optimal rollover outfit, but I'd liek to reliably re-equip the outfit I had on the night before....
 

holatuwol

Developer
Checkpoint's always worked. It just never prints a message since the checkpoint is stored locally rather than on the KoL servers.
 

macman104

Member
[quote author=holatuwol link=topic=834.msg4057#msg4057 date=1175755894]
Checkpoint's always worked. It just never prints a message since the checkpoint is stored locally rather than on the KoL servers.[/quote]My mistake then, carry on :)
 

darius180

Member
Wait, it's stored locally? Does that mean that if I close mafia and reopen it, the checkpoint value for that character will be saved?
 

darius180

Member
Well shoot. Is there a way I could make it persist between sessions?

Clearly i need to be more specific in my askings though - my bad. I keep on falling into the trap of assuming everyone already knows what I'm thinking. Smart, huh?
 

darius180

Member
I'm not exactly sure how I'd use that though... I thought I had to do some type of text manipulation thing (I forgot the word - it might be parse).


EDIT: Off topic random question - is there a way to check whether the hermit has any clovers and/or how many?
 
see also string url_encode( string text ) on that same page (in case your outfit name has spaces or other such characters.) the url is inv_equip.php?which=2&action=customoutfit&outfitname= just add the name of your outfit onto the end of the url. You need not do anything with the return of the visit_url command unless you want to test for success.

Clovers? Answer is in another thread where a user wanted to ask chatbot if the hermit has clovers today.

[quote author=efilnikufecin link=topic=704.msg3315#msg3315 date=1168722745]
No need asking chatbot.
You must have a worthless item and access to the hermit via hermit permit or quest completion.

Code:
int kiss_clovers_in_stock()
{
string source = visit_url("hermit.php");
if(contains_text(source, "(1 left in stock for today)")){return 1;}
if(contains_text(source, "(2 left in stock for today)")){return 2;}
if(contains_text(source, "(3 left in stock for today)")){return 3;}
if(contains_text(source, "(4 left in stock for today)")){return 4;}
if(contains_text(source, "(5 left in stock for today)")){return 5;}
if(contains_text(source, "(6 left in stock for today)")){return 6;}
return 0;
}

it's called kiss_clovers_in_stock as a reminder to me. Instead of trying to read the number from the source and return it, this is much simpler. Kiss means "keep it simple stupid"

Fixed an omission in the script function
[/quote]

There are several complete scripts (written by others) which completely handle obtaining of clovers, and several of them use the above function. Some of them are optimized for hardcore, some for the meager budget, and some to accomplish the task in as few server hits as possible with lack of concern for excess purchasing (works on the theory that if I don't use it all today, I will tomorrow or the next day).
 

darius180

Member
OK, I've used that clover script + a while loop, and it looks to fix my problems (at least it did today, I'll have to see still. My programming kung fu is weak).

OK, so if I wanted to save an outfit call say, Cloths, the line would be something to the effect of:

Visit_url("inv_equip.php?which=2&action=customoutfit&outfitname=Cloths")
Do I need the quotes? I might be thinking about straight up java, so I could be wrong. And confirming, this would be how I would *save* the outfit, not load it (I figured I'd ask, since I can;t really tell from the URL). And if this is true then, could I just use the CLI command to change outfits to change back to the outfit Cloths, or would it be better achieved via another Visit_url()?

Thanks all y'all!
 
[quote author=darius180 link=topic=834.msg4219#msg4219 date=1176913367]
OK, I've used that clover script + a while loop, and it looks to fix my problems (at least it did today, I'll have to see still. My programming kung fu is weak).

OK, so if I wanted to save an outfit call say, Cloths, the line would be something to the effect of:

Visit_url("inv_equip.php?which=2&action=customoutfit&outfitname=Cloths")
[/quote]

That appears to be correct.

[quote author=darius180 link=topic=834.msg4219#msg4219 date=1176913367]
Do I need the quotes?
[/quote]

Yes.

[quote author=darius180 link=topic=834.msg4219#msg4219 date=1176913367]
I might be thinking about straight up java, so I could be wrong. And confirming, this would be how I would *save* the outfit, not load it (I figured I'd ask, since I can;t really tell from the URL). And if this is true then, could I just use the CLI command to change outfits to change back to the outfit Cloths, or would it be better achieved via another Visit_url()?
[/quote]

That is the valid URL for saving the outfit, not equipping the outfit. Kol uses a number instead of a name in the url for equipping the outfit.

Once the outfit is saved, use kolmafia's built in outfit switching methods. Whenever kolmafia has a built in method of doing what you want done it is always better to use that method unless the method doesn't handle a special situation correctly.
 

darius180

Member
Great! Thank y'all very much! I guess my script suite is just about ready to go!

EDIT: It's now up in here, in the between battle section I believe.
 
Top