<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.kolmafia.us/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cheesecookie</id>
	<title>Kolmafia - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kolmafia.us/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cheesecookie"/>
	<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Special:Contributions/Cheesecookie"/>
	<updated>2026-04-24T21:14:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Append&amp;diff=4759</id>
		<title>Append</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Append&amp;diff=4759"/>
		<updated>2018-08-07T22:32:30Z</updated>

		<summary type="html">&lt;p&gt;Cheesecookie: Append returns the result, it does not change the original.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|append}}{{&lt;br /&gt;
#vardefine:return_type|buffer}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
parameter1={{Param|buffer|original}}|&lt;br /&gt;
parameter2={{Param|string|add}}|&lt;br /&gt;
p1desc={{Pspan|original}} is the buffer to add to|&lt;br /&gt;
p2desc={{Pspan|add}} is a string to add on|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=Returns a buffer containing {{pspan|original}} with {{pspan|add}} tacked on to the end.|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Sample|&lt;br /&gt;
description=Print a list of all items currently equipped.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
buffer gear;&lt;br /&gt;
&lt;br /&gt;
foreach slot in $slots[]&lt;br /&gt;
   if(equipped_item(slot) != $item[none]) {&lt;br /&gt;
      if(length(gear) != 0)&lt;br /&gt;
         gear = append(gear, &amp;quot;, &amp;quot;);&lt;br /&gt;
      gear = append(gear, to_string(equipped_item(slot)));&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;I am wearing: &amp;quot;+ gear);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|append_tail}}|&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:String Handling Routines]]&lt;/div&gt;</summary>
		<author><name>Cheesecookie</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Maximize&amp;diff=7215</id>
		<title>Maximize</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Maximize&amp;diff=7215"/>
		<updated>2016-01-05T03:46:36Z</updated>

		<summary type="html">&lt;p&gt;Cheesecookie: _spec was changed to Generated:_spec in r15467. Added example of usage to clarify how the speculative data can be used.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|maximize}}{{&lt;br /&gt;
#vardefine:return_type|boolean}}{{&lt;br /&gt;
#vardefine:return_type2|record}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
parameter1={{Param|string|expression}}|&lt;br /&gt;
parameter2={{Param|boolean|simulate}}|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function2={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
parameter1={{Param|string|expression}}|&lt;br /&gt;
parameter2={{Param|int|max_price}}|&lt;br /&gt;
parameter3={{Param|int|price_level}}|&lt;br /&gt;
parameter4={{Param|boolean|simulate}}|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function3={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate=yes|&lt;br /&gt;
return_type=record [int]|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
parameter1={{Param|string|expression}}|&lt;br /&gt;
parameter2={{Param|int|max_price}}|&lt;br /&gt;
parameter3={{Param|int|price_level}}|&lt;br /&gt;
parameter4={{Param|boolean|simulate}}|&lt;br /&gt;
parameter5={{Param|boolean|include_equip}}|&lt;br /&gt;
p1desc={{Pspan|expression}} is the list of modifiers to maximize for.|&lt;br /&gt;
p2desc={{Pspan|max_price}} limits how much meat will be spent on maximization.|&lt;br /&gt;
p3desc={{Pspan|price_level}} controls checking the mall and affects return value.|&lt;br /&gt;
p4desc={{Pspan|simulate}} will not equip gear if true.|&lt;br /&gt;
p5desc={{Pspan|include_equip}} will return a record including equipment and effects if true, otherwise only effects|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=This command will run the [[modifier maximizer]] and return true if successful. If a minimum is applied to a modifier and that minimum could not be accomplished (such as 4 clownosity) then it will return false.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This function will set &amp;quot;Generated:_spec&amp;quot; so that it can be checked with {{f|numeric_modifier}}. That is the main purpose of using a true value for {{Pspan|simulate}} as shown in the following code:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
    maximize(&amp;quot;cold resistance, spooky resistance&amp;quot;, true);&lt;br /&gt;
    print(numeric_modifier(&amp;quot;Generated:_spec&amp;quot;, &amp;quot;cold resistance&amp;quot;));&lt;br /&gt;
    print(numeric_modifier(&amp;quot;Generated:_spec&amp;quot;, &amp;quot;Maximum HP&amp;quot;));&lt;br /&gt;
    print(numeric_modifier(&amp;quot;Generated:_spec&amp;quot;, &amp;quot;Spooky Resistance&amp;quot;));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If {{Pspan|max_price}} is &amp;lt;= 0, it will use the preference autoBuyPriceLimit, or available meat, whichever is lower. Otherwise, that&#039;s the value it&#039;s considering as the max value for new items.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
If {{Pspan|price_level}} is greater than 0, Mall price is considered. If {{Pspan|price_level}} is 2, always consider mall price. If {{Pspan|price_level}} is 1, only consider it if there isn&#039;t another way.&lt;br /&gt;
Also, if {{Pspan|price_level}} is 0 or less, validateItem always returns true.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When using the 5-parameter version, a record will be returned of the format:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record {&lt;br /&gt;
   string display; //What would be shown in the Modifier Maximizer tab&lt;br /&gt;
   string command; //The CLI command the Maximizer would execute&lt;br /&gt;
   float score;    //The score added from equipping the item or gaining 1 turn of the effect&lt;br /&gt;
   effect effect;  //The effect you would gain&lt;br /&gt;
   item item;      //The item being used or equipped&lt;br /&gt;
   skill skill;    //The skill you need to cast&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
When {{Pspan|include_equip}} is true, the first items in the record array are equipment. If you are only looking for effects that you can combine with maximized equipment, a better set of parameters might be (using Prismatic Damage as an example):&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;maximize(&amp;quot;Prismatic Damage&amp;quot;,0,0,false,false);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
...which would equip items giving you bonus Prismatic Damage and return an array that can boost your score higher with certain effects. Keep in mind, these effects only count 1 turn of the effect, so effects that vary with more turns will likely no be represented properly.&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
needscode=yes|&lt;br /&gt;
&lt;br /&gt;
cli_equiv=The CLI command command &amp;quot;maximize&amp;quot; will automatically change equipment as if the {{Pspan|simulate}} parameter was false.|&lt;br /&gt;
more_info=See the page on the [[Modifier Maximizer]] for more information on how to use this, especially to create a meaningful expression.|&lt;br /&gt;
}}&lt;br /&gt;
{{RFI|What exactly is validateItem? What does it mean to us?}}&lt;br /&gt;
[[Category:Equipment]]&lt;/div&gt;</summary>
		<author><name>Cheesecookie</name></author>
	</entry>
</feed>