This one doesn't work as I am a practical example. I play ronin characters "before midnight" and ronin clear characters after. This breaks the logic as a character may be on before rollover one day, and after, on the next/same date, while on a different KoL day. This makes the date vague when rollover happens when you're awake in your timezone. Planting mushrooms also requires similar logic, and I really don't want to reinvent the wheel... As for the rest of the suggestions, they were already in the code.
morgad's issue is very intriguing as nothing's changed in the code since its introduction, and he didn't seem to recognize or comment on the possible scenarios where his issue can be noticed. So, I'd like to specifically state the code from clanLoungeRequest.java:
Code:
if ( action == null )
{
if ( responseText.indexOf( "tree5.gif" ) != -1 )
{
Preferences.setInteger( "crimboTreeDays", 0 );
RequestLogger.printLine( "You have a present under the Crimbo tree in your clan's VIP lounge!" );
}
else if( responseText.indexOf( "crimbotree" ) != -1 )
{
Preferences.setBoolean( "_crimboTree", true );
ClanLoungeRequest request = new ClanLoungeRequest( ClanLoungeRequest.CRIMBO_TREE );
request.run();
}
else if( responseText.indexOf( "crimbotree" ) == -1 )
{
Preferences.setBoolean( "_crimboTree", false );
}
return;
}
Basically, WHENEVER there is a visit the VIP lounge by you or mafia's breakfast routine, this information has a chance to get updated for all lounge equipment. If you breakfast in a clan without a crimbo tree, it can't do this until you "visit" the VIP lounge in a clan that has one. Otherwise, it can only display the "days" it learned on your previous visit. Additionally, if you set mafia to not do anything in the VIP lounge with a crimbo tree during breakfast, this information will not get updated. There is no code to countdown your days left as it is possible to be logged off for more than your remaining days and it would also be inaccurate. The only way to really solve it was to make the crimbotree command update the data whenever it found a crimbo tree. Switching clans doesn't cause mafia to recheck clan or lounge equipment, the crimbotree command without the "get" option is only an alias to display the crimboTreeDays variable, not to check the tree.
Bale's script is easily fixed with a premptive visit_url("clan_viplounge.php");
My working assumption was thus: if you have access to the VIP lounge, you'd do something in there during breakfast, which should cause the equipment to get scanned initially. The crimboTreeDays number would update at that time.
This was a far from graceful solution for folks who do breakfast in 100% scripted ways, but what can you do with on-demand based programming vs desire to limit the login routine to bare minimum, global timezones, daylight savings and general timezone configuration illiteracy and my desire to play characters in and out of ronin while balancing the desire to keep server hits to a minimum? Honestly, this is only my second real unique addition to mafia's java code.
The logical desire is to use the KoL date. Which doesn't have a readily available year and causes problems when you're something like 95-102 days away from that's mafia's last usage by that character (like on my non-main PC where I only play KoL on rare occasion). So, until there's a better solution, you can use the visit_url("clan_viplounge.php"); in your ASH scripts before your crimbotree command to guarantee results.