PDA

View Full Version : StDoodle's Custom Daily Deeds



StDoodle
02-06-2010, 04:09 AM
CustomDaily 2.3

Attention: README

The bump to version 2.3 is to bring to your attention the fact that this version is not only unsupported, but could conceivably produce undesirable results. While this isn't likely, I'm removing this script at this point and instead suggesting all users try the newer Relay Version (http://kolmafia.us/showthread.php?4812).

If you absolutely, positively prefer using your current version, please edit the script's version to 2.3 and enjoy.

lostcalpolydude
02-06-2010, 04:24 AM
The name you're after is Zarqon. I'll have to give this a try once it's uploaded. I've actually been editing the daily deeds file to add and remove stuff as I see fit (especially for things like astral mushrooms when I have no badger), so this seems like a nice script.

StDoodle
02-06-2010, 04:31 AM
The name you're after is Zarqon.

I have no idea what you're talking about... ;)



I'll have to give this a try once it's uploaded. I've actually been editing the daily deeds file to add and remove stuff as I see fit (especially for things like astral mushrooms when I have no badger), so this seems like a nice script.

Glad to hear! It may be a while; I have unpredictable fits & spurts of free time; I'm really hoping it will be ready for testing within 48 hours, though. (Also, I sux at teh coding, which slows things down.)

lostcalpolydude
02-11-2010, 03:07 AM
In the relay override script, the include has ../scripts/. Is that actually needed, or will it just cause problems for someone that wants to put the script in a subdirectory in the scripts folder?

StDoodle
02-11-2010, 07:27 PM
Nope, guess that wasn't needed after all, thanks for the heads up. Change made.

Kirkpatrick
02-12-2010, 03:18 PM
Looking good, StD!

Minor bug report in the current version: I can't seem to get the Boulder's rays listed the way I'm setting them up. Picking:
"yes yes no" for shows all three.
"no yes no" shows red and blue.
"no no yes" shows none of them.
"yes no yes" shows just the yellow.

I'm choosing "yes" for all the other familiar options. Running r8089 though, if that's an issue. More poking can easily be done if requested, when I'm not dead tired!

StDoodle
02-12-2010, 03:28 PM
Looking good, StD!

Minor bug report in the current version: I can't seem to get the Boulder's rays listed the way I'm setting them up.

Yup, bug; the values were being set correctly, but the reporting function had the wrong numbers for 2 of 4 blue-ray combos. Should be fixed in v1.0 (to be uploaded shortly).

Kirkpatrick
02-12-2010, 03:58 PM
Looks fixed after brief checking!

mredge73
02-13-2010, 02:58 AM
What does your script do?
There is no description above.

heeheehee
02-13-2010, 06:32 AM
Gotta love the CHEAT option. Although... [I suppose you could add a few lines to figure out the actual autosell value of the player's entire inventory... make it seem a bit more realistic, y'know?]

StDoodle
02-13-2010, 06:43 AM
Gotta love the CHEAT option. Although... [I suppose you could add a few lines to figure out the actual autosell value of the player's entire inventory... make it seem a bit more realistic, y'know?]

Yeah, that thing already takes up far more code than it should... that's what happens when you go too long without sleep and discuss your project in /clan. ;)

heeheehee
02-13-2010, 06:48 AM
I got bored. Heh.


int[item] invent = get_inventory();
record autosell{
item it;
string a;
string b;
int sell;
};
autosell[item] trade;
file_to_map("tradeitems.txt",trade);
int tot=0;
foreach i in invent{tot=tot+trade[i].sell*invent[i];}

That yields tot, which is the total autosell value of your inventory. Have fun! xD

StDoodle
02-13-2010, 10:41 PM
That yields tot, which is the total autosell value of your inventory. Have fun! xD

Except that, near as I can tell (and I tried a clean install of KoLmafia to check, in case my settings were borked), "tradeitems.txt" doesn't exist by default. I'm kind of hesitant to make an additional data file a script requirement just for added detail on a joke easter egg.

But the thought is appreciated!

heeheehee
02-13-2010, 10:51 PM
You can get it through cli_execute("update data").

jasonharper
02-13-2010, 11:08 PM
It's possible that KoLmafia is now at a point where that's merely useless advice, rather than outright dangerous...

You don't need an explicit copy of tradeitems.txt to be able to read it into a map, because it's one of the built-in data files. You don't need to read it into a map in the first place, because there's an autosell_price(item) function already.

StDoodle
02-13-2010, 11:17 PM
It's possible that KoLmafia is now at a point where that's merely useless advice, rather than outright dangerous...

Which was why I was, to say the least, "hesitant" to add that to my script. ;)


