CanGalaktik Scriptlet inspired by Presto Ragu's RestorerSelector

This Script was inspired by Presto Ragu's RestorerSelector. Though not as useful because of in game costs, it has it's purposes.

Like Presto Ragu's RestorerSelector, it is meant to be used by another script, however, this one can be used from the GUI. I don't see why anyone would want to, but why not make it possible?

As with Presto Ragu's script, you must put the import command near the top of the script that will use this script.

Code:
import <CanGalaktik.ash>;
if you didn't rename the file.

There are 2 useable functions in this script.
The first:
Code:
price_galaktik("hp");
Code:
price_galaktik("mp");
return the price to restore at Doc Galaktiks

The second:
Code:
can_galaktik("hp");
Code:
can_galaktik("mp");
returns true if you have enough meat to restore at Doc Galaktik's,
  and false if you don't.

Finally if called alone, KOLMafia will display 1 of 3 things:
Code:
You can restore HP/MP at the doc
Code:
You can restore HP but not MP at the doc
Code:
You can restore MP but not HP at the doc

This script has no effect on a character, and is designed to simply answer questions. It's usefullness might show when your max MP is 40, and you want to cast antiphon. after using other methods to get your mp as close to 40 as possible, say you only need 2 more MP. It would be a waste of a tiny house, and Galaktik is an alternative if you have enough meat. Though the HP functionality isn't nearly as usefull, it was included for the case when someone really wants to be at full HP, and doesn't want to waste HP restorers.

Another possible future addition could be added:
Code:
should_galaktik("hp");
Code:
should_galaktik("mp");
which would look at the restorers you have in inventory, and determine if you would be wasting excess mp using them, rather than Galaktik.
It would return true if it is wastefull to use restoring items that you have, and false if you have restorers that wouldn't be wasting a lot of their HP/MP restoring capabilities.

as stated at the top, not near as usefull as Presto Ragu's RestorerSelector but mildly usefull in conjunction with it.
 

Attachments

  • TestGalaktik.ASH
    1 KB · Views: 93
[quote author=efilnikufecin link=topic=43.msg115#msg115 date=1144043690]I don't see why anyone would want to, but why not make it possible?[/quote]

Not that I think you were directing that at me, but for RetorererSelecter there wasn't any logical path to follow if anyone ran it by itself.

[quote author=efilnikufecin link=topic=43.msg115#msg115 date=1144043690]as stated at the top, not near as usefull as Presto Ragu's RestorerSelector but mildly usefull in conjunction with it.[/quote]

Actually, I think it is very usefull in conjunction. Between the two, it should be easy for people to make usefull, accurate, and efficient restoring scripts.

Allow me to be the first to say well done. :) This kind of collaboration is precisely what this repository is all about.
 
[quote author=Presto Ragu link=topic=43.msg116#msg116 date=1144050604]
Not that I think you were directing that at me, but for RetorererSelecter there wasn't any logical path to follow if anyone ran it by itself.[/quote]

It wasn't directed at you, I just saw a feasible return for what I did in a stand alone script. I am with you on not seeing a logical path to follow for your script being ran as a stand alone script. Since my script only does some quick calculations for the end user, and doesn't actually do any using of items, or healing at all, it was just easy to go that route.

[quote author=Presto Ragu link=topic=43.msg116#msg116 date=1144050604]
Actually, I think it is very usefull in conjunction.  Between the two, it should be easy for people to make usefull, accurate, and efficient restoring scripts.

Allow me to be the first to say well done.  :)  This kind of collaboration is precisely what this repository is all about.
[/quote]

My writing and posting of this script was my way of saying well done for your scripts. In reading of some of your scripts, I have found better ways to complete some of the tasks I have scripting in a much better way.

My current major project is a script for eating and drinking which always eats and drinks the best (reasonably priced) foods and drinks. Having seen your scripts, I have reduced the overall file size of my project by over half. Hence to say that some of your methods were better than mine, so I implemented them.  :)
 

TrickyBeta

New member
Oooh! I like the idea of a food and drink script: aka, breakfast bot. May I suggest, for the hardcore of us, including a "stat day" setting? As I only eat really really good stat foods on stat days.

However, I'm not sure if stat days are supported yet by KoLm. It'd be nice, but not necessary.
 

macman104

Member
[quote author=TrickyBeta link=topic=43.msg124#msg124 date=1144105745]
Oooh! I like the idea of a food and drink script: aka, breakfast bot. May I suggest, for the hardcore of us, including a "stat day" setting? As I only eat really really good stat foods on stat days.

However, I'm not sure if stat days are supported yet by KoLm. It'd be nice, but not necessary.
[/quote]Stat days are not supported by mafia. The only way to monitor calender activity is to have some sort of item counter that you check for in your script.
 

Nightmist

Member
Nice script, never occured to me to use this method, my in-between battle script has just been re-fixed thanks to you.
 
Top