Adventure Function Library

muffins

Member
Haha, I'm sure you're all sick of me by now!

Still, I'm trying to help with this one...

Firstly, bigbigbig love to Tirian for creating his own function library. I hadn't even thought about implementing something like that for ASH scripting, but... when I did, I got a brilliant idea! I decided to create two gihugenormongous function library files to share with everyone! YAY!

Well, it ended up having to be three files because of the darn drunklimit counting needing to be in 50948573495 places at once and I didn't feel like throwing it in the AdventureLib file, 'cause... well, I just didn't feel like it.

Now, on to what I need from ya'll...

As you can see from the attached AdventureLib file, I *think* I've gotten every single adventure location in there with an extremely basic adventuring script that, (in theory) should also use an SGEEA if beaten up (and buy one if you don't have one). I'll probably be changing this later to include can_interact() and make a check for tongue of the otter and use that if you have that skill, etc, etc...

But, for right now, everything is a wee bit too uniform, and I need to add a bit of customization for specific areas. I know (most) of the area requirements, but I want to make sure I don't leave anything out.

I know I've rambled a lot, so I'll get to the point here: I am requesting help on a) what specific areas need customization (i.e. an outfit, or method of travel or buff, etc), and b) what the best method is for obtaining that certain something.

I've already begun adding the outfits for the "in disguise" areas (not in the current file), but I'd also like to add a check for the dinghy dingy and be able to obtain it, and the biggest challenge I can think of (without actually having tried anything yet, heh), would be getting to the 8-bit realm (having to do a check to see if I've got the transfunctioner thingymabob, then getting it if I don't... the getting it if I don't part is the bit I haven't tested yet/am unsure as to how easy it is).

P.S. Yes, I know I don't need to use a SGEEA at the campsite, etc, that's just there because I was extremely lazy and used a combination of MySQL, PHP, and a while loop (and a lot of str_replace when creating the function names) to create what I've got now ;) I'll get around to customizing bits later... also lazily!
 

Attachments

  • AdventureLib.ash
    70 KB · Views: 170
  • DrunkLib.ash
    96 bytes · Views: 123

macman104

Member
Big props to you for taking this up, however, I'm kind of think that you went to alot of trouble for something could be alot simpler. For the beaten up thing, all that's required is an inbetween script to run, and do the check. Then mafia already doesn't allow you to adventure if you are drunk. You can also shorten your list ALOT, by taking out the places that are no longer available, and also taking out places that you can adventure while beaten up (especially if you don't fight anything).

In addition, removing the beaten up is fine, but usually if you are beaten up, you also have 0 hp, so you should add the other part of the healing script (I'm assuming that was pulled from one of my posts? I don't mind just wondering), and if that's the case, you're better off just importing it, or adding the function to the top and just calling the function.

Please don't take my advice as saying its not good, just little pointers and such.
 

Tirian

Member
To see how to get the continuum transfunctioner with CLI, check out my "Welcome to the Kingdom of Loathing, Noob" script in the quest area. It unlocks lots of the early quests like that, so you can grab the CLI commands.

Thank you for your kind words about my library. I am half-intending it to be something that the general community can use to suppliment their own scripts, so feel free to take advantage of it in that way if it would make your work easier. I am dedicated to keeping the functionality backwards-compatible until that becomes too painful to endure, at which point I'll just bump the major version number.

I'll be interested to see how your script grows as you start using it to actually accomplish tasks in the game. It seems like you have your sights set high!
 

muffins

Member
[quote author=macman104 link=topic=132.msg612#msg612 date=1146598645]
Big props to you for taking this up, however, I'm kind of think that you went to alot of trouble for something could be alot simpler. For the beaten up thing, all that's required is an inbetween script to run, and do the check. Then mafia already doesn't allow you to adventure if you are drunk. You can also shorten your list ALOT, by taking out the places that are no longer available, and also taking out places that you can adventure while beaten up (especially if you don't fight anything).

In addition, removing the beaten up is fine, but usually if you are beaten up, you also have 0 hp, so you should add the other part of the healing script (I'm assuming that was pulled from one of my posts? I don't mind just wondering), and if that's the case, you're better off just importing it, or adding the function to the top and just calling the function.

