Hobo Code Getter

Tipmon

Member
OK, so I have been wanting to learn how to script in ash for awhile now but I never saw anything that really caught my attention that I also thought I could do. I found an old thread from 2009 by tebee with a glyph checker script. It was abandoned and I thought that maybe I could add some adventuring to it so it would automatically get the codes also for aftercore. This is the first time I ever made a script so I am kinda proud even though I have alot of questions about it so I can fix things.

One of the main problems (I am not actually sure is a problem but if it is then it will ruin the entire script) is I am not sure how autoabort works in relation to a script. The wiki said that it stops the automation aspect of Mafia but does that include scripts? It also said that it wouldn't autoabort if there was a condition that is still unfulfilled, is there a way to add a specific non-adventure as the condition? I used
Code:
adventure(my_adventures(),$location[whatever])
That is kinda scary and I am not sure if it will work. Will the auto stop make it stop adventuring there with that line? Will it abort the entire script or actually just abort that adventure sequence and allow the script to continue executing lines after that adventure line?

Another problem is I feel like it will lag too much (and hammer on the servers WAY too much) because I visit url's constantly throughout the script. Is there and easier/simpler/less hammery way to check the quest log for all the codes with only one function? Is there a way to check a location's availibility for regular zones like The Cyrpt? --This is a part of the script that makes me very disappointed because I know there are about a billion better ways to do this but I don't know how with my limited knowledge.

I see some scripts that make a popup window that will let the user change values everytime the script is executed. How is the managed? I looked at the wiki but couldn't find anything about it. I would like to add one to see if they want it to spend adventures trying to get the codes or if they just want a list of codes they are missing.

/end huge post

THIS ISN'T FINISHED!
(Note: I commented out all the lines about adventuring because I didn't want to waste all my adventures while debugging it)


Thanks in advance for all the help!
 
Last edited:

Winterbay

Active member
1) I believe all the hobo codes are "autoaborts" and as such will exit the adventure()-function when encountered and continue on to any lines of code after that funciton. If you specifically want to hunt for such an adventure you can use "1 autostop" as the condition, or if you want to check for the correct adventure name you can adventure one turn at a time and check the result of get_property("lastEncounter") against the name of the noncombat.

2) I guess you could import canadv.ash which can be used to check the availability of zones. You may still need to check the questlog for the glyphs already found, but it should be enough to do that once at the beginning of the script and then add any further found when found rather than recheck the questlog again.

3) user_confirm() is the function you are looking for for the little pop-up.
 

Tipmon

Member
Ok, thanks. I added the popup and uncommented most of the adventures(I couldn't nail a few of the technical names for areas). I also added some checks for adventures remaining, a check for the hobo code binder, and a block to equip it for you. I uploaded the new version in the OP incase anyone else stumbles upon this.
 

Theraze

Active member
Also, if you're feeling paranoid:
Code:
					cli_execute("conditions add 1 autostop;");
autostop IS a valid condition that you can set. If you want. I use it in TheSea for Granny's last adventure.
 

HasteBro

Member
I would suggest you check on how maps work in a ASH script. They can make your script shorter and faster.

As for the checking which glyphs you have. I would suggest visit_url() and a matcher to find them in the source code. A single check would be needed to parse all acquired codes. This would need a map to make it more manageable.
 

Pazleysox

Member
I updated this script. It was only a few simple things that needed to be changed. I find that I needed this script for a new project, and if anyone else happens to need it, here it is.

View attachment glyphs.ash
 

Attachments

  • glyphs.ash
    17.7 KB · Views: 55
Last edited:
Top