TraFa - The familiar helper

Thanks a ton for this script, I just used it to get the 500 lbs trophy.

Just a slight mistype: line 667 should read "Your total terrarium weight".

Glad to hear it. And the typo is fixed for the next release. Thanks. I hope Z didn't see it! :eek:

I was looking through this script and it does not seem to use Tiny Fly Glasses or Three Days Slow to increase the familiar experience per battle, nor Curiosity and Empathy to increase the familiars weight. Are these usually not used in training?:confused:

Sorry, tgetgel. I guess I missed your post. Thanks for the suggestion. ;)

For familiar equipment like the tiny fly glasses I will add a maximize familiar experience command, but this will only be useful if your combat training rather than arena training. When arena training the script uses mafia's cli command train turns which manages familiar equipment on it's own. For example:

Code:
> maximize familiar experience -tie

Maximizing...
384     combinations checked, best score 1.0
Putting on tiny fly glasses...
Equipment     changed.

> train turns 1

Starting     training session...
Putting on sugar shield...
Equipment changed.
Round     1: Zoukikensakuban-san vs. Par for the Corpse...

[3536] Cake-Shaped     Arena
Zoukikensakuban-san gains 4 experience.
Putting on tiny fly     glasses...
Equipment changed.
Putting on microwave stogie...
Equipment     changed.
Training session completed.
For Three Days Slow and other one a day buffs I see no harm in adding those in. It already gets the Corsican blessing and I'll add a hatter check for the next release.

For other buffs, I don't mind having the script doing some mood management, but I don't want it to create it's own mood. I know how to add a trigger to a mood via the cli command in script.
PHP:
cli_execute("trigger lose_effect, Curiosity of Br'er Tarrypin, cast 1 Curiosity of Br'er Tarrypin;");
However, I do not know how to remove a single trigger from the mood? Am I just missing something?

Also, I'm not entirely clear on which familiar experience modifiers work in the arena and which ones don't?! I know familiar's in the CoT don't get experience from arena training. Does anyone else have more info on this?
 
Last edited:

oska

New member
Hi,

