Difference between pages "File talk:Breakable equipment.jpg" and "Maximize"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Heeheehee
m (Uhh... what?!)
 
imported>Cheesecookie
(_spec was changed to Generated:_spec in r15467. Added example of usage to clarify how the speculative data can be used.)
 
Line 1: Line 1:
== THIS! IS! SPAMBOT! ==
+
{{
 +
#vardefine:name|maximize}}{{
 +
#vardefine:return_type|boolean}}{{
 +
#vardefine:return_type2|record}}{{
  
Times this page has been spammed: 3
+
FunctionPage|
 +
name={{#var:name}}|
  
Now we know what happens when we protect the page that spambots like. This seems to be the new spambot page. ;) --Bale 21:29, 17 August 2010 (UTC)
+
function1={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
parameter1={{Param|string|expression}}|
 +
parameter2={{Param|boolean|simulate}}|
 +
}}|
  
Times this page has been spammed: 5 --[[User:Bale|Bale]] 06:56, 18 August 2010 (UTC)
+
function2={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
parameter1={{Param|string|expression}}|
 +
parameter2={{Param|int|max_price}}|
 +
parameter3={{Param|int|price_level}}|
 +
parameter4={{Param|boolean|simulate}}|
 +
}}|
  
Times this page has been spammed: 7 --[[User:Heeheehee|Heeheehee]] 23:54, 20 August 2010 (UTC)
+
function3={{Function|
 +
name={{#var:name}}|
 +
aggregate=yes|
 +
return_type=record [int]|
 +
return_also={{#var:return_also}}|
 +
parameter1={{Param|string|expression}}|
 +
parameter2={{Param|int|max_price}}|
 +
parameter3={{Param|int|price_level}}|
 +
parameter4={{Param|boolean|simulate}}|
 +
parameter5={{Param|boolean|include_equip}}|
 +
p1desc={{Pspan|expression}} is the list of modifiers to maximize for.|
 +
p2desc={{Pspan|max_price}} limits how much meat will be spent on maximization.|
 +
p3desc={{Pspan|price_level}} controls checking the mall and affects return value.|
 +
p4desc={{Pspan|simulate}} will not equip gear if true.|
 +
p5desc={{Pspan|include_equip}} will return a record including equipment and effects if true, otherwise only effects|
 +
}}|
  
Times this page has been spammed: 9 --[[User:Bale|Bale]] 19:14, 21 August 2010 (UTC)
+
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.</p>
  
Times this page has been spammed: 10 --[[User:Heeheehee|Heeheehee]] 04:13, 22 August 2010 (UTC)
+
<p>This function will set "Generated:_spec" 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:</p>
 +
<syntaxhighlight>
 +
    maximize("cold resistance, spooky resistance", true);
 +
    print(numeric_modifier("Generated:_spec", "cold resistance"));
 +
    print(numeric_modifier("Generated:_spec", "Maximum HP"));
 +
    print(numeric_modifier("Generated:_spec", "Spooky Resistance"));
 +
</syntaxhighlight>
  
Times this page has been spammed: 11 (That's ridiculous. It's not even funny. Seriously it isn't)----[[User:Icon315|Icon315&#9813;]] ([[User talk:Icon315|&#9742;]]|[[Special:Contributions/Icon315|♤]]) 23:22, 23 August 2010 (UTC)
+
<p>If {{Pspan|max_price}} is <= 0, it will use the preference autoBuyPriceLimit, or available meat, whichever is lower. Otherwise, that's the value it's considering as the max value for new items.</p>
  
* You're right that it really isn't funny, but thanks to your "seriously it isn't" comment, I spit tea out my nose. So I guess it was funny after all. Either that or I just have a bad case of reverse-schadenfreude where I take delight in my own misery. --[[User:Bale|Bale]] 23:31, 23 August 2010 (UTC)
+
<p>
 +
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't another way.
 +
Also, if {{Pspan|price_level}} is 0 or less, validateItem always returns true.</p>
  
Times this page has been spammed: 12. Ok first of all, why would you spam here? Secondly, should we block this page?----[[User:Icon315|Icon315&#9813;]] ([[User talk:Icon315|&#9742;]]|[[Special:Contributions/Icon315|♤]]) 19:54, 24 August 2010 (UTC)
+
<p>When using the 5-parameter version, a record will be returned of the format:
 +
<syntaxhighlight>
 +
record {
 +
  string display; //What would be shown in the Modifier Maximizer tab
 +
  string command; //The CLI command the Maximizer would execute
 +
  float score;    //The score added from equipping the item or gaining 1 turn of the effect
 +
  effect effect;  //The effect you would gain
 +
  item item;      //The item being used or equipped
 +
  skill skill;    //The skill you need to cast
 +
};
 +
</syntaxhighlight>
 +
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):
 +
<syntaxhighlight>maximize("Prismatic Damage",0,0,false,false);</syntaxhighlight>
 +
...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.
 +
|
  
* NO! We should not block this page. There was another page on this wiki (whose name escapes me since it was weird) which was spammed exclusively. We didn't use that page for anything, so we deleted it every time the spambot created it. We finally decided to protect that page 3 days before this page became the new spam lightening rod. If we protected this page, the new spambot favorite page might be one that actually gets used. That would be BAD! --[[User:Bale|Bale]] 20:53, 24 August 2010 (UTC)
+
needscode=yes|
** '''(ASHRM) String Handling Routines''' or something like that? But yeah, I had originally protected the page but was convinced to unprotect it because of the cool analogy (lightning rod!). It was eventually StD who reprotected it because he got sick of the spam problem. But since it's resurfaced, we really should learn to stop protecting pages. If it spreads to a new page while this one's still unprotected, then we might consider protecting pages en masse (alternative solution, pester Fewyn to restrict editing to logged-in users only, but we'd have to wait for him to respond). But okay, it's been hit 12 times in a row without any other targets coming into sight. Guess we'll have to wait another 25 before being really sure that spambots won't target any other pages. --[[User:Heeheehee|Heeheehee]] 21:23, 24 August 2010 (UTC)
 
***Isn't there a way to make it so that only registered users can edit pages? That would keep away lots of spam bots----[[User:Icon315|Icon315&#9813;]] ([[User talk:Icon315|&#9742;]]|[[Special:Contributions/Icon315|♤]]) 22:00, 24 August 2010 (UTC)
 
***It seems that only fewyn can change [[Special:ListGroupRights|permissions]]. --[[User:Bale|Bale]] 23:49, 24 August 2010 (UTC)
 
*** Yep. "(alternative solution, pester Fewyn to restrict editing to logged-in users only, but we'd have to wait for him to respond)" --[[User:Heeheehee|Heeheehee]] 05:56, 25 August 2010 (UTC)
 
*** We try not to bother fewyn about the wiki as much as we can get away with. Not making fewyn work except for something important is one of our guiding principles. However I think that this may be important. But what does StDoodle think? --[[User:Bale|Bale]] 07:07, 25 August 2010 (UTC)
 
  
Sorry guys, been busy lately. Here's my take:
+
cli_equiv=The CLI command command "maximize" will automatically change equipment as if the {{Pspan|simulate}} parameter was false.|
# The original "protect this page" was equal parts frustration & experiment. The experiment was fruitful, in that we learned something, but unfortunately not what we wanted to. IE it didn't stop the spam, it just moved it. So unless anyone can think of something useful to add to that process, we should think carefully about that option. (Note: this does NOT apply if the spam moves on its own to a useful page).
+
more_info=See the page on the [[Modifier Maximizer]] for more information on how to use this, especially to create a meaningful expression.|
# As mentioned above, this page isn't all that useful. I mean, yeah, kinda, but it's easy to make a new one for the content, and just leave this one here as a spam honeypot. (Plus, it's name isn't one that represents what I was trying to move the wiki away from, as the ASHRM one did.)
+
}}
# Long-term solution would be to bug fewyn to make the changes mentioned above. I think I'm going to go ahead and do that, since we all seem to agree that it's the best idea. But I'm not going to pressure him to hurry; it looks like you guys have stayed on top of things fairly well, so no major need to have it done RIGHT NAOO.
+
{{RFI|What exactly is validateItem? What does it mean to us?}}
# I'm likely to be busy for the near-to-mid future with personal junk. (Possible divorce, ew.) From this point on, I'd like to designate Bale as being officially, 100% in charge of day-to-day operations (fewyn of course keeping the "final say," when he wants it). Thanks for all of your efforts!
+
[[Category:Equipment]]
-- [[User:StDoodle|StDoodle]] 07:27, 25 August 2010 (UTC)
 
 
 
== oqNpkWoecHwzmsh ==
 
 
 
Isn't this cute? The spambot has created a new section with a nonsense name so that our discussion wasn't deleted. I don't know what to make of it. I'm leaving the section header here just 'cause I'm curious if future spambots will use it or create their own nonsense sections. I suspect the later.  
 
 
 
Times this page has been spammed: 13 --[[User:Bale|Bale]] 20:12, 25 August 2010 (UTC)
 
: Times this page has been spammed: 14. Also, uh, what was up with the latest spam hit? --[[User:Heeheehee|Heeheehee]] 23:53, 25 August 2010 (UTC)
 

Latest revision as of 03:46, 5 January 2016

needs(code_samples);

Function Syntax

boolean maximize(string expression ,boolean simulate )

boolean maximize(string expression ,int max_price ,int price_level ,boolean simulate )

record [int] maximize(string expression ,int max_price ,int price_level ,boolean simulate ,boolean include_equip )

  • expression is the list of modifiers to maximize for.
  • max_price limits how much meat will be spent on maximization.
  • price_level controls checking the mall and affects return value.
  • simulate will not equip gear if true.
  • include_equip will return a record including equipment and effects if true, otherwise only effects

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.

This function will set "Generated:_spec" so that it can be checked with numeric_modifier(). That is the main purpose of using a true value for simulate as shown in the following code:

    maximize("cold resistance, spooky resistance", true);
    print(numeric_modifier("Generated:_spec", "cold resistance"));
    print(numeric_modifier("Generated:_spec", "Maximum HP"));
    print(numeric_modifier("Generated:_spec", "Spooky Resistance"));

If max_price is <= 0, it will use the preference autoBuyPriceLimit, or available meat, whichever is lower. Otherwise, that's the value it's considering as the max value for new items.

If price_level is greater than 0, Mall price is considered. If price_level is 2, always consider mall price. If price_level is 1, only consider it if there isn't another way. Also, if price_level is 0 or less, validateItem always returns true.

When using the 5-parameter version, a record will be returned of the format:

record {
   string display; //What would be shown in the Modifier Maximizer tab
   string command; //The CLI command the Maximizer would execute
   float score;    //The score added from equipping the item or gaining 1 turn of the effect
   effect effect;  //The effect you would gain
   item item;      //The item being used or equipped
   skill skill;    //The skill you need to cast
};

When 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):

maximize("Prismatic Damage",0,0,false,false);

...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.

CLI Equivalent

The CLI command command "maximize" will automatically change equipment as if the simulate parameter was false.

More Information

See the page on the Modifier Maximizer for more information on how to use this, especially to create a meaningful expression.


Attention KoLmafia Experts!

We need your help; some details of this function's operation are unknown or unclear.

The following specific question has been raised:

  • What exactly is validateItem? What does it mean to us?