outfit changing

Jt

Member
I just noticed this today running 5395.

Putting on Custom: camp...
You are already wearing "camp."

Is this new? Is there anything around it to check if you are wearing the outfit first? Or can it not be a failure condition?

Thanks,
JT
 
I was just coming to post about this as well. I'm seeing it in 11.9 release, and it is stopping my scripts that change between a base outfit and a +non-combat or +combat outfit.

Hola, is there any chance the code could be changed to not stop executing a script, since finding out you are already wearing what you want to be wearing is not really an error. Thanks for considering!
 

hippymon

Member
Well, I believe that it is not actually a problem with mafia but a message within KoL itself... But on any-hand it would be nice if there were some way to avoid this from auto-stopping/aborting mafia...;)
 

Veracity

Developer
Staff member
As always, if you "capture" the result of a function which would otherwise abort a script, you prevent the script from aborting. So, rather than simply saying "outfit( xxx )", you say "boolean result = outfit( xxx )".

I agree that changing to an outfit you are already wearing should not be an error, but you do have a workaround...
 

hippymon

Member
Well, I have tried:

if(!outfit("saved cloths"))
print("Good to go");

In version 11.8 this worked but then in 11.9 it still auto-aborted..
 

Veracity

Developer
Staff member
Does it still work with 11.8? My impression is that there was a server-side change; I am fairly certain that KoLmafia's outfit changing code did not change going from 11.8 to 11.9.
 

Veracity

Developer
Staff member
[quote author=hippymon link=topic=1382.msg6377#msg6377 date=1198096322]
Well, I have tried:

if(!outfit("saved cloths"))
   print("Good to go");

In version 11.8 this worked but then in 11.9 it still auto-aborted.[/quote]
You know, I really, really don't like wasting my time on bogus bug reports.

I made this script:

Code:
void main( string name )
{
        if ( !outfit( name ) )
            print("Already wearing?");
}
and got this result:

Putting on Custom: Rollover...
You are already wearing "Rollover."
Already wearing?
Precisely as I suggested, the new error message - which is generated by KoL, not by KoLmafia - can be captured by a script, which does not abort.

I did fix a bug: changing into Birthday Suit no longer generates an exception - so it was not a complete waste of my time, but, sheesh.
 
Veracity,

My problem is that my CLI/basic scripts abort, and your ASH workaround earlier in this thread makes my head spin. I'm not sure I understand the discussion above, with my limited ASH comprehension, but I see you added the following to today's daily build.
Code:
Revision: 5416
Author: veracity0
Date: 7:54:43 AM, Thursday, December 20, 2007
Message:
If KoL says you're already wearing the outfit you asked for, cool
----
Modified : /src/net/sourceforge/kolmafia/EquipmentRequest.java

Does your change mean that basic scripts will no longer abort on receipt of the new server-side message? If so, thanks much.

If not, I've figured out the workaround for basic non-ASH scripts. I'd manually add a change into a designated stinker outfit (or birthday suit) before every regular outfit change in my scripts. That's bad for server hits, though, so I'm happier if you've fixed the abort.
 

Veracity

Developer
Staff member
[quote author=Mighty Xerxes link=topic=1382.msg6392#msg6392 date=1198193381]
Does your change mean that basic scripts will no longer abort on receipt of the new server-side message?  If so, thanks much.[/quote]
Yes. KoLmafia detects the new message from the server and reports it to you, but doesn't consider it an error. No more abort.
 
Top