Difference between pages "Help:To Do List" and "Is trendy"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Bale
(→‎Missing Stuff: r17477: can_still_steal())
 
imported>Eliteofdelete
 
Line 1: Line 1:
{{TOCright}}
+
{{
 +
#vardefine:name|is_trendy}}{{
 +
#vardefine:return_type|boolean}}{{
  
== "To Do" List ==
+
FunctionPage|
 +
name={{#var:name}}|
  
This is a list of stuff that is missing from the wiki or else needs major work. Please help!
+
function1={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
parameter1={{Param|item|thing}}|
 +
}}|
  
 +
function2={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
parameter1={{Param|familiar|thing}}|
 +
}}|
  
If you need tips for editing the wiki, find that here: [[Help:Editing]].
+
function3={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
parameter1={{Param|skill|thing}}|
 +
}}|
  
*CLI Commands are usually only added to the [[CLI Reference]]. Only very complicated commands require their own page.
+
function4={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
parameter1={{Param|string|thing}}|
 +
p1desc={{pspan|thing}} is checked for trendiness|
 +
}}|
  
*ASH commands need to be listed on their category page as well as on the [[Ash Functions]] list.  
+
function_description=This function checks to see if the {{pspan|thing}} is currently trendy. {{pspan|thing}} can be an item, familiar, skill. It can also be a string to check all categories. Using the string parameter is the only way to check a campground items. Bookshelf skills are checked by the skill parameter.</p>
**It is not necessary to always create a code sample, although it is preferred.
 