You don't need an explicit copy of tradeitems.txt to be able to read it into a map, because it's one of the built-in data files. You don't need to read it into a map in the first place, because there's an autosell_price(item) function already.

For future reference, is there a list anywhere of such files which can be imported via file_to_map() even though they don't exist as text files in /data? Could be quite useful, but I haven't run across such information in my many trips through the wiki etc.

lostcalpolydude
02-13-2010, 11:40 PM
For future reference, is there a list anywhere of such files which can be imported via file_to_map() even though they don't exist as text files in /data? Could be quite useful, but I haven't run across such information in my many trips through the wiki etc.

I believe http://kolmafia.svn.sourceforge.net/viewvc/kolmafia/src/data/ will do, it's even self-updating when mafia changes.

StDoodle
02-14-2010, 03:10 AM
I believe http://kolmafia.svn.sourceforge.net/viewvc/kolmafia/src/data/ will do, it's even self-updating when mafia changes.

Thanks lost, very useful.

TeKRunneR
02-14-2010, 05:29 PM
Little bug report, the clan section doesn't seem to appear in the relay override table (at least not if the only thing to display there is the VIP pool buff).

StDoodle
02-14-2010, 07:18 PM
Little bug report, the clan section doesn't seem to appear in the relay override table (at least not if the only thing to display there is the VIP pool buff).

Nope, it never would. When I moved the clan stuff around to its own category, I forgot to add that in to the relay override script; good catch! Relay override script updated.

TeKRunneR
02-14-2010, 09:57 PM
One more little bug: still uses show up in the list even when I don't have any left (and the parameter is set to 1).

Also, with v1.2 of the script, and mafia r8137, I'm getting "0 of 3" for VIP pool uses, even though I've used them all. I'm on the first day of a run, in case that matters.

StDoodle
02-14-2010, 11:29 PM
One more little bug: still uses show up in the list even when I don't have any left (and the parameter is set to 1).

Have you tested this under 1.2? Still tracking was backwards in v1.1 (I reported uses left instead of used, der!).


Also, with v1.2 of the script, and mafia r8137, I'm getting "0 of 3" for VIP pool uses, even though I've used them all. I'm on the first day of a run, in case that matters.

Got Churl2 to help test this; it appears the counter doesn't increment after 3 uses for the day, without an exception being made for ascension; but it does reset to 0 at ascension (so, if you've used 3 pool buffs pre-gash, it will never increment day 1). I could be wrong, but I've posted it as a bug in case (Don't shoot me V & jason!)

zarqon
02-17-2010, 07:24 AM
Since I don't think it was ever quite resolved:


int tot;
foreach dealy,amt in get_inventory() tot = tot + autosell_price(dealy)*amt;

Hehe.

StDoodle
02-17-2010, 10:49 AM
Hehe.

Figures that the feature people are most concerned with is the stupid joke I put in while suffering from sleep deprivation. :P

AlbinoRhino
03-25-2010, 04:53 PM
Is there some way I can make this check the crimbo tree and the mirror ?

fronobulax
03-25-2010, 05:46 PM
mafia's breakfast checks the mirror and gets the potion right now. mafia checks the tree but I think it just reports the presence of a present and does not actually get it.

AlbinoRhino
03-25-2010, 06:24 PM
Yes. What I am loving about this script is the summary table inserted into the character sheet. I just thought there was some way to use the script settings to add those items, but I'm just not understanding how to do it.