Please don't take my advice as saying its not good, just little pointers and such.
[/quote]

As far as the Beaten Up thing (I actually wrote that one myself in one of my first adventuring scripts using ASH), I agree it could be separated into a between battle script... I left out healing for the reason that I would hope most everyone has their own healing options set through mafia in some way (I didn't want to force users to heal sooner than they'd want to/more than they'd want to), but I guess if I'm going to assume that, I should assume it to the fullest extent and just create a separate healing script (or "borrow" one, since quite a few are already written, heh).

As far as the drunk thing goes, yes, I know mafia doesn't adventure when drunk... the only problem is (at least, as I can remember it), it also halts the script altogether. This AFL is only intended to let users import whatever zone they want to adventure in with ease, they can add other bits before or after as they see fit, so I don't want it to stop or create an error and halt whatever else they wanted to do.

Thanks for the feedback! :)

[quote author=Tirian link=topic=132.msg613#msg613 date=1146602459]
To see how to get the continuum transfunctioner with CLI, check out my "Welcome to the Kingdom of Loathing, Noob" script in the quest area. It unlocks lots of the early quests like that, so you can grab the CLI commands.

Thank you for your kind words about my library. I am half-intending it to be something that the general community can use to suppliment their own scripts, so feel free to take advantage of it in that way if it would make your work easier. I am dedicated to keeping the functionality backwards-compatible until that becomes too painful to endure, at which point I'll just bump the major version number.

I'll be interested to see how your script grows as you start using it to actually accomplish tasks in the game. It seems like you have your sights set high!
[/quote]

Thank you for the offer! I'll definitely crack that open and see what I can do about getting all that imported :) I already had one written a while back about checking main stat levels and completing just the right amount of quests to get the meatcar/untinkerer and thus, unlock Degrassi Knoll, but I might have lost it or accidently deleted it... we'll see though. Right now I'm just trying to remember what goes where, etc!

You're very welcome. If I hadn't seen it, I wouldn't have gotten this idea! I might end up having someone move this thread to the "Writing in progress", since that is essentially what it is... (Any mod is welcome to go ahead and do this, btw).

My main objective with this script is to be able to just import an adventure function and have it adventure in that location no matter what (barring drunkeness), even if it means it needs to go grab an item or adventure for/pull an outfit from the closet/hagnk's (I'm going to add an option at the top to either enable or disable pulls from hagnk's, since I know people might not want to pull something on a certain day).

Mostly now I just need to be reminded of what areas need what in some sort of list format, i.e.:
Pirates Cove (in disguise): dinghy dingy, eyepatch, stuffed shoulder parrot, swashbuckling pants
Inexplicable Door: continum transfunctioner

I'm thinking about replacing the DrunkLib.ash with a MiniLib.ash that would just contain stuff that's needed for the AdventureLib.ash (which is intended to be imported into a regular FunctionLib.ash file... the MiniLib file would contain the drunklimit and probably your nifty zodiac_to_stat bit, so I could stick the welcome_noob stuff at the top, if you don't mind?
 

macman104

Member
Currently, no one is a mod (except for daychilde, and I think hola and veracity), but you should be able to move your own topics.

EDIT: I was wondering, what is the harm if mafia aborts if you try to adventure drunk? Because right now, in your script if are drunk, then its done. Just thinking, finding things to either trim or otherwise slim it.
 

muffins

Member
[quote author=macman104 link=topic=132.msg622#msg622 date=1146613651]
Currently, no one is a mod (except for daychilde, and I think hola and veracity), but you should be able to move your own topics.

EDIT: I was wondering, what is the harm if mafia aborts if you try to adventure drunk? Because right now, in your script if are drunk, then its done. Just thinking, finding things to either trim or otherwise slim it.
[/quote]

Like I said, that check is mainly there for people who want to do things after they adventure/so, if needed, someone could run the script again without it aborting due to drunkeness. This way, they could have a script that contains

Code:
void main()
{
cli_execute("login username");
eat();
drink();
icy_peak_prep(); // Contains knob buffs and checks for cold protection
icy_peak_adv();
trader();
mallsell(); // or autosell();
bedtime();
}

...or something along those lines, point being that, just using the peak as an example, since there are quite a few things that could be done after, the script would login, eat and drink (if my_inebriety == 0, otherwise contine), adventure if not above drunklimit, skip adventuring if it is above drunklimit, visit the bounty hunter, mallsell remaiining furs/skins or autosell remaining furs/skins (though why anyone wouldn't save them for another day, I dunno, it's just there as example,could fit another adventure location), then have their nightcap (if right at drunklimit), put on rollover outfit, etc.

Point being there's plenty that could be done after adventuring, but if a script halts, it won't be done.

In other words, better safe than sorry ;)
 

muffins

Member
I did a quick run tonight on a new test character with the addition of the welcome_noob function from Tirian with some modifications (i.e. taking out the eating and drinking, since right now this particular function library is only for adventuring) and aside from running out of adventures, it ran quite smoothly :)

I'm going to actually break down the welcome_noob bit even more, so, for example, I can call thecrackpot mystic bit if someone tries to adventure at the Inexplicable Door without having the transfunctioner.

Also, I realized I was going at this whole thing rather backwards by importing the MiniFuncLib into the AdventureLib, then importing the AdventureLib into the FunctionLib... it'd work much better if I just threw everything into the FunctionLib file and imported that into the AdventureLib... considering AdventureLib will, no doubt, end up using an endless amount of checks and specific functions, depending on the area.

Plus, that way I don't have to write three files, only two ;)

Edit: Err, whoops... broke it :(

Edit 2: Ohh, maybe not!
Okay, I've decided to start expanding my checks (though I haven't actually implemented any of them, yet).

I'm using a MySQL table to keep track of things (also, it's easier to create a giant function library using a PHP while loop to call the rows, *drool*), and so far, these are the rows I have created:

