relay_Hardcore_Deeds.ash - Your daily tasks

peacy

Member
relay_Hardcore_Deeds.ash
Your daily hardcore and possibly othercore tasks
!Script Still In Development!
version: 1.0rc1


This script provides a graphical representation of what one does on daily basis in a run. It groups all the consumption in one place, shows you your fullness/drunkness/spleen levels. Let's you eat your daily food and more. Script is designed to be highly customizable eventually. At the moment, only some basic customisation is possible.
Requires Zlib


-----------------
Features:
-----------------
* Regular Skills:
* Cocktail Summons
* Noodle Summons
* Reagent Summons

* Librams:
* Hearts
* Songs
* BRICKOs
* Favors*

* Tomes:
* Snowcones*
* Stickers
* Sheets
* Show summoned ammount/max summons

* Spleen:
* spleen level indication
* dropdown of available spleen stuff + use them
* spleen familiar drop info

* Misc:
* version tracking - direct dl link if new version
* show/hide functions
* custom booze/food/spleen - needs to be moved to ext files rather than in the code once the rest is finished
* custom widget order
* Reset to default settings option
* Consumables only show up if required level was reached

* Booze:
* cast ode / notify that ode is on
* drunknes indication
* dropdown menu of some drinks (sr/advanced/super) + drink them (popup if overdrink, popup if no ode) *
* link to discoveries to mix
* stat type gain for the significant ones
* adv gain (ode factored in if it is active)

* Food:
* use milk / notify if it is on
* fullness indication
* dropdown menu of some food (sr/noodles) + eat them (popup if no milk) *
* link to discoveries
* stat type gain for the significant ones
* adv gain (ode factored in if it is active)


* not all aspects tested ie. I do not have all librams/tomes, however they should
work as far as I think/hope/dream
ditto for food

* Stats:
* HP/MP/Meat/advs
* gongs/aguas/mushrooms/absinthe
* combat init/meat/item bonus etc.

* Consumption Simulation:
* shows predicted values for food/booze/drink consumption (ode/milk taken into account only if active)
* checkbox whether or not to simulate
* checkbox default status configurable
* option to eat after simulation

------------------
Eventual Features
------------------
* Custom importable widgets - no idea how to do that yet. something might pop up once I get to it - which won't be for a few
* Links to make stuff you might do every run ie. bartender/chef, epic weapons etc.
* order consumption links according to user settings, just like the tabs
* Clone some of mafia's daily deeds - tub/pool/machine/crimbo tree/nuns etc.
* Run summary - some info day, level, quests not done etc. - haven't given it much thought yet
* Easy web based clicky settings (external db - easier / zlib - way more difficult but probably better) zlib integration started, scrap SQL: relay_zlib.ash is recommended to use now, not needed though. Eventually I'll come up with my own settings explaining what the vars actually mean.


-------------
Changelog:
-------------
* 1.0rc1: bugfix: spleen consumption not working with checkbox unchecked, libram mp cost; New Stuff: june familiar, custom consumables in ext files, results show on the site rather than redirected to inventory, used embedded mafia calls rather than calling urls. Added vip support, item tracking based on inventory rather than all storage. Familiar widget, some consumables added, charpane reloads to stay up to date with mafia
* 1.0c-r1: fixed a bug that wouldn't let you drink at 19 (or 14) drunkness
* 1.0c: consumption simulation, fixed bug causing mafia to get out of sync, consumables don't show if you don't have the level, summoning noodles/reagents/cocktail stuff hides correctly on hideRedundant, changed hideRedundant defaults to true, moved the title to a server so that it can actually be useful for me now, moved the title to the bottom in defaults, reset defaults option
* 0.1b: milk/ode, added stats + hide options, added top panel as a placeholder for now. Tome summon count, Fixed a couple typos, no swearing in the script (I think), direct download link for new version.
* 0.1a: release




Configurable Options (via ZLIB vars)


