PDA

View Full Version : Crimbo 2010



mredge73
12-16-2010, 02:33 PM
Secret Hidden 2011 script!

Grotfang
12-16-2010, 02:41 PM
*sigh*

Fluxxdog
12-16-2010, 03:49 PM
I have a cleaner one if you like. Many less server hits and emulates exactly how I am fighting with 2 clicks:
void Crimbo2010(){
Print("Crimbo 2010, Wasting Adventures the Easy Way","blue");
if( !contains_text( visit_url( "mountains.php" ) , "crimbcohq.gif" ) ){
print( "I'm sorry, Crimbo2010 is currently closed!","red" );
return;}

int start_boredom_level(){
matcher Boredom=create_matcher("Boredom:</td><td><b><font color=blue>(\\d+)%", visit_url("charpane.php"));
if(Boredom.find()) return to_int(Boredom.group(1));
return 0;}

int total_boredom_level=start_boredom_level();
while( total_boredom_level < 50 && my_adventures()>0 ){
bbsaction();
string page_text = visit_url( "adventure.php?snarfblat=247" );
if( contains_text( page_text , "Combat" ) ){
buffer finale=visit_url("fight.php?action=macro&macrotext=use facsimile dictionary; repeat !pastround 9; attack; repeat");
matcher boredom_test=create_matcher("<td valign=center><b>Boredom \\+(\\d+)%", finale);
if(boredom_test.find()){
total_boredom_level+=to_int(boredom_test.group(1)) ;}
print("Boredom level:"+total_boredom_level);}
else if( contains_text( page_text , "choice.php" ) ) abort("Unknown Choice");}
print("Done!");}You hit once to check for the HQ, once to get your boredom level, then 2 per adventure (once to start the fight and once again to send the macro). Your boredom level is returned from the fight results page rather than reloading the charpane each time. I wouldn't recommend using this with a lanyard, but this'll let you stasis if you're going for anything else, like getting drops from Crowned familiars.

Right now, combat scripts can fail because monsters aren't in the system yet. SS makes mafia freak because it's asking for a "bad monster value".

A couple things to note. First, I set the adventures to 50 because I'm hitting tea to keep my boredom down (designated faxer). Second, the "bbsaction()" is from an imported script. Use your own or delete it as needed.

StDoodle
12-16-2010, 04:28 PM
*sigh*

x2

mredge73
12-16-2010, 04:29 PM
Good idea on parsing the fight page for boredom, cuts down on a few hits.
Too bad that you cannot use your CCS with this method, you have to hard code your fighting strategy.

mredge73
12-16-2010, 04:32 PM
I know that automating Crimbo automation is always a Grey area, some years it is not supported and others it is fully automated (2009).
Opinion is usually split down the middle on which way to go, can we discuss it on another thread?

Winterbay
12-16-2010, 04:33 PM
x2

Agreed.

Deathless Assassin
12-16-2010, 04:52 PM
Unless more copiers become available in the future I support strip farming Crimbo 100%

Grotfang
12-16-2010, 05:03 PM
I know that automating Crimbo automation is always a Grey area, some years it is not supported and others it is fully automated (2009).
Opinion is usually split down the middle on which way to go, can we discuss it on another thread?

Why not discuss it here so it is kept in one place? Your script allows the content to be fully automated. If you concede that opinion is usually split down the middle, releasing this script fairly conclusively declares opposition opinion to be worthless.

The existence of clan VIP content in the crimbo store means more multis will be used to enable clans to get the content without an individual having to sacrifice profit/items. Mafia facilitating that isn't helpful to its reputation -- we typically do things to reduce lag, not add to it.

StDoodle
12-16-2010, 05:17 PM
My interpretation only, but I've been given the impression that the deciding factor on whether or not KoLmafia would allow automation for holiday content had historically been based on 1) whether said content was limited to a given number of adventures per day by KoL itself and 2) Whether there was a serious potential for multi-abuse fueled acquisition (ie significant content that would help more than that account itself). In the past, my impression is that if a holiday didn't have #1 and did have #2, then KoLmafia would not support it, and the /devs of KoLmafia would not support publicly posting ways to automate it. So in my opinion, this particular holiday looks like one that shouldn't be automatable out-of-the-box or via public scripts.

mredge73
12-16-2010, 05:26 PM
Looks to be straight down the middle again.

Currently: 3 vs 3

Grotfang
12-16-2010, 05:31 PM
Looks to be straight down the middle again.

Currently: 3 vs 3

a) That's a crazy way of looking at it. Engage with what's said, please.
b) The only example of mafia supporting crimbo as far as I'm aware is last year, and StDoodle has already explained why that's a special case.
c) Even if it is exactly an even split, why should you then have the casting vote?

Note, please, that any discussion will always be related not to whether you as an individual should be able to automate -- of course that would be futile. Instead why should you post publicly on HOW to automate?