A couple of other things I noticed. I have a character who has a Gravyskin Belt of the Sauceblob and the character sheet and the gCLI reports "8 of 5" reagents as summoned.

Also, every clan I belong to has a pool table and using the "list" mode in the gCLI correctly reports the uses. However, the character sheet table always says "You don't have access to a clan Pool Table."

The gCLI "clan" section seems to report everything correctly, but the character sheet "clan" section reports everything as "X of 0". For example, Ball pit uses, 1 of 0 on character sheet but 1 of 1 in the gCLI. All items in the clan section do this.

Is there some obvious thing that I am doing wrong ?

StDoodle
03-25-2010, 11:26 PM
Yes. What I am loving about this script is the summary table inserted into the character sheet. I just thought there was some way to use the script settings to add those items, but I'm just not understanding how to do it.

There is a way to add custom tracking; try reading through "HELP" (ie call the script with HELP typed as a parameter). (I'd give more helpful advice, but honestly I've forgotten. ;) ). And if you love the charsheet mods, you'll enjoy what I'm planning to add over the next week or so (extensive configuration & such via the relay browser).


A couple of other things I noticed. I have a character who has a Gravyskin Belt of the Sauceblob and the character sheet and the gCLI reports "8 of 5" reagents as summoned.I haven't worked on the script since the Nemesis stuff came out, so I'll need to go through and add in new summoning-limit checks.



Also, every clan I belong to has a pool table and using the "list" mode in the gCLI correctly reports the uses. However, the character sheet table always says "You don't have access to a clan Pool Table."

The gCLI "clan" section seems to report everything correctly, but the character sheet "clan" section reports everything as "X of 0". For example, Ball pit uses, 1 of 0 on character sheet but 1 of 1 in the gCLI. All items in the clan section do this.

Is there some obvious thing that I am doing wrong ?The only "obvious" problem I can think of would be if you're clan-hopping to a clan-less state while viewing it that way (it only reports uses based on your current clan, just in case you get de-whitelisted). Sounds more likely that I have a bug in the relay browser portion though, and I'll look into that.

Edit ('cause I forgot to respond to earlier posts):

I'll probably add in something for the mirror (again, it didn't exist last I worked on the script). I dunno about the crimbo tree; mafia reports on it when you login, and it isn't really "daily" so much as "every once in a while," but I can see the upside of including it. For reference, some things will likely never be included (like tower items) since they don't really need a daily check, and mafia already has excellent built-in tools for handling it.

AlbinoRhino
03-26-2010, 08:17 PM
I appreciate your response .. thanks. Here is a screenshot of the behavior I am getting. I deleted all of the data files and started over fresh, but this was still the result.

screenshot (http://i213.photobucket.com/albums/cc205/GlenQuagmyre/kol/20100326-06-merge.png)

StDoodle
03-26-2010, 11:51 PM
I cannot reproduce this on my end. Can you do a couple of things for me?
1) Make sure you have the latest version dl'd. Since it appears you haven't started using these scripts until just recently, I doubt this is an issue; but in case you dl'd them earlier than a few weeks ago, please try this first.
2) Try to see if you can reproduce this behavior, making sure not to clan-hop at any point during testing.
3) If you can reproduce, please let me know what the last line listed on the gCLI says; it's possible that could help.

As far as I can tell, my script's relay function works exactly like calling main() with "LIST ALL" as parameters, so I have no clue what this could be. Please let me know if the problem persists.

Thanks!

AlbinoRhino
03-27-2010, 01:22 AM
OK. I deleted both script files, as well as all of the "custd_" data files. I downloaded new copies from the first post of this thread. I downloaded charsheet.ash into the relay folder and customdaily.ash into the scripts folder. I did not change clans at any point. I called customdaily.ash from the Scripts menu and typed "setup" into the popup. I answered "Yes" to every prompt (as I did both previous times). The gCLI gave me - "Successfully ran "SETUP" mode." - after all of the prompts. In fact, that is the only thing printed to the gCLI. I still get the same behavior. (This is all with my softcore character, MeatBall.) I also get this behavior with the AlbinoRhino character. However, I tried this script with another character, AlbinoWino, and everything worked as expected. The only difference between the first two characters and the third one, which immediately pops to mind, is that the first two have telescopes while the third does not. Also the first two have bookshelves in their campgrounds and the third doesn't. In any event, the gCLI reporting is always correct. Perhaps I will just do without the character sheet enhancement, as it is optional anyway. If I can be of any further assistance, please let me know.

