Disable

From Kolmafia
Revision as of 15:07, 10 March 2010 by imported>Grotfang (Create page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Syntax

void disable(string func )

  • func is the name of the function you wish to disable.

Mafia has an internal array of function names which are disabled. At the start of each session, this array starts empty. Disable adds names to this array and mafia will not allow functions to be called that are named after any on the disabled list (with the exception of disable and enable). This is useful for debugging scripts, as you can quickly disable functions from the top of a script without digging through the code. In addition, when a disabled function is called, mafia will print a line informing you of this fact, while not acting on it.

Important considerations:

  1. Mafia cannot differentiate between scripts that call functions of the same name. If function "foo" is disabled from script one, it will still be disabled when you run script two, unless you enable "foo" or restart mafia.
  2. If a disabled function is incorporated into a condition (eg. "if(disabled_function())" ), then mafia will not just skip the entire conditional. If an else statement is present, the condition is treated as false and the else code will be performed.

CODE EXAMPLE TITLE

DESCRIPTION OF CODE

CODE GOES HERE

CLI Equivalent

LIST_CLI_EQUIVALENT_INFO

See Also

FIRST() | SECOND() | ETC()

More Information

A_LINE_TO_NOTIFY_OF_EXTERNAL_INFO

Special

SPECIAL_NOTES_SUCH_AS_NOT-LOGGED-IN_VALUE