<?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=115.93.43.194</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=115.93.43.194"/>
	<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Special:Contributions/115.93.43.194"/>
	<updated>2026-04-25T03:48:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Notify&amp;diff=2485</id>
		<title>Notify</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Notify&amp;diff=2485"/>
		<updated>2010-06-21T05:15:30Z</updated>

		<summary type="html">&lt;p&gt;115.93.43.194: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#customtitle:notify}}&lt;br /&gt;
[[notify]] &#039;&#039;playername&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The notify command is a special ASH command which sends a kmail to the specified player saying:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;I have opted to let you know that I have chosen to run &amp;lt;scriptname.ash&amp;gt;. Thanks for writing this script!&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Its intended purpose is for script authors to get feedback on who is using their scripts.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==Using Notify==&lt;br /&gt;
&lt;br /&gt;
The proper syntax is [[notify]] &#039;&#039;playername&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
You can also specify the scriptname to be used in the notification by using the script command before the notify command, as follows:&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
script &amp;quot;scriptname&amp;quot;;&lt;br /&gt;
notify playername;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
Note that no parentheses or quotes are necessary.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Do not use [[notify]] for [[In-combat Consulting|consult scripts]] -- you cannot send kmail during combat.&lt;br /&gt;
&lt;br /&gt;
[[notify]] cannot be used from the CLI using the &amp;quot;ash&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
The following is taken from the top of dj_d&#039;s EatDrink.ash:&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
# ----------------------------------------------------------------------------------&lt;br /&gt;
# EatDrink.ash]]&lt;br /&gt;
# by]]&lt;br /&gt;
# dj_d]]&lt;br /&gt;
# ]]&lt;br /&gt;
# inspired by reportConsumables.ash, by Sandiman]]&lt;br /&gt;
# ----------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
script &amp;quot;EatDrink.ash&amp;quot;&lt;br /&gt;
notify &amp;quot;dj_d&amp;quot;;&lt;br /&gt;
  &lt;br /&gt;
import &amp;lt;zlib.ash&amp;gt;;&lt;br /&gt;
  &lt;br /&gt;
string EATDRINK_VERSION = &amp;quot;2.4&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Miscellaneous ASH Features]]&lt;/div&gt;</summary>
		<author><name>115.93.43.194</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Relay_Override_Scripting&amp;diff=5897</id>
		<title>Relay Override Scripting</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Relay_Override_Scripting&amp;diff=5897"/>
		<updated>2010-04-01T03:44:22Z</updated>

		<summary type="html">&lt;p&gt;115.93.43.194: added more information, qualified some assertions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a means of changing KoL&#039;s web pages so that the user sees something different. There are two kinds of relay override scripts. The first is simply known as an Relay Script. The second is a User Interface script.&lt;br /&gt;
&lt;br /&gt;
=Relay Script=&lt;br /&gt;
For a simple Relay Script, there are several basic rules:&lt;br /&gt;
#The name of the script must be the same as the page it is overriding, except with an ash extension instead of a php extension. For users who have enabled relay override scripts, mafia will automatically call xyz.ash every time the relay browser attempts to visit xyz.php.&lt;br /&gt;
#Unless the script is displaying entirely new content, it should first load the unmodified page from KoL using the command [[visit_url|visit_url()]] with no parameters.&lt;br /&gt;
#Then the contents of the page can be modified with [[replace_string|replace_string()]] or other string manipulation functions.&lt;br /&gt;
#Finally, the modified page is written with the [[write|write()]] command.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is an example of a relay script. This will modify shore.php to reveal items that are needed for the level 6 tower monster. The script must be named shore.php in order to modify the correct page.&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-bottom: 1em; border: dashed 1px green; padding: 1em; margin:0px 20px;&amp;quot;&amp;gt;&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
// This script will only work if it is named shore.ash&lt;br /&gt;
void main() {&lt;br /&gt;
   buffer results;&lt;br /&gt;
   // Get the basic shore page&lt;br /&gt;
   append(results, visit_url());&lt;br /&gt;
   &lt;br /&gt;
   // This will modify the Dude Ranch text if a stick of dynamite is needed&lt;br /&gt;
   void dynamite() {&lt;br /&gt;
      if(available_amount($item[stick of dynamite]) &amp;lt; 1)&lt;br /&gt;
         replace_string(results, &amp;quot;Distant Lands Dude Ranch Adventure&amp;quot;,&lt;br /&gt;
          &amp;quot;&amp;lt;font color=\&amp;quot;green\&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Distant Lands Dude Ranch Adventure&amp;quot;&lt;br /&gt;
          +&amp;quot; (stick of dynamite needed)&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // This will modify the Paradise Island text if a tropical orchid is needed&lt;br /&gt;
   void orchid() {&lt;br /&gt;
      if(available_amount($item[tropical orchid]) &amp;lt; 1)&lt;br /&gt;
         replace_string(results, &amp;quot;Tropical Paradise Island Getaway&amp;quot;,&lt;br /&gt;
          &amp;quot;&amp;lt;font color=\&amp;quot;green\&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tropical Paradise Island Getaway&amp;quot;&lt;br /&gt;
          +&amp;quot; (tropical orchid needed)&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // This will modify the Ski Resort text if a barbed-wire fence is needed&lt;br /&gt;
   void fence() {&lt;br /&gt;
      if(available_amount($item[barbed-wire fence]) &amp;lt; 1)&lt;br /&gt;
         replace_string(results, &amp;quot;Large Donkey Mountain Ski Resort&amp;quot;,&lt;br /&gt;
          &amp;quot;&amp;lt;font color=\&amp;quot;green\&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Large Donkey Mountain Ski Resort&amp;quot;&lt;br /&gt;
          +&amp;quot; (barbed-wire fence needed)&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
   &lt;br /&gt;
   // Only do this if the character has no access to the mall&lt;br /&gt;
   if(!can_interact()) {   &lt;br /&gt;
      // If the character has a level 7 telescope, only check for the necessary item&lt;br /&gt;
      if(get_property(&amp;quot;telescopeUpgrades&amp;quot;) == &amp;quot;7&amp;quot;)&lt;br /&gt;
         switch(get_property(&amp;quot;telescope7&amp;quot;)) {&lt;br /&gt;
         case &amp;quot;see a wooden beam&amp;quot;:&lt;br /&gt;
            dynamite(); break;&lt;br /&gt;
         case &amp;quot;see a formidable stinger&amp;quot;:&lt;br /&gt;
            orchid(); break;&lt;br /&gt;
         case &amp;quot;see a pair of horns&amp;quot;:&lt;br /&gt;
            fence(); break;&lt;br /&gt;
         }&lt;br /&gt;
      // Check for all three items&lt;br /&gt;
      else {&lt;br /&gt;
         dynamite();&lt;br /&gt;
         orchid();&lt;br /&gt;
         fence();&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   &lt;br /&gt;
   // Write the modified page to the web browser&lt;br /&gt;
   write(results);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=User Interface Script=&lt;br /&gt;
More information will be added later. In the meantime, here are two links:&lt;br /&gt;
* http://kolmafia.us/showthread.php?3771-Scripts-with-user-interfaces&lt;br /&gt;
* http://kolmafia.us/showthread.php?3842-Form-of...HTML!&lt;/div&gt;</summary>
		<author><name>115.93.43.194</name></author>
	</entry>
</feed>