location (varchar)
iscombat (bin)
safe_moxie (int)
req_mainstat (int)
req_hat (varchar)
req_weap (varchar)
req_offh (varchar)
req_pants (varchar)
req_acc1 (varchar)
req_acc2 (varchar)
req_acc3 (varchar)
req_outfit (varchar)
req_transport (varchar)
req_item (varchar)
req_skill (varchar)

I've got most, if not all, of the safe_moxie fields filled out, some of the req_mainstat, all of the iscombat, and some of the req_item (okay, just for the casino games at this moment).

I'm getting as much of the req_mainstat data I can from the wiki, but if anyone has data they'd like to contribute, it'd be much appreciated.

Locations like the Icy Peak will be chock-full-o'-stuff, since there are so many ways you could achieve what you need to adventure there (items/skills-wise). I might, and probably will, end up adding more req_skill fields for the purpose of making sure that sole location has as many checks as possible in place.

Like I said, if anyone has any data they'd like to contribute, for anything at all, please send it my way either here or in PM or something. After I get a bit more work done on it, I'll make my requests for data a bit more specific, but in the mean time, why not go for everything? ;)

Edit: Whoops, almost forgot to add one more check... adding a req_zodiac1(,2,3) (varchar) for sign-specific areas... I thought about making a simpler req_asc (bin) row, but I'm not sure if there's any way through script to check if a character is ascended or not, so this seemed the more logical path :)
 

muffins

Member
I certainly hope so! :D

The only reason I'm really asking for help is because it *is* such a *huge* project that's only able to be worked on while I'm not at work (welllll, I prolly could, heh), sleeping, etc. I do plan to do as much of it as possible on my own, though. Like I said, I'll start requesting a bit more specific data later on, once I've got as many of the fields filled out as I can. Right now I'm looking for missing pieces in the req_stat field... if anyone knows of a list of sorts that contains that info (like the moxie survival list), please send me a link to it!

Also, thanks in advance for all the support, everyone!

P.S. Yes, I've already got all the "new" adventure locations changed... like I said, the MySQL/PHP combo makes it so, so much easier ;)
 
Top