just tried faminfo() on v1.6 of this script to check weight and equipment. Worked fine on all familiars in my terrarium but one (maybe two, but that one familiar just doesn't have an equipment uniquely fitting).

There was just one bug i stumbled over:
06-pound --- Holiday Log --- Equipment missing!

It has a pet rock "Groucho" disguise equipped, which is marked as familiar-specific equipment here. So it should definitely not be missing

Oska

Thanks for providing this code!

edit: I might add that i have another pet rock disguise equipped on other familiars, too, no problem there, those were identified correctly.
 
Last edited:

slyz

Developer
Just change line 99
PHP:
foreach guy in $familiars[Pet Rock, Toothsome Rock, Bulky Buddy Box]
to
PHP:
foreach guy in $familiars[Pet Rock, Toothsome Rock, Bulky Buddy Box, Holiday Log]
 
Update 1.7


  • Re-factored code (less server hits, less global variables, converted many functions to boolean return, renamed many functions and variables to be less cryptic)
  • Added Holiday Log support.
  • Uses the modifier maximizer to maximize familiar experience when combat training.
  • Added hatter.ash, The Function. The script uses it to get the Three Days Slow buff from the Mad Hatter.
boolean hatter(string command)
Returns true if it successfully gets a buff from the Mad Hatter. For the most part it works the same as the hatter.ash script. For a valid list of command arguments see the main hatter.ash thread.


  • Added Sellbot(#1053259) functions. The script may now utilize sellbot to buy Snooty and/or Groucho disguises. I guess this would probably be considered overkill.:)

int[item] sellbot_gifts()
Returns a map of the items currently being sold by Sellbot and their price.
boolean sellbot_buygift(int amount, item gift)
Attempts to buy amount gift from Sellbot. Returns true if it successfully buys gift from Sellbot.
boolean sellbot_buygifts(int[item]gifts)
Attempts to buy the requested amount of each item in gifts from Sellbot. Returns true if it successfully buys from Sellbot.
boolean sellbot_buygifts(boolean[item]gifts)
Attempts to buy one of each item in gifts from Sellbot. Returns true if it successfully buys from Sellbot.

Note: I talked earlier in the thread about have the script do some mood management, but for now, mood management for buffs like Curiosity of Br'er Tarrypin, Heart of White, Green Tongue and the such is still up to the user.
 

slyz

Developer
Line 642
PHP:
case "myst": totune = $stat[Moxie]; break;
should be:
PHP:
case "myst": totune = $stat[Mysticality]; break;
 

ribzer

New member
I know, two years later...

Change line 869 from

PHP:
if(!arena_wt && !arena_tt) cli_execute("maximize 100 familiar experience, 50 meat, items -tie");

to:

PHP:
if(!arena_wt && !arena_tt) { cli_execute("maximize 100 familiar experience, 50 meat, items -tie"); cli_execute("familiar lock"); }

also changing, of course, whatever you want the secondary modifier to be.


Since the modifier only runs once at the beginning, and not every time the familiar is switched out, this will lock the tiny fly glasses so it will be used by all the familiars when you're not training in the arena.
 
Last edited:

Theraze

Active member
Why would you force melee weapons regardless of class? That seems like a very bad idea. If you wanted to protect the weapon, you could do -weapon instead, but... If you want the best familiar experience weapon, don't limit it to melee only. That just seems like it's asking for some DB or AT to complain bitterly.
 

ribzer

New member
Sorry, that was my own modifier. I meant to keep it like the original. I was maximizing for experience, while the original did meat (and I am SC right now).

...I'll just go edit the post.
 

ribzer

New member
Yes, people are free to do whatever works best for them for the secondary modifiers. The original script had the non-arena adventure location be the castle, so the modifier was set for meat. But the familiar equipment needed locking since the familiar was going to be changing but the +fam exp equipment shouldn't be changed.
 

ribzer

New member
another couple changes:

Add the Homemade Robot to the list of familiars in line 75, and also do the following:

after lines 896 and line 998,

PHP:
if(have_familiar($familiar[Stocking Mimic])) remove myfamiliars[$familiar[Stocking Mimic]];


add another line for Homemade Robot, since it also does not gain experience.
PHP:
if(have_familiar($familiar[Homemade Robot])) remove myfamiliars[$familiar[Homemade Robot]];


Also, when I ran the original script, I got an error "Missing return value," on line 632, which reads

PHP:
boolean feast(){ feast(my_familiar()); }

I got the script to work by commenting this out. Since I am unlikely to have a moveable feast anytime soon, I don't mind this, but maybe somebody else can take a look? I don't really know java that well.
 
Last edited:

Theraze

Active member
Okay, I just took a quick peek at the script and did some basic work to handle the homemade robot and the feasting. Gave the robot its own function, binge_robot, which may or may not work due to not being sure which page it attaches the extra parts on. Should check that at some point, but... eh. Since the stocking and robot presumably don't count towards trophies, or at least the stocking didn't and the robot uses similar logic, put the same trophy-avoidance for the robot.

Also, the right way to do that feast line is return feast, not commenting it out. Since feast needs a boolean, return feast(my_familiar()); will be a proper boolean. :) Anyways, attached.

Oh, and one more... changed the castle lines to castle top. Since the castle is ambiguous now. Anyways, it at least all passes validation.
 

Attachments

  • trafa.ash
    43.9 KB · Views: 23

ribzer

New member
Thanks for this. I am out of adventures so I can't test it, but it looks good.

The only issues I am seeing are that the command to lock the familiar equipment wasn't added, and also the way the script calculates terrarium weight, because the command "familiar_weight($familiar[homemade robot])" returns 100 for me, even though this does not count towards the trophies. However, I don't know if I should exclude the entire robot, or all but 1 pound. I also do not know what would return for terrarium_weight() a stocking mimic.

Since I do not have a mimic, this code change can't really affect me. And I might be 1 pound off on the robot (but it is better than being 100 pounds off). It's not exactly pretty, but after line 111 (of your new version), I added

PHP:
weight -= familiar_weight($familiar[stocking mimic]); weight -= familiar_weight($familiar[homemade robot]);

to subtract the weight of those familiars back out of the total terrarium weight.


Also, it seems like maybe the stocking mimic does actually count towards trophy in some cases (but I don't think that homemade robot ever would - it is a summoned item, and a useless familiar, after all).

According to the wiki page for the mimic, up to 20 pounds will count towards trophy, just like any other familiar. But only weight gained from actual combat (with it's familiar specific equipment equipped), and not directly feeding it candy, will count. The page says "With its familiar equipment, the Stocking Mimic gains weight through combat like a normal familiar."

Implementing the changes from this info on the mimic is a bit of an overhaul of the script, so I am not expecting anything there - I just thought it was nice to know.



I don't know what "familiar_weight($familiar[stocking])" would return, and I probably never will. But I am very close to the 300 pound trophy, so I will come back to say if the robot counts as 1 or 0, unless I screw that up.
 

lostcalpolydude

Developer
Staff member
According to the wiki page for the mimic, up to 20 pounds will count towards trophy, just like any other familiar. But only weight gained from actual combat (with it's familiar specific equipment equipped), and not directly feeding it candy, will count.

I don't see that anywhere on any page. There's no reason KoL would bother tracking it well enough to do that either. I'm sure it's just capped at 20 pounds for the trophy.
 

ribzer

New member
I don't see that anywhere on any page. There's no reason KoL would bother tracking it well enough to do that either. I'm sure it's just capped at 20 pounds for the trophy.


I guess it was actually a combination of things on both the Stocking Mimic page and its discussion page (mostly at the very bottom).
 

lostcalpolydude

Developer
Staff member
I guess it was actually a combination of things on both the Stocking Mimic page and its discussion page (mostly at the very bottom).

Weird, looking at my terrarium after giving my mimic a small amount of candy seems to agree with that conclusion. Mafia doesn't track the separate weight gain sources and never will, so I guess it's impossible for a script to be completely accurate for that.
 

ribzer

New member
Right, I wasn't looking for the script to track it somehow. More like, if the total weight of the mimic was under the specified weight (and under 20), train the mimic through combat before feeding it, rather than remove it from the list of combat familiars altogether, as it does now.

Bu whatever. The script more than works for my purposes since I don't have a mimic and never will.
 

Theraze

Active member
Rather than adding the mimic/robot weight and then removing them, now we just skip adding them in the first place. If $familiars[stocking mimic, homemade robot] does not contain the current familiar being considered, add the weight. Whee.
 

Attachments

  • trafa.ash
    44 KB · Views: 31
Top