Automatically unlock areas of Dreadsylvania

Pazleysox

Member
A Clannie of mine said she was tired of all the clicks it took to unlock all the areas of dread, so I wrote this script for her.

It's pretty simple. Script will pop open a window, and display a bunch of info that it can do for you.

If will use the Freddie Kruegerands you have in inventory to buy a key if needed. It will NOT buy keys from the mall. If you don't have a key, and cannot afford to buy one, it will let you know, and stop. It will no longer continue.

It will banish monsters from zones (if they are unlocked)
It will banish elements from zones too (if locked zones are unlocked)

The script will abort before it uses any turns if there is an issue with an area (locked rooms, with no key, wrong class type, etc)

It now offers the ability to unlock one zone at a time, or all zones at once. If you choose to unlock one at a time, it will restart the script, so you can unlock multiple ones with out re-opening the script manually.

If offers the same help with banishing elements, and monsters.

For the person who's NEW to Dreadsylvania, and needs some advice, there is a help section neatly laid out inside the script also. It offers advice on how to farm for things you need for specific bosses, and tells you exactly how to get each boss to show up, instead of leaving it to chance.


Code:
svn checkout svn://svn.code.sf.net/p/unlock-dread2/code/
v2.0 The attic needs to be unlocked before you can banish sleaze/grab music parts. It now checks.
v1.9 Fixed small bug where script would see Village, and not recognize element to be banished
v1.8 Added monster banish, and fixed issue with checking locks, and aborting if an issue
v1.7 Added ability to unlock each zone individually, and restart.
v1.6 Added banish for each zone/element. Script knows if element has been banished.
v1.5 Added help for setting up Dread, including unlocking areas
v1.4 Made script stop if skeleton key can not be obtained, rather than have it continue to try, and fail, and some other minor changes again.
v1.3 Cleaned up the code a little, changed some messages, and other minor changes (thanks to bale's suggestion)
v1.2 Re-Arranged script, so it checks if an areas is unlocked BEFORE it tries to buy a key, and other stuff (much better this way)
v1.1 Added check to see if areas have been unlocked
v1.0 release: If an area is already unlocked, the script will just try to unlock it anyways. I have to put in a check for that.
 
Last edited:

Bale

Minion
It is not necessary for a repository to contain dependencies.txt so if you leave the file empty it would be better to not have it at all.

You can add the checks by using contains_text() on visit_url( "clan_raidlogs.php" ). Though you might need to unlock the choice adventure once to see what the raidlog says so that you know what text to check.
 
Last edited:

Pazleysox

Member
You can add the checks by using contains_text() on visit_url( "clan_raidlogs.php" ).

I've been playing around with that for a few days with no luck. I can't figure out the right way to code it. I've used the ashref visit_url, and ashref contains_text to get to the page describing how it works, with no luck on my part.
 

Bale

Minion
In my Clan's raidlogs I find these lines

Code:
<br>SKF (#1681024) unlocked the attic of the cabin (1 turn)
<br>SKF (#1681024) unlocked the fire watchtower (1 turn)
<br>SKF (#1681024) unlocked the schoolhouse (1 turn)
<br>SKF (#1681024) unlocked the master suite (1 turn)
<br>SKF (#1681024) unlocked the ballroom (1 turn)
<br>SKF (#1681024) unlocked the lab (1 turn)

So I tried a small program to tell me those locations was unlocked. It's been tested to be sure that I don't give you a bad example.

Code:
void main() {
	string log = visit_url( "clan_raidlogs.php" );
	foreach place in $strings[attic of the cabin, fire watchtower, schoolhouse, master suite, ballroom, lab]
		if(log.contains_text( ") unlocked the " + place ))
			print( "The " + place + " has been unlocked" );
		else print( "You need to unlock the " + place );
}

Obviously that example would need to be modified to work in your script, but the principle is sound.
 
Last edited:

Bale

Minion
I think you don't get the basic concept of foreach. All it does is allow you to run the same code while changing the variable. If the variable never changes, then foreach shouldn't be used. Here's an example from your script.

Code:
			string log = visit_url( "clan_raidlogs.php" );
			foreach place in $strings[attic of the cabin]
			if(log.contains_text( ") unlocked the " + place ))
			{	print( "The " + place + " has been unlocked, moving on", "green" );	return;}
			else print( "The " + place + " needs to be unlocked.  Unlocking now.");

That should be written as:

Code:
			string log = visit_url( "clan_raidlogs.php" );
			if(log.contains_text( ") unlocked the attic of the cabin" ))
			{	print( "The attic of the cabin has been unlocked, moving on", "green" );	return;}
			else print( "The attic of the cabin needs to be unlocked.  Unlocking now.");
 
Top