<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://script.quakenet.org/wiki/index.php?action=history&amp;feed=atom&amp;title=How_to_start_%28part_2%29</id>
	<title>How to start (part 2) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://script.quakenet.org/wiki/index.php?action=history&amp;feed=atom&amp;title=How_to_start_%28part_2%29"/>
	<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=How_to_start_(part_2)&amp;action=history"/>
	<updated>2026-06-04T02:49:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=How_to_start_(part_2)&amp;diff=4631&amp;oldid=prev</id>
		<title>Cail: added category and see also</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=How_to_start_(part_2)&amp;diff=4631&amp;oldid=prev"/>
		<updated>2007-08-08T11:03:50Z</updated>

		<summary type="html">&lt;p&gt;added category and see also&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:03, 8 August 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l64&quot;&gt;Line 64:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When the on text event is triggered, the script will msg the channel &amp;quot;(someguy) wanted to know his own nickname, silly someguy.&amp;quot;, and echo to your active window &amp;quot;This command was executed at 12:36:24 with parameters: someguy asked his nick&amp;quot;.&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When the on text event is triggered, the script will msg the channel &amp;quot;(someguy) wanted to know his own nickname, silly someguy.&amp;quot;, and echo to your active window &amp;quot;This command was executed at 12:36:24 with parameters: someguy asked his nick&amp;quot;.&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that $+ is used to attach things together, since you cannot use $nick. you&amp;#039;ll need to use $nick $+ .&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that $+ is used to attach things together, since you cannot use $nick. you&amp;#039;ll need to use $nick $+ .&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== See also ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[How to start|How to start (part 1)]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Tutorials]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Cail</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=How_to_start_(part_2)&amp;diff=2315&amp;oldid=prev</id>
		<title>Cail: Added page.</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=How_to_start_(part_2)&amp;diff=2315&amp;oldid=prev"/>
		<updated>2007-08-08T09:37:48Z</updated>

		<summary type="html">&lt;p&gt;Added page.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;If you haven&amp;#039;t read the [[How to start|part 1 of How to start]], i suggest you read it first.&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
So, you have read it, and know where to find remote editor, variables tab, etc. it&amp;#039;s time to learn how to make scripts.&lt;br /&gt;
&lt;br /&gt;
==Aliases==&lt;br /&gt;
Aliases are commands, used to perform various tasks, ie. /join and /part are &amp;#039;&amp;#039;&amp;#039;build-in&amp;#039;&amp;#039;&amp;#039; aliases, you can make &amp;#039;&amp;#039;&amp;#039;custom&amp;#039;&amp;#039;&amp;#039; aliases yourself in the remote editor (shortcut alt+r).&amp;lt;br /&amp;gt;&lt;br /&gt;
You can create aliases in two places, &amp;#039;&amp;#039;&amp;#039;aliases-tab&amp;#039;&amp;#039;&amp;#039; (example line in the editor: /hello /say hello) and in &amp;#039;&amp;#039;&amp;#039;remote-tab&amp;#039;&amp;#039;&amp;#039; (example line in the editor: alias hello { say hello } ).&amp;lt;br /&amp;gt;&lt;br /&gt;
Even though you can make commands in aliases-tab, it is recommended to use remote-tab, since you cannot make identifiers or anything else than commands in aliases-tab, so all the examples here are made in the remote-tab.&lt;br /&gt;
&lt;br /&gt;
It is time to make the first script.&lt;br /&gt;
 alias hello { echo -ag Hello world! I am a mircscript! }&lt;br /&gt;
Now we have a new command, which can be executed by writing /hello in the editbox (editbox is the box where you normally write your text to be sent to a channel/nickname)&lt;br /&gt;
What this command does, it [[echo|echoes]] &amp;quot;Hello world! I am a mircscript!&amp;quot; in your active window, echo means that no-one else but you can see it.&lt;br /&gt;
&lt;br /&gt;
Now it&amp;#039;s time to use some identifiers in our script.&lt;br /&gt;
 alias test { echo -a $calc(1+2) }&lt;br /&gt;
Fairly easy to understand what this script does, by writing /test it echoes the sum of 1 and 2 (1+2) in the active window.&lt;br /&gt;
&lt;br /&gt;
To use parameters in your scripts, you can use [[$1-|$1, $2, $1-]] identifiers to get the parameters, which are space separated tokens (words).&lt;br /&gt;
 alias test { echo -a Your first parameter was: $1 Second was: $2 And the whole line was: $1- }&lt;br /&gt;