bumcheekcity
12-16-2010, 05:55 PM
For what it's worth, I have no problems with automating this in the slightest.

heeheehee
12-16-2010, 06:09 PM
Either way, it's not a matter of being able to automate vs. not being able to automate. Folks will be able to automate regardless. It's more of allowing the folks who wouldn't otherwise automate (i.e. due to inability to do so / unwillingness to script on own time). Isn't Crimbo lag bad enough as it is?

Theraze
12-16-2010, 06:11 PM
Personally I prefer cutting the time I'll spend down to 2-5 minutes instead of 30. If I'm going to do it regardless, running it faster is in my best interest, at least...

When it comes to making it easy in general, it all depends. I don't want to see posts from the area creators saying that we're making them depressed. That's a great time to pull all public copies of the script. Until then, it's a more fuzzy choice. I'd sort of like the backend stuff to be more supported (items added to the main daily build as soon as found, etc) and it to say out of the adventuring tab, to at least force a bit of automation work if you're going to do it.

Fluxxdog
12-16-2010, 06:19 PM
My $.02 for what it's worth. I look at it like sex education. Do you arm your kids with knowledge knowing that exposure to it may encourage them, or hope that they won't do it at all if you don't mention it? Myself, I'd rather say say "Here's a rubber so you don't screw up yours and some girl's life" than pray that my kid remains celibate until he's married.

The first script's been posted. Unless a mod deletes the posts (or the providers remove the posts themselves), it should fall to us to refine the scripts to minimize the impact. Scripting is gonna happen regardless, why not provide the best example we can? The one I provided (not counting bBS activity) needs at most 102 hits over a 50 adventure run or 202 hits over 100 adventures. If we can cut that down further, let's cut it down. (Honestly, I'm inclined to get rid of the first part that hunts for the HQ image. That's save 1 hit, but that's still 1 hit.)

Veracity
12-16-2010, 06:36 PM
For what it's worth, I've outright asked Jick if it is OK for me to submit the adventure zone. He's yet to respond to a kmail from me, so I am not sanguine about getting a response this time, either. However, Eleron has offered to ask him directly in /dev on my behalf, so perhaps I'll get an answer, by and by.

StDoodle
12-16-2010, 06:38 PM
Again, this is just my impression... but KoLmafia is not a democracy. If the public faces of KoLmafia say "this is how we do things," then, well.... that's how they're done. If you don't like it, as a BSD project, you're free to fork it. I'm not trying to say "I don't feel mafia should be able to automate Crimbo or be associated in any way with doing so," I'm saying "The devs seem to have made their opinion clear on the matter, and I'd like to respect it."

Fluxxdog
12-16-2010, 07:17 PM
If you don't like it, you're free to fork it.Heh, always found that statement funny. I blame Beavis and Butthead.

redwulf25_ci
12-16-2010, 07:21 PM
Either way, it's not a matter of being able to automate vs. not being able to automate. Folks will be able to automate regardless. It's more of allowing the folks who wouldn't otherwise automate (i.e. due to inability to do so / unwillingness to script on own time). Isn't Crimbo lag bad enough as it is?

As far as I've seen it's non-existent this year. Besides it's not like it take mafia to automate this. One could just as easily use click saver plus for Greasemonkey to adventure in crimbo town. I'm pretty sure it's easier to write mafia scripts in a manner that minimizes server hits than to do the same with click saver.

mredge73
12-16-2010, 07:37 PM
For : 5
Against : 3
Undecided : 3

Disclaimer:
A Mafia is not a democracy, the devs can make this thread disappear whenever they want.

twilightsun
12-16-2010, 07:38 PM
I, for one, suck at scripting. I would love to be able to automate Crimbo. Instead of sitting and manually clicking for an hour, I'd be done in minutes. That's better for the kingdom as a whole, getting people on and off faster, right? Alas, I can't get either of the scripts posted here to work for me. I hope Jick tells Veracity to go for it. My husband and son would prefer me not to be glued to my laptop clicking all night long. (I've already done it for quite some time today.) XD

bumcheekcity
12-16-2010, 07:41 PM
ash while (my_adventures() > 0) { visit_url("adventure.php?snarfblat=247"); run_combat(); }

Paste in the CLI. Laziest way of doing it.

Also, it's worth noting that Eleron's kolproxy scripts Crimbo.

twilightsun
12-16-2010, 07:50 PM
Have I told you lately that I love you?

I laughed heartily at all the new content this morning. I even IMed the combat text to my husband so he could chuckle at it from the office. But now? I just want my scrip. :-)

bumcheekcity
12-16-2010, 07:57 PM
Heh. I script whole ascensions, so I sympathise :D