relay_Hardcore_Deeds_order - string parameter for ordering the widgets, allows you to specify the order in which they appear, using the following notation:
f - food
b - booze
s - spleen
t - tomes
l - librams
c - consumption skills
i - title
default is: icfbstl
relay_Hardcore_Deeds_hideRedundant - does not display fields that have already been used up ie. already at top fullness, food widget will not display - default: false
relay_Hardcore_Deeds_hideNotOwned - hides widgets you couldn't possibly use ie. no librams, default: true
relay_Hardcore_Deeds_hideTitle - will hide title information. at the moment it is useless and you should hide it, default:false
relay_Hardcore_Deeds_hideNoSkillOde - whether or not display ode option if you don't have the skill, deafult: false
relay_Hardcore_Deeds_hideNoMilkOwned - as above but milk
relay_Hardcore_Deeds_simulateConsumption - whether or not to have consumption simulation box checked, default: true

Consumption Related:
not listing all these. there is a lot of them (28 atm).
they are just true/false toggles and do exactly what they claim to do. They manipulate the visibility of consumables in the consume widgets.



Adding custom consumables - FINALLY IN SEPARATE FILES!:


Adding custom consumables requires modifying a text file and that is all. Follow the pattern highlighted here for all the consumables:
counter name id fullness minimum maximum level
Separate them with tabs. You can find the ID on kol wiki

For booze:
Look in your data folder for Hardcore_Deeds_booze.txt file and open it. (the file will be created once you run the script at least one time (version 1.0rc1 and above)).
To add a booze, follow the above pattern. For example to add a banana daiquiri add this line (assuming that it will be the first entry)
0 bananan daiquiri 2376 3 6 10 3

For food:
Look in your data folder for Hardcore_Deeds_food.txt file and open it. (the file will be created once you run the script at least one time (version 1.0rc1 and above)).
To add a booze, follow the above pattern. For example to add a goat cheese pizza add this line (assuming that it will be the first entry)
0 goat cheese pizza 325 3 3 10 2

For spleen:
Look in your data folder for Hardcore_Deeds_spleen.txt file and open it. (the file will be created once you run the script at least one time (version 1.0rc1 and above)).
To add a booze, follow the above pattern. For example to add a goat epic wad wad add this line (assuming that it will be the first entry)
0 epic wad 3316 1 5 5 15



About the predefined consumables


I have included quite a few of predefined consumables that you might use during a run, however I am a bit of a beginner when it comes to KOL so there will be a lot of relevant things missing. If you find something missing that should really be included in the basic list, let me know and I will add it in the next release. I have not tested all of the food that is in the list, so if you end up using an instant karma instead of eating spaghetti with Skullheads, I apologise in advance, but you have been warned. Should this happen, please let me know.


Current State of the Script


At the moment, the script is getting closer to be out of the beta stage, however there is still a lot that needs to be done. Thanks to everyone that contributed so far!
Feature Requests are now open! However... they will not be given a top priority as there are things that I still need to finish up.


Needs Testing


* Summon Snowcones once again
* Summon Favors once again


Next Major Version (1.0)


The plans for the next version is to have the following done:
* implemented all that is in features
* fix any reported bugs
* call it version 1.0 and thus conclude this testing stage

-----------------------------------------------


Wow, you read this far. Nice One! So, what does all this actually look like? There is no clear answer to that as it will look differently depending on many factors, such as what skills you used already, what skills you have, what settings you used etc. etc. However for the general idea, here is a picture:
Next Release Preview:
 

Attachments

  • relay_Hardcore_Deeds.ash
    82.8 KB · Views: 103
Last edited:

peacy

Member
ah thanks fixed. thinking about it, they might be messed up in the script as well, will have a look

Edit: nope, they are correct in the script, just the post was wrong
 
Last edited:

heeheehee

Developer
Staff member
Report on snowcones: Since breakfast took care of those, right now, I can only verify that it's correct in saying that I have no tome summons remaining. I'd presume that the relevant snippet uses tomeSummons and is therefore correct as far as I'm concerned.
 