**If you don't add a code sample, please remember to add '''needscode=yes|''' to the page.
 
  
 +
<p>Fuzzy matching is not used for a string parameter so you need to spell it properly, including [http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references character entities]. Otherwise it will not match against the item, familiar or skill in the database.|
  
== Missing Stuff ==
+
code1={{CodeSample|
 +
title=Code Samples|
 +
description=Ouputs which familiars can be used if you are on the Trendy Path.|
 +
code=
 +
<syntaxhighlight>
 +
if (my_path() == "Trendy") {
 +
  foreach it in $familiars[]
 +
      if (have_familiar(it) && is_trendy(it))
 +
        print("You can currently use familiar "+it+".", "blue");
 +
}
 +
else print("You are not on the Trendy path.", "blue");
 +
</syntaxhighlight>|
  
'''test CLI commands:'''
+
}}|
 
r14764: add "test xpath" to, well, test xpath expressions
 
r14767: Expose an xpath function that relay scripts can use after they've invoked visit_url().
 
http://kolmafia.us/showthread.php?16722-the-DOM-regex-scalability-and-other-jargony-words
 
http://kolmafia.us/showthread.php?16764-xpath-primer
 
 
r14967: Add "test mchat" command which can be used after "test load JSONFILE"
 
 
This is how test newitem is used!
 
http://kolmafia.us/showthread.php?17365-When-detecting-new-items-detect-new-outfits-too&p=119368&viewfull=1#post119368
 
r15741, Now "test newitem descId" no longer requires itemId.
 
 
r15176: Add "test adventure URL" CLI command to see how we translate the given URL
 
 
r15239: Add "test dump_disabled_skills" to the gCLI to aid upcoming debugging
 
 
r15606: Add "test encounter URL" command.
 
 
r15874: Add "test leet NAME" command to check if KoL monster names get translated successfully from their 1337 versions.
 
 
r15883: "test load HTMLFILE" followed by "test aagain" will print the Adventure Again URL from that page.
 
 
r16275: "test visit-choice" now prints the various choice options available on the loaded HTML text.
 
 
r16309: Add "test manuel" command which will process a loaded HTML file as if it were the response to a visit to Monster Manuel.
 
http://kolmafia.us/showthread.php?19094-shrine-to-the-Barrel-god-(Sept-2015-IotM)&p=128256&viewfull=1#post128256
 
 
r15928: Add "test monster" command to parse the monster out of the saved HTML and save
 
it where ASH's last_monster() function will fetch it.
 
 
r16496: Add "test spleen X" to set your current spleen use to X (as far as KoLmafia knows; obviously it does not actually change KoL's value).
 
 
r16508: Add "test numberology adventureDelta spleenDelta"
 
 
r16519: Add "test stats X" to set all three stat values to X substats (if X > 0).
 
 
r17296: Add "test cookies" command to see values of the "special" cookies we track.
 
 
r17446: Soup up "test crop" command to allow specifying current crop and test crop.
 
Fix crop "is better than" test to only include count when comparing identical crop type
 
  
r15148: Track Xiblaxian holo-wrist-puter drops in '''_holoWristDrops''', and progress toward the next drop in '''_holoWristProgress'''.
+
see_also={{SeeAlso|is_giftable|is_tradeable}}|
 +
}}
  
r15177: Track which keys have been used on the Sorceress Tower door in a setting: '''nsTowerDoorKeysUsed'''
+
[[Category:Miscellaneous Functions]]
It is a comma separated list.
 
 
 
r15235: Add buffer '''run_choice( int )''' command. When in a choice adventure, use this to submit the selected option.
 
With -1 as imput, it will automate the rest of the choice using existing settings.
 
 
Also add '''run_turn()''', which will work as run_combat() or run_choice( -1 ) depending on whether you are in combat or in a choice.
 
 
 
r15238: Provide '''limit_mode()''' function that returns (currently) null or spelunky.
 
 
 
r15354: Move "equip all familiars" function from the FamiliarTrainingFrame to a new
 
module: FamiliarManager. Let ASH use it via boolean '''equip_all_familiars()'''
 
 
 
r15440: Add "'''servants'''" command to list Ed's servants, "'''servant'''" to list status of your current servant,
 
and "'''servant TYPE'''" to switch to the servant of the specified type.
 
 
 
r15441 adds the $servant data type to ASH and the following functions to manipulate them:
 
 
int '''to_servant'''( servant )
 
servant to_servant( int )
 
servant to_servant( string )
 
servant '''my_servant'''()
 
boolean '''have_servant'''( servant )
 
boolean '''use_servant'''( servant )
 
 
Additionally, it has the following proxy fields:
 
int id
 
string name
 
int level
 
int experience
 
string image,
 
string level1_ability
 
string level7_ability
 
string level14_ability
 
string level21_ability
 
 
 
r15466: Add '''chew'''(INT,ITEM) to ASH for cnsuming spleen toxins
 
 
 
equip [2268] will equip an item by number.
 
 
 
r15475: Add '''prefref''' as a built-in gCLI command
 
 
 
r15590: '''Add run_combat( string filter )'''.
 
 
 
r15676: Make built-in Sorceress Tower scripts available to scripts.
 
 
 
CLI: '''maze''' [arg]
 
CLI: '''door'''
 
 
 
'''hedge_maze( string )'''
 
'''tower_door()'''
 
 
The string argument for the maze can be one of:
 
traps - 4 turns, all traps
 
gopher or duck - 7 turns gopher and duck
 
chihuahua or kiwi - 7 turns chihuahua and kiwi
 
nugglets - 10 turns, all nugglets
 
 
 
r15791: The "pvp" command with no arguments will list available stances and their
 
associated option number. You now can now specify a stance by either name or
 
number. The "pvp" command now requires you to choose a stance, since it can
 
no longer choose a reaosnable default based on your stats.
 
 
 
r15796: Add ASH function: '''int [string] current_pvp_stances()'''
 
 
 
r15840: Provide  ASH '''string leetify( string )''' function to garble strings.
 
 
 
r15847: Add "Random Monster Attributes" modifier as provided by dice items and the
 
Curse of Randomness status effect. Add random_attributes proxy field to ASH
 
$monster type. Munge random attributes from monster names is the Random Monster
 
Attribute modifier is > 0, not only if current path is One Crazy Random Summer.
 
 
 
r15922: Add Familiar Script. This script will run after changing familiars, before
 
automatically changing familiar equipment. The script should have a boolean main() function.
 
Returning true will cause normal familiar equipiment switching to be skipped,
 
while false will lead to it running after the script returns.
 
 
 
r15937: Add mayosoak command
 
 
 
r15959: Add knowledge of familiar drop counters to FamiliarData,
 
New ASH proxy fields for $familiar data type:
 
drop_name = short name of the thing that drops
 
drop_item = if it is a single item, the $item. Otherwise, $item[none]
 
drops_today = how many things this familiar has dropped so far today
 
drops_limit = the maximum number of available drops from this familiar today
 
 
 
CLI: wumpus status - Display status of last wumpus cave.
 
r16014: Add "wumpus replay FILE" command to process the session log of a wumpus exploration and make deductions, etc.
 
r16015: Add "wumpus reset" CLI command to clear in-memory Wumpus cave state
 
 
 
r16044:The "cheat" command is a synonym for the "play" command. options:
 
play random - play a random card (1 draw)
 
cheat phylum PHYLUM - cheat (5 draws) a fight with specified phylum
 
cheat stat STAT - cheat (5 draws) 500 substats of specified stat
 
cheat buff BUFF - cheat (5 draws) 20 turns of the specified buff, either by name
 
  or by effect: muscle, mysticality, moxie, item drop (or items), initiative
 
cheat CARD - cheat (5 draws) the specified card name.
 
PHYLUM, STAT, BUFF, and CARD all use fuzzy matching.
 
 
 
r16047: Track Armorer quest (Madness Bakery) as questM25Armorer.
 
 
 
r16060: Make fixed list of modifier maximizer strings configurable
 
set maximizerList. Default value is:
 
mainstat | mus | mys | mox | familiar weight | HP | MP | ML | DA | DR | +combat -tie | -combat -tie | initiative | exp | meat drop | item drop | 2.0 meat, 1.0 item | item, sea | weapon dmg | ranged dmg | elemental dmg | spell dmg | adv | pvp fights | hot res | cold res | spooky res | stench res | sleaze res | all res | mp regen | ML, 0.001 slime res | 4 clownosity, -tie | 7 raveosity, -tie | surgeonosity | +four songs
 
 
 
r16163: For all monsters where our name differs from Manuel's, add a new attribute: Manuel: "MANUEL NAME"
 
Add .manuelName proxy field for ASH $monster data type
 
 
Add "'''checkmanuel'''" command which will look up all of you
 
 
'''int monster_factoids_available( monster )'''
 
 
returns number of factoids currently retained in memory. Note that this
 
can be more than the currently logged in character knows, since we don't
 
flush the factoids from a previous login if you know all three factoids.
 
 
'''string monster_manuel_text( monster )'''
 
 
returns the full HTML of the monster manuel entry for the given
 
monster. As above, this could have been retained from the previous
 
character; otherwise, it will fetch and cache the text.
 
 
 
r16166: Add ASH function: '''boolean [monster] all_monsters_with_id()'''
 
 
returns a map of all monsters that have a non-zero monster ID. It builds this
 
afresh every time you call it, since new monsters can be (temporarily) added
 
 
 
r16169: Add MonsterManuelManager.flushCache()and expose it to ASH via flush_'''monster_manuel_cache()''' function.
 
Add a second parameter to MonsterManuelManager.getFactoidsAvailable: boolean
 
cachedOnly says "don't look on the page if the monster is not in the cache,
 
because we have already looked at the page and the monster wasn't there."
 
Expose this to ASH by changing '''monster_factoids_available()''' parameters: monster, boolean
 
 
 
 
 
r16171: Add ASH function: '''boolean[monster] get_location_monsters(location)'''
 
This has the same info as get_monsters, but returns a (perhaps) more useful aggregate value
 
 
 
r16200: '''Mayominder''' CLi command. Sets (buying if needed) Mayo Minder to a particular Mayo.
 
Can specify Mayo name or use a description (adv, stat, food, drunk or bmc).
 
 
 
r16218: Add ASH function '''get_stash()''' to retrieve cached view of clan stash
 
 
 
r16391: Add ASH '''skill_modifier'''(object, modifiername) (currently only useful for "Skill")
 
to interpret the specified modifier of an item as a skill object.
 
 
 
r16396, r16398 & r16399 : '''Numberology''' command:
 
numberology - lists all the currently possible seeds and what they give you
 
numberology? N - N is the desired (numeric) result you want. Tell you if it is currently available.
 
numberology N - Attempts to get the desired result.
 
For both of these, if it is not currently available, tells you in how many turns it will be available.
 
 
 
16481: Add $vykea type to ASH
 
vykea my_vykea_companion( )
 
int to_int( vykea )
 
vykea to_vykea( strict_string )
 
 
 
r16800: Add multi-line string support to ASH. In order to specify a multi-line string,
 
you must explicitly escape the end-of-line by placing a backslash (\) at the end of the line.
 
 
Note that as a consequence of how the parser is written, it will trim all
 
leading and trailing whitespace for each of these lines via Java's
 
String.trim() method. Previously, this was irrelevant in the context of ASH
 
strings, but now that ASH strings can span multiple lines, it is worth
 
mentioning. If you want to have whitespace at the beginning of the line,
 
just escape the first character of the line.
 
 
 
r16866: Add aggregate literals to ASH.
 
http://kolmafia.us/showthread.php?20103-16866-Add-aggregate-literals-to-ASH-The-main-use-of-these-is-likely-for-initializa
 
http://kolmafia.us/showthread.php?10685-Map-literals-in-ASH-(potential-feature)&p=134150#post134150
 
 
 
r16886: Add '''witchess''' command to get Puzzle Champ. This only works if you have solved all puzzles.
 
 
 
r16978: Eudora CLI command now returns current correspondent with no argument.
 
Add ash string eudora() command which returns current correspondent.
 
Add ash boolean eudora(string) command which takes "penpal", "game" or "xi" and attempts to set that correspondent.
 
 
 
r17023: Add terminal gCLI command
 
 
 
r17136: Track furniture in the Clan Rumpus Room, accessible with '''get_clan_rumpus()'''. Extra Adventures and PvP Fights from furniture are tracked.
 
If your clan has a ball pit, the last entry in get_clan_rumpus() will indicate how many balls are in it.
 
 
r17471: get_clan_rumpus() now returns int [string] map of furniture names.
 
http://kolmafia.us/showthread.php?21006-Improve-return-value-of-get_clan_rumpus()
 
 
 
r17151: Add ASH and CLI support for stocking mall stores from Hagnk's.
 
boolean '''put_shop_using_storage(int price, int limit, item it)'''
 
boolean '''put_shop_using_storage(int price, int limit, int qty, item it)'''
 
 
and extends the CLI commands mallsell and shop.
 
put_shop() works by batching requests for "shop put". Similarly, buy_using_storage() puts together requests via "buy using storage".
 
 
 
r17283: Add "timespinner" command courtesy of lost.
 
Add "timespinner" command courtesy of lost.
 
timespinner list food -> list available foods
 
timespinner eat FOOD -> Spin and Munch on the specified food
 
 
r17284: Allow pranking with timespinner
 
 
r17286: Add "timespinner list monsters [filter]". This will show all monsters that should be available in the Time-Spinner, optionally filtered (case-insensitive).
 
 
 
r17290: Add traceprint( string) ASH function
 
 
 
r17454: Experimental ASH feature: allow X++, X--, ++X, and --X with their normal meanings: post-increment, post-decrement, pre-increment, and pre-decrement.
 
 
 
r17460: Add Java-style "for" loop:
 
for (INIT [, INIT]* ; CONDITION ; ITERATE [, ITERATE]* ) BODY
 
You can have 0 or more INIT statements, which can be of the form
 
X = EXP (where X is declared already) or
 
TYPE X = EXP (whre X of type TYPE will be declared for use in the BODY scope).
 
 
You can have 0 or more ITERATE statements, which can be of the form
 
X++ or X--
 
++X or -- X
 
X OPER EXP (where OPER can be =, +=, -=, etc.
 
 
BODY can be a single statement ending with a ; or a block enclosed in {}, with no ; at the end, just like and other loop.
 
 
break, continue, return, or exit are allowed within BODY, just like any loop.
 
 
 
r17477: Add boolean '''can_still_steal()''' function to ASH, which calls the same function
 
that Stationary Buttons use do decide whether to enable or disable the "steal" button
 
 
 
== Needs Major Work ==
 
 
 
[[Proxy Records]] is only slightly better than a placeholder.
 
 
 
In r10047, the adventure tab interface was altered. Fix SinginSally's guide on pages...
 
 
http://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Attack_Script
 
http://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Custom_Combat_Script
 
http://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Goal-Oriented_Adventuring
 
 
 
Information on moods calling other moods: http://kolmafia.us/showthread.php?8852-Composable-Moods&p=66468&viewfull=1#post66468
 
 
 
== Needs Code Samples ==
 
 
 
There is a list of all pages that require code samples: [[:Category:Needs_Code_Sample|Category:Needs Code Sample]]
 
 
 
Information on how to create a code sample: [[Template:CodeSample]]
 
[[Category:Contributing]]
 

Latest revision as of 14:20, 17 January 2015

Function Syntax

boolean is_trendy(item thing )

boolean is_trendy(familiar thing )

boolean is_trendy(skill thing )

boolean is_trendy(string thing )

  • thing is checked for trendiness

This function checks to see if the thing is currently trendy. thing can be an item, familiar, skill. It can also be a string to check all categories. Using the string parameter is the only way to check a campground items. Bookshelf skills are checked by the skill parameter.

Fuzzy matching is not used for a string parameter so you need to spell it properly, including character entities. Otherwise it will not match against the item, familiar or skill in the database.

Code Samples

Ouputs which familiars can be used if you are on the Trendy Path.

if (my_path() == "Trendy") {
   foreach it in $familiars[]
      if (have_familiar(it) && is_trendy(it))
         print("You can currently use familiar "+it+".", "blue");
}
else print("You are not on the Trendy path.", "blue");

See Also

is_giftable() | is_tradeable()