StDoodle
03-27-2010, 01:48 AM
I would definitely like to get to the bottom of this bug. Unfortunately, it looks like it's going to be messy; we'll probably need to go back-and-forth a bit to track it down. Please PM me with your availability if you're up for helping me on this (or join the #kolmafia IRC channel & give me a shout, which would be easiest, probably).

AlbinoRhino
03-27-2010, 03:13 AM
(or join the #kolmafia IRC channel & give me a shout, which would be easiest, probably).

How do I do that ? I couldn't find anything on the wiki about IRC. I tried "#kolmafia" from a web-based client but it only took me to an empty room. Any pointers ?

Edit: Disregard this. I went to the sourceforge page and figured it out.

AlbinoRhino
03-29-2010, 02:03 AM
From lines 212 to 218 of the script :



int def_REAGENT() {
return to_int(have_skill($skill[Advanced Cocktailcrafting]));
}

int def_GARNISH() {
return to_int(have_skill($skill[Advanced Saucecrafting]));
}


I think those 2 are reversed ? I hadn't noticed it until I logged on to a character who has saucerafting and way of sauce, but no cocktail skills at all. So I am getting a counter for garnishes but none for reagents. I swapped the skill names around and everything is checking correctly now.

edit:
Another issue has turned up. The other night, you ended with this code for the clan hall matching :



string current_clan() {
matcher mat = create_matcher("<b>Clan Hall</b></td></tr><tr><td style=\"padding: 5px; border: 1px solid " + get_property("defaultBorderColor") +";\"><center><table><tr><td><center><b>(.+?)</b>", visit_url("clan_hall.php"));
if (find(mat)) {return group(mat,1); }
return "";
}


I happened to run the script with "setup all" again and was surprised to see that the prompts relating to the clan were skipped and that clan information was not displayed on the character sheet or in the gCLI. After some tinkering I determined that when mafia is used to change the value for defaultBorderColor, not only does it use a hex color value, it includes an "\" before the color value in GLOBAL_prefs.txt. I assume this is for escaping the "#" whenever mafia uses the property. In any event, the matching fails and the script believes there is no clan ? At least, all the clan-related settings get set to "0" in the custd_ ... _settings.txt file. I used "set defaultBorderColor=blue" to change the property back to a text value and everything worked perfectly again. Apparently the matcher would have to account for the "\" in the GLOBAL_prefs.txt file for anyone who has changed the border color, as well as be able to match a text color value for those who haven't ?

However, if I run a successful setup, where the clan info is prompted for and collected, and then subsequently change the color, everything still works. Until "setup" is run again, and then all clan settings are set to "0".

StDoodle
03-29-2010, 12:47 PM
Re: Reagants & cocktails: I thought I'd fixed that bug ages ago... but apparently, not everywhere.

Re: the other issue (clans): Yeah, I realized just after you left that changing that line would fix things from the relay browser, but break (some of) them from the CLI. If you change it back to "blue" it should work from the CLI again, but I have to do a bit more fiddling to get it to work on both. Don't worry about the escape character "\" as it's generally ignored in string matching.

For reference, I believe you're pretty close on what that change breaks; it will work fine if you have saved clan information that's matched, but any time it looks for new clan info (such as when re-running SETUP), it won't work from the CLI. Grrr for stupid bugs. ;)

I'll look at a quick-fix to these issues tonight and put them up.

Edit: updates enclosed. No time to test, so they'll be changed in the first post later.

AlbinoRhino
03-29-2010, 04:28 PM
Re: Reagants & cocktails: I thought I'd fixed that bug ages ago... but apparently, not everywhere.

Re: the other issue (clans): Yeah, I realized just after you left that changing that line would fix things from the relay browser, but break (some of) them from the CLI. If you change it back to "blue" it should work from the CLI again, but I have to do a bit more fiddling to get it to work on both. Don't worry about the escape character "\" as it's generally ignored in string matching.

For reference, I believe you're pretty close on what that change breaks; it will work fine if you have saved clan information that's matched, but any time it looks for new clan info (such as when re-running SETUP), it won't work from the CLI. Grrr for stupid bugs. ;)

I'll look at a quick-fix to these issues tonight and put them up.

Edit: updates enclosed. No time to test, so they'll be changed in the first post later.

Yes, I eventually determined (after I had written the above) that only "blue" would work.

I have tried this new version many times - changing colors, changing clans, running setup over and over - with multiple characters ... and have been unable to confuse it. It all seems to be working beautifully with the new files. Well done !

icon315
04-09-2010, 04:31 AM
Hey your scripts doesn't seem to know that i already cast Summon Crimbo Candy for that day

StDoodle
04-09-2010, 05:04 AM
Hey your scripts doesn't seem to know that i already cast Summon Crimbo Candy for that day

I don't have the skill, so I've never been able to test that one. Does anyone know if the pref "_candySummons" reflects the Summon Crimbo Candy skill?

icon315
04-09-2010, 05:17 AM
This is what it says in Settings:


_candySummons=1


EDIT:Ignore me

StDoodle
04-23-2010, 06:17 AM
PLEASE NOTE: This post is a formatting test only for script debugging (kthnx gby)

Hello

drakono82
06-08-2010, 05:37 PM
Mafia-noob question: I added charsheet.ash to the relay directory, but not getting any output from the script when I look at my charsheet. I enabled the option in mafia to "enable user-scripted relay browser overrides", but still no dice. What else do I need to do?

slyz
06-08-2010, 05:39 PM
Did you try restarting Mafia? Or the Relay browser page?

drakono82
06-08-2010, 05:47 PM
I'm certain I'd tried both opening another relay session and closing my mafia session and logging back in. And it still wasn't working. However, closing mafia all the way (not just to the log in screen) and opening it up again did the trick. Thanks.

Darzil
08-21-2010, 04:26 PM
I don't have the skill, so I've never been able to test that one. Does anyone know if the pref "_candySummons" reflects the Summon Crimbo Candy skill?

It does, but you needed to treat it like the other summons, rather than like Rage Gland. As a result it always showed 0, even when it had been used.

Love the script, made a few small changes, if you want to incorporate them into your official version.

Fixed Crimbo Candy Summons.
Added Rogue Program Drops.
No longer shows Ball Pit in Hardcore (but does list it as available in Clan file).
No longer shows Hot Tub and Deluxe Mr Klaw with no VIP access.

3386

Warning: This is my first day of looking at Ash, and I've only tested this on a couple of characters.

StDoodle
08-23-2010, 12:26 AM
Yeah, I had a lot of changes I started making; I actually significantly re-designed the whole system. But life got really freakin' hectic, and I haven't been able to work on it for months.

Edit:

For those who want to be (whatever-comes-before-alpha) testers (work in progress!!!):

3437

Note: requires htmlform.ash (Get it here (http://kolmafia.us/showthread.php?3842))
Note2: all saved data files are slightly different than the original version (the original cli form and this one will not interfere with each other)

Theraze
12-24-2010, 03:52 PM
Any way to make the script actually detect the version number on this thread again? It keeps asking me to update "from 2.2 to at..." (so from 2.2 to un-versioned). Well, on the relatively few times I pop into the charsheet instead of using the updated relay... but still, it'd be nice to not have the 20 second delay. :)

StDoodle
12-24-2010, 04:16 PM
Something got borked along the way and it doesn't appear to properly update the setting "custd_version" anymore. If you manually set that to 2.2 you should be ok. Also, have you tried out the new(er) relay version? Much improved!