EdFox
12-16-2010, 08:14 PM
I, for one, suck at scripting. I would love to be able to automate Crimbo. Instead of sitting and manually clicking for an hour, I'd be done in minutes. That's better for the kingdom as a whole, getting people on and off faster, right? Alas, I can't get either of the scripts posted here to work for me. I hope Jick tells Veracity to go for it. My husband and son would prefer me not to be glued to my laptop clicking all night long. (I've already done it for quite some time today.) XD

I also suck, but I do know enough to get the two scripts posted to work. Change the very first line to this:

void main(){

I really hope I'm not stepping on any toes here and that wasn't supposed to be obscured.

Theraze
12-16-2010, 08:26 PM
Yeah... as it stood, they posted it as it would be used as part of another script file. You'd import that file, then run the function.

But if you save it to its own file? rename function to main and it should run again.

Veracity
12-16-2010, 08:37 PM
Also, it's worth noting that Eleron's kolproxy scripts Crimbo.
This is, actually, worth noting.

Eleron was in my clan today, chatting. Somebody had already come up with and was distributing the adventures.txt and zonelist.txt overrides necessary for KoLmafia to automate the cubicles. Eleron made a point of telling us that kolproxy didn't require an update in order to automate the zone.

Eleron is on the dev team.

I asked him if Jick had commented on whether he cared about automating the zone. Eleron said "Jick has said nothing about it."

I'm going to submit it. If Jick responds to my note and asks me to disable it, I will comply, but I just might ask him about his opinion on kolproxy automation, if so.

huvanile
12-16-2010, 09:07 PM
I dunno if my opinion counts or not since I'm pretty new to both the forums and to mafia, but I also appreciate the ability to automate Crimbo. Before the scripts in this thread got me started down the right path to automating it, I was getting pretty bored with the clicking (and clicking and clicking). Thanks for the scripts people!

redwulf25_ci
12-16-2010, 09:40 PM
I have a cleaner one if you like. Many less server hits and emulates exactly how I am fighting with 2 clicks:
void Crimbo2010(){
Print("Crimbo 2010, Wasting Adventures the Easy Way","blue");
if( !contains_text( visit_url( "mountains.php" ) , "crimbcohq.gif" ) ){
print( "I'm sorry, Crimbo2010 is currently closed!","red" );
return;}

int start_boredom_level(){
matcher Boredom=create_matcher("Boredom:</td><td><b><font color=blue>(\\d+)%", visit_url("charpane.php"));
if(Boredom.find()) return to_int(Boredom.group(1));
return 0;}

int total_boredom_level=start_boredom_level();
while( total_boredom_level < 50 && my_adventures()>0 ){
bbsaction();
string page_text = visit_url( "adventure.php?snarfblat=247" );
if( contains_text( page_text , "Combat" ) ){
buffer finale=visit_url("fight.php?action=macro&macrotext=use facsimile dictionary; repeat !pastround 9; attack; repeat");
matcher boredom_test=create_matcher("<td valign=center><b>Boredom \\+(\\d+)%", finale);
if(boredom_test.find()){
total_boredom_level+=to_int(boredom_test.group(1)) ;}
print("Boredom level:"+total_boredom_level);}
else if( contains_text( page_text , "choice.php" ) ) abort("Unknown Choice");}
print("Done!");}You hit once to check for the HQ, once to get your boredom level, then 2 per adventure (once to start the fight and once again to send the macro). Your boredom level is returned from the fight results page rather than reloading the charpane each time. I wouldn't recommend using this with a lanyard, but this'll let you stasis if you're going for anything else, like getting drops from Crowned familiars.

Right now, combat scripts can fail because monsters aren't in the system yet. SS makes mafia freak because it's asking for a "bad monster value".

A couple things to note. First, I set the adventures to 50 because I'm hitting tea to keep my boredom down (designated faxer). Second, the "bbsaction()" is from an imported script. Use your own or delete it as needed.

This line:


buffer finale=visit_url("fight.php?action=macro&macrotext=use facsimile dictionary; repeat !pastround 9; attack;

is due to stasising with a stocking mimic to gain meat, correct? If I want it to instead attack immediately (due to using a Squamous Gibberer to generate more turns instead) I would I use


buffer finale=visit_url("fight.php?action=macro&macrotext=attack;

Correct?

(Some what moot as it looks like we're getting support for automating and I can just use my CCS but it will help me understand scripting better).

bumcheekcity
12-16-2010, 10:10 PM
This is, actually, worth noting.

Eleron was in my clan today, chatting. Somebody had already come up with and was distributing the adventures.txt and zonelist.txt overrides necessary for KoLmafia to automate the cubicles. Eleron made a point of telling us that kolproxy didn't require an update in order to automate the zone.

Eleron is on the dev team.

I asked him if Jick had commented on whether he cared about automating the zone. Eleron said "Jick has said nothing about it."

I'm going to submit it. If Jick responds to my note and asks me to disable it, I will comply, but I just might ask him about his opinion on kolproxy automation, if so.

Yeah, KolProxy doesn't have to be updated with zones and monsters. It will always be able to automate a zone without update, so Eleron would have to specifically DISable support for certain snarfblats, but old versions would still be able to automate.

That said, I'm no expert on it, and I have no idea how many people use Mafia and/or KoLProxy.

Fluxxdog
12-17-2010, 12:40 AM
This line:


buffer finale=visit_url("fight.php?action=macro&macrotext=use facsimile dictionary; repeat !pastround 9; attack;

is due to stasising with a stocking mimic to gain meat, correct?Partly. I also have a Crown of Thrones and am trying to get goodies to drop as well.
If I want it to instead attack immediately (due to using a Squamous Gibberer to generate more turns instead) I would I use


buffer finale=visit_url("fight.php?action=macro&macrotext=attack;

Correct?Actually, it should be more like:
buffer finale=visit_url("fight.php?action=macro&macrotext=attack; repeat;This way, it'll attack more than once, in case of fumble or you're not strong enough to take it out in one blow.

On a side note, this may be posted like this because the last repeat got snipped, but hope that helps you understand my madness ^^

redwulf25_ci
12-17-2010, 03:35 AM
Partly. I also have a Crown of Thrones and am trying to get goodies to drop as well.Actually, it should be more like:
buffer finale=visit_url("fight.php?action=macro&macrotext=attack; repeat;This way, it'll attack more than once, in case of fumble or you're not strong enough to take it out in one blow.

On a side note, this may be posted like this because the last repeat got snipped, but hope that helps you understand my madness ^^

Thanks.

mredge73
12-17-2010, 01:23 PM
For : 10
Against : 3
Undecided : 1

Disclaimer:
A Mafia is not a democracy, the devs can make this thread disappear whenever they want.

Theraze
12-17-2010, 01:31 PM
Counting is irrelevant at this point... maybe we stop rubbing people's faces in it?

Since the goal at this point is to make the automation as efficient for the servers as possible, here's what I'm currently using.
void Crimbo2010(){
Print("Crimbo 2010, Wasting Adventures the Easy Way","blue");
if( !contains_text( visit_url( "mountains.php" ) , "crimbcohq.gif" ) ){
print( "I'm sorry, Crimbo2010 is currently closed!","red" );
return;}
int start_boredom_level(){
matcher Boredom=create_matcher("Boredom:</td><td><b><font color=blue>(\\d+)%", visit_url("charpane.php"));
if(Boredom.find()) return to_int(Boredom.group(1));
return 0;}
int total_boredom_level=start_boredom_level();
while( total_boredom_level < 50 && my_adventures()>0 ){
adventure(1, $location[CRIMBCO cubicles]);
total_boredom_level=start_boredom_level();
print("Boredom level: "+total_boredom_level);}
print("Done!");}This adventures up to 50 boredom, then stops, so I can decide if I want to run another 50/51 adventures for a BGE form, drink 2 workytime teas and run the script again, or whatever... What I like about this is that, since it uses my normal BBS and CCS and CCS (interesting that both Custom Combat and Counter Checker fall under those. Well, interesting to me, at least.) and I won't end up missing out on more semi-rares than I absolutely have to...

mredge73
12-17-2010, 01:44 PM
Remember, I was attacked first and this is my thread.
I am not interested in fighting or arguing, but I want to keep counting so I will do so.
I actually thought it would have evened out by now instead of being fully supported.

I am sure we will do this again next year. Merry Crimbo!

Veracity
12-17-2010, 03:08 PM
I am not interested in fighting or arguing, but I want to keep counting so I will do so.
This is called "attitude". This whole thread has oozed attitude. I was not happy when it appeared, have not been impressed with your "counting", and am now completely pissed off that you persist in it.

You know something? I can solve it for myself. Welcome to my ignore list.

Rinn
12-17-2010, 07:19 PM
Here's the ash script to buy from the gift shop as mafia won't acquire from coinmasters I guess? Is that a bug? Should there be a command to trade in? I'm pretty sure you can't automate trading in during wossname either without visit_url.



void BuyGift(item i, int num)
{
visit_url("crimbo10.php?pwd=&action=buygift&whichitem="+to_int(i)+"&howmany="+num);
}

void BuySSGift(item i, int num)
{
visit_url("crimbo10.php?pwd=&action=buyssgift&whichitem="+to_int(i)+"&howmany="+num);
}


Also you need to check for boredom two ways to account for either the full or compact charpane


// Full
matcher Boredom=create_matcher("Boredom:</td><td><b><font color=blue>(\\d+)%", visit_url("charpane.php"));
// Compact
matcher Boredom=create_matcher("Bored:</td><td aligh=left><b><font color=blue>(\\d+)%", visit_url("charpane.php"));

Fluxxdog
12-17-2010, 10:11 PM
Counting is irrelevant at this point... maybe we stop rubbing people's faces in it?Ya think? My biggest gripe is where I was counted. I should have been undecided. But that's not important.
Since the goal at this point is to make the automation as efficient for the servers as possible, here's what I'm currently using.
adventure(1, $location[CRIMBCO cubicles]);
total_boredom_level=start_boredom_level();The reason I checked the fight page to add to boredom was so it wouldn't keep hitting charpane.php over and over again. This adds an extra hit similar to the original.

Another reason I imported the bBS that I used and called it as a function is an oddity I noticed of late. It seems that between each battle, naturally ^^, there's a large delay from loading in my bBS. This is because my bBS is probably very large and imports about 10 different scripts. But with the version of this I put up, it never leaves memory. The script ran viciously faster. Just wish I could do that for all my adventuring, though scripts that I'm fully automating is going to have a "fight,choice,or otherwise" function. So hey! Merry Crimbo to me! I learned something and got a nice idea ^^

Theraze
12-17-2010, 10:39 PM
Yeah... if my CC would run with the fast version, I'd be happy using that. Losing semirares though because I forgot to stop the script at the right spot meant missing out on a couple of lunchboxes, which just feels sad.

And yes, if I could get the fight code into the buffer, I would... but adventure returns a boolean, as does adv1. If I were 100% certain I'd never lose a fight, I could just increment automatically as I go, but...

Fluxxdog
12-18-2010, 01:00 AM
Fair enough. I'm farming scrips for my clan so we can get a fax machine (optimal or not be damned!) and forsaking semirares. So my play style is going to be violently different from yours.

huvanile
12-18-2010, 07:33 PM
Speaking of Crimbo 2010 stuff: I'm trying to use the Lunch Break skill into my breakfast scripts through the following code:



use_skill(1,$skill[Lunch Break]);


I'm getting the error, "Bad skill value: "Lunch Break" (sandbox.ash, line 1)". Any ideas?

(Didn't know where else to post this we can move it if necessary)

lostcalpolydude
12-18-2010, 08:43 PM
Speaking of Crimbo 2010 stuff: I'm trying to use the Lunch Break skill into my breakfast scripts through the following code:



use_skill(1,$skill[Lunch Break]);


I'm getting the error, "Bad skill value: "Lunch Break" (sandbox.ash, line 1)". Any ideas?

(Didn't know where else to post this we can move it if necessary)

It's recognized in 8833. You must have an old version.

huvanile
12-18-2010, 10:55 PM
Hmm... Not sure what 8833 references (sorry); I'm running KoLmafia v14.3, released on October 19 2010 (latest stable release on sourceForge site). Is there a separate library or file or something I should manually update? Thanks for the help.

charred
12-18-2010, 10:57 PM
adding my 2 cents also. i full support automation of crimbo. i went through the zone once and checked everything out and laughed at all the hilarity and loved it. but now its on to scrip farming business and it saves me real life time. i already edited my adventures and zonelist a couple days ago. ive just been doing it very rudamentary today.
ive just been typing in the gcli
adventure 50 crimbco cubicles
then after the 50 advs
use workytime tea; adventure 25 crimbco cubicles
and repeating that until im done
yeah it sucks real bad compared to the scripts here, but being such a short time period im fine with crappy :) it works for me

charred
12-18-2010, 10:59 PM
Hmm... Not sure what 8833 references (sorry); I'm running KoLmafia v14.3, released on October 19 2010 (latest stable release on sourceForge site). Is there a separate library or file or something I should manually update? Thanks for the help.

theyre talking about the daily builds
http://builds.kolmafia.us/

Theraze
12-18-2010, 11:25 PM
Slight tweaks to my adventure script. Wanted it to be less nasty server-wise, so using this to clean it up a bit.
void Crimbco2010(){
Print("Crimbo 2010, Wasting Adventures the Easy Way","blue");
if( !contains_text( visit_url( "mountains.php" ) , "crimbcohq.gif" ) ){
print( "I'm sorry, Crimbo2010 is currently closed!","red" );
return;}
int start_boredom_level(){
matcher Boredom=create_matcher("Boredom:</td><td><b><font color=blue>(\\d+)%", visit_url("charpane.php"));
if(Boredom.find()) return to_int(Boredom.group(1));
return 0;}
int total_boredom_level=start_boredom_level();
print("Starting Boredom level: "+total_boredom_level);
while( total_boredom_level < 50 && my_adventures()>0 ){
(!adventure(1, $location[CRIMBCO cubicles]));
if (have_effect($effect[beaten up]) > 0) cli_execute ("uneffect beaten up");
else total_boredom_level += 1;
print("Boredom level: "+total_boredom_level);}
print("Done!");}

Basically, it checks the charpane the first time, displays boredom level from that, and then runs up to 50 boredom if not there yet. If beaten up, try to uneffect it. If not, we won, so increment boredom count. Since it only runs up to 50, I don't need to worry about if I want to Workytime or not, and whether or not I win the BGE and so need to subtract 50 boredom.

Since BGE items got released, I think my current run will be running the script to check boredom, then after the adventures finish (if need be), run the rest of adventures. Maybe run the script again after, to do a 1-page hit to check boredom... less server impact then actually loading the relay browser and having it load 4 panes.

Ferdawoon
12-19-2010, 01:22 AM
Hmm... Not sure what 8833 references (sorry); I'm running KoLmafia v14.3, released on October 19 2010 (latest stable release on sourceForge site). Is there a separate library or file or something I should manually update? Thanks for the help.

I recommend getting the exe file from here: http://kolmafia.us/showthread.php?2856-Automatically-download-the-newest-daily-build
That is what I have stickied to my actionbar, so that whenever I start Mafia using that shortcut it check for a more recent version, download it and then start it.

bordemstirs
12-19-2010, 01:27 AM
After quite a bit of reading and experience with this Crimbo, I feel it's pretty safe to suggest that automation is no longer a huge issue. Lag seems to be all but nonexistent, and as for my reasons against automation (i.e. not enjoying the actual content) it generally takes a day for mafia to catch up, and players will have time to experience a chunk of it before automation becomes possible (for mafia, that is. I have nothing to say in regards to other techniques)
I'd still like it if there was maybe a week before it was implemented for the masses, though, so that the common player is more likely to read the actual adventure text (remember why you started playing KoL? This shit is hilarious.)
Jick seems rather apathetic about it all, and that's not necessarily a good sign for either argument.

That said and done, there is still a flaw with this:

For : 10
Against : 3
Undecided : 1

You assume that each person should have equal say in this... what is this? Debate? Decision? Whatever. And that's just not true. I'm not one to judge who's opinion is worth more or less, but I can say that they are not equal.

slyz
12-19-2010, 04:03 AM
If beaten up, try to uneffect it. If not, we won, so increment boredom count.
Couldn't Beaten Up be removed by your auto-restore settings at the end of adventure()? I think auto-restore runs before adventuring though, so it's probably not a problem.

Another solution would be to parse the last combat page, returned by run_combat() without any additional server hit.

Theraze
12-19-2010, 05:05 AM
Just do buffer page = run_combat(); and then check that?

slyz
12-19-2010, 05:34 AM
Yup (http://wiki.kolmafia.us/index.php?title=Run_combat).

Theraze
12-19-2010, 05:43 AM
So, tomorrow I try this:
void main(){
Print("Crimbo 2010, Wasting Adventures the Easy Way","blue");
if( !contains_text( visit_url( "mountains.php" ) , "crimbcohq.gif" ) ){
print( "I'm sorry, Crimbo2010 is currently closed!","red" );
return;}
int start_boredom_level(){
matcher Boredom=create_matcher("Boredom:</td><td><b><font color=blue>(\\d+)%", visit_url("charpane.php"));
if(Boredom.find()) return to_int(Boredom.group(1));
return 0;}
int total_boredom_level=start_boredom_level();
print("Starting Boredom level: "+total_boredom_level);
while( total_boredom_level < 50 && my_adventures()>0 ){
adventure(1, $location[CRIMBCO cubicles]);
buffer finale=run_combat();
matcher boredom_test=create_matcher("<td valign=center><b>Boredom \\+(\\d+)%", finale);
if(boredom_test.find()){
total_boredom_level+=to_int(boredom_test.group(1)) ;}
print("Boredom level: "+total_boredom_level);}
print("Done!");}

slyz
12-19-2010, 09:56 AM
I could test it today, and everything seemed to work. Here are the functions I use (the matcher accounts for the -50% boredom from the BGE, but I only tested this with a specific string, not with the actual BGE combat page):


int boredom_level()
{
buffer charpane = visit_url( "charpane.php" );

// Full
matcher Boredom = create_matcher( "Boredom:</td><td><b><font color=blue>(\\d+)%", charpane );
if( Boredom.find() ) return Boredom.group( 1 ).to_int();

// Compact
matcher Bored = create_matcher("Bored:</td><td aligh=left><b><font color=blue>(\\d+)%", charpane );
if( Bored.find() ) return Bored.group( 1 ).to_int();

return 0;
}

int boredom_inc( string page )
{
matcher bored_inc = create_matcher( "<td valign=center><b>Boredom (\\+|-)(\\d+)%", page );
if( bored_inc.find() )
{
int fac = 1;
if( bored_inc.group( 1 ) == "-" ) fac = -1;
return fac * bored_inc.group( 2 ).to_int();
}

return 0;
}

and I simply use boredom_inc() like this:


adventure( 1, $location[CRIMBCO cubicles] );
total_boredom_level += boredom_inc( run_combat() );

Theraze
12-19-2010, 03:11 PM
Spiffy. Put both of those in there, so now it should work for compact pane or full, and properly -50 at BGE. If I let it. :) I'm still stopping at 50 on the script for now, but eventually will probably change that up. Speaking of which, I should really be running these adventures against my trackitems alias, so I can just get my scrip/form count at the end without needing to switch back to the adventure tab. Heh.

That FN Ninja
12-19-2010, 03:23 PM
I think heeheehee already adjusted Zarqon's matcher to work for both full and compact:

Also, to work for weirdos who have the compact charpane, the regex input string should be "Bored.+?(\\d+)%". :D

slyz
12-19-2010, 04:00 PM
I went back a few pages in the thread but skipped heeheehee's regex. Fixed:


int boredom_level()
{
matcher Boredom = create_matcher( "Bored.+?(\\d+)%", visit_url( "charpane.php" ) );
if( Boredom.find() ) return Boredom.group( 1 ).to_int();
return 0;
}

Bale
12-20-2010, 05:16 AM
Can anyone help me with the code to turn in crimbco scrip at the gift store. I have this, but it doesn't seem to work:


void crimbo_gift(item doodad, item q) {
visit_url("crimbo10.php?action=buygift&pwd&whichitem="+to_item(doodad)+"&howmany="+q);
}

What should that be?

Veracity
12-20-2010, 05:18 AM
Should we have "coinmaster buy" and "coinmaster sell" commands, or something of the sort, to obviate visit_url to do the same thing?

Bale
12-20-2010, 05:27 AM
I think that would be a good feature for KoL.

slyz
12-20-2010, 05:30 AM
I think you need to change to_item(doodad) to to_int(to_item(doodad)). Doing this worked for me:


> ashq visit_url("crimbo10.php?place=giftshop&pwd&action=buygift&whichitem=4856&howmany=1");

You acquire an item: paperclip
You spent 5 CRIMBCO scrip

Bale
12-20-2010, 05:37 AM
Oh ick. Yeah, I used to_int() like that in an earlier version of this before I screwed it up and posted. :(

Fortunately you found my error. I missed place=giftshop

slyz
12-20-2010, 05:46 AM
> ashq visit_url("crimbo10.php?pwd&action=buygift&whichitem=4856&howmany=1");

You acquire an item: paperclip
You spent 5 CRIMBCO scrip

the "place=giftshop" isn't needed though.

Bale
12-20-2010, 05:47 AM
Hah? Then I must have made a different error when I wasn't making this error? I must be muzzy-headed. Long Sunday.

mredge73
12-20-2010, 03:53 PM
Update to my original script.
Nothing really new, uses Slyz's adventure method and is now a stand alone script that will adventure to a specified maximum boredom level.



int boredom_level()
{
buffer charpane = visit_url( "charpane.php" );
// Full
matcher Boredom = create_matcher( "Boredom:</td><td><b><font color=blue>(\\d+)%", charpane );
if( Boredom.find() ) return Boredom.group( 1 ).to_int();
// Compact
matcher Bored = create_matcher("Bored:</td><td aligh=left><b><font color=blue>(\\d+)%", charpane );
if( Bored.find() ) return Bored.group( 1 ).to_int();
return 0;
}
int boredom_inc( string page )
{
if( contains_text( page , "choice.php" ) )Abort("Unknown Choice");
matcher bored_inc = create_matcher( "<td valign=center><b>Boredom (\\+|-)(\\d+)%", page );
if( bored_inc.find() )
{
int fac = 1;
if( bored_inc.group( 1 ) == "-" ) fac = -1;
return fac * bored_inc.group( 2 ).to_int();
}
return 0;
}

void main(int maxBoredom)
{
if( !contains_text( visit_url( "mountains.php" ) , "crimbcohq.gif" ) )
{
print( "I'm sorry, Crimbo2010 is currently closed!","red" );
return;
}
Print("Crimbo 2010, Wasteing Adventures the Easy Way","blue");
int B = boredom_level();
int S=item_amount($item[CRIMBCO scrip]);
int A= my_adventures();
print("Starting Boredom: "+B+"%","blue");

while( B < maxBoredom && my_adventures()!=0 )
{
adventure(1, $location[CRIMBCO cubicles]);
B += boredom_inc( run_combat() );
print("Boredom: "+B+"%","olive");
}
S=(item_amount($item[CRIMBCO scrip])-S);
A=(A- my_adventures());
print("");
print("Finish Boredom: "+B+"%","red");
print("You gained "+S+" script using "+A+" adventures.","blue");
if(A==0) A=1;
print("SPA: "+(S/A),"green");
print("Current Crimbco Scrip: "+item_amount($item[CRIMBCO scrip]),"green");
}

slyz
12-20-2010, 05:13 PM
Here is a little more compact boredom_level() (http://kolmafia.us/showthread.php?5499-Crimbo-2010&p=40402&viewfull=1#post40402) function, with Heeheehee's regex.

LARRYT3HCABLEGU
12-22-2010, 02:21 AM
@mredge73 u need to add something to check for the adventure Uh Ohh! if you dont it will fail and make you manually adventure there ...

i did this:


while( B < maxBoredom && my_adventures()!=0 )
{
if(contains_text(visit_url("adventure.php?snarfblat=247"),"As you're headed to the cubicles, you're nearly deafened by a blaring announcement from the loudspeaker."))
{
visit_url("crimbo10.php?place=office");
}
adventure(1, $location[CRIMBCO cubicles]);
B += boredom_inc( run_combat() );
print("Boredom: "+B+"%","olive");
}


and it worked out great... if anyone knows an easier method please share

Theraze
12-22-2010, 02:28 AM
None of those adventures and needed visits to Mr. Mination have been detected for as yet, including the initial triggering. Not having these in helps to present that mafia isn't being used to skip the content, just speed up the automated part.

Though a suggestion for the edge script? Change my_adventures() != 0 to my_adventures() > 0. If you have less than 0 adventures due to some sort of bug or server lag or the like, you don't want to get into an infinite loop.

LARRYT3HCABLEGU
12-22-2010, 02:42 AM
None of those adventures and needed visits to Mr. Mination have been detected for as yet, including the initial triggering. Not having these in helps to present that mafia isn't being used to skip the content, just speed up the automated part.


hmm i see... i just thoguht it would help those with more than one account that cant be bothered with it... i have 2 accounts myself that i currently use and i dont like to read (or see ) something twice (or have mafia tell me to go visit someone and have to load the mini- or relay-browser and click on his office, gets annoying when i just wanna get my scrip, do my bounties, and spend the rest of the day in the chat lol)
hope its not to much of a bother though... if need be ill take it off...

Theraze
12-22-2010, 02:57 AM
I've run more than that. After the first one gets into a loop though, you cancel out of the script, click on the cubicles, get the message, go to Mination, run manual adventures until you see the new monster(s), and go back to the script. Then further players will just log in, click on cubicle, click on Mination, and run the script. Total delay for a new character? ~10 seconds. And nothing says you have to READ what's on the screen. Though I do suggest doing it the first time. It's good stuff. Especially the dictated messages. :)

mredge73
12-22-2010, 03:04 AM
I thought that my line:
if( contains_text( page , "choice.php" ) )Abort("Unknown Choice");
Would have caught that issue but I didn't test it. It may catch any unknown choices, but I am not sure.

Theraze
12-22-2010, 06:00 AM
It would have... if it were a choice adventure. If you notice, his is just matching on the text, which is why it captures it.

A fix would be verifying that adventures is actually going down. If you try to run an adventure and it doesn't decrement, you could break out of the automation...

Fluxxdog
12-22-2010, 07:04 AM
if( !contains_text( page , "<b>Combat!</b>" ) )Abort("Unknown Encounter");That should fit the bill nicely. Anything non-combat will cause a halt. Especially if we get more surprises. Which we almost undoubtedly will.

tgetgel
12-24-2010, 07:32 PM
... i have 2 accounts myself...With my own accounts and those that I am sitting for my college kids, I am running 12 accounts. Automation rocks! I am in favor of it. Play through it all to read the content once, then let them run.

icon315
12-24-2010, 10:04 PM
i don't do anything with my extra accounts, they just sit there, but by "all" i mean one.

relyk
12-28-2010, 11:23 AM
Using this works fine for me, since i'm not concerned with BGE forms and can just buy the tea manually. From what i've read, is it hard/bad on the server to check boredom every adventure?



void main()
{
int B = 999;
while( my_adventures() != 0 ){
matcher Boredom=create_matcher("Boredom:</td><td><b><font color=blue>(\\d+)%", visit_url("charpane.php"));
if(Boredom.find())B =Boredom.group(1).to_int();
print(" You currently have "+B+"% boredom.");

if( B >= 25){
cli_execute("use Workytime Tea");
}

visit_url( "adventure.php?snarfblat=247" );
run_combat();
}
}

slyz
12-28-2010, 12:26 PM
You don't need to check for charpane.php before each adventure, see this post (http://kolmafia.us/showthread.php?5499-Crimbo-2010&p=40474&viewfull=1#post40474).

Ferdawoon
12-30-2010, 04:44 AM
Maybe it is just me, but I set my Maximize Mainstat outfit, go for the CRIMBCO lanyard (or whatever it is called) and set Mafia to do 50 adv in the cubilces, use 2 tea, 50 more adv, 2 tea, and so on, with a custom combat setting to Olfaction the conference calls.
Sure, using mafia to burn 50 in a go is automation, but I dont see why you need a script to see your boredom level :o
If I was any good at scripting though I would probably write my own script to do the equipping, adventuring and tea drinking by itself. But, it is not like it is troublesome to do it manually.

Veracity
12-30-2010, 06:00 AM
I do that too.

StDoodle
12-30-2010, 01:37 PM
I do 25 adv. at a time, but basically the same.