Quick scripting question regarding special familiar item drops

shazbot

Member
I'm having difficulty finding how, in an ash, to determine how many of an item the familiar has dropped. Example, I would like to know how, in my script, how many absinthe bottles have been dropped in the day. I know kolmafia has it, but I'm having issues finding a way to get that in a script.
 

Theraze

Active member
In ASH, you'd use get_property("<value>") where <value> is something like _absintheDrops... just look for items in your settings file with Drops.
 

Bale

Minion
Code:
[COLOR="#808000"]> pref drops[/COLOR]

_absintheDrops (user, now '0', default 0)
_aguaDrops (user, now '0', default 0)
_astralDrops (user, now '0', default 0)
_gongDrops (user, now '0', default 0)
_pieDrops (user, now '0', default 0)
_tokenDrops (user, now '0', default 0)

That's the preferences you're looking for. pref is an alias I use to search through the list of all mafia's preferences. It's a very useful tool. Here it is for your use:

PHP:
alias pref => ashq record r{string d;};r[string,string] m; string[int]a; file_to_map("defaults.txt",m); matcher s = create_matcher("(\\w+)(\\s=*\\s*([\\w\\.]+))?",$string[%%]); if(find(s)){foreach t,p,d in m if(to_lower_case(p).contains_text(to_lower_case(s.group(1)))) {print(p+" ("+t+", now '"+get_property(p)+"', default "+d.d+")"); a[count(a)] = p;}if(s.group(2)!="0"){if(count(a)==1)set_property(a[0],s.group(3));else print("You do not match exactly one preference!","red");}}else print("Invalid parameters","red");

The underline is the first character of the preference. It is part of the name, but it also has special significance. Any preference that starts with an underline is reset to its default value at rollover.
 
Last edited:
Top