Script Request--Grand Tour

lostcalpolydude

Developer
Staff member
hiddencity.php redirects to adventure.php for non-special squares. That's why using the hipster there is useful, and you can get wandering monsters, and so on.

but there is also another
I won't believe it until I can personally test it. Or I will assume it's false through a misunderstanding like with the hidden city.
 

Donavin69

Member
Mafia already keeps track of every adventure you spend. Time to dust off session_logs()!

I love this idea, and am trying to run with it, however, I'm having a hard time figuring out how to parse the log for a location
I thought about using "Encounter:" but that gives the Mob, and not a location. The adventure number is the only place I see the location, but the only unique thing there is the ], and it is also used for crafting. I could parse the entire line and compare it to a list of locations, anyone have a better suggestion?
 

Donavin69

Member
Ok, so with a list of all the locations that I've adventured (in an array "int[location]") how do I get the list of where I haven't from the compare to all the locations in the kingdom?
 

slyz

Developer
Do it the other way around:
PHP:
string adv_log;
foreach i, log in session_logs( 5 )
{
	adv_log += log;
}

foreach loc in $locations[]
{
	if ( adv_log.contains_text( "] " + loc ) ) print( "You have already adventuresd in " + loc );
}
 

Donavin69

Member
I'm glad I asked, this is way much easier than what I was doing...I was trying to make a list of where I still needed to adv, rather than just process it as I went.

Thanks Slyz
 

Catch-22

Active member
I won't believe it until I can personally test it. Or I will assume it's false through a misunderstanding like with the hidden city.

I confirmed it on a 3rd, rarely used, account just a few minutes ago. There's definitely at least one adventure. Donavin's script will actually go there, but Donavin's script will also go to a few places that don't count.

If you're confident enough that only adventure.php counts, then you can add (loc.to_url().index_of("adventure.php") > -1) as a condition to Donavin's script to save yourself a few adventures, but I can guarantee you'll miss out on at least one adventure that counts.
 

Flanders

New member
Dude. That's a good script, containing functionality I never would have thought to add. Go, Donavin!

Though I didn't come back and declare my abject failure as a mafia scripter, I did fail. Abjectly. Don's script goes way beyond what I envisioned, and to him I will send the m1million. Because that's awesome.
 

jwylot

Member
Now we just need a script which parses our logs for booze consumed in the last 30 days......
/me ducks :)
 
Top