peacy

Member
Yea the summon amount uses tomeSummons. Reminds me that I should add some indication of how many have already been summoned. Was meaning to do that a while back but got distracted :)
 

peacy

Member
well, it depends on what you mean by confirm messages? before you consume stuff a yes/no prompt? As for your food items not being displayed, this could be caused by quite a few things.

Edit: ok, released a newer version, think I implemented what you meant by confirmation if you use the simulate option (on by default) as for the food, you might not have any of the hardcoded food. It doesn't display all your food. My goal is eventually to include all sorts of food that people eat during a run rather than including all the food you have so that it isn't cluttered any more than it needs to be. If you are missing some food that you normally eat, let me know, the chances are you are not the only one, and it will be added in the next release. Or you can add it yourself by editing the source file. Think the next release will contain custom food loaded from external files unless I run into some problems. Also note that although I have had accounts registered before ns13, I never managed to keep my focus to play for longer than a few weeks at once, so I am new to this ascending, optimal, and whatnot, meaning I included a lot of consumables but they might not be the ones that older players would even consider using.
 
Last edited:

icon315

Member
Well clicking on the summoning link send me to peacemaster's profile (guessing that's you), actually there's a link from Consumption Summoning Skills to [Cook Some]
 
Last edited:

peacy

Member
Sorry, I am a little confused with that icon. Does it send you to my profile when you try to summon something (noodles/reagents/cocktail ingredients)? or does a link appear next to the ConsumptionSummoningSkills title saying [Cook Some] and it links to my profile? Also, do you have the newest version (top of the page not complaining about needing an update)?

Edit: Ah also, could you please tell me the url it links to, should make figuring out what the problem is easier. It might not be direct url to my profile, but something triggering the game to link there

Edit 2: Ah, I think I bumped into it on an alt... seems like I didn't close a tag somewhere, looking into it now

Edit 3: Ok, hope that this was the problem.. had a syntax error in the title, which is loaded from my server, so all should be fixed without the need to download a new version. but please let me know if it is working as it should now
 
Last edited:

slyz

Developer
I have one request to make: could you use Mafia's built in commands, to use librams for example? You make calls directly to KoL, but as a result Mafia's inventory needs to be resynched after using your script's feature.

I guess the same should apply to eating/drinking: the drunkness is updated in the character pane so Mafia catches that, but I think it wouldn't catch the added fullness from eating something.
 

Veracity

Developer
Staff member
I don't understand why inventory (or fullness) would get out-of-synch just because you are using direct calls to KoL; we (supposedly) figure things out by watching the requests & responses, rather than assuming/requiring that you use internal calls that make the same requests. This is how the Relay Browser keeps inventory synchronized.

If a script using visit_url makes inventory get out of synch, then visiting those same pages in the Relay Browser should similarly fail - and that would be a bug.
 

heeheehee

