Current hit stat: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Grotfang
m moved Current hit stat() to Current hit stat: Conformity
imported>AlbinoRhino
mNo edit summary
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[stat]] [[current_hit_stat()]]
{{
#vardefine:name|current_hit_stat}}{{
#vardefine:return_type|stat}}{{


Returns the [[stat]] that is currently used to calculate hit percentages.
FunctionPage|
name={{#var:name}}|


The following will warn non-myst classes if they are equipping the wrong type of weapon (melee vs. ranged).
function1={{Function|
name={{#var:name}}|
aggregate={{#var:aggregate}}|
return_type={{#var:return_type}}|
return_also={{#var:return_also}}
}}|


<code>
function_description=Returns the stat (muscle, mysticality or moxie) that is currently being used to calculate hit percentages. This is most likely to be useful in consult ccs scripts, or scripts designed to optimise equipment usage.|
  if ([[my_primestat()]] != $[[stat]][mysticality] && [[current_hit_stat()]] != [[my_primestat()]])
    [[print()|print]]("You could probably select a more effective weapon!");
</code>


A better use for this function would be in consult scripts to determine your expected success in smiting foes.
code1={{CodeSample|
title=Code Samples|
description=Checks to ensure your mainstat and hit stat are the same - to make sure you have the right type of weapon equipped. This only applies to muscle and moxie classes, so it checks to make sure you are not a mysticality class first.|
code=
<syntaxhighlight>
if(my_primestat() != $stat[mysticality]) {
  if(current_hit_stat() != my_primestat()) {
      print("You could probably select a more effective weapon!");
  }
}
</syntaxhighlight>
}}|


[[Category:Your Character | hit stat()]]
see_also={{SeeAlso|my_primestat|buffed_hit_stat}}|
[[Category:Ash Functions | hit stat()]]
special=When not logged in, this function returns $stat[muscle].
}}


When not logged in, this function returns ?? (needs spading)
[[Category:Your Character]]

Latest revision as of 06:57, 27 December 2017

Function Syntax

stat current_hit_stat()

Returns the stat (muscle, mysticality or moxie) that is currently being used to calculate hit percentages. This is most likely to be useful in consult ccs scripts, or scripts designed to optimise equipment usage.

Code Samples

Checks to ensure your mainstat and hit stat are the same - to make sure you have the right type of weapon equipped. This only applies to muscle and moxie classes, so it checks to make sure you are not a mysticality class first.

if(my_primestat() != $stat[mysticality]) {
   if(current_hit_stat() != my_primestat()) {
      print("You could probably select a more effective weapon!");
   }
}

See Also

my_primestat() | buffed_hit_stat()

Special

When not logged in, this function returns $stat[muscle].