So if we wrote /test hello world, the script would echo &amp;quot;Your first parameter was: hello Second was: world And the whole line was: hello world&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
At this point would be a good time to mention that you NEED to have spaces around identifiers, ie. &amp;quot;hello:$1&amp;quot; wouldn&amp;#039;t work, since : and $ are in conjunction, also &amp;quot;hello: $1,&amp;quot; wouldn&amp;#039;t work, since mirc would think that you wanted to use identifier called $1, and not $1 (note that this doesn&amp;#039;t apply to normal brackets when used inside another identifier, ie. $calc($1-)).&lt;br /&gt;
&lt;br /&gt;
Now, let&amp;#039;s make a calculator command with what we&amp;#039;ve learned.&lt;br /&gt;
 alias calculator { echo -a $1- = $calc($1-) }&lt;br /&gt;
Writing /calculator 1+2+3 would echo &amp;quot;1+2+3 = 6&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Identifiers==&lt;br /&gt;
Identifiers are created the same way as commands, the difference is that they are used to return data, like $time is mirc&amp;#039;s own build-in identifier and it returns the current time.&amp;lt;br /&amp;gt;&lt;br /&gt;
An easy way to test identifiers is to write //command into the editbox, the double backslashes force mirc to evaluate the line (ie. //echo -a Current time is: $time).&lt;br /&gt;
&lt;br /&gt;
Simple custom identifier.&lt;br /&gt;
 alias testing { return Just testing. }&lt;br /&gt;
//echo -a $testing would return &amp;quot;Just testing.&amp;quot; to the echo command, and the text would be echoes to the active window.&lt;br /&gt;
&lt;br /&gt;
Identifiers accept parameters inside brackets, $identifier(param1,param2,param3).&lt;br /&gt;
 alias testing { return $calc($1 + $2) }&lt;br /&gt;
//echo -a $testing(4,5) would give 4 and 5 as parameters to the identifier, which returns the sum of these parameters, so this would result in echoing number 9.&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
Events are scripts that trigger when something happens, ie. when someone joins a channel, or sends a message to a channel.&amp;lt;br /&amp;gt;&lt;br /&gt;
Events starts with &amp;quot;on&amp;quot; as the first thing on the line, and is followed by (usually) level, event name, trigger text, target, commands.&lt;br /&gt;
&lt;br /&gt;
A simple [[On text|text event]] would look like this:&lt;br /&gt;
 on *:text:!hello:#my_own_channel:{ msg $chan Well hello there! }&lt;br /&gt;
Where the first asterisk is the [[Access Levels|userlevel]], * means &amp;quot;any level&amp;quot;, &amp;quot;text&amp;quot; is the event name (this event is called &amp;quot;on text&amp;quot; event), &amp;quot;!hello&amp;quot; is the trigger text (triggers when someone writes !hello), #my_own_channel is the target, and the commands are enclosed inside the brackets.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;note: Be sure that your syntax is correct, and you use the brackets correctly, or you will end up with broken scripts.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Now we have a basic knowledge on how to make commands, identifiers and events, let&amp;#039;s try doing a bit more complicated scripts.&lt;br /&gt;
&lt;br /&gt;
 ; we&amp;#039;ll use this identifier to enclose the first parameter into brackets, so that &amp;quot;hello&amp;quot; becomes &amp;quot;(hello)&amp;quot;&lt;br /&gt;
 alias add_brackets { return ( $+ $1 $+ ) }&lt;br /&gt;
 &lt;br /&gt;
 ; an alias to echo time and given parameters to active window&lt;br /&gt;
 alias echo_time { echo -a This command was executed at $time with parameters: $1- }&lt;br /&gt;
 &lt;br /&gt;
 ; on text event to trigger on incoming text on a channel&lt;br /&gt;
 on *:text:!mynick *:#:{&lt;br /&gt;
   msg $chan $add_brackets($nick) wanted to know his own nickname, silly $nick $+ .&lt;br /&gt;
   echo_time $nick asked his nick&lt;br /&gt;
 }&lt;br /&gt;
When the on text event is triggered, the script will msg the channel &amp;quot;(someguy) wanted to know his own nickname, silly someguy.&amp;quot;, and echo to your active window &amp;quot;This command was executed at 12:36:24 with parameters: someguy asked his nick&amp;quot;.&amp;lt;br /&amp;gt;&lt;br /&gt;
Note that $+ is used to attach things together, since you cannot use $nick. you&amp;#039;ll need to use $nick $+ .&lt;/div&gt;</summary>
		<author><name>Cail</name></author>
	</entry>
</feed>