Developer
Staff member
It's not actually using visit_url() that makes the inventory out of sync, it's creating clickable links that either visit the URL directly or use JavaScript to do things (e.g. pyramid.ash's "Turn Ratchet" link, which uses JS to use a ratchet, then refresh the current page).
 

Veracity

Developer
Staff member
(e.g. pyramid.ash's "Turn Ratchet" link, which uses JS to use a ratchet, then refresh the current page).
I still don't get it. Javascript runs in your browser. For it to "use a rachet", it must submit a URL. All URLS submitted by the (Relay) browser pass through KoLmafia.

Edit: OK, I just did a test.

I installed relay/pyramid.ash and visited the pyramid with a character who had not yet finished the pyramid. I see a link "Turn Rachet" which has this code:
PHP:
<a href='pyramid.php' onclick='do_stuff()'>
Note that this does not work in Safari: when you click on it, it dutifully follows the href and loads pyramid.php. It ignores the "onclick". In Firefox, it runs the Javascript AND connects to pyramid.php.

In my debug log, I see this (removing all but the interesting lines):

Requesting: http://www5.kingdomofloathing.com/inv_use.php?pwd&which=3&whichitem=2540
Requesting: http://www5.kingdomofloathing.com/pyramid.php
Retrieved: http://www5.kingdomofloathing.com/inv_use.php?pwd&which=3&whichitem=2540
Field: Location = [inventory.php?which=3&action=message]
Retrieved: http://www5.kingdomofloathing.com/pyramid.php

In other words, the browser submitted a request to use the tomb ratchet (from the JavaScript) and, without waiting for the response, also a request to refresh pyramid.php. The inv_use request comes back with a redirect to inventory.php&action=message, to tell you that you turned the ratchet. KoLmafia does not follow that redirect; it passes it back to the browser - which does not follow it, either. In the meantime, KoL sent back a response to pyramid.php - and in my test, the response came before the tomb ratchet actually turned, so the pyramid showed the original position, even though the tomb ratchet really did get turned.

In my session log, I see this:

use 1 tomb ratchet

But, because we only actually update inventory when the request returns - and the Javascript effectively kept that from happening, by failing to follow the redirect to inventory.php - the inventory did not reflect the usage of the ratchet.

To summarize:

- Javascript has to interact with KoL exactly the same as regular HTML links, visit_url, or KoLmafia internal requests do: by submitting URLs to the KoL server.
- All such requests coming from the Relay Browser, whether submitted via normal HTML links or generated by JavaScript, pass through KoLmafia, which logs them in the session log and examines the responses when they come back before passing them back down to the Browser.
- It is the responsibility of the Javascript to make sure that requests complete: to wait for the response, allowing redirects to be followed and the ultimate response to come back. Use Links do this, for example; they call a JavaScript function which submits a request and waits for the response. KoLmafia looks at the response and maintains inventory correctly.
- ***If you do not wait for the response, the inventory will get out of synch, and there is nothing that KoLmafia can do about it.***

The solution is NOT to "refresh inventory". The solution is to fix your buggy Javascript function.
 
Last edited:

slyz

Developer
I used the script again to summon a love song.

Before the summon:
Code:
> inv love song

love song of disturbing obsession
love song of icy revenge
love song of naughty innuendo (2)
love song of smoldering passion
love song of sugary cuteness
love song of vague ambiguity (2)

After the summon:
Code:
> inv love song

love song of disturbing obsession
love song of icy revenge
love song of naughty innuendo (2)
love song of smoldering passion
love song of sugary cuteness
love song of vague ambiguity (2)

After refreshing my inventory (I got one innuendo).
Code:
> refresh inv

Refreshing closet...
Updating consumable items...
Updating miscellaneous items...
Refreshing stickers...
Requests complete.

> inv love song

love song of disturbing obsession
love song of icy revenge
love song of naughty innuendo (3)
love song of smoldering passion
love song of sugary cuteness
love song of vague ambiguity (2)

The gCLI doesn't show anything else, but the session log does have a cast 1 Summon Love Song line.

I do not know much about HTML/Javascript, but in Hardcore Deeds' case, it's apparently a form that submits to skills.php. How could the script (or the page) wait for the request to be completed?
 

xKiv

Active member
How about href="javascript:doStuff()" instead?
Or
Code:
<span style="cursor: pointer" onclick="doStuff();">"link" text here</span>
?
 

peacy

Member
Heya guys, been a long delay since I updated. I have started rewriting a bit of the code to use the mafia internal functions for eating/drinking, however I had to fly to amsterdam for a few days and am having an operation on monday so it will take a few till I can finish this. However, once finished, these issues should be more or less sorted.
 

icon315

Member
Hey is it possible for you to add Chez Snootée to the food part, and the Microbrewery to the drink (whichever is active)
 

peacy

Member
Haven't thought of that, but will try to come up with something. However will need to ascend under a non muscle sign to make sure it doesn't buy random stuff, which might be a while :/
 
Top