Visiting cellar

relyk

New member
I want to check and print if the rat faucet has been found but visit_url for the cellar counts as an adventure. This is kind of ugly and annoying to look at. Is there a way to prevent mafia from printing to the CLI?
 

StDoodle

Minion
This is kind of ugly and annoying to look at. Is there a way to prevent mafia from printing to the CLI?

I'm guessing from the way you've put that that you type "ash visit_url(..." on the cli; don't. Use ashq instead to avoid putting the html on the cli. Also, you may want to visit and parse your quest log instead of the tavern. Also also, you may want to be careful about using the word "annoying" to describe the program's (correct) behavior. The devs find that word annoying.
 

relyk

New member
This is in a script. I would just parse the quest log if it indicated whether you have found the rat faucet yet. Mafia counts just going to the cellar itself as an adventure even though it isn't, I doubt that is intended.
 

Veracity

Developer
Staff member
Mafia doesn't "count" things as costing adventures unless KoL itself tells you after the fact that your adventures remaining have gone down.

I assume that what you meant to say is that we printed your adventure count in the gCLI or session log when you visit the cellar.php map, rather than only when you visit a square. If so, yes, that is not intended. It's also completely not a big deal for you to simply ignore the adventure number on that line and just smile happily when you see the same adventure number in the log when you actually go to a square.
 

icon315

Member
Code:
> ash string url = visit_url("cellar.php"); contains_text(url,"A Rat Faucet");

[3948] Tavern Cellar
Encounter: The Tavern Cellar
Returned: true


Works great. You can ignore that whole encounter thing, it doesn't really count an adventure
 
Last edited by a moderator:

relyk

New member
I was wondering if the encounter part could be hidden since my script prints a checklist. I've had it stored as a string so it pops up at the start and wondered if there was a better solution than smiling happily at it :/
 

icon315

Member
ok then you can use this

PHP:
string url = visit_url("questlog.php?which=2"); 
 if(contains_text(url,"Ooh, I Think I Smell a Rat")){
print("Faucet closed", "green");
} 
else print("Faucet open", "red");
 
Top