Display Xiblaxian holo-wrist-puter charges

For script writing
Post Reply
Antipasta
AFH
Posts: 251
Joined: Fri Sep 21, 2007 5:24 pm

Display Xiblaxian holo-wrist-puter charges

Post by Antipasta » Wed Jan 14, 2015 5:53 pm

Mafia tracks holo-wrist-puter use now, but the info is buried in a couple of preference values (_holoWristDrops and _holoWristProgress). This is a pretty dumb relay override that converts the info into a countdown timer and displays it on your char pane.

The countdown number is green if you have the holo thing equipped, gray if not equipped, red if the counter has hit zero and you have it equipped. If you hit zero with the -puter equipped, it will also make an expiring timer to double remind you.

Probably won't work well with anything else that modifies the char pane, e.g. CHIT.

To install, copy it into your kolmafia/relay directory, and refresh the scripts menu.

[edit - fixed a few things like off-by-one on first drop and error msgs in valhalla, added edit-the-script flag to hide if inactive]
[edit edit - made a few changes to work with compact mode, got rid of regex that was destroying mafia's brain, display only if have wrist-computer]
Attachments
charpane.ash
(2.44 KiB) Downloaded 36 times
Last edited by Antipasta on Wed Mar 11, 2015 8:07 am, edited 2 times in total.

Phazic
Pie of the Sky
Posts: 35
Joined: Sun Jan 25, 2015 2:00 am

Re: Display Xiblaxian holo-wrist-puter charges

Post by Phazic » Sat Jan 31, 2015 2:15 am

I took a stab at what it would take to integrate this into CHIT and noticed that CHIT has plugin support so converted it into a loadable CHIT plugin.

I'm terrible at UI dev so I just made the colors that Antipasta picked as the background for the bars as CHIT does for the fortune cookie counter.

Make the top of charpane.ash look like this:

Code: Select all

script "Character Info Toolbox";
notify "Bale";
import "zlib.ash";
import "CHITWristPuter.ash";
For SVN users, I'd recommend modifying the version in svn/mafiachit/relay/charpane.ash

After modifying, perform a: "svn sync" in the CLI

Then drop the attached file in either the scripts or relay directory.

Lastly, enable the feature by setting it on a block.

For example to add it to the roof:
zlib chit.roof.layout = character,stats,trail,pluginwristputer

Preview of this in action (the red looks horrible):
Off: Image
On: Image
Expired: Image
Attachments
CHITWristPuter.ash
(1.3 KiB) Downloaded 40 times
Last edited by Phazic on Wed Feb 04, 2015 11:12 am, edited 1 time in total.

User avatar
digitrev
Spy vs. Pie
Posts: 63
Joined: Tue Oct 07, 2014 8:01 pm

Re: Display Xiblaxian holo-wrist-puter charges

Post by digitrev » Mon Feb 02, 2015 6:13 am

This looks good. I made a slight change to the plugin. If you don't have a wrist-puter, it doesn't bother displaying the pane. Useful for those who might have varying correspondence strategies. Just make the following change:

Instead of

Code: Select all

buffer result;
put

Code: Select all

buffer result;
if (wrist.available_amount() < 1)
	return result;
Image

Phazic
Pie of the Sky
Posts: 35
Joined: Sun Jan 25, 2015 2:00 am

Re: Display Xiblaxian holo-wrist-puter charges

Post by Phazic » Tue Feb 03, 2015 1:24 am

Thanks for the suggestion! Was wrist defined to be $item[Xiblaxian holo-wrist-puter]?

Here's an updated version that should skip printing if you don't have a wrist-puter available to you.
Attachments
CHITWristPuter.ash
(1.38 KiB) Downloaded 31 times

User avatar
digitrev
Spy vs. Pie
Posts: 63
Joined: Tue Oct 07, 2014 8:01 pm

Re: Display Xiblaxian holo-wrist-puter charges

Post by digitrev » Tue Feb 03, 2015 10:44 am

I made a few more changes. I'm usually running the wrist-puter so I can get Xiblaxian space whiskey, so I added some code to display which items I'll need (and which area I should be adventuring in) to get the missing items for my whiskey. That information will only show when the counter hits 0.
Attachments
CHITWristPuter.ash
(1.82 KiB) Downloaded 33 times
Image

Phazic
Pie of the Sky
Posts: 35
Joined: Sun Jan 25, 2015 2:00 am

Re: Display Xiblaxian holo-wrist-puter charges

Post by Phazic » Wed Feb 04, 2015 11:39 am

Here's a version of charpane.ash v208 with the necessary changes.

Too big to post on forum.
http://pastebin.com/hC1mEDzF

Antipasta
AFH
Posts: 251
Joined: Fri Sep 21, 2007 5:24 pm

Re: Display Xiblaxian holo-wrist-puter charges

Post by Antipasta » Mon Mar 02, 2015 12:59 pm

Mafia changed the way it tracks the drops, so the counter will be off by one in these tracker scripts - I changed mine in the first post. The calculation should always be the same, instead of different for the first vs. later drops:

Code: Select all

	countdown = 10 + 5*drop - progress;

Phazic
Pie of the Sky
Posts: 35
Joined: Sun Jan 25, 2015 2:00 am

Re: Display Xiblaxian holo-wrist-puter charges

Post by Phazic » Wed Mar 04, 2015 1:50 am

Updated digitrev's version of the CHIT plugin to account for the off by one error.

I'm also using KoLMafia's "since" keyword to ensure the version is at least r15493 which fixed the _holoWristProgress.
Attachments
CHITWristPuter.ash
(1.67 KiB) Downloaded 33 times

bale
Just Plain Old Pie
Posts: 3
Joined: Wed Mar 11, 2015 1:52 am

Re: Display Xiblaxian holo-wrist-puter charges

Post by bale » Wed Mar 11, 2015 2:03 am

This thread was just brought to my attention today. I like the idea so I'm adding a Xiblaxian helper to ChIT. I changed things a tiny bit so I hope people like my version. The helper will only show up if you actually equip the Wrist-puter, but I figured that much was up to the player to remember. I removed the bright red and green because it is not Christmas and those colors really didn't fit the scheme of ChIT, but I have hopes it will still be helpful. I really liked the idea to set a timer to interrupt regular adventuring so I kept that. It's awesome. A few other things got added/changed as well, such as a link to the 5D printer if you click the icon.

Any constructive criticism is always gleefully accepted, even when I don't agree so please feel free. Unfortunately I might not check this thread regularly, but I always check the ChIT thread.

littlelolligagged
Leader of Heck
Posts: 677
Joined: Tue Aug 23, 2011 10:42 am

Re: Display Xiblaxian holo-wrist-puter charges

Post by littlelolligagged » Sat Mar 14, 2015 4:08 pm

I saw that in my last run with ChIT, it was very helpful! Thanks!

bale
Just Plain Old Pie
Posts: 3
Joined: Wed Mar 11, 2015 1:52 am

Re: Display Xiblaxian holo-wrist-puter charges

Post by bale » Sun Mar 22, 2015 1:49 am

I'm happy to hear that.

Post Reply