Difference between revisions of "Notify"

From Kolmafia
Jump to navigation Jump to search
imported>Zarqon
m
imported>StDoodle
m
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{DISPLAYTITLE:notify}}
 
[[notify]] ''playername''
 
[[notify]] ''playername''
  
Line 9: Line 10:
 
Mafia will send a notify kmail only once per filename per character.  After sending the initial kmail, only clearing the global settings file or renaming the script (including moving it to another folder) will cause the notify command to send a second kmail about that script.
 
Mafia will send a notify kmail only once per filename per character.  After sending the initial kmail, only clearing the global settings file or renaming the script (including moving it to another folder) will cause the notify command to send a second kmail about that script.
  
==Using the notify command==
+
==Using Notify==
  
 
The proper syntax is [[notify]] ''playername'';
 
The proper syntax is [[notify]] ''playername'';
  
You can also specify the scriptname to be used in the notification by using the [[script]] command before the notify command, as follows:
+
You can also specify the scriptname to be used in the notification by using the script command before the notify command, as follows:
 
+
{{CodeSample|
  '''script''' "scriptname";
+
code=
  [[notify]] ''playername'';
+
<syntaxhighlight>
 
+
script "scriptname";
 +
notify playername;
 +
</syntaxhighlight>}}
 
Note that no parentheses or quotes are necessary.
 
Note that no parentheses or quotes are necessary.
  
The [[notify]] command must be the first command in the script, or attempting to run the script will generate an [[abort error]].  Only the script command, [[comments]], and whitespace can safely precede it.
+
The [[notify]] command must be the first command in the script, or attempting to run the script will generate an [[ASH Errors#abort|abort error]].  Only the script command, [[comments]], and whitespace can safely precede it.
  
Do not use [[notify]] for [[consult scripts]] -- you cannot send kmail during combat.
+
Do not use [[notify]] for [[In-combat Consulting|consult scripts]] -- you cannot send kmail during combat.
  
 
[[notify]] cannot be used from the CLI using the "ash" command.
 
[[notify]] cannot be used from the CLI using the "ash" command.
Line 30: Line 33:
 
The following is taken from the top of dj_d's EatDrink.ash:
 
The following is taken from the top of dj_d's EatDrink.ash:
  
<code>
+
{{CodeSample|
  [[comments|# ----------------------------------------------------------------------------------]]
+
code=
  [[comments|# EatDrink.ash]]
+
<syntaxhighlight>
  [[comments|# by]]
+
# ----------------------------------------------------------------------------------
  [[comments|# dj_d]]
+
# EatDrink.ash]]
  [[comments|# ]]
+
# by]]
  [[comments|# inspired by reportConsumables.ash, by Sandiman]]
+
# dj_d]]
  [[comments|# ----------------------------------------------------------------------------------]]
+
# ]]
 +
# inspired by reportConsumables.ash, by Sandiman]]
 +
# ----------------------------------------------------------------------------------
  
  [[script]] "EatDrink.ash"
+
script "EatDrink.ash"
  [[notify]] "dj_d";
+
notify "dj_d";
 
+
 
  [[import]] <zlib.ash>;
+
import <zlib.ash>;
 
    
 
    
  [[string]] EATDRINK_VERSION = "2.4";
+
string EATDRINK_VERSION = "2.4";
  ...
+
</syntaxhighlight>}}
</code>
 
  
[[Category:Ash Functions | notify]]
+
[[Category:Miscellaneous ASH Features]]

Latest revision as of 17:56, 21 June 2010

notify playername

The notify command is a special ASH command which sends a kmail to the specified player saying:

I have opted to let you know that I have chosen to run <scriptname.ash>. Thanks for writing this script!

Its intended purpose is for script authors to get feedback on who is using their scripts.

Mafia will send a notify kmail only once per filename per character. After sending the initial kmail, only clearing the global settings file or renaming the script (including moving it to another folder) will cause the notify command to send a second kmail about that script.

Using Notify

The proper syntax is notify playername;

You can also specify the scriptname to be used in the notification by using the script command before the notify command, as follows:

script "scriptname";
notify playername;

Note that no parentheses or quotes are necessary.

The notify command must be the first command in the script, or attempting to run the script will generate an abort error. Only the script command, comments, and whitespace can safely precede it.

Do not use notify for consult scripts -- you cannot send kmail during combat.

notify cannot be used from the CLI using the "ash" command.

Example

The following is taken from the top of dj_d's EatDrink.ash:


# ----------------------------------------------------------------------------------
# EatDrink.ash]]
# by]]
# dj_d]]
# ]]
# inspired by reportConsumables.ash, by Sandiman]]
# ----------------------------------------------------------------------------------

script "EatDrink.ash"
notify "dj_d";
  
import <zlib.ash>;
  
string EATDRINK_VERSION = "2.4";