looking at clan_raidlogs.php

Pazleysox

Member
Code:
void main() {
	string log = visit_url("clan_raidlogs.php");
	string [int] drove;
	foreach place in $strings[some werewolves out of the forest, 
		some bugbears out of the forest, 
		some vampires out of the castle,
		some skeletons out of the castle, 
		some zombies out of the village, 
		some ghosts out of the village] {
			drove = split_string(log, place);
			if(count(drove) > 1)
				print("Drove " + place+ " " + (count(drove) - 1) + " times.");
			else print("Didn't drive " + place);
	}
}

So, while messing around with this script, I can now figure out if an area has had monsters driven out 1, or 2 times. This makes the banish script that much better. I need to now figure out which one the player adventured in.
 

Pazleysox

Member
Here's what I ended up putting in. I made the "string log" the first thing it checks, because there's multiple places in the code that looks at the log.

Code:
void main() {
	print("Checking out the Cabin", "Green");

			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, initiating banish", "green" );	}
			else
			{	print("The attic of the cabin has not been unlocked yet.  Unlock, and re-run script.", "red"); exit;	}
		}
		{	string [int] drove;
	foreach place in $strings[some werewolves out of the forest] 
	 {
			drove = split_string(log, place);
			if(count(drove) == 3)
			{	print("Drove " + place+ " " + (count(drove) - 1) + " times.");	return; }
			else if(count(drove) == 2)
			{	print("Drove " + place+ " " + (count(drove) - 1) + " times.");	}
			else { print("Didn't drive " + place); }
	}}
	visit_url("clan_dreadsylvania.php?action=forceloc&loc=1");
	visit_url("choice.php?pwd&whichchoice=721&option=3"); //attic
	visit_url("choice.php?pwd&whichchoice=724&option=2"); //banish werewolves
}

I tried to make the second half look like the first with no success. If I removed the "foreach place in $strings" code, I get nothing but errors. I've tried multiple ways to code it. I think leaving it in works best (for now at least). I've managed to make it work. What I'm trying to make it do, is skip an area that's had 2 of a particular monster type already banished, and adventure in the areas if 0, or 1 banish has been done.
 
Last edited:
Top