Feature - Implemented familiar_name()

Fluxxdog

Active member
This might seem more cute than anything, but I was wondering about a function to report the given name of a familiar
Code:
string familiar_name(familiar check_me)
Returns the name of the given familiar. If you don't have that familiar, returns "".

Yeah, backburner project, but had to ask :)
 

slyz

Developer
I don't think Mafia stores your familiars' names anywhere, so there would be quite a bit of work to scrape familiar names from familiar.php, store them, and retrieve them for the familiar_name() function.

I think you would be better off doing it in ASH and saving the names in a data file.
 

Fluxxdog

Active member
Didn't think it'd be that much work. I know when you first log in it goes through your familiars to determine what you have, but I thought it'd be a simple add to save the name of the familiar as well. Then again, I don't have experience coding in Java, so... chalk it up to naivete?
 

lostcalpolydude

Developer
Staff member
Save the names in 150 (and growing) preferences? Or maybe a single giant strange-character delimited (because commas can be in the name, right?) preference? Both seem like ugly implementations.
 

Theraze

Active member
I'd probably suggest only saving it as a proxy value for that login session, since it doesn't really matter and it's in the scrape page anyways. But still... minimal benefit, easily scripted.
 

Bale

Minion
There may be one or two people who will ever find a use for the familiar_name() function. It's basically just a curiosity. Do you actually have a use for this? If so, then I am curious to hear what it is.

Anyway, you can write a script to scrape your terrarium and report on the names of your familiars if you actually have a use for it. Get the page with visit_url() and then use these functions to extract the names.

I'm marking this "Rejected."
 

Veracity

Developer
Staff member
We already scrape familiar names when we visit the terrarium and save them in the FamiliarData associated the appropriate familiar.
Revision 9705 adds a proxy field to familiars:

$familiar[mosquito].name -> "your name here"
$familiar[emo roe].name -> "" (unless you are very lucky and the object of my envy and resentment. ;))
 
Top