<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://script.quakenet.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jay2k1</id>
	<title>Scriptwiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://script.quakenet.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jay2k1"/>
	<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/Special:Contributions/Jay2k1"/>
	<updated>2026-04-03T14:14:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=User:Jay2k1&amp;diff=6392</id>
		<title>User:Jay2k1</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=User:Jay2k1&amp;diff=6392"/>
		<updated>2025-09-17T00:08:09Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: need more coffee&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Babel-2|de|en-3}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table border=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;[[Image:sgthartman.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
  &amp;lt;table border=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Age&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;{{age|1984|4|9}}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr valign=&amp;quot;top&amp;quot; height=&amp;quot;40&amp;quot;&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Country&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Germany&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Words of wisdom&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;More Coffee!&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
[[Category:Members]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=User:Shenghi&amp;diff=6177</id>
		<title>User:Shenghi</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=User:Shenghi&amp;diff=6177"/>
		<updated>2016-11-29T15:54:28Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: AgeFix Ultimate™&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Babel-2|nl|en-3}}&lt;br /&gt;
&amp;lt;table border=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;!--&amp;lt;td&amp;gt;[[Image:Shenghi.jpg]]&amp;lt;/td&amp;gt;--&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
  &amp;lt;table border=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Name&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Bart van Nierop&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Age&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;{{age|1983|11|22}}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr valign=&amp;quot;top&amp;quot; height=&amp;quot;40&amp;quot;&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Country&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Rotterdam, Netherlands&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Words of wisdom&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Give a man a fish and he has food for a day. Teach a man how to fish and he has food for the rest of his life.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;People are not born stupid, they decide to be stupid. If you made that decision, please change your mind.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
[[Category:Members]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Channel_Rules&amp;diff=6174</id>
		<title>Channel Rules</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Channel_Rules&amp;diff=6174"/>
		<updated>2016-07-25T19:45:28Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: fixed encoding issues with the paragraph sign&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$read&amp;diff=6170</id>
		<title>$read</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$read&amp;diff=6170"/>
		<updated>2016-03-18T13:07:13Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: clarified that s switch scans for a whole word&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Returns a line of text from a text file.&lt;br /&gt;
 $read(&#039;&#039;filename&#039;&#039;,[ntswrp],[&#039;&#039;string&#039;&#039;],[&#039;&#039;N&#039;&#039;])&lt;br /&gt;
The first parameter is the filename and the only required parameter.&lt;br /&gt;
If you omit all other parameters you will be returned with a random line from the file.&lt;br /&gt;
&lt;br /&gt;
The second parameter is a set of options that determin the type of search you wish to use, for a full description see the table below.&lt;br /&gt;
if &#039;&#039;string&#039;&#039; is numerical and you do not use &#039;&#039;swr&#039;&#039; switch the line corresponding to the numerical value will be returned.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;N&#039;&#039; parameter is given it starts to search the file from that line number.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If the first line of your text file is a numerical value mIRC treats this number as the total number of lines in the text file, be careful not to accidently have your file cut short due to an unexpected numerical value.&lt;br /&gt;
If you specify N = 0, mIRC returns the value of the first line if it&#039;s a number.&lt;br /&gt;
Take good note of the &#039;&#039;t&#039;&#039; switch in the table below.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:100%&amp;quot;&lt;br /&gt;
| style=&amp;quot;width:5%&amp;quot; | &#039;&#039;&#039;&#039;&#039;Switch&#039;&#039;&#039;&#039;&#039; || style=&amp;quot;width:95%&amp;quot; | &#039;&#039;&#039;&#039;&#039;Meaning&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| n || If the &#039;&#039;n&#039;&#039; switch is specified then the line read in will not be evaluated and will be treated as plain text.&lt;br /&gt;
|-&lt;br /&gt;
| t || If the &#039;&#039;t&#039;&#039; switch is specified then mIRC will treat the first line in the file as plain text, even if it is a numeric.&lt;br /&gt;
|-&lt;br /&gt;
| s || Scans the &#039;&#039;filename&#039;&#039; for a line beginning with a word specified in the &#039;&#039;string&#039;&#039; and returns the text following the match value.&lt;br /&gt;
|-&lt;br /&gt;
| w || Scans the &#039;&#039;filename&#039;&#039; for a line matching &#039;&#039;string&#039;&#039;, where &#039;&#039;string&#039;&#039; can contain [[If-Then-Else#iswm|wildcards]].&lt;br /&gt;
|-&lt;br /&gt;
| r || Scans the &#039;&#039;filename&#039;&#039; for a line matching &#039;&#039;string&#039;&#039;, where &#039;&#039;string&#039;&#039; is taken as a [[Regular_Expression|regular expression]].&lt;br /&gt;
|-&lt;br /&gt;
| p || If the &#039;&#039;p&#039;&#039; switch is specified, command &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; separators are treated as such instead of as plain text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
 &#039;&#039;&#039;&#039;&#039;Example.txt:&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
 5&lt;br /&gt;
 Ave It&lt;br /&gt;
 Hash Help Dot Script&lt;br /&gt;
 6&lt;br /&gt;
 Cows dont go moo, Fish go moo!&lt;br /&gt;
 Fish go moo&lt;br /&gt;
 Yes they do&lt;br /&gt;
The above is an example text file used in the following examples.&lt;br /&gt;
&lt;br /&gt;
 $read(&#039;&#039;Example.txt&#039;&#039;,&#039;&#039;s&#039;&#039;,&#039;&#039;Ave&#039;&#039;)  ;Returns &#039;&#039;It&#039;&#039;, all data that follows the first line starting with &#039;&#039;Ave&#039;&#039;.&lt;br /&gt;
 $read(&#039;&#039;Example.txt&#039;&#039;,&#039;&#039;w&#039;&#039;,&#039;&#039;*moo&#039;&#039;)  ;Returns &#039;&#039;Fish go moo&#039;&#039;, note the lack of pending asterisks means moo has to be the last word.&lt;br /&gt;
 $read(&#039;&#039;Example.txt&#039;&#039;,&#039;&#039;3&#039;&#039;)  ;Returns &#039;&#039;6&#039;&#039;, This is the 3rd line in the file if you count line 1 as the linecount line because it is a number.&lt;br /&gt;
 $read(&#039;&#039;Example.txt&#039;&#039;,&#039;&#039;t&#039;&#039;,&#039;&#039;3&#039;&#039;)  ;Returns &#039;&#039;Hash Help Dot Script&#039;&#039;, This is the 3rd line in the file if you count line 1 plain text.&lt;br /&gt;
 $read(&#039;&#039;Example.txt&#039;&#039;,&#039;&#039;w&#039;&#039;,&#039;&#039;*moo&#039;&#039;)  ;Returns &#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 [[kick]] [[$chan]] [[$nick]] $read(Example.txt)  ;Kicks a user with a random line from the text file.&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[$readn]] This returns the line number that $read just returned.&lt;br /&gt;
* [[$lines]] This returns the total number of lines in the given file.&lt;br /&gt;
* [[play]] This is a much better alternative if you require to list the content of a whole file to a channel.&lt;br /&gt;
* [[filter]] This can help with more complex needs when reading in content from files or windows.&lt;br /&gt;
* [[loadbuf]] This is a much better alternative if you need to dump many lines of text to a dialog or to a custom window&lt;br /&gt;
&lt;br /&gt;
[[Category:File and Directory Identifiers]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=YouTube_parser&amp;diff=6149</id>
		<title>YouTube parser</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=YouTube_parser&amp;diff=6149"/>
		<updated>2015-05-06T22:12:29Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: Added note about this script no longer working because of API deprecation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;boilerplate metadata&amp;quot; id=&amp;quot;stub&amp;quot; style=&amp;quot;padding: 7px; background: #ffeeee; border: 1px solid #ff0000; text-align: center; font-size:95%;&amp;quot;&amp;gt;&#039;&#039;&#039;&#039;&#039;On May 6th, 2015, YouTube shut down their API v2 which is being used in this script to retrieve video metadata. One now has to use their API v3, which unfortunately seems to require an API key (as opposed to being publicly accessible by anyone).&amp;lt;br&amp;gt;As a consequence, this script is now useless, unless you view it as a code example. I&#039;m working on a version that works with the new API.&#039;&#039;&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As the description says, this script retrieves information about youtube videos from the YouTube API and posts them to the channel whenever a youtube link is posted. You can install it by opening the script editor (Alt+R), creating a new script file (File -&amp;gt; New) and then copy paste the script into it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Make sure to replace the channels (#foo,#bar) in the &#039;&#039;on TEXT&#039;&#039; event line with the channels you want the script to be active in.&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
 ********************************************************************************************************&lt;br /&gt;
 *&lt;br /&gt;
 *  youtube.mrc by Jay2k1 @ QuakeNet, 2013&lt;br /&gt;
 *&lt;br /&gt;
 *  Whenever a youtube link is posted in the channels #foo or #bar, this script retrieves the video&#039;s details&lt;br /&gt;
 *  from the youtube API and post them to the channel. It looks like this:&lt;br /&gt;
 *&lt;br /&gt;
 *  &amp;lt;Jay2k1&amp;gt; http://www.youtube.com/watch?v=oHg5SJYRHA0&lt;br /&gt;
 *  &amp;lt;Bot&amp;gt; &#039;RickRoll&#039; by cotter548, 00:03:34, 68213084 views, rating: 87% (259236/38751)&lt;br /&gt;
 *&lt;br /&gt;
 *********************************************************************************************************&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
 ; on text event: regex check for messages containing youtube.com or youtu.be, match the URL&lt;br /&gt;
 on $*:TEXT:/(youtu\.be\/.*?(\s|$)|youtube\.com\/.*?(\s|$))/:#foo,#bar:{&lt;br /&gt;
 &lt;br /&gt;
   ; use another regex to extract the video ID from the matched URL&lt;br /&gt;
   [[noop]] [[$regex]]([[$regml]](1),/(\?v=|&amp;amp;v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]{11})/)&lt;br /&gt;
 &lt;br /&gt;
   ; call the youtube script with the channel and the video ID, if there is one&lt;br /&gt;
   youtube [[$$]][[regml]](2) [[$chan_(remote)|$chan]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ; alias youtube: opens a socket connection to youtube&lt;br /&gt;
 ; expects: youtube video ID as $1, #channel as $2&lt;br /&gt;
 ; returns: -&lt;br /&gt;
 [[alias]] -l youtube {&lt;br /&gt;
   ; create a unique socket name to allow for multiple connections at a time&lt;br /&gt;
   [[Local_Variables|var]] %sock = youtube. [[DollarPlus|$+]] [[$ticks]]&lt;br /&gt;
   [[sockopen]] %sock gdata.youtube.com 80&lt;br /&gt;
   ; store video ID and channel in socket mark&lt;br /&gt;
   [[sockmark]] %sock [[$1-|$1-]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:SOCKOPEN:youtube.*:{&lt;br /&gt;
   ; obligatory error check&lt;br /&gt;
   [[If-Then-Else|if]] $sockerr { [[return]] }&lt;br /&gt;
 &lt;br /&gt;
   ; send our request&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] GET /feeds/mobile/videos/ [[DollarPlus|$+]] [[$gettok]]([[$sock]]([[$sockname]]).mark,1,32) [[DollarPlus|$+]] ?v=2&amp;amp;prettyprint=true HTTP/1.1&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] Host: [[$sock]]([[$sockname]]).addr&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] [[$crlf]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:SOCKREAD:youtube.*:{&lt;br /&gt;
   [[If-Then-Else|if]] $sockerr { [[return]] }&lt;br /&gt;
 &lt;br /&gt;
   ; receive answer to the request into a variable&lt;br /&gt;
   [[Local_Variables|var]] %t = [[$sockname]], %data&lt;br /&gt;
   [[Sockread|sockread]] %data&lt;br /&gt;
 &lt;br /&gt;
   ; while there&#039;s bytes in the sockread buffer...&lt;br /&gt;
   [[while]] $sockbr {&lt;br /&gt;
 &lt;br /&gt;
     ; extract things of interest out of the source code into a hash table&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;title&amp;gt;*&amp;lt;/title&amp;gt;* iswm %data) { [[hadd]] -m %t title [[$regsubex]](%data,/(.*&amp;lt;title&amp;gt;|&amp;lt;/title&amp;gt;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:duration seconds=&#039;*&#039;/&amp;gt;* iswm %data) { [[hadd]] -m %t dur [[$duration]]([[$regsubex]](%data,/(.*seconds=&#039;|&#039;/&amp;gt;.*)/g,),3) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:statistics favoriteCount=&#039;*&#039; viewCount=&#039;*&#039;/&amp;gt;* iswm %data) { [[hadd]] -m %t views [[$regsubex]](%data,/(.*viewCount=&#039;|&#039;/&amp;gt;)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:rating numDislikes=&#039;*&#039; numLikes=&#039;*&#039;/&amp;gt;* iswm %data) { [[hadd]] -m %t likes [[$regsubex]](%data,/(.*numLikes=&#039;|&#039;/&amp;gt;.*)/g,) | [[hadd]] -m %t dislikes [[$regsubex]](%data,/(.*numDislikes=&#039;|&#039;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;name&amp;gt;*&amp;lt;/name&amp;gt;* iswm %data) { [[hadd]] -m %t uploader [[$regsubex]](%data,/(.*&amp;lt;name&amp;gt;|&amp;lt;/name&amp;gt;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:uploaded&amp;gt;*&amp;lt;/yt:uploaded&amp;gt;* iswm %data) { [[hadd]] -m %t uploaded [[$left]]([[$regsubex]](%data,/(.*&amp;lt;yt:uploaded&amp;gt;|&amp;lt;/yt:uploaded&amp;gt;.*)/g,),10) }&lt;br /&gt;
     [[If-Then-Else|if]] (*accessControl action=&#039;rate&#039; permission=&#039;denied&#039;* iswm %data)  { [[hadd]] -m %t rating disabled or no votes }&lt;br /&gt;
 &lt;br /&gt;
     ; the &amp;lt;/entry&amp;gt; tag marks the end of the data.&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;/entry&amp;gt;* iswm %data) || ([[$hget]](%t,0).item == 7)  || (([[$hget]](%t,0).item == 7) &amp;amp;&amp;amp; ([[$hget]](%t,rating) == disabled)) {&lt;br /&gt;
       [[Local_Variables|var]] %ytmsg = &#039; [[DollarPlus|$+]] [[$hget]](%t,title) [[DollarPlus|$+]] &#039; by [[$hget]](%t,uploader) [[DollarPlus|$+]] [[$chr]](44) [[$hget]](%t,dur) [[DollarPlus|$+]] [[$chr]](44) [[$hget]](%t,views) views&lt;br /&gt;
       [[Local_Variables|var]] %ytmsg = %ytmsg [[DollarPlus|$+]] , [[$iif]]([[$hget]](%t,likes),rating: [[$round]]([[$calc]]([[$hget]](%t,likes) / ([[$hget]](%t,likes) + [[$hget]](%t,dislikes)) * 100),1) [[DollarPlus|$+]] % ( [[DollarPlus|$+]] [[$hget]](%t,likes) [[DollarPlus|$+]] / [[DollarPlus|$+]] [[$hget]](%t,dislikes) [[DollarPlus|$+]] ),rating disabled or not rated yet)&lt;br /&gt;
       [[Local_Variables|var]] %ytmsg = [[$replace]](%ytmsg,&amp;amp;nbsp;,[[$chr]](160),&amp;amp;quot;,&amp;quot;,&amp;amp;#39;,&#039;,&amp;amp;lt;,&amp;lt;,&amp;amp;gt;,&amp;gt;,&amp;amp;amp;,&amp;amp;, &amp;amp;pound;,[[$chr]](163), &amp;amp;euro;, [[$chr]](8364), &amp;amp;copy;, [[$chr]](169), &amp;amp;trade, [[$chr]](8482), &amp;amp;reg;, [[$chr]](174))                  &lt;br /&gt;
       [[msg]] [[$gettok]]([[$sock]](%t).mark,2,32) %ytmsg&lt;br /&gt;
 &lt;br /&gt;
       [[sockclose]] %t&lt;br /&gt;
       [[hfree]] %t&lt;br /&gt;
       [[return]]&lt;br /&gt;
     }&lt;br /&gt;
     [[Sockread|sockread]] %data&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Archive]]&lt;br /&gt;
&lt;br /&gt;
{{Author|Jay2k1}}&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Template:Warning&amp;diff=6148</id>
		<title>Template:Warning</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Template:Warning&amp;diff=6148"/>
		<updated>2015-05-06T22:04:26Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: Created page with &amp;quot;{{ mbox | demospace = {{{demospace|}}} | type      = content | image     = {{#if:{{{image|}}}| Warning }} | textstyle = {{{align|text-align: center...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{ mbox&lt;br /&gt;
| demospace = {{{demospace|}}}&lt;br /&gt;
| type      = content&lt;br /&gt;
| image     = {{#if:{{{image|}}}| [[Image:{{{image|}}}|40px|Warning]] }}&lt;br /&gt;
| textstyle = {{{align|text-align: center;}}}&lt;br /&gt;
| text      = {{#if:{{{header|}}}|&amp;lt;div style=&amp;quot;text-align: center&amp;quot;&amp;gt;&#039;&#039;&#039;{{{header}}}&#039;&#039;&#039;&amp;lt;/div&amp;gt;}}{{{text|{{{1}}}}}}&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;{{Documentation}}&amp;lt;!-- Add categories and interwikis to the /doc sub-page --&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=YouTube_parser&amp;diff=6144</id>
		<title>YouTube parser</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=YouTube_parser&amp;diff=6144"/>
		<updated>2015-04-10T18:50:05Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: removed some debugging code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As the description says, this script retrieves information about youtube videos from the YouTube API and posts them to the channel whenever a youtube link is posted. You can install it by opening the script editor (Alt+R), creating a new script file (File -&amp;gt; New) and then copy paste the script into it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Make sure to replace the channels (#foo,#bar) in the &#039;&#039;on TEXT&#039;&#039; event line with the channels you want the script to be active in.&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
 ********************************************************************************************************&lt;br /&gt;
 *&lt;br /&gt;
 *  youtube.mrc by Jay2k1 @ QuakeNet, 2013&lt;br /&gt;
 *&lt;br /&gt;
 *  Whenever a youtube link is posted in the channels #foo or #bar, this script retrieves the video&#039;s details&lt;br /&gt;
 *  from the youtube API and post them to the channel. It looks like this:&lt;br /&gt;
 *&lt;br /&gt;
 *  &amp;lt;Jay2k1&amp;gt; http://www.youtube.com/watch?v=oHg5SJYRHA0&lt;br /&gt;
 *  &amp;lt;Bot&amp;gt; &#039;RickRoll&#039; by cotter548, 00:03:34, 68213084 views, rating: 87% (259236/38751)&lt;br /&gt;
 *&lt;br /&gt;
 *********************************************************************************************************&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
 ; on text event: regex check for messages containing youtube.com or youtu.be, match the URL&lt;br /&gt;
 on $*:TEXT:/(youtu\.be\/.*?(\s|$)|youtube\.com\/.*?(\s|$))/:#foo,#bar:{&lt;br /&gt;
 &lt;br /&gt;
   ; use another regex to extract the video ID from the matched URL&lt;br /&gt;
   [[noop]] [[$regex]]([[$regml]](1),/(\?v=|&amp;amp;v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]{11})/)&lt;br /&gt;
 &lt;br /&gt;
   ; call the youtube script with the channel and the video ID, if there is one&lt;br /&gt;
   youtube [[$$]][[regml]](2) [[$chan_(remote)|$chan]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ; alias youtube: opens a socket connection to youtube&lt;br /&gt;
 ; expects: youtube video ID as $1, #channel as $2&lt;br /&gt;
 ; returns: -&lt;br /&gt;
 [[alias]] -l youtube {&lt;br /&gt;
   ; create a unique socket name to allow for multiple connections at a time&lt;br /&gt;
   [[Local_Variables|var]] %sock = youtube. [[DollarPlus|$+]] [[$ticks]]&lt;br /&gt;
   [[sockopen]] %sock gdata.youtube.com 80&lt;br /&gt;
   ; store video ID and channel in socket mark&lt;br /&gt;
   [[sockmark]] %sock [[$1-|$1-]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:SOCKOPEN:youtube.*:{&lt;br /&gt;
   ; obligatory error check&lt;br /&gt;
   [[If-Then-Else|if]] $sockerr { [[return]] }&lt;br /&gt;
 &lt;br /&gt;
   ; send our request&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] GET /feeds/mobile/videos/ [[DollarPlus|$+]] [[$gettok]]([[$sock]]([[$sockname]]).mark,1,32) [[DollarPlus|$+]] ?v=2&amp;amp;prettyprint=true HTTP/1.1&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] Host: [[$sock]]([[$sockname]]).addr&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] [[$crlf]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:SOCKREAD:youtube.*:{&lt;br /&gt;
   [[If-Then-Else|if]] $sockerr { [[return]] }&lt;br /&gt;
 &lt;br /&gt;
   ; receive answer to the request into a variable&lt;br /&gt;
   [[Local_Variables|var]] %t = [[$sockname]], %data&lt;br /&gt;
   [[Sockread|sockread]] %data&lt;br /&gt;
 &lt;br /&gt;
   ; while there&#039;s bytes in the sockread buffer...&lt;br /&gt;
   [[while]] $sockbr {&lt;br /&gt;
 &lt;br /&gt;
     ; extract things of interest out of the source code into a hash table&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;title&amp;gt;*&amp;lt;/title&amp;gt;* iswm %data) { [[hadd]] -m %t title [[$regsubex]](%data,/(.*&amp;lt;title&amp;gt;|&amp;lt;/title&amp;gt;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:duration seconds=&#039;*&#039;/&amp;gt;* iswm %data) { [[hadd]] -m %t dur [[$duration]]([[$regsubex]](%data,/(.*seconds=&#039;|&#039;/&amp;gt;.*)/g,),3) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:statistics favoriteCount=&#039;*&#039; viewCount=&#039;*&#039;/&amp;gt;* iswm %data) { [[hadd]] -m %t views [[$regsubex]](%data,/(.*viewCount=&#039;|&#039;/&amp;gt;)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:rating numDislikes=&#039;*&#039; numLikes=&#039;*&#039;/&amp;gt;* iswm %data) { [[hadd]] -m %t likes [[$regsubex]](%data,/(.*numLikes=&#039;|&#039;/&amp;gt;.*)/g,) | [[hadd]] -m %t dislikes [[$regsubex]](%data,/(.*numDislikes=&#039;|&#039;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;name&amp;gt;*&amp;lt;/name&amp;gt;* iswm %data) { [[hadd]] -m %t uploader [[$regsubex]](%data,/(.*&amp;lt;name&amp;gt;|&amp;lt;/name&amp;gt;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:uploaded&amp;gt;*&amp;lt;/yt:uploaded&amp;gt;* iswm %data) { [[hadd]] -m %t uploaded [[$left]]([[$regsubex]](%data,/(.*&amp;lt;yt:uploaded&amp;gt;|&amp;lt;/yt:uploaded&amp;gt;.*)/g,),10) }&lt;br /&gt;
     [[If-Then-Else|if]] (*accessControl action=&#039;rate&#039; permission=&#039;denied&#039;* iswm %data)  { [[hadd]] -m %t rating disabled or no votes }&lt;br /&gt;
 &lt;br /&gt;
     ; the &amp;lt;/entry&amp;gt; tag marks the end of the data.&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;/entry&amp;gt;* iswm %data) || ([[$hget]](%t,0).item == 7)  || (([[$hget]](%t,0).item == 7) &amp;amp;&amp;amp; ([[$hget]](%t,rating) == disabled)) {&lt;br /&gt;
       [[Local_Variables|var]] %ytmsg = &#039; [[DollarPlus|$+]] [[$hget]](%t,title) [[DollarPlus|$+]] &#039; by [[$hget]](%t,uploader) [[DollarPlus|$+]] [[$chr]](44) [[$hget]](%t,dur) [[DollarPlus|$+]] [[$chr]](44) [[$hget]](%t,views) views&lt;br /&gt;
       [[Local_Variables|var]] %ytmsg = %ytmsg [[DollarPlus|$+]] , [[$iif]]([[$hget]](%t,likes),rating: [[$round]]([[$calc]]([[$hget]](%t,likes) / ([[$hget]](%t,likes) + [[$hget]](%t,dislikes)) * 100),1) [[DollarPlus|$+]] % ( [[DollarPlus|$+]] [[$hget]](%t,likes) [[DollarPlus|$+]] / [[DollarPlus|$+]] [[$hget]](%t,dislikes) [[DollarPlus|$+]] ),rating disabled or not rated yet)&lt;br /&gt;
       [[Local_Variables|var]] %ytmsg = [[$replace]](%ytmsg,&amp;amp;nbsp;,[[$chr]](160),&amp;amp;quot;,&amp;quot;,&amp;amp;#39;,&#039;,&amp;amp;lt;,&amp;lt;,&amp;amp;gt;,&amp;gt;,&amp;amp;amp;,&amp;amp;, &amp;amp;pound;,[[$chr]](163), &amp;amp;euro;, [[$chr]](8364), &amp;amp;copy;, [[$chr]](169), &amp;amp;trade, [[$chr]](8482), &amp;amp;reg;, [[$chr]](174))                  &lt;br /&gt;
       [[msg]] [[$gettok]]([[$sock]](%t).mark,2,32) %ytmsg&lt;br /&gt;
 &lt;br /&gt;
       [[sockclose]] %t&lt;br /&gt;
       [[hfree]] %t&lt;br /&gt;
       [[return]]&lt;br /&gt;
     }&lt;br /&gt;
     [[Sockread|sockread]] %data&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Archive]]&lt;br /&gt;
&lt;br /&gt;
{{Author|Jay2k1}}&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=YouTube_parser&amp;diff=6142</id>
		<title>YouTube parser</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=YouTube_parser&amp;diff=6142"/>
		<updated>2015-03-31T20:30:17Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: channel correction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As the description says, this script retrieves information about youtube videos from the YouTube API and posts them to the channel whenever a youtube link is posted. You can install it by opening the script editor (Alt+R), creating a new script file (File -&amp;gt; New) and then copy paste the script into it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Make sure to replace the channels (#foo,#bar) in the &#039;&#039;on TEXT&#039;&#039; event line with the channels you want the script to be active in.&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
 ********************************************************************************************************&lt;br /&gt;
 *&lt;br /&gt;
 *  youtube.mrc by Jay2k1 @ QuakeNet, 2013&lt;br /&gt;
 *&lt;br /&gt;
 *  Whenever a youtube link is posted in the channels #foo or #bar, this script retrieves the video&#039;s details&lt;br /&gt;
 *  from the youtube API and post them to the channel. It looks like this:&lt;br /&gt;
 *&lt;br /&gt;
 *  &amp;lt;Jay2k1&amp;gt; http://www.youtube.com/watch?v=oHg5SJYRHA0&lt;br /&gt;
 *  &amp;lt;Bot&amp;gt; &#039;RickRoll&#039; by cotter548, 00:03:34, 68213084 views, rating: 87% (259236/38751)&lt;br /&gt;
 *&lt;br /&gt;
 *********************************************************************************************************&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
 ; on text event: regex check for messages containing youtube.com or youtu.be, match the URL&lt;br /&gt;
 on $*:TEXT:/(youtu\.be\/.*?(\s|$)|youtube\.com\/.*?(\s|$))/:#foo,#bar:{&lt;br /&gt;
 &lt;br /&gt;
   ; use another regex to extract the video ID from the matched URL&lt;br /&gt;
   [[noop]] [[$regex]]([[$regml]](1),/(\?v=|&amp;amp;v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]{11})/)&lt;br /&gt;
 &lt;br /&gt;
   ; call the youtube script with the channel and the video ID, if there is one&lt;br /&gt;
   youtube [[$$]][[regml]](2) [[$chan_(remote)|$chan]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ; alias youtube: opens a socket connection to youtube&lt;br /&gt;
 ; expects: youtube video ID as $1, #channel as $2&lt;br /&gt;
 ; returns: -&lt;br /&gt;
 [[alias]] -l youtube {&lt;br /&gt;
   ; create a unique socket name to allow for multiple connections at a time&lt;br /&gt;
   [[Local_Variables|var]] %sock = youtube. [[DollarPlus|$+]] [[$ticks]]&lt;br /&gt;
   [[sockopen]] %sock gdata.youtube.com 80&lt;br /&gt;
   ; store video ID and channel in socket mark&lt;br /&gt;
   [[sockmark]] %sock [[$1-|$1-]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:SOCKOPEN:youtube.*:{&lt;br /&gt;
   ; obligatory error check&lt;br /&gt;
   [[If-Then-Else|if]] $sockerr { [[return]] }&lt;br /&gt;
 &lt;br /&gt;
   ; send our request&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] GET /feeds/mobile/videos/ [[DollarPlus|$+]] [[$gettok]]([[$sock]]([[$sockname]]).mark,1,32) [[DollarPlus|$+]] ?v=2&amp;amp;prettyprint=true HTTP/1.1&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] Host: [[$sock]]([[$sockname]]).addr&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] [[$crlf]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:SOCKREAD:youtube.*:{&lt;br /&gt;
   [[If-Then-Else|if]] $sockerr { [[return]] }&lt;br /&gt;
 &lt;br /&gt;
   ; receive answer to the request into a variable&lt;br /&gt;
   [[Local_Variables|var]] %t = [[$sockname]], %data&lt;br /&gt;
   [[Sockread|sockread]] %data&lt;br /&gt;
 &lt;br /&gt;
   ; while there&#039;s bytes in the sockread buffer...&lt;br /&gt;
   [[while]] $sockbr {&lt;br /&gt;
 &lt;br /&gt;
     ; extract things of interest out of the source code into a hash table&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;title&amp;gt;*&amp;lt;/title&amp;gt;* iswm %data) { ylog found title! | [[hadd]] -m %t title [[$regsubex]](%data,/(.*&amp;lt;title&amp;gt;|&amp;lt;/title&amp;gt;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:duration seconds=&#039;*&#039;/&amp;gt;* iswm %data) { ylog found duration! | [[hadd]] -m %t dur [[$duration]]([[$regsubex]](%data,/(.*seconds=&#039;|&#039;/&amp;gt;.*)/g,),3) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:statistics favoriteCount=&#039;*&#039; viewCount=&#039;*&#039;/&amp;gt;* iswm %data) { ylog found views! | [[hadd]] -m %t views [[$regsubex]](%data,/(.*viewCount=&#039;|&#039;/&amp;gt;)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:rating numDislikes=&#039;*&#039; numLikes=&#039;*&#039;/&amp;gt;* iswm %data) { ylog found rating! | [[hadd]] -m %t likes [[$regsubex]](%data,/(.*numLikes=&#039;|&#039;/&amp;gt;.*)/g,) | [[hadd]] -m %t dislikes [[$regsubex]](%data,/(.*numDislikes=&#039;|&#039;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;name&amp;gt;*&amp;lt;/name&amp;gt;* iswm %data) { ylog found uploader name! | [[hadd]] -m %t uploader [[$regsubex]](%data,/(.*&amp;lt;name&amp;gt;|&amp;lt;/name&amp;gt;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:uploaded&amp;gt;*&amp;lt;/yt:uploaded&amp;gt;* iswm %data) { ylog found upload date! | [[hadd]] -m %t uploaded [[$left]]([[$regsubex]](%data,/(.*&amp;lt;yt:uploaded&amp;gt;|&amp;lt;/yt:uploaded&amp;gt;.*)/g,),10) }&lt;br /&gt;
     [[If-Then-Else|if]] (*accessControl action=&#039;rate&#039; permission=&#039;denied&#039;* iswm %data)  { ylog found rating disabled | [[hadd]] -m %t rating disabled or no votes }&lt;br /&gt;
 &lt;br /&gt;
     ; the &amp;lt;/entry&amp;gt; tag marks the end of the data.&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;/entry&amp;gt;* iswm %data) || ([[$hget]](%t,0).item == 7)  || (([[$hget]](%t,0).item == 7) &amp;amp;&amp;amp; ([[$hget]](%t,rating) == disabled)) {&lt;br /&gt;
       [[Local_Variables|var]] %ytmsg = &#039; [[DollarPlus|$+]] [[$hget]](%t,title) [[DollarPlus|$+]] &#039; by [[$hget]](%t,uploader) [[DollarPlus|$+]] [[$chr]](44) [[$hget]](%t,dur) [[DollarPlus|$+]] [[$chr]](44) [[$hget]](%t,views) views&lt;br /&gt;
       [[Local_Variables|var]] %ytmsg = %ytmsg [[DollarPlus|$+]] , [[$iif]]([[$hget]](%t,likes),rating: [[$round]]([[$calc]]([[$hget]](%t,likes) / ([[$hget]](%t,likes) + [[$hget]](%t,dislikes)) * 100),1) [[DollarPlus|$+]] % ( [[DollarPlus|$+]] [[$hget]](%t,likes) [[DollarPlus|$+]] / [[DollarPlus|$+]] [[$hget]](%t,dislikes) [[DollarPlus|$+]] ),rating disabled or not rated yet)&lt;br /&gt;
       [[Local_Variables|var]] %ytmsg = [[$replace]](%ytmsg,&amp;amp;nbsp;,[[$chr]](160),&amp;amp;quot;,&amp;quot;,&amp;amp;#39;,&#039;,&amp;amp;lt;,&amp;lt;,&amp;amp;gt;,&amp;gt;,&amp;amp;amp;,&amp;amp;, &amp;amp;pound;,[[$chr]](163), &amp;amp;euro;, [[$chr]](8364), &amp;amp;copy;, [[$chr]](169), &amp;amp;trade, [[$chr]](8482), &amp;amp;reg;, [[$chr]](174))                  &lt;br /&gt;
       [[msg]] [[$gettok]]([[$sock]](%t).mark,2,32) %ytmsg&lt;br /&gt;
 &lt;br /&gt;
       [[sockclose]] %t&lt;br /&gt;
       [[hfree]] %t&lt;br /&gt;
       [[return]]&lt;br /&gt;
     }&lt;br /&gt;
     [[Sockread|sockread]] %data&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Archive]]&lt;br /&gt;
&lt;br /&gt;
{{Author|Jay2k1}}&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=MHTTP&amp;diff=6141</id>
		<title>MHTTP</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=MHTTP&amp;diff=6141"/>
		<updated>2015-02-22T04:28:24Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: /* Script */ bugfix in http.urlparse: local var %protocol wasn&amp;#039;t initialized, so %protocol was set as global variable, which led to an empty %host variable if you passed an url without protocol as argument to http.urlparse, which made sockopen fail&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Often times you may want to download a web page from the internet using HTTP, but HTTP can be complicated.  This script handles most of the basics for you including&lt;br /&gt;
* URL Parsing&lt;br /&gt;
* SSL &lt;br /&gt;
* Cookies&lt;br /&gt;
* Sending POST data&lt;br /&gt;
* Following redirects&lt;br /&gt;
* Handling CHUNKED encoding&lt;br /&gt;
&lt;br /&gt;
Typical usage simply involves using the /http.open, save and close commands to download a file, and creating a signal event to do something with it once it is done.&lt;br /&gt;
== Example ==&lt;br /&gt;
 alias DownloadGooglesLogo {&lt;br /&gt;
  http.open google https://www.google.com/images/srpr/logo11w.png&lt;br /&gt;
  http.save -f google logo.png&lt;br /&gt;
 }&lt;br /&gt;
 on *:SIGNAL:http: {&lt;br /&gt;
   if ($1 == google) {&lt;br /&gt;
      if ($2 == SAVED) { run $3- } &lt;br /&gt;
      if ($2 == PROGRESS) { echo -atg Download progress: $bytes($3).suf $+ / $+ $bytes($4).suf downloaded }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
 ; Ben&#039;s (ben@st0rm.net) HTTP for mIRC script (mHTTP)&lt;br /&gt;
 ; Used to download over HTTP&lt;br /&gt;
 ; Basic usage&lt;br /&gt;
 ; /http.open [name] &amp;lt;URL&amp;gt; &lt;br /&gt;
 ;     Opens an HTTP handle for the given URL&lt;br /&gt;
 ; /http.save [-f] &amp;lt;name&amp;gt; &amp;lt;file|bvar&amp;gt;&lt;br /&gt;
 ;     Downloads a given HTTP resource to the given file or binvar&lt;br /&gt;
 ;     -f forces the file to be overwritten&lt;br /&gt;
 ; /http.close &amp;lt;name&amp;gt; &lt;br /&gt;
 ;     Closes and HTTP handle for the given URL&lt;br /&gt;
 ;&lt;br /&gt;
 ; Here are some things you can do after opening a handle, but before saving it&lt;br /&gt;
 ; Manage POST data:&lt;br /&gt;
 ;   /http.addpost &amp;lt;handle&amp;gt; &amp;lt;variable&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
 ;   /http.delpost &amp;lt;handle&amp;gt; &amp;lt;variable&amp;gt;&lt;br /&gt;
 ; Manage cookies &lt;br /&gt;
 ;   /http.addcookie &amp;lt;handle&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
 ;   $http.cookie(handle,N) - gets Nth cookie&lt;br /&gt;
 ;&lt;br /&gt;
 ; After a request completes (e.g. after a save) you can get some data:&lt;br /&gt;
 ;     $http.responseheader(handle, header, N) - Returns value of given responseheader, or $false. Only useful after a request is made&lt;br /&gt;
 ;&lt;br /&gt;
 ; You can mark a socket with data of your choice (it&#039;s a transparent write to a hashtable) similar to sockmark&lt;br /&gt;
 ; /http.mark &amp;lt;handle&amp;gt; [data] - Writes the data. Specify no data to delete the mark&lt;br /&gt;
 ; $http.mark(handle) - Reads the data&lt;br /&gt;
 ;&lt;br /&gt;
 ; Signals&lt;br /&gt;
 ;   In order to tell via script when something happens (your file is being saved, for example) use&lt;br /&gt;
 ;   on *:SIGNAL:http:&lt;br /&gt;
 ;   where $1 = Handle name, $2 = Event name, $3- = parameters&lt;br /&gt;
 ;   Events:&lt;br /&gt;
 ;        COMPLETED &amp;lt;statuscode&amp;gt;   -  when a request completes&lt;br /&gt;
 ;        SAVED &amp;lt;location&amp;gt;         - when a save completes&lt;br /&gt;
 ;        REDIRECT &amp;lt;location&amp;gt;      - when a request is redirected elsewhere &lt;br /&gt;
 ;        PROGRESS &amp;lt;bytes&amp;gt; [total size] - When part but not all of the data is downloaded. Total size is not available for chunked transfer&lt;br /&gt;
 ;       &lt;br /&gt;
 ;&lt;br /&gt;
 ; Known issues:&lt;br /&gt;
 ;    Cookies do not respect attributes such as domain, path, expiration, or secure. They area always sent&lt;br /&gt;
 ;    Relative redirects don&#039;t work, only absolute&lt;br /&gt;
 ;    Redirects from insecure to secure links when you don&#039;t have SSL will not be handled well&lt;br /&gt;
 ; Creates a request that when completed is saved to a file&lt;br /&gt;
 alias http.save {&lt;br /&gt;
   if ($1 == -f) {&lt;br /&gt;
     var %force = $true&lt;br /&gt;
     tokenize 32 $2-&lt;br /&gt;
   }&lt;br /&gt;
   else { var %force = $false }&lt;br /&gt;
   if ($0 &amp;lt; 2) { &lt;br /&gt;
     echo -atg * /http.save: Use /http.save &amp;lt;http handle&amp;gt; &amp;lt;file&amp;gt;&lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   var %hashtable = http. $+ $1&lt;br /&gt;
   if (!$hget(%hashtable)) { &lt;br /&gt;
     echo -atg * /http.save: No such HTTP handle exists. Use /http.open first&lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   if ($sock(%hashtable)) {&lt;br /&gt;
     echo -atg * /http.save: There is a pending request for this HTTP handle already. A connection is open the the remote host. Close it, or wait for it to complete &lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   var %destination = $2-&lt;br /&gt;
   if ($exists(%destination)) {&lt;br /&gt;
     if (%force) {&lt;br /&gt;
       .remove %destination&lt;br /&gt;
     }&lt;br /&gt;
     else {&lt;br /&gt;
       echo -atg * /http.save: File already exists. Try /http.save -f to force an overwrite&lt;br /&gt;
       return&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (&amp;amp;* iswm %destination) { &lt;br /&gt;
     .hadd %hashtable bvarout %destination&lt;br /&gt;
   }&lt;br /&gt;
   else {&lt;br /&gt;
     ;  Open file handler stream for writing&lt;br /&gt;
     .fopen -n %hashtable %destination&lt;br /&gt;
     if ($ferr) {&lt;br /&gt;
       echo -atg * /http.save: Could not use file. Error: $ferr&lt;br /&gt;
       return&lt;br /&gt;
     }&lt;br /&gt;
     ; Store fstream name in hashtable to indicate that we want to save this once it completes&lt;br /&gt;
     .hadd %hashtable fstream %hashtable&lt;br /&gt;
   }&lt;br /&gt;
   ; Set redirect counter to 0&lt;br /&gt;
   .hadd %hashtable redirects 0&lt;br /&gt;
   ; Start socket&lt;br /&gt;
   http.sockstart %hashtable&lt;br /&gt;
 }&lt;br /&gt;
 alias http.mark {&lt;br /&gt;
   var %hashtable = http. $+ $1&lt;br /&gt;
   if ($isid) {&lt;br /&gt;
     ; As an identifier, read the mark&lt;br /&gt;
     return $hget(%hashtable,mark)&lt;br /&gt;
   }&lt;br /&gt;
   else {&lt;br /&gt;
     ; As a command, set the mark&lt;br /&gt;
     if (!$hget(%hashtable)) {&lt;br /&gt;
       echo -atg * /http.mark - No such handle $1&lt;br /&gt;
     }&lt;br /&gt;
     elseif (!$2) { &lt;br /&gt;
       .hdel %hashtable mark&lt;br /&gt;
     }&lt;br /&gt;
     else {&lt;br /&gt;
       .hadd %hashtable mark $2-&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 ; Opens socket&lt;br /&gt;
 alias -l http.sockstart {&lt;br /&gt;
   if ($hget($1,secure) == $true) {&lt;br /&gt;
     if ($sock($1) &amp;amp;&amp;amp; $sock($1).ssl) { &lt;br /&gt;
       http.sendrequest $1&lt;br /&gt;
     } &lt;br /&gt;
     else {&lt;br /&gt;
       if ($sock($1)) { .sockclose $1 }&lt;br /&gt;
       if (!$sslready) {&lt;br /&gt;
         echo -atg HTTP Error - request $qt($right($1,-5)) would require you to use SSL but you are not SSL ready. Please see http://mirc.com/ssl.html&lt;br /&gt;
         http.close $right($1,-5)&lt;br /&gt;
         return&lt;br /&gt;
       }&lt;br /&gt;
       sockopen -e $1 $hget($1, host) $hget($1, port)&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   else {&lt;br /&gt;
     if ($sock($1)) {&lt;br /&gt;
       http.sendrequest $1&lt;br /&gt;
     }&lt;br /&gt;
     else {&lt;br /&gt;
       sockopen $1 $hget($1, host) $hget($1, port)&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 ; Sends the request. Assumes the socket is open and ready&lt;br /&gt;
 alias -l http.sendrequest {&lt;br /&gt;
   if (!$sock($1)) { echo -atg HTTP Internal error. Socket not open in /http.sendrequest | return }&lt;br /&gt;
   var %inname = $1&lt;br /&gt;
   var %exname = $right($1,-5)&lt;br /&gt;
   ; Cleanup from previous requests&lt;br /&gt;
   .hdel %inname responseheaders&lt;br /&gt;
   .hdel %inname body&lt;br /&gt;
   .hdel %inname contentlength&lt;br /&gt;
   .hdel %inname chunkleft&lt;br /&gt;
   ; Get POST binvar&lt;br /&gt;
   var %postBV = $http.postdata(%inname)&lt;br /&gt;
   ; Use GET if there&#039;s no post data, POST otherwise&lt;br /&gt;
   if ($bvar(%postBV,0) == 0) {&lt;br /&gt;
     sockwrite -n %inname GET $hget(%inname,path) HTTP/1.1 &lt;br /&gt;
   }&lt;br /&gt;
   else {&lt;br /&gt;
     sockwrite -n %inname POST $hget(%inname,path) HTTP/1.1 &lt;br /&gt;
   }&lt;br /&gt;
   ; Send the host&lt;br /&gt;
   sockwrite -n %inname Host: $hget(%inname,host)&lt;br /&gt;
   ; Send the user-agent&lt;br /&gt;
   sockwrite -n %inname User-agent: $hget(%inname,user-agent)&lt;br /&gt;
   sockwrite -n %inname Connection: Keep-Alive&lt;br /&gt;
   ; Only plain-text supported&lt;br /&gt;
   sockwrite -n %inname Accept: text/plain; q=0.5, text/html&lt;br /&gt;
   ; Send cookies&lt;br /&gt;
   if ($http.cookie(%exname, 0) &amp;gt; 0) {&lt;br /&gt;
     sockwrite %inname Cookie: $+ $chr(32)&lt;br /&gt;
     var %i = 1&lt;br /&gt;
     while ($http.cookie(%exname, %i)) {&lt;br /&gt;
       sockwrite %inname $http.urlencode($ifmatch) $+ ;&lt;br /&gt;
       inc %i&lt;br /&gt;
     }&lt;br /&gt;
     sockwrite -n %inname&lt;br /&gt;
   }&lt;br /&gt;
   ; If POST send content type and length&lt;br /&gt;
   if ($bvar(%postBV,0) &amp;gt; 0) {&lt;br /&gt;
     sockwrite -n %inname Content-Type: application/x-www-form-urlencoded&lt;br /&gt;
     sockwrite -n %inname Content-Length: $v1&lt;br /&gt;
   }&lt;br /&gt;
   ; End request headers with empty line&lt;br /&gt;
   sockwrite -n %inname&lt;br /&gt;
   ; If POST, send data&lt;br /&gt;
   if ($bvar(%postBV,0) &amp;gt; 0) {&lt;br /&gt;
     sockwrite %inname %postBV&lt;br /&gt;
     ; sockwrite -n %inname&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 ; Just some bookeeping in case we miss it &lt;br /&gt;
 on *:SOCKCLOSE:http.*: {&lt;br /&gt;
   if ($fopen($sockname)) { .fclose $sockname }&lt;br /&gt;
 }&lt;br /&gt;
 on *:SOCKOPEN:http.*: {&lt;br /&gt;
   http.sendrequest $sockname&lt;br /&gt;
 }&lt;br /&gt;
 on *:SOCKREAD:http.*: {&lt;br /&gt;
   if ($sockerr &amp;gt; 0) {&lt;br /&gt;
     echo -atg * HTTP handle $qt($right($sockname,-5)) failed with socket error $sockerr&lt;br /&gt;
     http.close $right($sockname,-5)&lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   ;Read all the data into &amp;amp;bvTemp&lt;br /&gt;
   :read&lt;br /&gt;
   ; First, read this buffer&lt;br /&gt;
   sockread &amp;amp;bvThis&lt;br /&gt;
   if ($sockbr &amp;gt; 0) {&lt;br /&gt;
     ; If data was read, copy it to the on-going buffer and continue&lt;br /&gt;
     bcopy &amp;amp;bvTemp $calc($bvar(&amp;amp;bvTemp,0) +1) &amp;amp;bvThis 1 -1&lt;br /&gt;
     goto read&lt;br /&gt;
   }&lt;br /&gt;
   if ($bvar(&amp;amp;bvTemp,0) == 0) { echo -atg HTTP sockread called with no data to read... | return }&lt;br /&gt;
   ; Do we need to parse headers?&lt;br /&gt;
   ; If response headers not set, this call has the headers&lt;br /&gt;
   if (!$hget($sockname,responseheaders)) {&lt;br /&gt;
     ; Find the response headers&lt;br /&gt;
     var %end = $bfind(&amp;amp;bvTemp,1, 13 10 13 10)&lt;br /&gt;
     if (%end == 0) { echo -atg Error: No headers found, but no content length so this can&#039;t be a subsequent call | return }&lt;br /&gt;
     ; Increase to include the 3 extra characters&lt;br /&gt;
     inc %end 3&lt;br /&gt;
     bcopy &amp;amp;bvResponseHeaders 1 &amp;amp;bvTemp 1 %end&lt;br /&gt;
     ; If there&#039;s still non-header data copy it over&lt;br /&gt;
     if (%end &amp;lt; $bvar(&amp;amp;bvTemp, 0)) { &lt;br /&gt;
       bcopy -c &amp;amp;bvTemp 1 &amp;amp;bvTemp $calc(%end + 1) -1&lt;br /&gt;
     }&lt;br /&gt;
     else { bunset &amp;amp;bvTemp }&lt;br /&gt;
     ; If this is the first header response, save in hash table&lt;br /&gt;
     if (!$hget($sockname, responseheaders)) {&lt;br /&gt;
       .hadd -b $sockname responseheaders &amp;amp;bvResponseHeaders &lt;br /&gt;
       http.OnHeaders $sockname&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   ; there&#039;s no more to read, bail&lt;br /&gt;
   if (!$bvar(&amp;amp;bvTemp,0)) {&lt;br /&gt;
     ; If that&#039;s all this response has to offer, we&#039;re done&lt;br /&gt;
     if ($hget($sockname,contentlength) == 0) {&lt;br /&gt;
       http.ondone $sockname&lt;br /&gt;
     }&lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   ; Read body&lt;br /&gt;
   var %contentlength = $hget($sockname,contentlength)&lt;br /&gt;
   if (%contentlength == $null || %contentlength == $false) {&lt;br /&gt;
     var %chunked = $true&lt;br /&gt;
   }&lt;br /&gt;
   else {&lt;br /&gt;
     var %chunked = $false&lt;br /&gt;
   }&lt;br /&gt;
   ; Set bvBody to the body ready so far&lt;br /&gt;
   if ($hget($sockname,body)) {&lt;br /&gt;
     noop $hget($sockname, body, &amp;amp;bvBody)&lt;br /&gt;
   }&lt;br /&gt;
   if (%chunked) {&lt;br /&gt;
     :readChunk&lt;br /&gt;
     var %chunkleft = $hget($sockname, chunkleft)&lt;br /&gt;
     if (!%chunkleft) {&lt;br /&gt;
       ; If we&#039;ve read all of a chunk, or this is the first one, get its size&lt;br /&gt;
       var %crlf = $bfind(&amp;amp;bvTemp, 1, 13 10)&lt;br /&gt;
       if (!%crlf) {&lt;br /&gt;
         echo -atg HTTP internal error. Handle $qt($right($sockname,-5)) is in chunked encoding but no chunk size found in data&lt;br /&gt;
         return&lt;br /&gt;
       }&lt;br /&gt;
       var %chunkleft = $base($bvar(&amp;amp;bvTemp, 1, $calc(%crlf - 1)).text,16,10)&lt;br /&gt;
       if (%chunkleft !isnum) {&lt;br /&gt;
         echo -atg HTTP internal error. Handle $qt($right($sockname,-5))  has invalid chunk size: %chunkleft&lt;br /&gt;
       }&lt;br /&gt;
       ; New chunk&lt;br /&gt;
       else {&lt;br /&gt;
         ; Save chunk size and remove it (plus its \r\n) from temp&lt;br /&gt;
         .hadd $sockname chunkleft %chunkleft&lt;br /&gt;
         .bcopy -c &amp;amp;bvTemp 1 &amp;amp;bvTemp $calc(%crlf +2) -1&lt;br /&gt;
         if (%chunkLeft == 0) { &lt;br /&gt;
           ; if we just read chunk size 0, that was the end. &lt;br /&gt;
           .hadd -b $sockname body &amp;amp;bvBody&lt;br /&gt;
           http.onDone $sockname&lt;br /&gt;
           return&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
     ; read %chunkleft bytes&lt;br /&gt;
     var %bytesToRead = $iif(%chunkLeft &amp;lt; $bvar(&amp;amp;bvTemp,0),%chunkLeft, $bvar(&amp;amp;bvTemp,0))&lt;br /&gt;
     .bcopy &amp;amp;bvBody $calc($bvar(&amp;amp;bvBody,0) +1) &amp;amp;bvTemp 1 %bytesToRead&lt;br /&gt;
     hdec $sockname chunkleft %bytesToRead&lt;br /&gt;
     .signal http $right($sockname,-5) PROGRESS %bytesToRead&lt;br /&gt;
     if (%bytesToRead == %chunkLeft) {&lt;br /&gt;
       ; If this is the end of the chunk, consume crlf&lt;br /&gt;
       inc %bytesToRead 2&lt;br /&gt;
       ; If there&#039;s still stuff in this var, go back and read the new chunk&lt;br /&gt;
       if (%bytesToRead &amp;lt; $bvar(&amp;amp;bvTemp,0)) {&lt;br /&gt;
         .bcopy -c &amp;amp;bvTemp 1 &amp;amp;bvTemp $calc(%bytesToRead + 1) -1    &lt;br /&gt;
         goto readChunk&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
     ; End of this call, save body in hashtable for future calls&lt;br /&gt;
     .hadd -b $sockname body &amp;amp;bvBody&lt;br /&gt;
   }&lt;br /&gt;
   else {&lt;br /&gt;
     ; Copy everything&lt;br /&gt;
     .bcopy &amp;amp;bvBody $calc($bvar(&amp;amp;bvBody,0) +1) &amp;amp;bvTemp 1 -1&lt;br /&gt;
     ; Add read-so-far body to hashtable&lt;br /&gt;
     .hadd -b $sockname body &amp;amp;bvBody&lt;br /&gt;
     .signal http $right($sockname,-5) PROGRESS $bvar(&amp;amp;bvBody,0) $hget($sockname,contentlength) &lt;br /&gt;
     ; Check if we&#039;re done&lt;br /&gt;
     if ($bvar(&amp;amp;bvBody,0) &amp;gt;= $hget($sockname,contentlength)) { &lt;br /&gt;
       ; We&#039;re done&lt;br /&gt;
       http.onDone $sockname&lt;br /&gt;
       if ($bvar(&amp;amp;bvBody,0) &amp;gt; $hget($sockname,contentlength)) { &lt;br /&gt;
         echo -qatg HTTP Warning: Read past content-length.&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 ; Internal event called when we get the first header response from the server&lt;br /&gt;
 alias -l http.OnHeaders {&lt;br /&gt;
   noop $hget($1,responseheaders, &amp;amp;bvResponseHeaders)&lt;br /&gt;
   ; First header is always the status response&lt;br /&gt;
   var %end = $bfind(&amp;amp;bvResponseHeaders, 1, 13 10)&lt;br /&gt;
   if (%end &amp;lt;= 1) {&lt;br /&gt;
     echo -atg Error: HTTP $qt($right($1,-5)) Server did not respond with HTTP status &lt;br /&gt;
     goto cleanup&lt;br /&gt;
   }&lt;br /&gt;
   var %status = $bvar(&amp;amp;bvResponseHeaders,1,$calc(%end - 1)).text&lt;br /&gt;
   .hadd $1 responsestatus %status&lt;br /&gt;
   var %version = $gettok(%status,1,32)&lt;br /&gt;
   if (%version != HTTP/1.1 &amp;amp;&amp;amp; %version != HTTP/1.0) {&lt;br /&gt;
     echo -atg Error: HTTP $qt($right($1,-5)) Server indicated unknown version: %version&lt;br /&gt;
     goto cleanup&lt;br /&gt;
   }&lt;br /&gt;
   var %statuscode = $gettok(%status,2,32)&lt;br /&gt;
   if (%statuscode !isnum) {&lt;br /&gt;
     echo -atg Error: HTTP $qt($right($1,-5)) Server indicated invalid status code: %statuscode&lt;br /&gt;
     goto cleanup&lt;br /&gt;
   }&lt;br /&gt;
   ; Check transfer type&lt;br /&gt;
   if ($http.responseheader($right($1,-5),Content-Length,1) != $null) {&lt;br /&gt;
     hadd $1 contentlength $v1&lt;br /&gt;
   }&lt;br /&gt;
   elseif ($http.responseheader($right($1,-5), Transfer-Encoding, 1) != chunked) {&lt;br /&gt;
     echo -atg HTTP Handle $qt($right($1,-5)) has no content-length header and is not chunked&lt;br /&gt;
     echo -atg $bvar(&amp;amp;bvResponseHeaders,1-).text&lt;br /&gt;
     return&lt;br /&gt;
   } &lt;br /&gt;
   ; Add any cookies that were set&lt;br /&gt;
   var %cookie = 1&lt;br /&gt;
   while ($http.responseheader($right($1,-5), Set-Cookie, %cookie)) {&lt;br /&gt;
     inc %cookie&lt;br /&gt;
     var %cookieValue = $gettok($ifmatch,1,$asc(;))&lt;br /&gt;
     http.addcookie $right($1,-5) %cookieValue&lt;br /&gt;
   }&lt;br /&gt;
   ; Handle redirects&lt;br /&gt;
   if (%statuscode == 303 || %statuscode == 302 || %statuscode == 307) {&lt;br /&gt;
     var %location = $http.responseheader($right($1,-5), Location)&lt;br /&gt;
     .signal http $right($1,-5) REDIRECT %location&lt;br /&gt;
     http.seturl $1 %location&lt;br /&gt;
     hinc $1 redirects&lt;br /&gt;
     ; If the server doesn&#039;t promise us this connection is keep-alive, close it and use a new one&lt;br /&gt;
     if ($http.responseheader($right($1,-5), Connection, 1) != Keep-Alive) {&lt;br /&gt;
       if ($sock($1)) { .sockclose $1 }&lt;br /&gt;
     }&lt;br /&gt;
     if ($hget($1, redirects) &amp;gt; 5) {&lt;br /&gt;
       echo -atg HTTP Handle $qt($right($1,-5)) redirect loop detected&lt;br /&gt;
       return&lt;br /&gt;
     }&lt;br /&gt;
     http.sockstart $1&lt;br /&gt;
   }&lt;br /&gt;
   return&lt;br /&gt;
   :cleanup&lt;br /&gt;
   if ($sock($1)) { .sockclose $1 }&lt;br /&gt;
 }&lt;br /&gt;
 alias http.addcookie {&lt;br /&gt;
   var %hashtable = http. $+ $1&lt;br /&gt;
   if (!$hget(%hashtable)) {&lt;br /&gt;
     echo -atg * /http.addcookie: No such HTTP handle&lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   if ($0 &amp;lt; 2) {&lt;br /&gt;
     echo -atg * /http.addcookie: Usage: /http.addcookie &amp;lt;handle&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   var %i = 1&lt;br /&gt;
   var %cookieNum = 1&lt;br /&gt;
   while ($hget(%hashtable,%i).item) {&lt;br /&gt;
     var %item = $ifmatch&lt;br /&gt;
     inc %i&lt;br /&gt;
     if (cookie-* iswm %item) {&lt;br /&gt;
       var %tmp = $gettok(%item,2,$asc(-))&lt;br /&gt;
       ; If the value is the same, overwrite&lt;br /&gt;
       if ($2- == $hget(%hashtable,%item)) {&lt;br /&gt;
         %cookieNum = %tmp&lt;br /&gt;
         break&lt;br /&gt;
       }&lt;br /&gt;
       ; Otherwise store max cookie num&lt;br /&gt;
       elseif (%tmp &amp;gt;= %cookieNum) { %cookieNum = $calc(%tmp + 1) }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   .hadd %hashtable cookie- $+ %cookieNum $+ -value $2-&lt;br /&gt;
 }&lt;br /&gt;
 ; Gets an HTTP cookie for the given handle&lt;br /&gt;
 ; $http.cookie(&amp;lt;handle&amp;gt;, &amp;lt;index&amp;gt;)&lt;br /&gt;
 alias http.cookie {&lt;br /&gt;
   if ($2 !isnum) {&lt;br /&gt;
     echo -atg * $!http.cookie invalid parameters&lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   var %hashtable = http. $+ $1&lt;br /&gt;
   if (!$hget(%hashtable)) {&lt;br /&gt;
     echo -atg * $!http.cookie no such HTTP handle &lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   var %i = 1&lt;br /&gt;
   var %found = 0&lt;br /&gt;
   while ($hget(%hashtable, %i).item) {&lt;br /&gt;
     inc %i&lt;br /&gt;
     var %item = $ifmatch&lt;br /&gt;
     if (cookie-*-value iswm %item) {&lt;br /&gt;
       inc %found&lt;br /&gt;
       var %id = $gettok(%item,2,$asc(-))&lt;br /&gt;
       if (%found == $2) {&lt;br /&gt;
         return $hget(%hashtable, cookie- $+ %id $+ -value)&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if ($2 == 0) { return %found }&lt;br /&gt;
 }&lt;br /&gt;
 ; Returns the value of the given response header&lt;br /&gt;
 ; Case sensitive since it is binary variable operation&lt;br /&gt;
 alias http.responseheader {&lt;br /&gt;
   if ($0 &amp;lt; 2) {&lt;br /&gt;
     echo -atg Invalid usage. Use: $http.responseheader(&amp;lt;handle&amp;gt;, &amp;lt;header&amp;gt;[, index])&lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   ; %index is parameter 3 - 1-N or 0 for number&lt;br /&gt;
   var %index = 1&lt;br /&gt;
   if ($3 isnum) {&lt;br /&gt;
     %index = $3&lt;br /&gt;
   }&lt;br /&gt;
   ; Veriy hash table exists&lt;br /&gt;
   var %table = http. $+ $1&lt;br /&gt;
   if (!$hget(%table,responseheaders)) { return $false }&lt;br /&gt;
   noop $hget(%table,responseheaders, &amp;amp;bvResponseHeaders))&lt;br /&gt;
   ; Set up parameters for the header search&lt;br /&gt;
   ; Offset is where we start searching from in the loop&lt;br /&gt;
   ; thisIndex is the number of matches found so far&lt;br /&gt;
   var %offset = 1&lt;br /&gt;
   var %thisIndex = 0&lt;br /&gt;
   ; The main search loop&lt;br /&gt;
   :search&lt;br /&gt;
   var %start = $bfind(&amp;amp;bvResponseHeaders, %offset, $2 $+ :).text&lt;br /&gt;
   ; If there isn&#039;t another match, either the index was too large or they want the count&lt;br /&gt;
   if (!%start) { &lt;br /&gt;
     if (%index == 0) { return %thisIndex }&lt;br /&gt;
     else { return $false  }&lt;br /&gt;
   }&lt;br /&gt;
   ; Find the end of the header&lt;br /&gt;
   var %end = $bfind(&amp;amp;bvResponseHeaders, %start, 13 10)&lt;br /&gt;
   if (%end &amp;lt;= %start) { echo -atg HTTP Internal error ($http.responseheader), header $qt($2) for handle $qt($1) has no CRLF termination | return $false }&lt;br /&gt;
   inc %thisIndex&lt;br /&gt;
   ; If this not the one they asked for, try again starting from the end of this header&lt;br /&gt;
   if (%index != %thisIndex) {&lt;br /&gt;
     var %offset = %end&lt;br /&gt;
     goto search&lt;br /&gt;
   }&lt;br /&gt;
   ; Find the colon. If there isn&#039;t one we&#039;ll return the whole string&lt;br /&gt;
   if ($calc($bfind(&amp;amp;bvResponseHeaders, %start, $asc(:)) +1) &amp;lt; %end) {&lt;br /&gt;
     %start = $v1&lt;br /&gt;
   }&lt;br /&gt;
   return $bvar(&amp;amp;bvResponseHeaders,%start, $calc(%end - %start)).text&lt;br /&gt;
 }&lt;br /&gt;
 ; Internal event called when a request is filled. $1 = internal handle name&lt;br /&gt;
 alias -l http.onDone {&lt;br /&gt;
   if ($hget($1,responseheaders)) {&lt;br /&gt;
     noop $hget($1,responseheaders,&amp;amp;bvResponseHeaders)&lt;br /&gt;
   }&lt;br /&gt;
   ; Write out and close filestream if set&lt;br /&gt;
   if ($hget($1,fstream)) {&lt;br /&gt;
     noop $hget($1,body,&amp;amp;bvBody)&lt;br /&gt;
     if (!$bvar(&amp;amp;bvBody,0)) {&lt;br /&gt;
       .fclose $hget($1,fstream)&lt;br /&gt;
     }&lt;br /&gt;
     else {&lt;br /&gt;
       .fwrite -b $hget($1,fstream) &amp;amp;bvBody&lt;br /&gt;
       ; Save fname so we can use it in the signal after the close&lt;br /&gt;
       var %fname = $fopen($hget($1,fstream)).fname&lt;br /&gt;
       .fclose $hget($1,fstream)&lt;br /&gt;
       .signal http $right($1,-5) SAVED %fname&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   ; If socket is still around, close it&lt;br /&gt;
   if ($sock($1)) { .sockclose $1 }&lt;br /&gt;
   ; Reset redirects for future calls&lt;br /&gt;
   .hadd $1 redirects 0&lt;br /&gt;
   .signal HTTP $right($1,-5) COMPLETED $hget($1,responsestatus)&lt;br /&gt;
   if ($hget($1, bvarout)) {&lt;br /&gt;
     noop $hget($1,body,&amp;amp;bvBody)&lt;br /&gt;
     var %bvarout = $ifmatch&lt;br /&gt;
     bcopy %bvarout 1 &amp;amp;bvBody 1 -1&lt;br /&gt;
     ; Need to use -n so that the binvar is still in scope&lt;br /&gt;
     ; So we need to do this last&lt;br /&gt;
     .signal -n http $right($1,-5) SAVED %bvarout&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 alias http.open {&lt;br /&gt;
   var %hashtable&lt;br /&gt;
   ; If two parameters are given, $1 is the name, else create a new name&lt;br /&gt;
   if ($0 &amp;gt; 1) { %hashtable = http. $+ $1 }&lt;br /&gt;
   else { &lt;br /&gt;
     var %h = $calc($ticks % $rand(1,1000000))&lt;br /&gt;
     var %hashtable = http. $+ %h  &lt;br /&gt;
   }&lt;br /&gt;
   if ($hget(%hashtable)) {&lt;br /&gt;
     echo -atg * /http.open: HTTP Request $qt($1) already exists&lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   ; Encode the octects of the URL. e.g.: foo bar,pie --&amp;gt; foo%20bar,%2Cpie&lt;br /&gt;
   var %url = $iif($0 &amp;gt; 1, $2-, $1-)&lt;br /&gt;
   var %urlEncoded = $http.urlencode(%url)&lt;br /&gt;
   ; Check the URL&lt;br /&gt;
   if (!$http.urlparse(%urlEncoded)) {&lt;br /&gt;
     echo -atg * /http.open: Malformed URL. Use /http.open [name] &amp;lt;url&amp;gt; &lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   if ($http.urlparse(%urlEncoded).secure &amp;amp;&amp;amp; !$sslready) {&lt;br /&gt;
     echo -atg * /http.open: URL is SSL but $!sslready = false. See http://www.mirc.com/ssl.html&lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   ; Everything checks out, let&#039;s store the relevent bits in a hashtable&lt;br /&gt;
   .hmake %hashtable 10&lt;br /&gt;
   http.seturl %hashtable %url&lt;br /&gt;
   echo -qatg * /http.open: Opened HTTP request $qt($right(%hashtable,-5))&lt;br /&gt;
 }&lt;br /&gt;
 alias -l http.seturl {&lt;br /&gt;
   if ($0 &amp;lt; 2) { echo -atg HTTP Internal error, seturl called with no url }&lt;br /&gt;
   var %hashtable = $1&lt;br /&gt;
   if (!$hget(%hashtable)) { echo -atg HTTP Internal error, seturl called with invalid handle }&lt;br /&gt;
   var %urlEncoded = $http.urlencode($2-)&lt;br /&gt;
   .hadd %hashtable host $http.urlparse(%urlEncoded).host&lt;br /&gt;
   .hadd %hashtable port $http.urlparse(%urlEncoded).port&lt;br /&gt;
   .hadd %hashtable secure $http.urlparse(%urlEncoded).secure&lt;br /&gt;
   .hadd %hashtable path $http.urlparse(%urlEncoded).path&lt;br /&gt;
   .hadd %hashtable user-agent mIRC $version&lt;br /&gt;
 }&lt;br /&gt;
 alias http.list {&lt;br /&gt;
   var %i = 1&lt;br /&gt;
   var %numFound = 0&lt;br /&gt;
   while (%i &amp;lt;= $hget(0)) {&lt;br /&gt;
     var %table = $hget(%i)&lt;br /&gt;
     inc %i&lt;br /&gt;
     if (http.* iswm %table) {&lt;br /&gt;
       inc %numFound&lt;br /&gt;
       echo -atg * $right(%table,-5) $+ : Host: $hget(%table,host) Port: $hget(%table,port) Path: $hget(%table,path)&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (%numFound == 0) { echo -atg * No HTTP handles opened }&lt;br /&gt;
 }&lt;br /&gt;
 alias http.close {&lt;br /&gt;
   var %i = 1&lt;br /&gt;
   var %numFound = 0&lt;br /&gt;
   while (%i &amp;lt;= $hget(0)) {&lt;br /&gt;
     var %table = $hget(%i)&lt;br /&gt;
     if (http. $+ $1 iswm %table) {&lt;br /&gt;
       ; Cleanup resources&lt;br /&gt;
       if ($sock(%table)) { .sockclose %table }&lt;br /&gt;
       if ($fopen(%table)) { .fclose %table }&lt;br /&gt;
       if ($hget(%table $+ .postdata)) { .hfree %table $+ .postdata }&lt;br /&gt;
       .hfree %table&lt;br /&gt;
       inc %numFound&lt;br /&gt;
       echo -qatg * HTTP Closed $right(%table,-5) &lt;br /&gt;
     }&lt;br /&gt;
     ; Only inc if we didnt find a match&lt;br /&gt;
     else {&lt;br /&gt;
       inc %i&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   if (%numFound == 0) {  echo -qatg * No matching HTTP handles } &lt;br /&gt;
 }&lt;br /&gt;
 ;&lt;br /&gt;
 ; Takes an encoded URL and returns based on the property&lt;br /&gt;
 ; .secure - true if https&lt;br /&gt;
 ; .host - the URL host&lt;br /&gt;
 ; .port - the port, 80 by default&lt;br /&gt;
 ; .path - The path to download, / by default&lt;br /&gt;
 ;  Returns $false is URL is malformed&lt;br /&gt;
 ;&lt;br /&gt;
 alias http.urlparse {&lt;br /&gt;
   var %secure&lt;br /&gt;
   var %host&lt;br /&gt;
   var %port&lt;br /&gt;
   var %path&lt;br /&gt;
   var %protocol&lt;br /&gt;
   var %regex = /^(https?://)?([a-z.0-9\-_]+)(:\d+)?(/.*)?$/i&lt;br /&gt;
   if ($regex($1, %regex)) {&lt;br /&gt;
     if (http*:// iswm $regml(1)) {&lt;br /&gt;
       %protocol = $lower($left($regml(1),-3))&lt;br /&gt;
     }&lt;br /&gt;
     %secure = $false&lt;br /&gt;
     if (%protocol == https) { &lt;br /&gt;
       %secure = $true&lt;br /&gt;
     }&lt;br /&gt;
     if (%protocol) { %host = $regml(2) }&lt;br /&gt;
     else { %host = $regml(1) }  &lt;br /&gt;
     var %portIndex = $iif(%protocol, 3, 2)&lt;br /&gt;
     var %portfound = $false&lt;br /&gt;
     if ($left($regml(%portIndex),1) == : &amp;amp;&amp;amp; $right($regml(%portIndex),-1) isnum) {&lt;br /&gt;
       %port = $right($regml(%portIndex),-1) &lt;br /&gt;
       %portFound = $true&lt;br /&gt;
     }&lt;br /&gt;
     else {&lt;br /&gt;
       if (%secure) { &lt;br /&gt;
         %port = 443&lt;br /&gt;
       }&lt;br /&gt;
       else {&lt;br /&gt;
         %port = 80&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
     %pathIndex = $iif(%portFound, $calc(%portIndex + 1), %portIndex)&lt;br /&gt;
     if ($regml(0) &amp;gt;= %pathIndex) {&lt;br /&gt;
       %path = $regml(%pathIndex)&lt;br /&gt;
     }&lt;br /&gt;
     else { %path = / }&lt;br /&gt;
   }  &lt;br /&gt;
   else { return $false }&lt;br /&gt;
   if ($prop == secure) { return %secure }&lt;br /&gt;
   if ($prop == host) { return %host }&lt;br /&gt;
   if ($prop == path) { return %path }&lt;br /&gt;
   if ($prop == port) { return %port }&lt;br /&gt;
   return $true&lt;br /&gt;
 }&lt;br /&gt;
 alias http.addpost {&lt;br /&gt;
   if ($0 &amp;lt; 3) { &lt;br /&gt;
     echo -atg * /http.addpost: Usage: /http.addpost &amp;lt;handle&amp;gt; &amp;lt;variable&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   var %maintable = http. $+ $1&lt;br /&gt;
   var %posttable = %maintable $+ .postdata&lt;br /&gt;
   if (!$hget(%maintable)) {&lt;br /&gt;
     echo -atg * /http.addpost: No such HTTP handle found&lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   if (!$hget(%posttable)) { .hmake %posttable 10 }&lt;br /&gt;
   hadd %posttable $2 $3-&lt;br /&gt;
   echo -qatg Post variable added: $2 $+ = $+ $3-&lt;br /&gt;
 }&lt;br /&gt;
 alias http.delpost {&lt;br /&gt;
   if ($0 &amp;lt; 2) {&lt;br /&gt;
     echo -atg * /http.delpost: Usage: /http.delpost &amp;lt;handle&amp;gt; &amp;lt;variable&amp;gt;&lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   var %maintable = http. $+ $1&lt;br /&gt;
   var %posttable = %maintable $+ .postdata&lt;br /&gt;
   if (!$hget(%maintable)) {&lt;br /&gt;
     echo -atg * /http.addpost: No such HTTP handle found&lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   if (!$hget(%posttable,$2)) {&lt;br /&gt;
     echo -qatg * /http.addpost: No post variable with that name exists&lt;br /&gt;
     return&lt;br /&gt;
   }&lt;br /&gt;
   hdel %posttable $2&lt;br /&gt;
   echo -qatg Post variable deleted: $2&lt;br /&gt;
 }&lt;br /&gt;
 ; Usage: $http.postdata(handle)&lt;br /&gt;
 ; Returns a binvar with a post data style query string (x=y&amp;amp;z=a) or $false&lt;br /&gt;
 alias http.postdata {&lt;br /&gt;
   ; Post data is stored in INNAME.postdata&lt;br /&gt;
   var %posttable = http. $+ $1 $+ .postdata&lt;br /&gt;
   if (!$hget(%posttable,0).item) { return $false }&lt;br /&gt;
   var %i = 1&lt;br /&gt;
   while ($hget(%posttable,%i).item) {&lt;br /&gt;
     var %item = $ifmatch&lt;br /&gt;
     bset -t &amp;amp;bvPost $calc($bvar(&amp;amp;bvPost,0) +1) $iif(%i &amp;gt; 1,&amp;amp;,) $+ $http.urlencode(%item) $+ = $+ $http.urlencode($hget(%posttable,%item))&lt;br /&gt;
     inc %i&lt;br /&gt;
   }&lt;br /&gt;
   return &amp;amp;bvPost&lt;br /&gt;
 }&lt;br /&gt;
 ; Replace some commonly touchy URL characters with their hex-octect encoding&lt;br /&gt;
 alias -l http.urlencode {&lt;br /&gt;
   return $replacex($1-,$chr(32),% $+ 20, $chr(44), % $+ 2C,+, % $+ 2B, $chr(37), % $+ 25)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
{{Author|aca20031}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Archive]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=YouTube_parser&amp;diff=6113</id>
		<title>YouTube parser</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=YouTube_parser&amp;diff=6113"/>
		<updated>2014-09-24T12:45:17Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: Bugfix: script didn&amp;#039;t produce output on unrated videos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As the description says, this script retrieves information about youtube videos from the YouTube API and posts them to the channel whenever a youtube link is posted. You can install it by opening the script editor (Alt+R), creating a new script file (File -&amp;gt; New) and then copy paste the script into it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Make sure to replace the channels (#foo,#bar) in the &#039;&#039;on TEXT&#039;&#039; event line with the channels you want the script to be active in.&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
 ********************************************************************************************************&lt;br /&gt;
 *&lt;br /&gt;
 *  youtube.mrc by Jay2k1 @ QuakeNet, 2013&lt;br /&gt;
 *&lt;br /&gt;
 *  Whenever a youtube link is posted in the channels #foo or #bar, this script retrieves the video&#039;s details&lt;br /&gt;
 *  from the youtube API and post them to the channel. It looks like this:&lt;br /&gt;
 *&lt;br /&gt;
 *  &amp;lt;Jay2k1&amp;gt; http://www.youtube.com/watch?v=oHg5SJYRHA0&lt;br /&gt;
 *  &amp;lt;Bot&amp;gt; &#039;RickRoll&#039; by cotter548, 00:03:34, 68213084 views, rating: 87% (259236/38751)&lt;br /&gt;
 *&lt;br /&gt;
 *********************************************************************************************************&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
 ; on text event: regex check for messages containing youtube.com or youtu.be, match the URL&lt;br /&gt;
 on $*:TEXT:/(youtu\.be\/.*?(\s|$)|youtube\.com\/.*?(\s|$))/:#pda:{&lt;br /&gt;
 &lt;br /&gt;
   ; use another regex to extract the video ID from the matched URL&lt;br /&gt;
   [[noop]] [[$regex]]([[$regml]](1),/(\?v=|&amp;amp;v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]{11})/)&lt;br /&gt;
 &lt;br /&gt;
   ; call the youtube script with the channel and the video ID, if there is one&lt;br /&gt;
   youtube [[$$]][[regml]](2) [[$chan_(remote)|$chan]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ; alias youtube: opens a socket connection to youtube&lt;br /&gt;
 ; expects: youtube video ID as $1, #channel as $2&lt;br /&gt;
 ; returns: -&lt;br /&gt;
 [[alias]] -l youtube {&lt;br /&gt;
   ; create a unique socket name to allow for multiple connections at a time&lt;br /&gt;
   [[Local_Variables|var]] %sock = youtube. [[DollarPlus|$+]] [[$ticks]]&lt;br /&gt;
   [[sockopen]] %sock gdata.youtube.com 80&lt;br /&gt;
   ; store video ID and channel in socket mark&lt;br /&gt;
   [[sockmark]] %sock [[$1-|$1-]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:SOCKOPEN:youtube.*:{&lt;br /&gt;
   ; obligatory error check&lt;br /&gt;
   [[If-Then-Else|if]] $sockerr { [[return]] }&lt;br /&gt;
 &lt;br /&gt;
   ; send our request&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] GET /feeds/mobile/videos/ [[DollarPlus|$+]] [[$gettok]]([[$sock]]([[$sockname]]).mark,1,32) [[DollarPlus|$+]] ?v=2&amp;amp;prettyprint=true HTTP/1.1&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] Host: [[$sock]]([[$sockname]]).addr&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] [[$crlf]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:SOCKREAD:youtube.*:{&lt;br /&gt;
   [[If-Then-Else|if]] $sockerr { [[return]] }&lt;br /&gt;
 &lt;br /&gt;
   ; receive answer to the request into a variable&lt;br /&gt;
   [[Local_Variables|var]] %t = [[$sockname]], %data&lt;br /&gt;
   [[Sockread|sockread]] %data&lt;br /&gt;
 &lt;br /&gt;
   ; while there&#039;s bytes in the sockread buffer...&lt;br /&gt;
   [[while]] $sockbr {&lt;br /&gt;
 &lt;br /&gt;
     ; extract things of interest out of the source code into a hash table&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;title&amp;gt;*&amp;lt;/title&amp;gt;* iswm %data) { ylog found title! | [[hadd]] -m %t title [[$regsubex]](%data,/(.*&amp;lt;title&amp;gt;|&amp;lt;/title&amp;gt;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:duration seconds=&#039;*&#039;/&amp;gt;* iswm %data) { ylog found duration! | [[hadd]] -m %t dur [[$duration]]([[$regsubex]](%data,/(.*seconds=&#039;|&#039;/&amp;gt;.*)/g,),3) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:statistics favoriteCount=&#039;*&#039; viewCount=&#039;*&#039;/&amp;gt;* iswm %data) { ylog found views! | [[hadd]] -m %t views [[$regsubex]](%data,/(.*viewCount=&#039;|&#039;/&amp;gt;)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:rating numDislikes=&#039;*&#039; numLikes=&#039;*&#039;/&amp;gt;* iswm %data) { ylog found rating! | [[hadd]] -m %t likes [[$regsubex]](%data,/(.*numLikes=&#039;|&#039;/&amp;gt;.*)/g,) | [[hadd]] -m %t dislikes [[$regsubex]](%data,/(.*numDislikes=&#039;|&#039;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;name&amp;gt;*&amp;lt;/name&amp;gt;* iswm %data) { ylog found uploader name! | [[hadd]] -m %t uploader [[$regsubex]](%data,/(.*&amp;lt;name&amp;gt;|&amp;lt;/name&amp;gt;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:uploaded&amp;gt;*&amp;lt;/yt:uploaded&amp;gt;* iswm %data) { ylog found upload date! | [[hadd]] -m %t uploaded [[$left]]([[$regsubex]](%data,/(.*&amp;lt;yt:uploaded&amp;gt;|&amp;lt;/yt:uploaded&amp;gt;.*)/g,),10) }&lt;br /&gt;
     [[If-Then-Else|if]] (*accessControl action=&#039;rate&#039; permission=&#039;denied&#039;* iswm %data)  { ylog found rating disabled | [[hadd]] -m %t rating disabled or no votes }&lt;br /&gt;
 &lt;br /&gt;
     ; the &amp;lt;/entry&amp;gt; tag marks the end of the data.&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;/entry&amp;gt;* iswm %data) || ([[$hget]](%t,0).item == 7)  || (([[$hget]](%t,0).item == 7) &amp;amp;&amp;amp; ([[$hget]](%t,rating) == disabled)) {&lt;br /&gt;
       [[Local_Variables|var]] %ytmsg = &#039; [[DollarPlus|$+]] [[$hget]](%t,title) [[DollarPlus|$+]] &#039; by [[$hget]](%t,uploader) [[DollarPlus|$+]] [[$chr]](44) [[$hget]](%t,dur) [[DollarPlus|$+]] [[$chr]](44) [[$hget]](%t,views) views&lt;br /&gt;
       [[Local_Variables|var]] %ytmsg = %ytmsg [[DollarPlus|$+]] , [[$iif]]([[$hget]](%t,likes),rating: [[$round]]([[$calc]]([[$hget]](%t,likes) / ([[$hget]](%t,likes) + [[$hget]](%t,dislikes)) * 100),1) [[DollarPlus|$+]] % ( [[DollarPlus|$+]] [[$hget]](%t,likes) [[DollarPlus|$+]] / [[DollarPlus|$+]] [[$hget]](%t,dislikes) [[DollarPlus|$+]] ),rating disabled or not rated yet)&lt;br /&gt;
       [[Local_Variables|var]] %ytmsg = [[$replace]](%ytmsg,&amp;amp;nbsp;,[[$chr]](160),&amp;amp;quot;,&amp;quot;,&amp;amp;#39;,&#039;,&amp;amp;lt;,&amp;lt;,&amp;amp;gt;,&amp;gt;,&amp;amp;amp;,&amp;amp;, &amp;amp;pound;,[[$chr]](163), &amp;amp;euro;, [[$chr]](8364), &amp;amp;copy;, [[$chr]](169), &amp;amp;trade, [[$chr]](8482), &amp;amp;reg;, [[$chr]](174))                  &lt;br /&gt;
       [[msg]] [[$gettok]]([[$sock]](%t).mark,2,32) %ytmsg&lt;br /&gt;
 &lt;br /&gt;
       [[sockclose]] %t&lt;br /&gt;
       [[hfree]] %t&lt;br /&gt;
       [[return]]&lt;br /&gt;
     }&lt;br /&gt;
     [[Sockread|sockread]] %data&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Archive]]&lt;br /&gt;
&lt;br /&gt;
{{Author|Jay2k1}}&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$comval&amp;diff=6104</id>
		<title>$comval</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$comval&amp;diff=6104"/>
		<updated>2014-07-06T22:10:13Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: /* See Also */ typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Returns member value for the Nth instantiation of the enumerated collection in name.&lt;br /&gt;
&lt;br /&gt;
 $comval(name,N,member)&lt;br /&gt;
&lt;br /&gt;
== Dispatch and Unknown ==&lt;br /&gt;
&lt;br /&gt;
The two variable types dispatch and unknown allow you to pass dispatch/unknown pointers as parameters in a $com() call, or retrieve dispatch/unknown pointers from a $com() call, by reference.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To pass a dispatch/unknown&#039;&#039;&#039; pointer as a parameter in $com(), specify the variable type as dispatch/unknown, and specify the name of an existing $com() connection as the value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To retrieve a dispatch/unknown&#039;&#039;&#039; pointer through a call to $com(), specify a dispatch* item, with a variable name, as the last parameter in a $com() call, without assigning it a value. When $com() returns, mIRC will create a new $com() item with that variable name and assign it the dispatch or unknown pointer. See example script #2 below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; In the case of retrieving an unknown pointer, mIRC will extend it to a dispatch pointer if it can, allowing you to call it directly via $com().&lt;br /&gt;
&lt;br /&gt;
You can use &#039;&#039;&#039;$com().dispatch&#039;&#039;&#039; or &#039;&#039;&#039;$com().unknown&#039;&#039;&#039; to see if a pointer exists for that $com() item.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
== Example ==&lt;br /&gt;
The following script is a simple example that connects to excel and then retrieves and sets the visible property.&lt;br /&gt;
&lt;br /&gt;
 alias excel {&lt;br /&gt;
  comopen excel Excel.Application&lt;br /&gt;
  if ($comerr) {&lt;br /&gt;
    echo comopen failed&lt;br /&gt;
    halt&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  ; check if excel window is visible&lt;br /&gt;
  if ($com(excel,Visible,3) == 0) {&lt;br /&gt;
    echo $com failed&lt;br /&gt;
    goto finish&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  echo Visible: $com(excel).result&lt;br /&gt;
  &lt;br /&gt;
  ; make excel window visible&lt;br /&gt;
  if ($com(excel,Visible,5,i4,1) == 0) {&lt;br /&gt;
    echo $com failed&lt;br /&gt;
    goto finish&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  ; check visibility again&lt;br /&gt;
  if ($com(excel,Visible,3) == 0) {&lt;br /&gt;
    echo $com failed&lt;br /&gt;
    goto finish&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  echo Visible: $com(excel).result&lt;br /&gt;
 &lt;br /&gt;
  :finish&lt;br /&gt;
  comclose excel&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
The following script retrieves information about your CPU. It displays debugging information so you can see whether a call succeeded or not, the value it returned, and whether a new COM object was created.&lt;br /&gt;
&lt;br /&gt;
 alias cpu {&lt;br /&gt;
 &lt;br /&gt;
   comopen Locator WbemScripting.SWbemLocator&lt;br /&gt;
 &lt;br /&gt;
   if ($comerr) { echo comopen failed | halt }&lt;br /&gt;
   echo com: $com(Locator, ConnectServer, 3, dispatch* Services)&lt;br /&gt;
   echo result: $com(Locator).result&lt;br /&gt;
  &lt;br /&gt;
   echo com(0): $com(0)&lt;br /&gt;
   if ($com(Services)) {&lt;br /&gt;
     echo com: $com(Services, Get, 3, string, Win32_Processor.DeviceID=&#039;CPU0&#039;, dispatch* More)&lt;br /&gt;
     echo result: $com(Services).result&lt;br /&gt;
     echo com(0): $com(0)&lt;br /&gt;
 &lt;br /&gt;
     if ($com(More)) {&lt;br /&gt;
       echo com: $com(More, Name, 3)&lt;br /&gt;
       echo result: $com(More).result&lt;br /&gt;
       echo com: $com(More, Caption, 3)&lt;br /&gt;
       echo result: $com(More).result&lt;br /&gt;
       echo com: $com(More, Manufacturer, 3)&lt;br /&gt;
       echo result: $com(More).result&lt;br /&gt;
 &lt;br /&gt;
       comclose More&lt;br /&gt;
     }&lt;br /&gt;
     comclose Services&lt;br /&gt;
   }&lt;br /&gt;
   comclose Locator&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The following script retrieves information about your hard drives. It does so by retrieving all drive instances in an enumerated collection and then accessing member values for each instance using the $comval() identifier.&lt;br /&gt;
&lt;br /&gt;
 alias drives {&lt;br /&gt;
   comopen Locator WbemScripting.SWbemLocator&lt;br /&gt;
 &lt;br /&gt;
   if ($comerr) { echo comopen failed | halt }&lt;br /&gt;
   echo Com: $com(Locator,ConnectServer,3, dispatch* Services)&lt;br /&gt;
   echo Result: $com(Locator).result&lt;br /&gt;
   comclose Locator&lt;br /&gt;
 &lt;br /&gt;
   if $com(Services) {&lt;br /&gt;
     echo com: $com(Services, InstancesOf,3,string,Win32_LogicalDisk,dispatch* Instances)&lt;br /&gt;
     echo result: $com(Services).result&lt;br /&gt;
 &lt;br /&gt;
     comclose Services&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   if $com(Instances) {&lt;br /&gt;
     echo com: $com(Instances,Count,3)&lt;br /&gt;
   &lt;br /&gt;
     var %n = $com(Instances).result&lt;br /&gt;
     echo result: %n&lt;br /&gt;
   &lt;br /&gt;
     var %m = 1&lt;br /&gt;
     while (%m &amp;lt;= %n) {&lt;br /&gt;
       echo 4 disk: %m&lt;br /&gt;
       echo 3 Com: $comval(Instances, %m, Name)&lt;br /&gt;
       echo 3 Com: $comval(Instances, %m, FileSystem)&lt;br /&gt;
       echo 3 Com: $comval(Instances, %m, FreeSpace)&lt;br /&gt;
       echo 3 Com: $comval(Instances, %m, Description)&lt;br /&gt;
       inc %m&lt;br /&gt;
     }&lt;br /&gt;
     comclose instances&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== See Also==&lt;br /&gt;
* [[COM Objects]] for /comopen /comclose /comlist /comreg $comerr&lt;br /&gt;
&lt;br /&gt;
[[Category:COM Objects]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=How_to_make_your_own_theme&amp;diff=6049</id>
		<title>How to make your own theme</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=How_to_make_your_own_theme&amp;diff=6049"/>
		<updated>2014-05-22T13:37:26Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: /* Miscellaneous */ grammar nazi strikes again&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Missing_pages&amp;diff=6048</id>
		<title>Missing pages</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Missing_pages&amp;diff=6048"/>
		<updated>2014-05-12T21:50:01Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: /* Events */ &amp;quot;on top&amp;quot; is not an event. At least not in mIRC.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Identifiers ==&lt;br /&gt;
[[$ansi2mirc]]&lt;br /&gt;
[[$com]]&lt;br /&gt;
[[$comcall]]&lt;br /&gt;
[[$comerr]]&lt;br /&gt;
[[$comval]]&lt;br /&gt;
[[$creq]]&lt;br /&gt;
[[$dbuh]]&lt;br /&gt;
[[$dbuw]]&lt;br /&gt;
[[$dccignore]]&lt;br /&gt;
[[$dccport]]&lt;br /&gt;
[[$dll]]&lt;br /&gt;
[[$dllcall]]&lt;br /&gt;
[[$get]]&lt;br /&gt;
[[$group]]&lt;br /&gt;
[[$height]]&lt;br /&gt;
[[$keychar]]&lt;br /&gt;
[[$keyrpt]]&lt;br /&gt;
[[$keyval]]&lt;br /&gt;
[[$lactivewid]]&lt;br /&gt;
[[$link]]&lt;br /&gt;
[[$menu]]&lt;br /&gt;
[[$menucontext]]&lt;br /&gt;
[[$menutype]]&lt;br /&gt;
[[$passivedcc]]&lt;br /&gt;
[[$send]]&lt;br /&gt;
[[$sreq]]&lt;br /&gt;
[[$vcmd]]&lt;br /&gt;
[[$vcmdstat]]&lt;br /&gt;
[[$vcmdver]]&lt;br /&gt;
&lt;br /&gt;
== Commands ==&lt;br /&gt;
[[comclose]]&lt;br /&gt;
[[comopen]]&lt;br /&gt;
[[comreg]]&lt;br /&gt;
[[creq]]&lt;br /&gt;
[[dcc chat]]&lt;br /&gt;
[[dcc get]]&lt;br /&gt;
[[dcc ignore]]&lt;br /&gt;
[[dcc nick]]&lt;br /&gt;
[[dcc passive]]&lt;br /&gt;
[[dcc reject]]&lt;br /&gt;
[[dcc send]]&lt;br /&gt;
[[dcc trust]]&lt;br /&gt;
[[dccserver]]&lt;br /&gt;
[[dll]]&lt;br /&gt;
[[drawcopy]]&lt;br /&gt;
[[drawpic]]&lt;br /&gt;
[[drawreplace]]&lt;br /&gt;
[[drawrot]]&lt;br /&gt;
[[drawsave]]&lt;br /&gt;
[[drawscroll]]&lt;br /&gt;
[[drawtext]]&lt;br /&gt;
[[font]]&lt;br /&gt;
[[fsend]]&lt;br /&gt;
[[fserve]]&lt;br /&gt;
[[identd]]&lt;br /&gt;
[[links]]&lt;br /&gt;
[[logview]]&lt;br /&gt;
[[mdi]]&lt;br /&gt;
[[pdcc]]&lt;br /&gt;
[[reseterror]]&lt;br /&gt;
[[savebuf]]&lt;br /&gt;
[[sockpause]]&lt;br /&gt;
[[sound]]&lt;br /&gt;
[[sreq]]&lt;br /&gt;
[[tray]]&lt;br /&gt;
[[url]]&lt;br /&gt;
[[vcadd]]&lt;br /&gt;
[[vcmd]]&lt;br /&gt;
[[vcrem]]&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
[[On connectfail]]&lt;br /&gt;
[[On dccserver]]&lt;br /&gt;
[[On error]]&lt;br /&gt;
[[On filercvd]]&lt;br /&gt;
[[On filesent]]&lt;br /&gt;
[[On getfail]]&lt;br /&gt;
[[On nosound]]&lt;br /&gt;
[[On sendfail]]&lt;br /&gt;
[[On serverop]]&lt;br /&gt;
[[On user]]&lt;br /&gt;
[[On vcmd]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Missing_pages&amp;diff=6047</id>
		<title>Missing pages</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Missing_pages&amp;diff=6047"/>
		<updated>2014-05-12T21:43:02Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: /* Commands */ - removed existing pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Identifiers ==&lt;br /&gt;
[[$ansi2mirc]]&lt;br /&gt;
[[$com]]&lt;br /&gt;
[[$comcall]]&lt;br /&gt;
[[$comerr]]&lt;br /&gt;
[[$comval]]&lt;br /&gt;
[[$creq]]&lt;br /&gt;
[[$dbuh]]&lt;br /&gt;
[[$dbuw]]&lt;br /&gt;
[[$dccignore]]&lt;br /&gt;
[[$dccport]]&lt;br /&gt;
[[$dll]]&lt;br /&gt;
[[$dllcall]]&lt;br /&gt;
[[$get]]&lt;br /&gt;
[[$group]]&lt;br /&gt;
[[$height]]&lt;br /&gt;
[[$keychar]]&lt;br /&gt;
[[$keyrpt]]&lt;br /&gt;
[[$keyval]]&lt;br /&gt;
[[$lactivewid]]&lt;br /&gt;
[[$link]]&lt;br /&gt;
[[$menu]]&lt;br /&gt;
[[$menucontext]]&lt;br /&gt;
[[$menutype]]&lt;br /&gt;
[[$passivedcc]]&lt;br /&gt;
[[$send]]&lt;br /&gt;
[[$sreq]]&lt;br /&gt;
[[$vcmd]]&lt;br /&gt;
[[$vcmdstat]]&lt;br /&gt;
[[$vcmdver]]&lt;br /&gt;
&lt;br /&gt;
== Commands ==&lt;br /&gt;
[[comclose]]&lt;br /&gt;
[[comopen]]&lt;br /&gt;
[[comreg]]&lt;br /&gt;
[[creq]]&lt;br /&gt;
[[dcc chat]]&lt;br /&gt;
[[dcc get]]&lt;br /&gt;
[[dcc ignore]]&lt;br /&gt;
[[dcc nick]]&lt;br /&gt;
[[dcc passive]]&lt;br /&gt;
[[dcc reject]]&lt;br /&gt;
[[dcc send]]&lt;br /&gt;
[[dcc trust]]&lt;br /&gt;
[[dccserver]]&lt;br /&gt;
[[dll]]&lt;br /&gt;
[[drawcopy]]&lt;br /&gt;
[[drawpic]]&lt;br /&gt;
[[drawreplace]]&lt;br /&gt;
[[drawrot]]&lt;br /&gt;
[[drawsave]]&lt;br /&gt;
[[drawscroll]]&lt;br /&gt;
[[drawtext]]&lt;br /&gt;
[[font]]&lt;br /&gt;
[[fsend]]&lt;br /&gt;
[[fserve]]&lt;br /&gt;
[[identd]]&lt;br /&gt;
[[links]]&lt;br /&gt;
[[logview]]&lt;br /&gt;
[[mdi]]&lt;br /&gt;
[[pdcc]]&lt;br /&gt;
[[reseterror]]&lt;br /&gt;
[[savebuf]]&lt;br /&gt;
[[sockpause]]&lt;br /&gt;
[[sound]]&lt;br /&gt;
[[sreq]]&lt;br /&gt;
[[tray]]&lt;br /&gt;
[[url]]&lt;br /&gt;
[[vcadd]]&lt;br /&gt;
[[vcmd]]&lt;br /&gt;
[[vcrem]]&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
[[On connectfail]]&lt;br /&gt;
[[On dccserver]]&lt;br /&gt;
[[On error]]&lt;br /&gt;
[[On filercvd]]&lt;br /&gt;
[[On filesent]]&lt;br /&gt;
[[On getfail]]&lt;br /&gt;
[[On nosound]]&lt;br /&gt;
[[On sendfail]]&lt;br /&gt;
[[On serverop]]&lt;br /&gt;
[[On top]]&lt;br /&gt;
[[On user]]&lt;br /&gt;
[[On vcmd]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Playctrl&amp;diff=6046</id>
		<title>Playctrl</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Playctrl&amp;diff=6046"/>
		<updated>2014-05-12T21:41:49Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: added some info on what the play central is&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Displays the play central dialog.&lt;br /&gt;
 /playctrl&lt;br /&gt;
&lt;br /&gt;
It lets you view and edit the play requests queue. Files are played in the order in which they appear in the queue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Commands]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Finger&amp;diff=6045</id>
		<title>Finger</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Finger&amp;diff=6045"/>
		<updated>2014-05-12T21:38:30Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: added what it does and some see-also&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/finger is an old command in mIRC that has been truncated in current mIRC versions.&lt;br /&gt;
Instead you should use:&lt;br /&gt;
 /ctcp NICK finger&lt;br /&gt;
&lt;br /&gt;
It returns name and email from mIRC Options -&amp;gt; Connect and the client&#039;s IRC idle time.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[ctcp]]&lt;br /&gt;
* [[Ctcp events]]&lt;br /&gt;
* [[ctcpreply]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Missing_pages&amp;diff=6044</id>
		<title>Missing pages</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Missing_pages&amp;diff=6044"/>
		<updated>2014-05-12T21:24:55Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: /* Identifiers */ - removed existing $hash&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Identifiers ==&lt;br /&gt;
[[$ansi2mirc]]&lt;br /&gt;
[[$com]]&lt;br /&gt;
[[$comcall]]&lt;br /&gt;
[[$comerr]]&lt;br /&gt;
[[$comval]]&lt;br /&gt;
[[$creq]]&lt;br /&gt;
[[$dbuh]]&lt;br /&gt;
[[$dbuw]]&lt;br /&gt;
[[$dccignore]]&lt;br /&gt;
[[$dccport]]&lt;br /&gt;
[[$dll]]&lt;br /&gt;
[[$dllcall]]&lt;br /&gt;
[[$get]]&lt;br /&gt;
[[$group]]&lt;br /&gt;
[[$height]]&lt;br /&gt;
[[$keychar]]&lt;br /&gt;
[[$keyrpt]]&lt;br /&gt;
[[$keyval]]&lt;br /&gt;
[[$lactivewid]]&lt;br /&gt;
[[$link]]&lt;br /&gt;
[[$menu]]&lt;br /&gt;
[[$menucontext]]&lt;br /&gt;
[[$menutype]]&lt;br /&gt;
[[$passivedcc]]&lt;br /&gt;
[[$send]]&lt;br /&gt;
[[$sreq]]&lt;br /&gt;
[[$vcmd]]&lt;br /&gt;
[[$vcmdstat]]&lt;br /&gt;
[[$vcmdver]]&lt;br /&gt;
&lt;br /&gt;
== Commands ==&lt;br /&gt;
[[comclose]]&lt;br /&gt;
[[comopen]]&lt;br /&gt;
[[comreg]]&lt;br /&gt;
[[creq]]&lt;br /&gt;
[[dcc chat]]&lt;br /&gt;
[[dcc get]]&lt;br /&gt;
[[dcc ignore]]&lt;br /&gt;
[[dcc nick]]&lt;br /&gt;
[[dcc passive]]&lt;br /&gt;
[[dcc reject]]&lt;br /&gt;
[[dcc send]]&lt;br /&gt;
[[dcc trust]]&lt;br /&gt;
[[dccserver]]&lt;br /&gt;
[[dll]]&lt;br /&gt;
[[drawcopy]]&lt;br /&gt;
[[drawdot]]&lt;br /&gt;
[[drawfill]]&lt;br /&gt;
[[drawline]]&lt;br /&gt;
[[drawpic]]&lt;br /&gt;
[[drawrect]]&lt;br /&gt;
[[drawreplace]]&lt;br /&gt;
[[drawrot]]&lt;br /&gt;
[[drawsave]]&lt;br /&gt;
[[drawscroll]]&lt;br /&gt;
[[drawtext]]&lt;br /&gt;
[[finger]]&lt;br /&gt;
[[font]]&lt;br /&gt;
[[fsend]]&lt;br /&gt;
[[fserve]]&lt;br /&gt;
[[identd]]&lt;br /&gt;
[[links]]&lt;br /&gt;
[[logview]]&lt;br /&gt;
[[mdi]]&lt;br /&gt;
[[pdcc]]&lt;br /&gt;
[[perform]]&lt;br /&gt;
[[playctrl]]&lt;br /&gt;
[[renwin]]&lt;br /&gt;
[[reseterror]]&lt;br /&gt;
[[savebuf]]&lt;br /&gt;
[[showmirc]]&lt;br /&gt;
[[sockpause]]&lt;br /&gt;
[[sound]]&lt;br /&gt;
[[sreq]]&lt;br /&gt;
[[strip]]&lt;br /&gt;
[[tray]]&lt;br /&gt;
[[unload]]&lt;br /&gt;
[[url]]&lt;br /&gt;
[[vcadd]]&lt;br /&gt;
[[vcmd]]&lt;br /&gt;
[[vcrem]]&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
[[On connectfail]]&lt;br /&gt;
[[On dccserver]]&lt;br /&gt;
[[On error]]&lt;br /&gt;
[[On filercvd]]&lt;br /&gt;
[[On filesent]]&lt;br /&gt;
[[On getfail]]&lt;br /&gt;
[[On nosound]]&lt;br /&gt;
[[On sendfail]]&lt;br /&gt;
[[On serverop]]&lt;br /&gt;
[[On top]]&lt;br /&gt;
[[On user]]&lt;br /&gt;
[[On vcmd]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Binary_Files&amp;diff=6043</id>
		<title>Binary Files</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Binary_Files&amp;diff=6043"/>
		<updated>2014-04-22T01:11:30Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: added a : in the category so it wouldn&amp;#039;t appear on the category page itself&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[:Category:Binary Files]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=YouTube_parser&amp;diff=6029</id>
		<title>YouTube parser</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=YouTube_parser&amp;diff=6029"/>
		<updated>2014-01-31T11:34:17Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: updated second regex to support ...&amp;amp;v= youtube links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As the description says, this script retrieves information about youtube videos from the YouTube API and posts them to the channel whenever a youtube link is posted. You can install it by opening the script editor (Alt+R), creating a new script file (File -&amp;gt; New) and then copy paste the script into it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Make sure to replace the channels (#foo,#bar) in the &#039;&#039;on TEXT&#039;&#039; event line with the channels you want the script to be active in.&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
 ********************************************************************************************************&lt;br /&gt;
 * &lt;br /&gt;
 *  youtube.mrc by Jay2k1 @ QuakeNet, 2013&lt;br /&gt;
 * &lt;br /&gt;
 *  Whenever a youtube link is posted in the channels #foo or #bar, this script retrieves the video&#039;s details&lt;br /&gt;
 *  from the youtube API and post them to the channel. It looks like this:&lt;br /&gt;
 * &lt;br /&gt;
 *  &amp;lt;Jay2k1&amp;gt; http://www.youtube.com/watch?v=oHg5SJYRHA0&lt;br /&gt;
 *  &amp;lt;Bot&amp;gt; &#039;RickRoll&#039; by cotter548, 00:03:34, 68213084 views, rating: 87% (259236/38751)&lt;br /&gt;
 * &lt;br /&gt;
 *********************************************************************************************************&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
 ; on text event: regex check for messages containing youtube.com or youtu.be, match the URL&lt;br /&gt;
 on $*:TEXT:/(youtu\.be\/.*?(\s|$)|youtube\.com\/.*?(\s|$))/:#foo,#bar:{&lt;br /&gt;
 &lt;br /&gt;
   ; use another regex to extract the video ID from the matched URL&lt;br /&gt;
   [[noop]] [[$regex]]([[$regml]](1),/(\?v=|&amp;amp;v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]{11})/)&lt;br /&gt;
 &lt;br /&gt;
   ; call the youtube script with the channel and the video ID, if there is one&lt;br /&gt;
   youtube [[$$]][[$regml|regml]](2) [[$chan_(remote)|$chan]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ; alias youtube: opens a socket connection to youtube&lt;br /&gt;
 ; expects: youtube video ID as $1, #channel as $2&lt;br /&gt;
 ; returns: -&lt;br /&gt;
 [[alias]] -l youtube {&lt;br /&gt;
   ; create a unique socket name to allow for multiple connections at a time&lt;br /&gt;
   [[Local_Variables|var]] %sock = youtube. [[DollarPlus|$+]] [[$ticks]]&lt;br /&gt;
   [[sockopen]] %sock gdata.youtube.com 80&lt;br /&gt;
   ; store video ID and channel in socket mark&lt;br /&gt;
   [[sockmark]] %sock [[$1-]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:SOCKOPEN:youtube.*:{&lt;br /&gt;
   ; obligatory error check&lt;br /&gt;
   [[If-Then-Else|if]] $sockerr { [[return]] }&lt;br /&gt;
 &lt;br /&gt;
   ; send our request&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] GET /feeds/mobile/videos/ [[DollarPlus|$+]] [[$gettok]]([[$sock]]([[$sockname]]).mark,1,32) [[DollarPlus|$+]] ?v=2&amp;amp;prettyprint=true HTTP/1.1&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] Host: [[$sock]]([[$sockname]]).addr&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] [[$crlf]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:SOCKREAD:youtube.*:{&lt;br /&gt;
   [[If-Then-Else|if]] $sockerr { [[return]] }&lt;br /&gt;
 &lt;br /&gt;
   ; receive answer to the request into a variable&lt;br /&gt;
   [[Local_Variables|var]] %data | [[Sockread|sockread]] %data&lt;br /&gt;
 &lt;br /&gt;
   ; while there&#039;s bytes in the sockread buffer...&lt;br /&gt;
   [[while]] $sockbr {&lt;br /&gt;
 &lt;br /&gt;
     ; extract things of interest out of the source code into a hash table&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;title&amp;gt;*&amp;lt;/title&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] title [[$regsubex]](%data,/(.*&amp;lt;title&amp;gt;|&amp;lt;/title&amp;gt;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:duration seconds=&#039;*&#039;/&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] dur [[$duration]]([[$regsubex]](%data,/(.*seconds=&#039;|&#039;/&amp;gt;.*)/g,),3) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:statistics favoriteCount=&#039;*&#039; viewCount=&#039;*&#039;/&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] views [[$regsubex]](%data,/(.*viewCount=&#039;|&#039;/&amp;gt;)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:rating numDislikes=&#039;*&#039; numLikes=&#039;*&#039;/&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] likes [[$regsubex]](%data,/(.*numLikes=&#039;|&#039;/&amp;gt;.*)/g,) | [[hadd]] -m [[$sockname]] dislikes [[$regsubex]](%data,/(.*numDislikes=&#039;|&#039;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;name&amp;gt;*&amp;lt;/name&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] uploader [[$regsubex]](%data,/(.*&amp;lt;name&amp;gt;|&amp;lt;/name&amp;gt;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:uploaded&amp;gt;*&amp;lt;/yt:uploaded&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] uploaded [[$left]]([[$regsubex]](%data,/(.*&amp;lt;yt:uploaded&amp;gt;|&amp;lt;/yt:uploaded&amp;gt;.*)/g,),10) }&lt;br /&gt;
 &lt;br /&gt;
     ; if we have seven items in our hash table, we have all data we need&lt;br /&gt;
     [[If-Then-Else|if]] [[$hget]]([[$sockname]],0).item == 7 {&lt;br /&gt;
       [[Local_Variables|var]] %t = [[$sockname]]&lt;br /&gt;
       [[msg]] [[$gettok]]([[$sock]]([[$sockname]]).mark,2,32) &#039; [[DollarPlus|$+]] [[$hget]](%t,title) [[DollarPlus|$+]] &#039; by [[$hget]](%t,uploader) [[DollarPlus|$+]] , [[$hget]](%t,dur) [[DollarPlus|$+]] , [[$hget]](%t,views) views, rating: [[$round]]([[$calc]]([[$hget]](%t,likes) / ([[$hget]](%t,likes) + [[$hget]](%t,dislikes)) * 100),1) [[DollarPlus|$+]] % ( [[DollarPlus|$+]] [[$hget]](%t,likes) [[DollarPlus|$+]] / [[DollarPlus|$+]] [[$hget]](%t,dislikes) [[DollarPlus|$+]] )&lt;br /&gt;
       [[sockclose]] %t&lt;br /&gt;
       [[hfree]] %t&lt;br /&gt;
       [[return]]&lt;br /&gt;
     }&lt;br /&gt;
     [[Sockread|sockread]] %data&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Archive]]&lt;br /&gt;
&lt;br /&gt;
{{Author|Jay2k1}}&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$bytes&amp;diff=6028</id>
		<title>$bytes</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$bytes&amp;diff=6028"/>
		<updated>2013-11-08T09:21:41Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: fixed grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Returns comma formatted filesize.&lt;br /&gt;
&lt;br /&gt;
 $bytes(&#039;&#039;N&#039;&#039;,bkmgt3)[.suf]&lt;br /&gt;
The &#039;&#039;&#039;bkmgt&#039;&#039;&#039; options return the result as bytes, kilobytes, megabytes, gigabytes or terabytes.&lt;br /&gt;
&lt;br /&gt;
Using option &#039;&#039;&#039;3&#039;&#039;&#039; would return the best human readable style with remainders.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;suf&#039;&#039; property appends B,KB,MB,GB or TG depending on what formatting is being used.&lt;br /&gt;
== Examples ==&lt;br /&gt;
 [[echo]] -ag $bytes(1024,k)  ;Returns &#039;&#039;1&#039;&#039; because there is 1 kilobyte in &#039;&#039;1024&#039;&#039; bytes&lt;br /&gt;
 echo -ag $bytes(123456,m)  ;Returns &#039;&#039;0.12&#039;&#039; because there is 0.12 megabytes in &#039;&#039;123456&#039;&#039; bytes&lt;br /&gt;
 echo -ag $bytes(1536,3).suf  ;Returns &#039;&#039;1.5KB&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 echo -ag $bytes([[$file]]([[$sfile]]([[$mircdir]])).size).suf&lt;br /&gt;
Returns the size of the file you selected in the best human readable form with its suffix appended.&lt;br /&gt;
&lt;br /&gt;
 echo -ag [[$replace]]($bytes(1000000),[[$chr]](44),.)&lt;br /&gt;
Returns the number specified by $bytes parameter in following form: &amp;quot;1.000.000&amp;quot;.&lt;br /&gt;
[[Category:Text and Number Identifiers]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Auth-Update2&amp;diff=6019</id>
		<title>Auth-Update2</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Auth-Update2&amp;diff=6019"/>
		<updated>2013-08-06T14:40:17Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This snippet is a new version of [[Auth-Update|Auth_update]]&lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; AUTH_UPDATE2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 ;&lt;br /&gt;
 ;  by Vliedel -- #vliedel @ QuakeNet&lt;br /&gt;
 ;  version 2.3  (written and tested on mIRC 6.35)&lt;br /&gt;
 ;  made for networks supporting WHOX&lt;br /&gt;
 ;&lt;br /&gt;
 ;&lt;br /&gt;
 ;What does this script do?&lt;br /&gt;
 ;&lt;br /&gt;
 ;  - updates the auths of nicks and stores them in a hash table&lt;br /&gt;
 ;  - if a channel is too big, /who nick1,nick2,nick3 etc is done until the auths for the channel is updated&lt;br /&gt;
 ;  - users who have a site with the auth in it will be saved without a /who&lt;br /&gt;
 ;    ie: &amp;quot;Vliedel&amp;quot; in &amp;quot;Vliedel.users.quakenet.org&amp;quot; will be treated as auth on the QuakeNet network&lt;br /&gt;
 ;  - users who are not authed (auth 0) will be checked every x time to see if they are authed yet&lt;br /&gt;
 ;  - script updates from largest to the smallest channel&lt;br /&gt;
 ;&lt;br /&gt;
 ;&lt;br /&gt;
 ;How to use this script?&lt;br /&gt;
 ;&lt;br /&gt;
 ;  - config the options below&lt;br /&gt;
 ;  - /load -rs1 auth_update2.mrc to load the script (make sure the script it loaded on top)&lt;br /&gt;
 ;  - script starts on load or on join&lt;br /&gt;
 ;  - to get the auth of a nick use: $auth(nick) or $auth(nick,cid)&lt;br /&gt;
 ;  - to get a nick from an auth use: $auth-nick(auth) or $auth-nick(auth,cid)&lt;br /&gt;
 ;  - to recheck a nick that was not authed by command use: /auth.update &amp;lt;nick&amp;gt;&lt;br /&gt;
 ;    note that rechecking is done automatically, only use this command if you really want to recheck quickly&lt;br /&gt;
 ;  - this script should be loaded as last script in your list for optimal usage&lt;br /&gt;
 ;&lt;br /&gt;
 ;  - You can use the following example script to see when a nicks auth is updated&lt;br /&gt;
 ;      on *:SIGNAL:authupdate.new:{&lt;br /&gt;
 ;        if (!$2) { echo -ag $1 is not authed }&lt;br /&gt;
 ;        else { echo -ag $1 is authed as $2 }&lt;br /&gt;
 ;      }&lt;br /&gt;
 ;&lt;br /&gt;
 ;  - The following signal is send when a requested auth is updated (with /auth.update &amp;lt;nick&amp;gt;)&lt;br /&gt;
 ;      on *:SIGNAL:authupdate.req:{&lt;br /&gt;
 ;        if ($2 == $null) { echo -ag requested: $1 is not on a common chan }&lt;br /&gt;
 ;        elseif ($2 == 0) { echo -ag requested: $1 is not authed }&lt;br /&gt;
 ;        else { echo -ag requested: $1 is authed as $2 }&lt;br /&gt;
 ;      }&lt;br /&gt;
 ;&lt;br /&gt;
 ;    Note that these signals return $2 == $null when someone isn&#039;t on a common channel.&lt;br /&gt;
 ;    This may occur for example when someone parted a channel between the /who and the who reply.&lt;br /&gt;
 ;&lt;br /&gt;
 ;&lt;br /&gt;
 ;Why is this script good?&lt;br /&gt;
 ;&lt;br /&gt;
 ;  - compared with my first auth_update, this script uses less resources, at the cost of a little bit more traffic&lt;br /&gt;
 ;  - sending /who chan for every channel is not needed and goes slow (lag)&lt;br /&gt;
 ;  - sending /who chan on join may cause Excess Flood or Max sendQ exceeded&lt;br /&gt;
 ;  - sending /who chan1,chan2,chan3 can be much faster, but only if there are not too many results (Max sendQ exceeded)&lt;br /&gt;
 ;  - unauthed users can auth without you knowing, so you need to check if they&#039;re authed every so many time.&lt;br /&gt;
 ;&lt;br /&gt;
 ;&lt;br /&gt;
 ;Since some people do not understand how to use this script on join, here is an example:&lt;br /&gt;
 ;&lt;br /&gt;
 ;  on *:JOIN:#:{&lt;br /&gt;
 ;    newuser $chan $nick&lt;br /&gt;
 ;  }&lt;br /&gt;
 ;&lt;br /&gt;
 ;  ; $1 = nick   $2 = auth&lt;br /&gt;
 ;  on *:SIGNAL:authupdate.new:{&lt;br /&gt;
 ;    if (*.users.quakenet.org iswm $ial($1)) { return }&lt;br /&gt;
 ;    var %i = 1&lt;br /&gt;
 ;    while ($comchan($1,%i)) {&lt;br /&gt;
 ;      newuser $v1 $1&lt;br /&gt;
 ;      inc %i&lt;br /&gt;
 ;    }&lt;br /&gt;
 ;  }&lt;br /&gt;
 ;&lt;br /&gt;
 ;  ; $1 = chan   $2 = nick&lt;br /&gt;
 ;  alias -l newuser {&lt;br /&gt;
 ;    var %auth = $auth($2)&lt;br /&gt;
 ;    if (%auth) { echo 4 -tg $1 $2 is authed as %auth }&lt;br /&gt;
 ;    elseif (%auth == 0) { echo 4 -tg $1 $2 is not authed }&lt;br /&gt;
 ;  }&lt;br /&gt;
 ;&lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SETTINGS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 &lt;br /&gt;
 ; maximum number of replies in a WHO, too high may cause &#039;Max sendQ exceeded&#039; disconnection&lt;br /&gt;
 ; too low may take the script a long time to update the auths, 1000 should be fine for most situations&lt;br /&gt;
 [[alias]] -l max.replies { [[return]] 1000 }&lt;br /&gt;
 &lt;br /&gt;
 ; maximum length of the /who &amp;lt;string&amp;gt;, too long may cause the server to ignore the command&lt;br /&gt;
 ; too low may slow things down, 400 should be fine in most cases&lt;br /&gt;
 [[alias]] -l max.len { [[return]] 400 }&lt;br /&gt;
 &lt;br /&gt;
 ; minimum time (seconds) between two /who commands (default 10)&lt;br /&gt;
 [[alias]] -l delay { [[return]] 10 }&lt;br /&gt;
 &lt;br /&gt;
 ; time (seconds) between the checking if any unauthed users should be rechecked (default 120)&lt;br /&gt;
 [[alias]] -l queue.delay { [[return]] 120 }&lt;br /&gt;
 &lt;br /&gt;
 ; time (seconds) to recheck if an unauthed user is now authed (default 600)&lt;br /&gt;
 [[alias]] -l queue.check { [[return]] 600 }&lt;br /&gt;
 &lt;br /&gt;
 ; minimum ratio of (nicks with unknown auth) / (total nicks) in a channel to do /who #channel rather then /who nick,nick, (default 0.09)&lt;br /&gt;
 [[alias]] -l min.ratio { [[return]] 0.09 }&lt;br /&gt;
 &lt;br /&gt;
 ; minimum nr of nicks with unknown auth in a channel to do /who #channel rather then /who nick,nick, (default 10)&lt;br /&gt;
 [[alias]] -l min.nicks { [[return]] 10 }&lt;br /&gt;
 &lt;br /&gt;
 ; The networks the script is supposed to work on (case sensitive)&lt;br /&gt;
 ; NOTE that the script ONLY works on networks supporting WHOX (ircu 2.10.* should work)&lt;br /&gt;
 [[alias]] -l used.network {&lt;br /&gt;
   [[return]] [[$istokcs]](QuakeNet UnderNet GameSurge HanIRC NetGamers OGameNet,[[$network]],32)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ; For every network a check to see if a user has a site where his authname is in&lt;br /&gt;
 ; $1 is the site&lt;br /&gt;
 [[alias]] -l auth.in.site {&lt;br /&gt;
   [[Local_Variables|var]] %n = [[$network]]&lt;br /&gt;
   [[If-Then-Else|if]] (%n === QuakeNet) { [[return]] [[$iif]](*.users.quakenet.org iswm [[$1-|$1]],[[$true]]) }&lt;br /&gt;
   [[If-Then-Else|elseif]] (%n === UnderNet) { [[return]] [[$iif]](*.users.undernet.org iswm [[$1-|$1]],[[$true]]) }&lt;br /&gt;
   [[If-Then-Else|elseif]] (%n === GameSurge) { [[return]] [[$iif]](*.*.GameSurge iswm [[$1-|$1]],[[$true]]) }&lt;br /&gt;
   [[If-Then-Else|elseif]] (%n === HanIRC) { [[return]] [[$iif]](*.users.HanIRC.org iswm [[$1-|$1]],[[$true]]) }&lt;br /&gt;
   [[If-Then-Else|elseif]] (%n === NetGamers) { [[return]] [[$iif]](*.users.netgamers.org iswm [[$1-|$1]],[[$true]]) }&lt;br /&gt;
   [[If-Then-Else|elseif]] (%n === OGameNet) { [[return]] [[$iif]](*.user.OGameNet iswm [[$1-|$1]],[[$true]]) }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ; For every network the method to return the auth from the site&lt;br /&gt;
 ; $1 is the site&lt;br /&gt;
 [[alias]] -l auth.from.site {&lt;br /&gt;
   [[Local_Variables|var]] %n = [[$network]]&lt;br /&gt;
   [[If-Then-Else|if]] (%n === QuakeNet) { [[return]] [[$gettok]]([[$1-|$1]],1,46) }&lt;br /&gt;
   [[If-Then-Else|elseif]] (%n === UnderNet) { [[return]] [[$gettok]]([[$1-|$1]],1,46) }&lt;br /&gt;
   [[If-Then-Else|elseif]] (%n === GameSurge) { [[return]] [[$gettok]]([[$1-|$1]],1,46) }&lt;br /&gt;
   [[If-Then-Else|elseif]] (%n === HanIRC) { [[return]] [[$gettok]]([[$1-|$1]],1,46) }&lt;br /&gt;
   [[If-Then-Else|elseif]] (%n === NetGamers) { [[return]] [[$gettok]]([[$1-|$1]],1,46) }&lt;br /&gt;
   [[If-Then-Else|elseif]] (%n === OGameNet) { [[return]] [[$gettok]]([[$1-|$1]],1,46) }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ; $auth(nick [,cid])  returns the auth of the nick&lt;br /&gt;
 [[alias]] auth {&lt;br /&gt;
   [[If-Then-Else|if]] (![[$isid]]) { [[$iif]]([[$show]],.auth,auth) [[$1-|$1-]] | [[return]] }&lt;br /&gt;
   [[If-Then-Else|if]] ([[$1-|$1]] == [[$null]]) || ([[$1-|$2]] !== [[$null]] &amp;amp;&amp;amp; (![[$scid]]([[$1-|$2]]) || ![[$1-|$2]])) { [[return]] }&lt;br /&gt;
   [[return]] [[$gettok]]([[$hget]]([[$iif]]([[$1-|$2]],[[$1-|$2]],[[$cid]]) [[DollarPlus|$+]] .auths,[[DollarPlus|$+]](auth.,[[$comchan]]([[$1-|$1]],1),[[$chr]](44),[[$1-|$1]])),1,32)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ; $auth-nick(auth [,cid])  returns the first nick with that auth&lt;br /&gt;
 [[alias]] auth-nick {&lt;br /&gt;
   [[If-Then-Else|if]] ([[$1-|$1]] == [[$null]]) || ([[$1-|$2]] !== [[$null]] &amp;amp;&amp;amp; (![[$scid]]([[$1-|$2]]) || ![[$1-|$2]])) { [[return]] }&lt;br /&gt;
   [[return]] [[$gettok]]([[$hfind]]([[$iif]]([[$1-|$2]],[[$1-|$2]],[[$cid]]) [[DollarPlus|$+]] .auths,[[$1-|$1]],1,n).data,-1,44)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; AUTH.UPDATE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 &lt;br /&gt;
 ; /auth.update nick&lt;br /&gt;
 [[alias]] auth.update {&lt;br /&gt;
   [[If-Then-Else|if]] (!$used.network) || (![[$comchan]]([[$1-|$1]],1)) { [[return]] }&lt;br /&gt;
   [[Local_Variables|var]] %t = [[$cid]] [[DollarPlus|$+]] .auths , %a = [[$hget]](%t,[[DollarPlus|$+]](auth.,[[$comchan]]([[$1-|$1]],1),[[$chr]](44),[[$1-|$1]]))&lt;br /&gt;
   [[If-Then-Else|if]] (0 * iswm %a) { [[hdel]] -w %t [[DollarPlus|$+]](auth.,*,[[$chr]](44),[[$1-|$1]]) }&lt;br /&gt;
   [[If-Then-Else|if]] (!%a) || (0 * iswm %a) { au.update n [[$1-|$1]] | [[hadd]] %t req. [[DollarPlus|$+]] [[$1-|$1]] 1 }&lt;br /&gt;
   [[If-Then-Else|else]] { .[[signal]] authupdate.req [[$1-|$1]] %a }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; AU.UPDATE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 &lt;br /&gt;
 ; $1 = t/n/c/r/d (timer nick chan repeat delay)&lt;br /&gt;
 ; [$1- = n nick]&lt;br /&gt;
 [[alias]] -l au.update {&lt;br /&gt;
   [[Local_Variables|var]] %t = [[$cid]] [[DollarPlus|$+]] .auths&lt;br /&gt;
   [[If-Then-Else|if]] (![[$hget]](%t)) { [[hmake]] %t }&lt;br /&gt;
   [[Local_Variables|var]] %tim = au.update.delay. [[DollarPlus|$+]] [[$cid]] , %w = [[$hget]](%t,who) , %l = [[$hget]](%t,wholock)&lt;br /&gt;
   ; when not called by repeat or delay, we probably have something to /who&lt;br /&gt;
   [[If-Then-Else|if]] (([[$1-|$1]] != r) &amp;amp;&amp;amp; ([[$1-|$1]] != d)) { [[hadd]] %t who 1 }&lt;br /&gt;
   ; if we&#039;re waiting for reply, don&#039;t set timer or /who&lt;br /&gt;
   [[If-Then-Else|if]] (%l) { [[return]] }&lt;br /&gt;
   ; if called by delay timer and we probably have something to /who, then /who&lt;br /&gt;
   [[If-Then-Else|if]] (([[$1-|$1]] == d) &amp;amp;&amp;amp; (%w)) { au.who | [[return]] }&lt;br /&gt;
   ; if delay timer hasn&#039;t been set already, we want to /who or set the timer&lt;br /&gt;
   [[If-Then-Else|if]] (!$timer(%tim)) {&lt;br /&gt;
     ; if we just joined a chan or just finished a /who, then set delay timer&lt;br /&gt;
     [[If-Then-Else|if]] (([[$1-|$1]] == c) || ([[$1-|$1]] == r)) { .[[timer]] [[DollarPlus|$+]] %tim 1 $delay au.update d }&lt;br /&gt;
     [[If-Then-Else|else]] { au.who [[$iif]]([[$1-|$1]] == n,[[$1-|$2]]) }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; NICKLIST CHANGING EVENTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 on ^*:JOIN:#:{&lt;br /&gt;
   [[Local_Variables|var]] %t = [[$cid]] [[DollarPlus|$+]] .auths&lt;br /&gt;
   [[If-Then-Else|if]] (!$used.network) { [[return]] }&lt;br /&gt;
   [[If-Then-Else|if]] ([[$nick_(remote)|$nick]] == [[$me]]) {&lt;br /&gt;
     au.start&lt;br /&gt;
     [[return]]&lt;br /&gt;
   }&lt;br /&gt;
   [[If-Then-Else|if]] (![[$hget]](%t)) { [[return]] }&lt;br /&gt;
   [[If-Then-Else|if]] ([[$hfind]](%t,[[DollarPlus|$+]](auth.*,[[$chr]](44),[[$nick_(remote)|$nick]]),1,w)) { [[hadd]] %t [[DollarPlus|$+]](auth.,[[$chan_(remote)|$chan]],[[$chr]](44),[[$nick_(remote)|$nick]]) [[$hget]](%t,[[$v1]]) }&lt;br /&gt;
   [[If-Then-Else|elseif]] ($auth.in.site($site)) { au.upd.nick [[$nick_(remote)|$nick]] $site }&lt;br /&gt;
   [[If-Then-Else|else]] { au.update n [[$nick_(remote)|$nick]] }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;366 Vliedel #vliedel :End of /NAMES list.&lt;br /&gt;
 RAW 366:*:{&lt;br /&gt;
   [[Local_Variables|var]] %c = [[$1-|$2]], %i = [[$nick_(nick)|$nick(]]%c,0), %w = auth.* [[DollarPlus|$+]] [[$chr]](44), %it = [[DollarPlus|$+]](auth.,%c,[[$chr]](44)), %t = [[$cid]] [[DollarPlus|$+]] .auths&lt;br /&gt;
   [[while]] (%i) {&lt;br /&gt;
     [[Local_Variables|var]] %n = [[$nick_(nick)|$nick(]]%c,%i)&lt;br /&gt;
     [[If-Then-Else|if]] ([[$hfind]](%t,%w [[DollarPlus|$+]] %n,1,w)) {&lt;br /&gt;
       [[tokenize]] 32 [[$hget]](%t,[[$v1]])&lt;br /&gt;
       [[hadd]] %t %it [[DollarPlus|$+]] %n [[$1-|$1]] [[$iif]]([[$1-|$2]],%c) [[$1-|$3]]&lt;br /&gt;
     }&lt;br /&gt;
     [[dec]] %i&lt;br /&gt;
   }&lt;br /&gt;
   au.update c&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:PART:#:{ au.part [[$chan_(remote)|$chan]] [[$nick_(remote)|$nick]] | au.upd.nick [[$nick_(remote)|$nick]] $site [[$chan_(remote)|$chan]] }&lt;br /&gt;
 on *:KICK:#:{ au.part [[$chan_(remote)|$chan]] $knick | au.upd.nick [[$nick_(remote)|$nick]] $site }&lt;br /&gt;
 &lt;br /&gt;
 ; $1 = chan   $2 = nick&lt;br /&gt;
 [[alias]] -l au.part {&lt;br /&gt;
   [[Local_Variables|var]] %t = [[$cid]] [[DollarPlus|$+]] .auths&lt;br /&gt;
   [[If-Then-Else|if]] (![[$hget]](%t)) { [[return]] }&lt;br /&gt;
   [[If-Then-Else|if]] ([[$1-|$2]] == [[$me]]) {&lt;br /&gt;
     [[hdel]] -w %t auth. [[DollarPlus|$+]] [[$chan_(remote)|$chan]] [[DollarPlus|$+]] ,*&lt;br /&gt;
     [[hdel]] %t ctime. [[DollarPlus|$+]] [[$chan_(remote)|$chan]]&lt;br /&gt;
     [[Local_Variables|var]] %i = [[$hfind]](%t,req.*,0,w)&lt;br /&gt;
     [[while]] (%i) {&lt;br /&gt;
       [[Local_Variables|var]] %it = [[$hfind]](%t,req.*,%i,w) , %n = [[$gettok]](%it,2,46)&lt;br /&gt;
       [[If-Then-Else|if]] (%n ison [[$1-|$1]]) &amp;amp;&amp;amp; (![[$comchan]](%n,2)) { [[hdel]] %t %it | .[[signal]] authupdate.req %n }&lt;br /&gt;
       [[dec]] %i&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   [[If-Then-Else|else]] {&lt;br /&gt;
     [[hdel]] %t [[DollarPlus|$+]](auth.,[[$1-|$1]],[[$chr]](44),[[$1-|$2]])&lt;br /&gt;
     [[If-Then-Else|if]] ([[$hget]](%t,req. [[DollarPlus|$+]] [[$1-|$2]])) &amp;amp;&amp;amp; (![[$comchan]]([[$1-|$2]],2)) { [[hdel]] %t req. [[DollarPlus|$+]] [[$1-|$2]] | .[[signal]] authupdate.req [[$1-|$2]] }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:QUIT:{&lt;br /&gt;
   [[Local_Variables|var]] %t = [[$cid]] [[DollarPlus|$+]] .auths&lt;br /&gt;
   [[If-Then-Else|if]] (![[$hget]](%t)) { [[return]] }&lt;br /&gt;
   [[hdel]] -w %t [[DollarPlus|$+]](auth.,*,[[$chr]](44),[[$nick_(remote)|$nick]])&lt;br /&gt;
   [[If-Then-Else|if]] ([[$hget]](%t,req. [[DollarPlus|$+]] [[$nick_(remote)|$nick]])) { [[hdel]] %t req. [[DollarPlus|$+]] [[$nick_(remote)|$nick]] | .[[signal]] authupdate.req [[$nick_(remote)|$nick]] }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on ^*:NICK:{&lt;br /&gt;
   [[Local_Variables|var]] %i = [[$comchan]]($newnick,0) , %t = [[$cid]] [[DollarPlus|$+]] .auths&lt;br /&gt;
   [[If-Then-Else|if]] ([[$nick_(remote)|$nick]] == $newnick) || (![[$hget]](%t)) { [[return]] }&lt;br /&gt;
   [[while]] (%i) {&lt;br /&gt;
     [[Local_Variables|var]] %it = [[DollarPlus|$+]](auth.,[[$comchan]]($newnick,%i),[[$chr]](44))&lt;br /&gt;
     [[$iif]]([[$hget]](%t,%it [[DollarPlus|$+]] [[$nick_(remote)|$nick]]),hadd,hdel) %t %it [[DollarPlus|$+]] $newnick [[$v1]]&lt;br /&gt;
     [[hdel]] %t %it [[DollarPlus|$+]] [[$nick_(remote)|$nick]]&lt;br /&gt;
     [[dec]] %i&lt;br /&gt;
   }&lt;br /&gt;
   [[If-Then-Else|if]] ([[$hget]](%t,req. [[DollarPlus|$+]] [[$nick_(remote)|$nick]])) { [[hadd]] %t req. [[DollarPlus|$+]] $newnick 1 | [[hdel]] %t req. [[DollarPlus|$+]] [[$nick_(remote)|$nick]] }&lt;br /&gt;
   [[If-Then-Else|if]] ($auth.in.site($site)) { au.upd.nick $newnick $site }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; AU.WHO ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 &lt;br /&gt;
 ; [$1 = nick]&lt;br /&gt;
 [[alias]] -l au.who {&lt;br /&gt;
   [[Local_Variables|var]] %t = [[$cid]] [[DollarPlus|$+]] .auths , %t2 = [[$cid]] [[DollarPlus|$+]] .au.who&lt;br /&gt;
   [[If-Then-Else|if]] ([[$hget]](%t2)) { [[hfree]] %t2 }&lt;br /&gt;
   [[hmake]] %t2&lt;br /&gt;
   [[hdel]] %t who&lt;br /&gt;
   [[If-Then-Else|if]] ([[$1-|$1]]) {&lt;br /&gt;
     [[Local_Variables|var]] %who = [[$1-|$1]] [[DollarPlus|$+]] ,,, [[DollarPlus|$+]] 137&lt;br /&gt;
     [[hadd]] %t2 -mask %who&lt;br /&gt;
     [[hadd]] %t wholock 1&lt;br /&gt;
     who %who n%nat,137&lt;br /&gt;
     [[return]]&lt;br /&gt;
   }&lt;br /&gt;
   [[Local_Variables|var]] %i = [[$comchan]]([[$me]],0) , %sort , %ticks = [[$ticks]]&lt;br /&gt;
   [[while]] (%i) {&lt;br /&gt;
     [[Local_Variables|var]] %sort = %sort [[$nick_(nick)|$nick(]][[$comchan]]([[$me]],%i),0) [[DollarPlus|$+]] . [[DollarPlus|$+]] %i&lt;br /&gt;
     [[dec]] %i&lt;br /&gt;
   }&lt;br /&gt;
   [[Local_Variables|var]] %sort = [[$sorttok]](%sort,32,n) , %i = [[$numtok]](%sort,32) , %maxlen = $max.len , %n.max = $max.replies  , %time = [[$calc]]([[$ctime]] - $queue.check) , %ids , %n.w , %len, %chans&lt;br /&gt;
   [[while]] (%i) {&lt;br /&gt;
     [[Local_Variables|var]] %c = [[$comchan]]([[$me]],[[$gettok]]([[$gettok]](%sort,%i,32),2,46)) , %n.0 = [[$hfind]](%t,0 %c &amp;amp;,0,w).data , %n.c = [[$nick_(nick)|$nick(]]%c,0)&lt;br /&gt;
     [[Local_Variables|var]] %n.l = [[$calc]](%n.c - [[$hfind]](%t,[[DollarPlus|$+]](auth.,%c,[[$chr]](44),*),0,w) + [[$iif]](%time &amp;lt; [[$hget]](%t,ctime. [[DollarPlus|$+]] %c),0,%n.0))&lt;br /&gt;
     [[If-Then-Else|if]] ([[$calc]](%len + [[$len]](%c) +1) &amp;gt; %maxlen) || ([[$calc]](%n.w + %n.c) &amp;gt; %n.max) { [[dec]] %i | [[continue]] }&lt;br /&gt;
     [[If-Then-Else|if]] (%n.l &amp;gt; 1) &amp;amp;&amp;amp; ((%n.l &amp;gt;= $min.nicks) || ([[$calc]](%n.l / %n.c) &amp;gt;= $min.ratio)) {&lt;br /&gt;
       [[Local_Variables|var]] %chans = %chans %c&lt;br /&gt;
       [[hadd]] %t ctime. [[DollarPlus|$+]] %c [[$ctime]]&lt;br /&gt;
       [[Local_Variables|var]] %j = [[$nick_(nick)|$nick(]]%c,0)&lt;br /&gt;
       [[while]] (%j) {&lt;br /&gt;
         [[Local_Variables|var]] %n = [[$nick_(nick)|$nick(]]%c,%j)&lt;br /&gt;
         [[If-Then-Else|if]] (![[$hget]](%t2,%n)) { [[hadd]] %t2 %n 1 | [[inc]] %n.w }&lt;br /&gt;
         [[dec]] %j&lt;br /&gt;
       }&lt;br /&gt;
       [[inc]] %len [[$calc]]([[$len]](%c) +1)&lt;br /&gt;
     }&lt;br /&gt;
     [[dec]] %i&lt;br /&gt;
   }&lt;br /&gt;
   [[Local_Variables|var]] %i = [[$comchan]]([[$me]],0) , %nicks&lt;br /&gt;
   [[while]] (%i) {&lt;br /&gt;
     [[Local_Variables|var]] %c = [[$comchan]]([[$me]],%i)&lt;br /&gt;
     [[If-Then-Else|if]] (![[$istok]](%chans,%c,32)) {&lt;br /&gt;
       [[If-Then-Else|if]] ([[$calc]]([[$nick_(nick)|$nick(]]%c,0) - [[$hfind]](%t,[[DollarPlus|$+]](auth.,%c,[[$chr]](44),*),0,w)) &amp;gt; 0) {&lt;br /&gt;
         [[Local_Variables|var]] %j = [[$nick_(nick)|$nick(]]%c,0)&lt;br /&gt;
         [[while]] (%j) {&lt;br /&gt;
           [[Local_Variables|var]] %n = [[$nick_(nick)|$nick(]]%c,%j)&lt;br /&gt;
           [[If-Then-Else|if]] ([[$calc]](%len + [[$len]](%n) +1) &amp;gt; %maxlen) { [[goto]] end }&lt;br /&gt;
           [[Local_Variables|var]] %val = [[$hget]](%t,[[DollarPlus|$+]](auth.,%c,[[$chr]](44),%n))&lt;br /&gt;
           [[If-Then-Else|if]] (![[$hget]](%t2,%n)) &amp;amp;&amp;amp; ((%val == [[$null]]) || ([[$gettok]](%val,3,32) &amp;lt; %time)) { [[Local_Variables|var]] %nicks = %nicks %n | [[hadd]] %t2 %n 1 | [[inc]] %n.w | [[inc]] %len [[$len]](%n) }&lt;br /&gt;
           [[If-Then-Else|if]] (%n.w &amp;gt;= %n.max) { [[goto]] end }&lt;br /&gt;
           [[dec]] %j&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       [[If-Then-Else|else]] {&lt;br /&gt;
         [[Local_Variables|var]] %j = [[$hfind]](%t,0 %c &amp;amp;,0,w).data&lt;br /&gt;
         [[while]] (%j) {&lt;br /&gt;
           [[Local_Variables|var]] %it = [[$hfind]](%t,0 %c &amp;amp;,%j,w).data , %n = [[$gettok]](%it,2,44)&lt;br /&gt;
           [[If-Then-Else|if]] ([[$calc]](%len + [[$len]](%n) +1) &amp;gt; %maxlen) { [[goto]] end }&lt;br /&gt;
           [[If-Then-Else|if]] (![[$hget]](%t2,%n)) &amp;amp;&amp;amp; ([[$gettok]]([[$hget]](%t,%it),3,32) &amp;lt; %time) &amp;amp;&amp;amp; (auth.* iswm %it) { [[Local_Variables|var]] %nicks = %nicks %n | [[hadd]] %t2 %n 1 | [[inc]] %n.w | [[inc]] %len [[$len]](%n) }&lt;br /&gt;
           [[If-Then-Else|if]] (%n.w &amp;gt;= %n.max) { [[goto]] end }&lt;br /&gt;
           [[dec]] %j&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
     [[dec]] %i&lt;br /&gt;
   }&lt;br /&gt;
   :end&lt;br /&gt;
   [[Local_Variables|var]] %who = [[$replace]](%chans %nicks,[[$chr]](32),[[$chr]](44))&lt;br /&gt;
   [[If-Then-Else|if]] (%who) {&lt;br /&gt;
     [[Local_Variables|var]] %who = %who [[DollarPlus|$+]] ,,, [[DollarPlus|$+]] 137&lt;br /&gt;
     [[hadd]] %t2 -mask %who&lt;br /&gt;
     [[hadd]] %t wholock 1&lt;br /&gt;
     who %who n%nat,137&lt;br /&gt;
     [[If-Then-Else|if]] (%len &amp;gt; [[$calc]](%maxlen * 0.7)) || (%n.w &amp;gt; [[$calc]](%n.max * 0.7)) { [[hadd]] %t who 1 }&lt;br /&gt;
   }&lt;br /&gt;
   [[If-Then-Else|else]] { au.update r }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RAW REPLIES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 ; RAW 354 SPECIAL WHO REPLY&lt;br /&gt;
 ; 354 &amp;lt;you&amp;gt;   &amp;lt;nr&amp;gt;  &amp;lt;nick&amp;gt;  &amp;lt;auth&amp;gt;&lt;br /&gt;
 ; 354 Vliedel 137   sy      rry&lt;br /&gt;
 RAW 354:&amp;amp; 137 &amp;amp; &amp;amp;:{&lt;br /&gt;
   [[haltdef]]&lt;br /&gt;
   [[Local_Variables|var]] %i = [[$comchan]]([[$1-|$3]],0) , %t = [[$cid]] [[DollarPlus|$+]] .auths&lt;br /&gt;
   [[If-Then-Else|if]] ([[$hget]](%t,req. [[DollarPlus|$+]] [[$1-|$3]])) { [[hdel]] %t req. [[DollarPlus|$+]] [[$1-|$3]] | .[[signal]] authupdate.req [[$1-|$3]] [[$iif]](%i,[[$1-|$4]]) }&lt;br /&gt;
   [[If-Then-Else|if]] (!%i) || (![[$hget]](%t)) { [[return]] }&lt;br /&gt;
   [[If-Then-Else|if]] ([[$gettok]]([[$hget]](%t,[[DollarPlus|$+]](auth.,[[$comchan]]([[$1-|$3]],1),[[$chr]](44),[[$1-|$3]])),1,32) !== [[$1-|$4]]) { .[[signal]] authupdate.new [[$1-|$3]] [[$1-|$4]] }&lt;br /&gt;
   [[while]] (%i) {&lt;br /&gt;
     [[Local_Variables|var]] %c = [[$comchan]]([[$1-|$3]],%i)&lt;br /&gt;
     [[hadd]] %t [[DollarPlus|$+]](auth.,%c,[[$chr]](44),[[$1-|$3]]) [[$1-|$4]] [[$iif]](![[$1-|$4]],%c [[$ctime]])&lt;br /&gt;
     [[dec]] %i&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ; RAW 315 WHO END&lt;br /&gt;
 ; 315 &amp;lt;you&amp;gt;    &amp;lt;requested&amp;gt;      :End of /who list.&lt;br /&gt;
 ; 315 Vliedel  #vliedel,,,137   :End of /WHO list.&lt;br /&gt;
 RAW 315:&amp;amp; *,,,137 end of /WHO list.: {&lt;br /&gt;
   [[If-Then-Else|if]] ([[$hget]]([[$cid]] [[DollarPlus|$+]] .au.who,-mask) == [[$1-|$2]]) {&lt;br /&gt;
     [[Local_Variables|var]] %who = [[$left]]([[$1-|$2]],-6) , %i = [[$wildtok]](%who,#*,0,44) , %t = [[$cid]] [[DollarPlus|$+]] .auths&lt;br /&gt;
     [[while]] (%i) {&lt;br /&gt;
       [[hadd]] %t ctime. [[DollarPlus|$+]] [[$wildtok]](%who,#*,%i,44) [[$ctime]]&lt;br /&gt;
       [[dec]] %i&lt;br /&gt;
     }&lt;br /&gt;
     [[hfree]] [[$cid]] [[DollarPlus|$+]] .au.who&lt;br /&gt;
     [[hdel]] %t wholock&lt;br /&gt;
     au.update r&lt;br /&gt;
     [[haltdef]]&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; STARTING AND STOPPING ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 on *:LOAD:{ scon -at1 au.load l }&lt;br /&gt;
 [[alias]] -l au.load {&lt;br /&gt;
   au.stop&lt;br /&gt;
   au.start&lt;br /&gt;
   au.update t&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [[alias]] -l au.stop {&lt;br /&gt;
   .[[timer]] [[DollarPlus|$+]] au.update. [[DollarPlus|$+]] [[$cid]] off&lt;br /&gt;
   .[[timer]] [[DollarPlus|$+]] au.update.delay. [[DollarPlus|$+]] [[$cid]] off&lt;br /&gt;
   [[If-Then-Else|if]] ([[$hget]]([[$cid]] [[DollarPlus|$+]] .auths)) { [[hfree]] [[$v1]] }&lt;br /&gt;
   [[If-Then-Else|if]] ([[$hget]]([[$cid]] [[DollarPlus|$+]] .au.who)) { [[hfree]] [[$v1]] }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [[alias]] -l au.start {&lt;br /&gt;
   [[If-Then-Else|if]] (!$used.network) { [[return]] }&lt;br /&gt;
   [[If-Then-Else|if]] (![[$hget]]([[$cid]] [[DollarPlus|$+]] .auths)) { [[hmake]] [[$cid]] [[DollarPlus|$+]] .auths }&lt;br /&gt;
   [[If-Then-Else|if]] (!$timer(au.update. [[DollarPlus|$+]] [[$cid]])) { .[[timer]] [[DollarPlus|$+]] au.update. [[DollarPlus|$+]] [[$cid]] 0 $queue.delay au.update t }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:DISCONNECT:{ au.stop }&lt;br /&gt;
 on *:UNLOAD:{ scon -a au.stop }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IAL-UPDATING EVENTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 on ^*:TEXT:*:*:{ au.upd.nick [[$nick_(remote)|$nick]] $site }&lt;br /&gt;
 on ^*:ACTION:*:*:{ au.upd.nick [[$nick_(remote)|$nick]] $site }&lt;br /&gt;
 on ^*:NOTICE:*:*:{ au.upd.nick [[$nick_(remote)|$nick]] $site }&lt;br /&gt;
 on ^*:RAWMODE:#:{ au.upd.nick [[$nick_(remote)|$nick]] $site }&lt;br /&gt;
 on ^*:TOPIC:#:{ au.upd.nick [[$nick_(remote)|$nick]] $site }&lt;br /&gt;
 on ^*:INVITE:#:{ au.upd.nick [[$nick_(remote)|$nick]] $site }&lt;br /&gt;
 [[CTCP]] *:*:*:{ au.upd.nick [[$nick_(remote)|$nick]] $site }&lt;br /&gt;
 RAW 352:&amp;amp; &amp;amp; &amp;amp; &amp;amp; &amp;amp; &amp;amp; &amp;amp; &amp;amp; *:{ au.upd.nick [[$1-|$6]] [[$1-|$4]] }&lt;br /&gt;
 &lt;br /&gt;
 ; $1 = nick   $2 = site   [ $3 = chan (exclude it)]&lt;br /&gt;
 [[alias]] -l au.upd.nick {&lt;br /&gt;
   [[If-Then-Else|if]] (!$auth.in.site([[$1-|$2]])) || (![[$hget]]([[$cid]] [[DollarPlus|$+]] .auths)) { [[return]] }&lt;br /&gt;
   [[Local_Variables|var]] %i = [[$comchan]]([[$1-|$1]],0) , %t = [[$cid]] [[DollarPlus|$+]] .auths , %au = $auth.from.site([[$1-|$2]])&lt;br /&gt;
   [[If-Then-Else|if]] (!%i) || (%i == 1 &amp;amp;&amp;amp; [[$1-|$3]]) || ([[$hget]](%t,[[DollarPlus|$+]](auth.,[[$comchan]]([[$1-|$1]],1),[[$chr]](44),[[$1-|$1]])) == %au) { [[return]] }&lt;br /&gt;
   [[while]] (%i) {&lt;br /&gt;
     [[If-Then-Else|if]] ([[$comchan]]([[$1-|$1]],%i) !== [[$1-|$3]]) { [[hadd]] %t [[DollarPlus|$+]](auth.,[[$v1]],[[$chr]](44),[[$1-|$1]]) %au }&lt;br /&gt;
     [[dec]] %i&lt;br /&gt;
   }&lt;br /&gt;
   .[[signal]] authupdate.new [[$1-|$1]] %au&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; USED DATA/TIMERS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 &lt;br /&gt;
 ; TABLE &amp;lt;cid&amp;gt;.auths&lt;br /&gt;
 ;auth.&amp;lt;chan&amp;gt;,&amp;lt;nick&amp;gt; --&amp;gt; &amp;lt;auth&amp;gt; [chan ctime]&lt;br /&gt;
 ;req.&amp;lt;nick&amp;gt;         --&amp;gt; 1&lt;br /&gt;
 ;ctime.&amp;lt;chan&amp;gt;       --&amp;gt; &amp;lt;ctime&amp;gt;&lt;br /&gt;
 ;who                --&amp;gt; &amp;lt;1/null&amp;gt;&lt;br /&gt;
 ;wholock            --&amp;gt; &amp;lt;1/null&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 ; TABLE &amp;lt;cid&amp;gt;.au.who&lt;br /&gt;
 ; nick   --&amp;gt; 1&lt;br /&gt;
 ; -mask  --&amp;gt; /who string&lt;br /&gt;
 &lt;br /&gt;
 ; TIMER au.update.delay.&amp;lt;cid&amp;gt;&lt;br /&gt;
 ; TIMER au.update.&amp;lt;cid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Archive]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$biton&amp;diff=6018</id>
		<title>$biton</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$biton&amp;diff=6018"/>
		<updated>2013-07-18T18:07:39Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: fixed c/p mistake&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Biton returns the given number with the Nth bit turned on.&lt;br /&gt;
&lt;br /&gt;
 $biton(decimal number, N)&lt;br /&gt;
&lt;br /&gt;
* Decimal number is the number to perform the operation on given in decimal form (Base 10)&lt;br /&gt;
* N is the bit to turn on.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
 $biton(5,2)&lt;br /&gt;
&lt;br /&gt;
The binary value of 5 is taken&lt;br /&gt;
 00000101&lt;br /&gt;
&lt;br /&gt;
And the second bit is turned on(second from the right)&lt;br /&gt;
 00000111&lt;br /&gt;
&lt;br /&gt;
 Returns: 7&lt;br /&gt;
&lt;br /&gt;
[[Category:Bitwise Identifiers]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$snicks&amp;diff=6017</id>
		<title>$snicks</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$snicks&amp;diff=6017"/>
		<updated>2013-07-17T18:26:47Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: /* See Also */ typo hunting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; $snicks&lt;br /&gt;
Returns a string of the currently selected nicknames in the active channel listbox in the form:&lt;br /&gt;
 nick1,nick2,nick3,...,nickN&lt;br /&gt;
==Example==&lt;br /&gt;
 $snicks&lt;br /&gt;
Returns Dana,G,Q when those nicknames are selected in the nicklist.&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[$snick]] - returns the Nth selected nickname on a channel&lt;br /&gt;
* [[$snotify]] - returns the currently selected nickname from your notify list box&lt;br /&gt;
[[Category:Nick and Address Identifiers]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Debugging_(Find_The_Bug)&amp;diff=6016</id>
		<title>Debugging (Find The Bug)</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Debugging_(Find_The_Bug)&amp;diff=6016"/>
		<updated>2013-07-13T17:24:43Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: Removed another &amp;quot;please contribute&amp;quot; line. Seems the whole article has been copy pasted from holycraplions.com/findthebug when it still existed.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Why am I Here? ==&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve come wandering upon this document it is likely that you are having trouble with a script that you wrote. It is probably fully written, but doesn&#039;t seem to work as it should, for one reason or another. The purpose of this document is therefore to teach you how to debug your own scripts, making the coding process easier and more efficient. Don&#039;t get discouraged, debugging is not hard. Debugging is a logical process that can be easily learned and applied if you follow the steps involved.&lt;br /&gt;
&lt;br /&gt;
If you happen to already know enough about debugging, but just can&#039;t seem to figure out what is going wrong with a script you wrote, you should take a look at section 5, in which some Common Scripting Pitfalls are discussed.&lt;br /&gt;
&lt;br /&gt;
== The Basics of Debugging ==&lt;br /&gt;
&lt;br /&gt;
If a script does not work, the logical process is to find out why, so that it may be fixed. DO NOT take for granted the first step I mentioned, in which you must find out why your script does not work. When first dealing with any bugged script, your frame of mind should never be, &amp;quot;this needs to be fixed&amp;quot;. Instead you should first be asking the question &amp;quot;why does this not work?&amp;quot; Once you answer that question you can move on to fixing it and the fix is usually much simpler than the debugging process itself. Think of debugging similar to a medical situation. Before you treat a patient, you must always diagnose him or her first. This concept applies the same way in debugging.&lt;br /&gt;
&lt;br /&gt;
A lot of people asking for help on IRC or in forums are basically just asking for other people to debug their scripts, instead of helping them with something the person asking doesn&#039;t understand. Don&#039;t expect much respect if you ask people to bugfix for you.&lt;br /&gt;
&lt;br /&gt;
== The Steps of Debugging ==&lt;br /&gt;
&lt;br /&gt;
Practically speaking, to diagnose a bugged script you should follow the set of steps which I will now begin explaining.&lt;br /&gt;
&lt;br /&gt;
=== Narrow it Down! ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Narrow it down&amp;quot; is probably one of the best phrases to keep in mind when debugging a script. Often a scripter will ask for help with a script that doesn&#039;t seem to trigger, but he will paste his entire script, which happens to be 100 or so lines of code. The truth is that it is rarely necessary to look at more than 5-10 lines of code at a time. While debugging you should constantly be narrowing down which lines of code the bug is affecting, or which lines of code simply do not work.&lt;br /&gt;
&lt;br /&gt;
But don&#039;t stop there; a line of code can easily become too general still. Continue to narrow down your search as much as possible. Sometimes it will be necessary to narrow things down to the smallest character (this has definitely been the source of many bugs I&#039;ve seen in the past). Remember that sometimes a bug can be as simple as a typo or spelling mistake.&lt;br /&gt;
&lt;br /&gt;
The question you are probably asking is how exactly you &amp;quot;narrow down&amp;quot; a search for a bug? &amp;quot;What should I be looking for?&amp;quot; There are many things to look for; here are some methods you can use to find out which part of your script is not functioning properly:&lt;br /&gt;
&lt;br /&gt;
=== Look for Error Messages ===&lt;br /&gt;
&lt;br /&gt;
Sometimes if mIRC breaks a script errantly it will echo the error information locally. This is usually found in the status window of your active connection id (unless your command explicitly used another connection id). If you get such an error it might inform you of the line it halted execution on. This is very useful to narrow your bug search to a certain line. If no line is mentioned you will most likely get the command, which is also very helpful. You can then go look up each time you used that command in your script.&lt;br /&gt;
&lt;br /&gt;
=== Be Verbose ===&lt;br /&gt;
&lt;br /&gt;
Verbose means to be audible. In the context of mIRC scripting it means to /echo data to the screen. Usually a debugger should try to echo as much information as often as possible.&lt;br /&gt;
&lt;br /&gt;
If you have a variable that does not have the right value, it is best to echo that variable right after you set it to find out what value it took on. This can easily narrow your code down to a line in one simple step.&lt;br /&gt;
&lt;br /&gt;
Another possibility is that a line of code isn&#039;t being executed at all (how do I know this, you ask? Well if it&#039;s a command such as /kick it is very easy to tell if it executes or not, however if it is a silent command, try tacking on a /echo inside the command itself to see if it executes). In such a case it is a good idea to drop in /echo commands along your code flow, regardless of what it actually echoes.&lt;br /&gt;
&lt;br /&gt;
Consider the following example:&lt;br /&gt;
&lt;br /&gt;
 alias function_name {&lt;br /&gt;
     echo -a Started execution&lt;br /&gt;
     if (a == a) {&lt;br /&gt;
         echo -a Got to first level if&lt;br /&gt;
         if (b == b) {&lt;br /&gt;
             ; mIRC should get here, &lt;br /&gt;
             ; but lets find out&lt;br /&gt;
             echo -a Got to second level&lt;br /&gt;
             ; Imagine this next if is a typo&lt;br /&gt;
             if (defcon == defdcon) {&lt;br /&gt;
                 echo -a Got to third level&lt;br /&gt;
             }&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
     echo -a Ending function&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 Output:&lt;br /&gt;
 Started execution&lt;br /&gt;
 Got to first level if&lt;br /&gt;
 Got to second level&lt;br /&gt;
 Ending function&lt;br /&gt;
&lt;br /&gt;
From this it should be clear that mIRC did not reach the last nested if-statement. You can now do further tests to find out why your if statement failed. In our case it was a typo, we really meant to say &#039;defcon&#039; instead of &#039;defdcon&#039;.&lt;br /&gt;
&lt;br /&gt;
Another way to use echo is echo&#039;ing big or complicated identifiers, or even entire commands, to see if they actually parse into what you want them to be.&lt;br /&gt;
&lt;br /&gt;
=== Check Brackets and Syntax ===&lt;br /&gt;
&lt;br /&gt;
This may seem trivial, but it is always important to make sure your script has as many open brackets as close brackets and also follow mIRC&#039;s basic syntax rules. I will outline some basic syntax rules that mIRC uses:&lt;br /&gt;
&lt;br /&gt;
Basic Syntax Rules&lt;br /&gt;
&lt;br /&gt;
* Braces {} must always be spaced out and never touch any other character. There is one  exception to this rule, but if you always space your braces out you should not have a problem. This also applies to the pipe | character used for dealing with multiple commands.&lt;br /&gt;
&lt;br /&gt;
* Multiple commands should generally be surrounded by braces. It is not necessary to use a new line for each command, but keep in mind the multiple command structure:&lt;br /&gt;
&lt;br /&gt;
On one line:&lt;br /&gt;
&lt;br /&gt;
 ALIAS/EVENT { command 1 | command 2 | command 3 }&lt;br /&gt;
 &lt;br /&gt;
On multiple lines:&lt;br /&gt;
 &lt;br /&gt;
 ALIAS/EVENT {&lt;br /&gt;
     command 1&lt;br /&gt;
     command 2&lt;br /&gt;
     command 3&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
On both multiple and single lines:&lt;br /&gt;
&lt;br /&gt;
 ALIAS/EVENT {&lt;br /&gt;
     command 1 | command 2&lt;br /&gt;
     command 3&lt;br /&gt;
     command 4&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Note that the opening brace can never be on its own on a line. Consider the following:&lt;br /&gt;
&lt;br /&gt;
 ALIAS/EVENT&lt;br /&gt;
 {&lt;br /&gt;
     command&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Some languages allow this syntax. This is not valid in mIRC. The opening brace can never begin a line.&lt;br /&gt;
&lt;br /&gt;
* The If control structure is command based in mIRC. As such, it must be properly spaced just like all commands. Some languages allow the use of:&lt;br /&gt;
&lt;br /&gt;
if(condition)&lt;br /&gt;
&lt;br /&gt;
This is also not valid in mIRC. In such a case, you would actually be performing the command of /if(condition), which most likely does not exist. The condition (including the brackets) in mIRC if statements is a parameter, and must follow the if statement with a space.&lt;br /&gt;
&lt;br /&gt;
As far as braces go (the { } characters), mIRC can check this automatically in the script editor by clicking the &amp;quot;{ }&amp;quot; button. If mIRC says you have a mismatch, fix it before going further; it is likely that this is the cause of your bug.&lt;br /&gt;
&lt;br /&gt;
When dealing with if statements it is always important to make sure you have the same amount of opening brackets as closing brackets. Sometimes mIRC will not report this error and will automatically fail the if statement and continue execution. If you read section 3.3 you may have used the echo method to find out which if statement is not being triggers. In such a case, the first thing you should do is count the brackets and look at general syntax as described above.&lt;br /&gt;
&lt;br /&gt;
=== Simplify Complicated and Suspicious Code ===&lt;br /&gt;
&lt;br /&gt;
If you were unsuccessful in tracking down your bug using any of the other methods mentioned above, try looking for suspicious code. If you wrote a line of code that you just aren&#039;t sure about, try looking closer at that line. Similarly, if you have a very complex line of code in your script, try looking at that one first. A good way to handle a situation like this is to change the line to something very simple, and see if it works. If it does then you know that your problem lies in the code that you changed. If not then you can be certain that the bug you&#039;re looking for does not lie in your complex code. (Although be aware that you shouldn&#039;t now automatically trust it completely, as there may still be issues with it which won&#039;t be apparent until the current bug is fixed, for example.)&lt;br /&gt;
&lt;br /&gt;
== Final Notes ==&lt;br /&gt;
&lt;br /&gt;
Remember that when you&#039;re debugging a script it is more important to find out why your script is failing than to fix it. An mIRC support channel can easily aid a scripter solve his problem when it is clear what the problem is. In essence, if you cannot solve a problem it is important that you at least understand what problem it is that you&#039;re having, that way you can get the help you need from an outside source. That is the purpose of debugging a script; not to directly fix, but to set yourself on a course to implement such a fix.&lt;br /&gt;
&lt;br /&gt;
== Common Scripting Pitfalls ==&lt;br /&gt;
&lt;br /&gt;
Conflicting Event Matching&lt;br /&gt;
&lt;br /&gt;
A Scripter will often put the following line of code in his Remotes and it will not trigger:&lt;br /&gt;
&lt;br /&gt;
 on 1:TEXT:!trigger *:#: { commands }&lt;br /&gt;
&lt;br /&gt;
There is nothing wrong with this code. It should trigger fine. However in his script (higher up in the file) he also has the following line:&lt;br /&gt;
&lt;br /&gt;
 on 1:TEXT:*:#: { commands }&lt;br /&gt;
&lt;br /&gt;
The reason his !trigger is not working is that mIRC goes downwards through a script file finding the first event that matches. Since &#039;*&#039; is more global than &#039;!trigger *&#039;, mIRC will not reach his !trigger event. To fix this the scripter must either reverse the order which they appear in the file, or put the !trigger in a new script file, so that mIRC will execute both.&lt;br /&gt;
&lt;br /&gt;
* Note: this also occurs for any other events that match for the same input&lt;br /&gt;
&lt;br /&gt;
Using &amp;quot; &amp;quot; In Filenames&lt;br /&gt;
&lt;br /&gt;
Always use &amp;quot; &amp;quot; when dealing with files and directories, to make sure mIRC understands directories with spaces in the name. It&#039;s a good habit to always use them, even when you aren&#039;t expecting any spaces.&lt;br /&gt;
&lt;br /&gt;
 /rename c:\Program Files\Half-life\hl.exe c:\Program Files\Half-Life\hl2.exe&lt;br /&gt;
&lt;br /&gt;
This won&#039;t work.&lt;br /&gt;
&lt;br /&gt;
 /rename &amp;quot;c:\Program Files\Half-life\hl.exe&amp;quot; &amp;quot;c:\Program Files\Half-Life\hl2.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will.&lt;br /&gt;
&lt;br /&gt;
&#039;=&#039; Is Not &#039;==&#039;&lt;br /&gt;
&lt;br /&gt;
Remember to always use == when you are comparing objects in if&#039;s or while loops. This counts for every programming language. == is for comparing, = is for assigning.&lt;br /&gt;
&lt;br /&gt;
 alias istest {&lt;br /&gt;
     if (100 == 100) {&lt;br /&gt;
         var %pie = 8&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Remember That Some Commands Have Delays&lt;br /&gt;
&lt;br /&gt;
Not all commands are completed the moment you start them. Some command require you to wait. this pretty much counts for every command that requires a reply from the server or from other clients or connections. For example, this won&#039;t work:&lt;br /&gt;
&lt;br /&gt;
 on *:DEOP:#:{&lt;br /&gt;
     if ($opnick == $me) {&lt;br /&gt;
         ;check if we are being deopped&lt;br /&gt;
         msg BOTNICK op $chan&lt;br /&gt;
         ;requesting op&lt;br /&gt;
         kick $chan $nick Don&#039;t deop me!&lt;br /&gt;
         ;kick the person that deopped you&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
It won&#039;t work because when you ask for op status, there is a delay between the time that you ask it and the time that you actually get it. Even if it&#039;s just a few milliseconds, the script goes too fast for it. There are two ways to solve it; either put the kick command in a timer or use a separate on op event for the kick.&lt;br /&gt;
&lt;br /&gt;
Using $read With The s Flag&lt;br /&gt;
&lt;br /&gt;
When you use $read with the s flag to scan for a line starting with a certain word, keep in mind that the result will NOT include the word you were searching for itself! It returns everything after the word you scanned with.&lt;br /&gt;
&lt;br /&gt;
So if you had a textfile with a line that said &amp;quot;ParaSite` is the greatest&amp;quot; and you used $read(textfile.txt,s,ParaSite`), it would return &amp;quot;is the greatest&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
[[Category:Debugging]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Debugging_(Find_The_Bug)&amp;diff=6015</id>
		<title>Debugging (Find The Bug)</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Debugging_(Find_The_Bug)&amp;diff=6015"/>
		<updated>2013-07-13T17:21:27Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: removed dead link and paragraph about contributing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Find the Bug v1.1.1.34 argv[0]&#039;s Guide to mIRC Debugging This project is now OpenText. Please contribute! Last edit by: argv[0] at 2006-06-03 12:53:46&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why am I Here? ==&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve come wandering upon this document it is likely that you are having trouble with a script that you wrote. It is probably fully written, but doesn&#039;t seem to work as it should, for one reason or another. The purpose of this document is therefore to teach you how to debug your own scripts, making the coding process easier and more efficient. Don&#039;t get discouraged, debugging is not hard. Debugging is a logical process that can be easily learned and applied if you follow the steps involved.&lt;br /&gt;
&lt;br /&gt;
If you happen to already know enough about debugging, but just can&#039;t seem to figure out what is going wrong with a script you wrote, you should take a look at section 5, in which some Common Scripting Pitfalls are discussed.&lt;br /&gt;
&lt;br /&gt;
== The Basics of Debugging ==&lt;br /&gt;
&lt;br /&gt;
If a script does not work, the logical process is to find out why, so that it may be fixed. DO NOT take for granted the first step I mentioned, in which you must find out why your script does not work. When first dealing with any bugged script, your frame of mind should never be, &amp;quot;this needs to be fixed&amp;quot;. Instead you should first be asking the question &amp;quot;why does this not work?&amp;quot; Once you answer that question you can move on to fixing it and the fix is usually much simpler than the debugging process itself. Think of debugging similar to a medical situation. Before you treat a patient, you must always diagnose him or her first. This concept applies the same way in debugging.&lt;br /&gt;
&lt;br /&gt;
A lot of people asking for help on IRC or in forums are basically just asking for other people to debug their scripts, instead of helping them with something the person asking doesn&#039;t understand. Don&#039;t expect much respect if you ask people to bugfix for you.&lt;br /&gt;
&lt;br /&gt;
== The Steps of Debugging ==&lt;br /&gt;
&lt;br /&gt;
Practically speaking, to diagnose a bugged script you should follow the set of steps which I will now begin explaining.&lt;br /&gt;
&lt;br /&gt;
=== Narrow it Down! ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Narrow it down&amp;quot; is probably one of the best phrases to keep in mind when debugging a script. Often a scripter will ask for help with a script that doesn&#039;t seem to trigger, but he will paste his entire script, which happens to be 100 or so lines of code. The truth is that it is rarely necessary to look at more than 5-10 lines of code at a time. While debugging you should constantly be narrowing down which lines of code the bug is affecting, or which lines of code simply do not work.&lt;br /&gt;
&lt;br /&gt;
But don&#039;t stop there; a line of code can easily become too general still. Continue to narrow down your search as much as possible. Sometimes it will be necessary to narrow things down to the smallest character (this has definitely been the source of many bugs I&#039;ve seen in the past). Remember that sometimes a bug can be as simple as a typo or spelling mistake.&lt;br /&gt;
&lt;br /&gt;
The question you are probably asking is how exactly you &amp;quot;narrow down&amp;quot; a search for a bug? &amp;quot;What should I be looking for?&amp;quot; There are many things to look for; here are some methods you can use to find out which part of your script is not functioning properly:&lt;br /&gt;
&lt;br /&gt;
=== Look for Error Messages ===&lt;br /&gt;
&lt;br /&gt;
Sometimes if mIRC breaks a script errantly it will echo the error information locally. This is usually found in the status window of your active connection id (unless your command explicitly used another connection id). If you get such an error it might inform you of the line it halted execution on. This is very useful to narrow your bug search to a certain line. If no line is mentioned you will most likely get the command, which is also very helpful. You can then go look up each time you used that command in your script.&lt;br /&gt;
&lt;br /&gt;
=== Be Verbose ===&lt;br /&gt;
&lt;br /&gt;
Verbose means to be audible. In the context of mIRC scripting it means to /echo data to the screen. Usually a debugger should try to echo as much information as often as possible.&lt;br /&gt;
&lt;br /&gt;
If you have a variable that does not have the right value, it is best to echo that variable right after you set it to find out what value it took on. This can easily narrow your code down to a line in one simple step.&lt;br /&gt;
&lt;br /&gt;
Another possibility is that a line of code isn&#039;t being executed at all (how do I know this, you ask? Well if it&#039;s a command such as /kick it is very easy to tell if it executes or not, however if it is a silent command, try tacking on a /echo inside the command itself to see if it executes). In such a case it is a good idea to drop in /echo commands along your code flow, regardless of what it actually echoes.&lt;br /&gt;
&lt;br /&gt;
Consider the following example:&lt;br /&gt;
&lt;br /&gt;
 alias function_name {&lt;br /&gt;
     echo -a Started execution&lt;br /&gt;
     if (a == a) {&lt;br /&gt;
         echo -a Got to first level if&lt;br /&gt;
         if (b == b) {&lt;br /&gt;
             ; mIRC should get here, &lt;br /&gt;
             ; but lets find out&lt;br /&gt;
             echo -a Got to second level&lt;br /&gt;
             ; Imagine this next if is a typo&lt;br /&gt;
             if (defcon == defdcon) {&lt;br /&gt;
                 echo -a Got to third level&lt;br /&gt;
             }&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
     echo -a Ending function&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 Output:&lt;br /&gt;
 Started execution&lt;br /&gt;
 Got to first level if&lt;br /&gt;
 Got to second level&lt;br /&gt;
 Ending function&lt;br /&gt;
&lt;br /&gt;
From this it should be clear that mIRC did not reach the last nested if-statement. You can now do further tests to find out why your if statement failed. In our case it was a typo, we really meant to say &#039;defcon&#039; instead of &#039;defdcon&#039;.&lt;br /&gt;
&lt;br /&gt;
Another way to use echo is echo&#039;ing big or complicated identifiers, or even entire commands, to see if they actually parse into what you want them to be.&lt;br /&gt;
&lt;br /&gt;
=== Check Brackets and Syntax ===&lt;br /&gt;
&lt;br /&gt;
This may seem trivial, but it is always important to make sure your script has as many open brackets as close brackets and also follow mIRC&#039;s basic syntax rules. I will outline some basic syntax rules that mIRC uses:&lt;br /&gt;
&lt;br /&gt;
Basic Syntax Rules&lt;br /&gt;
&lt;br /&gt;
* Braces {} must always be spaced out and never touch any other character. There is one  exception to this rule, but if you always space your braces out you should not have a problem. This also applies to the pipe | character used for dealing with multiple commands.&lt;br /&gt;
&lt;br /&gt;
* Multiple commands should generally be surrounded by braces. It is not necessary to use a new line for each command, but keep in mind the multiple command structure:&lt;br /&gt;
&lt;br /&gt;
On one line:&lt;br /&gt;
&lt;br /&gt;
 ALIAS/EVENT { command 1 | command 2 | command 3 }&lt;br /&gt;
 &lt;br /&gt;
On multiple lines:&lt;br /&gt;
 &lt;br /&gt;
 ALIAS/EVENT {&lt;br /&gt;
     command 1&lt;br /&gt;
     command 2&lt;br /&gt;
     command 3&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
On both multiple and single lines:&lt;br /&gt;
&lt;br /&gt;
 ALIAS/EVENT {&lt;br /&gt;
     command 1 | command 2&lt;br /&gt;
     command 3&lt;br /&gt;
     command 4&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Note that the opening brace can never be on its own on a line. Consider the following:&lt;br /&gt;
&lt;br /&gt;
 ALIAS/EVENT&lt;br /&gt;
 {&lt;br /&gt;
     command&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Some languages allow this syntax. This is not valid in mIRC. The opening brace can never begin a line.&lt;br /&gt;
&lt;br /&gt;
* The If control structure is command based in mIRC. As such, it must be properly spaced just like all commands. Some languages allow the use of:&lt;br /&gt;
&lt;br /&gt;
if(condition)&lt;br /&gt;
&lt;br /&gt;
This is also not valid in mIRC. In such a case, you would actually be performing the command of /if(condition), which most likely does not exist. The condition (including the brackets) in mIRC if statements is a parameter, and must follow the if statement with a space.&lt;br /&gt;
&lt;br /&gt;
As far as braces go (the { } characters), mIRC can check this automatically in the script editor by clicking the &amp;quot;{ }&amp;quot; button. If mIRC says you have a mismatch, fix it before going further; it is likely that this is the cause of your bug.&lt;br /&gt;
&lt;br /&gt;
When dealing with if statements it is always important to make sure you have the same amount of opening brackets as closing brackets. Sometimes mIRC will not report this error and will automatically fail the if statement and continue execution. If you read section 3.3 you may have used the echo method to find out which if statement is not being triggers. In such a case, the first thing you should do is count the brackets and look at general syntax as described above.&lt;br /&gt;
&lt;br /&gt;
=== Simplify Complicated and Suspicious Code ===&lt;br /&gt;
&lt;br /&gt;
If you were unsuccessful in tracking down your bug using any of the other methods mentioned above, try looking for suspicious code. If you wrote a line of code that you just aren&#039;t sure about, try looking closer at that line. Similarly, if you have a very complex line of code in your script, try looking at that one first. A good way to handle a situation like this is to change the line to something very simple, and see if it works. If it does then you know that your problem lies in the code that you changed. If not then you can be certain that the bug you&#039;re looking for does not lie in your complex code. (Although be aware that you shouldn&#039;t now automatically trust it completely, as there may still be issues with it which won&#039;t be apparent until the current bug is fixed, for example.)&lt;br /&gt;
&lt;br /&gt;
== Final Notes ==&lt;br /&gt;
&lt;br /&gt;
Remember that when you&#039;re debugging a script it is more important to find out why your script is failing than to fix it. An mIRC support channel can easily aid a scripter solve his problem when it is clear what the problem is. In essence, if you cannot solve a problem it is important that you at least understand what problem it is that you&#039;re having, that way you can get the help you need from an outside source. That is the purpose of debugging a script; not to directly fix, but to set yourself on a course to implement such a fix.&lt;br /&gt;
&lt;br /&gt;
== Common Scripting Pitfalls ==&lt;br /&gt;
&lt;br /&gt;
Conflicting Event Matching&lt;br /&gt;
&lt;br /&gt;
A Scripter will often put the following line of code in his Remotes and it will not trigger:&lt;br /&gt;
&lt;br /&gt;
 on 1:TEXT:!trigger *:#: { commands }&lt;br /&gt;
&lt;br /&gt;
There is nothing wrong with this code. It should trigger fine. However in his script (higher up in the file) he also has the following line:&lt;br /&gt;
&lt;br /&gt;
 on 1:TEXT:*:#: { commands }&lt;br /&gt;
&lt;br /&gt;
The reason his !trigger is not working is that mIRC goes downwards through a script file finding the first event that matches. Since &#039;*&#039; is more global than &#039;!trigger *&#039;, mIRC will not reach his !trigger event. To fix this the scripter must either reverse the order which they appear in the file, or put the !trigger in a new script file, so that mIRC will execute both.&lt;br /&gt;
&lt;br /&gt;
* Note: this also occurs for any other events that match for the same input&lt;br /&gt;
&lt;br /&gt;
Using &amp;quot; &amp;quot; In Filenames&lt;br /&gt;
&lt;br /&gt;
Always use &amp;quot; &amp;quot; when dealing with files and directories, to make sure mIRC understands directories with spaces in the name. It&#039;s a good habit to always use them, even when you aren&#039;t expecting any spaces.&lt;br /&gt;
&lt;br /&gt;
 /rename c:\Program Files\Half-life\hl.exe c:\Program Files\Half-Life\hl2.exe&lt;br /&gt;
&lt;br /&gt;
This won&#039;t work.&lt;br /&gt;
&lt;br /&gt;
 /rename &amp;quot;c:\Program Files\Half-life\hl.exe&amp;quot; &amp;quot;c:\Program Files\Half-Life\hl2.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This will.&lt;br /&gt;
&lt;br /&gt;
&#039;=&#039; Is Not &#039;==&#039;&lt;br /&gt;
&lt;br /&gt;
Remember to always use == when you are comparing objects in if&#039;s or while loops. This counts for every programming language. == is for comparing, = is for assigning.&lt;br /&gt;
&lt;br /&gt;
 alias istest {&lt;br /&gt;
     if (100 == 100) {&lt;br /&gt;
         var %pie = 8&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Remember That Some Commands Have Delays&lt;br /&gt;
&lt;br /&gt;
Not all commands are completed the moment you start them. Some command require you to wait. this pretty much counts for every command that requires a reply from the server or from other clients or connections. For example, this won&#039;t work:&lt;br /&gt;
&lt;br /&gt;
 on *:DEOP:#:{&lt;br /&gt;
     if ($opnick == $me) {&lt;br /&gt;
         ;check if we are being deopped&lt;br /&gt;
         msg BOTNICK op $chan&lt;br /&gt;
         ;requesting op&lt;br /&gt;
         kick $chan $nick Don&#039;t deop me!&lt;br /&gt;
         ;kick the person that deopped you&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
It won&#039;t work because when you ask for op status, there is a delay between the time that you ask it and the time that you actually get it. Even if it&#039;s just a few milliseconds, the script goes too fast for it. There are two ways to solve it; either put the kick command in a timer or use a separate on op event for the kick.&lt;br /&gt;
&lt;br /&gt;
Using $read With The s Flag&lt;br /&gt;
&lt;br /&gt;
When you use $read with the s flag to scan for a line starting with a certain word, keep in mind that the result will NOT include the word you were searching for itself! It returns everything after the word you scanned with.&lt;br /&gt;
&lt;br /&gt;
So if you had a textfile with a line that said &amp;quot;ParaSite` is the greatest&amp;quot; and you used $read(textfile.txt,s,ParaSite`), it would return &amp;quot;is the greatest&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
[[Category:Debugging]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$longip&amp;diff=6014</id>
		<title>$longip</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$longip&amp;diff=6014"/>
		<updated>2013-07-12T20:33:41Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: now the line breaks get rendered.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Converts an IP address into a long ip address, and a long ip address into a short ip address.&lt;br /&gt;
&lt;br /&gt;
 $longip(IP/longip)&lt;br /&gt;
&lt;br /&gt;
==The Principal==&lt;br /&gt;
A long IP address is an integer that represents an ip address.&lt;br /&gt;
Consider the IP Address 192.168.2.4&lt;br /&gt;
&lt;br /&gt;
 $longip(192.168.2.4) = 3232236036&lt;br /&gt;
&lt;br /&gt;
This is equal to (192*256^3)+(168*256^2)+(2*256^1)+(4*256^0)&lt;br /&gt;
 [[$calc]]((192*256^3)+(168*256^2)+(2*256^1)+(4*256^0)) = 3232236036&lt;br /&gt;
&lt;br /&gt;
or C0A80204 (The [[$base|base]] 16 value of each byte put together)&lt;br /&gt;
&lt;br /&gt;
 [[$base]](C0A80204,16,10) = 3232236036&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[[$ip]] To get your local IP address&amp;lt;br /&amp;gt;&lt;br /&gt;
[[$base]] To convert between decimal and hexadecimal&amp;lt;br /&amp;gt;&lt;br /&gt;
[[$calc]] To perform calculations&lt;br /&gt;
&lt;br /&gt;
[[Category:Identifiers]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$regsub&amp;diff=6013</id>
		<title>$regsub</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$regsub&amp;diff=6013"/>
		<updated>2013-07-12T20:26:37Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: one less typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;$regsub([name], text, re, subtext, %var)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Performs a regular expression match, like [[$regex|$regex()]], and then performs a substitution using subtext.&amp;lt;br /&amp;gt;&lt;br /&gt;
Returns N, the number of substitutions made, and assigns the result to %var.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 alias testing {&lt;br /&gt;
  var %num_of_matches = $regsub(a dog was eating milk,/dog/g,cat,%new_content)&lt;br /&gt;
  ;%num_of_matches will have a value of 1, since &#039;dog&#039; was matched once&lt;br /&gt;
  ;%new_content will be &#039;a cat was eating milk&#039;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Category:Regular_Expression]]&lt;br /&gt;
[[Category:Identifiers]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$(...)_(events)&amp;diff=6012</id>
		<title>$(...) (events)</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$(...)_(events)&amp;diff=6012"/>
		<updated>2013-07-10T23:09:11Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: Created page with &amp;quot;This identifier allows you to create a dynamic match parameter in an event.  $(...)  You can use $1- to reference the incoming line.  == Example ==  On *:TEXT:...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This identifier allows you to create a dynamic match parameter in an event.&lt;br /&gt;
 $(...)&lt;br /&gt;
&lt;br /&gt;
You can use [[$1-]] to reference the incoming line.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
 [[On_text|On *:TEXT]]:$(* [[DollarPlus|$+]] [[$me]] $+ *):#: {&lt;br /&gt;
  [[echo]] -a [[$nick]] just mentioned your nickname in [[$chan]] $+ .&lt;br /&gt;
 }&lt;br /&gt;
This example will echo to your active window whenever someone mentioned your nickname.&lt;br /&gt;
&lt;br /&gt;
== Note ==&lt;br /&gt;
You must use $(...) in the match text event for all other identifiers to be evaluated.&lt;br /&gt;
&lt;br /&gt;
 Correct:&lt;br /&gt;
 on *:text:$(hello [[$me]] *):#: { ... }&lt;br /&gt;
 &#039;&#039;Incorrect:&lt;br /&gt;
 on *:text:hello $($me) *:#: { ... }&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
$(...) is an alias of [[$eval]]. See the $eval page for more information on how it is used.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[$eval]]&lt;br /&gt;
[[Category:Remote Identifiers]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$(...)&amp;diff=6011</id>
		<title>$(...)</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$(...)&amp;diff=6011"/>
		<updated>2013-07-10T23:08:02Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: rephrasing for clarity&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Categories ==&lt;br /&gt;
* [[$(...) (events)|$(...)]] Using identifiers in event match text&lt;br /&gt;
* [[$eval|$(...)]] Evaluating strings&lt;br /&gt;
&lt;br /&gt;
{{Disambling}}&lt;br /&gt;
[[Category:Remote Identifiers]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$(...)&amp;diff=6010</id>
		<title>$(...)</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$(...)&amp;diff=6010"/>
		<updated>2013-07-10T23:04:50Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: move text into new page, make this a disambiguation page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Categories ==&lt;br /&gt;
* [[$(...) (matching text)|$(...)]] Matching text in events&lt;br /&gt;
* [[$eval|$(...)]] Evaluating strings&lt;br /&gt;
&lt;br /&gt;
{{Disambling}}&lt;br /&gt;
[[Category:Remote Identifiers]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$()&amp;diff=6009</id>
		<title>$()</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$()&amp;diff=6009"/>
		<updated>2013-07-10T22:59:55Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: redirect to $(...)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#Redirect [[$(...)]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$&amp;diff=6008</id>
		<title>$</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$&amp;diff=6008"/>
		<updated>2013-07-10T22:59:14Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: this has nothing to do with $+, rather $()&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[$(...)]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$%2B&amp;diff=6007</id>
		<title>$+</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$%2B&amp;diff=6007"/>
		<updated>2013-07-10T21:45:39Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: removed the &amp;quot;name as is due to technical limitations&amp;quot; note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The identifier $+ is used to combine (concatenate) items together when it&#039;s impossible just to write them together due to variables or identifiers.&lt;br /&gt;
&lt;br /&gt;
 $+ OR $+(...)&lt;br /&gt;
&lt;br /&gt;
The identifier $+ can be used two different ways. One way is just as $+ between items and another one is by passing arguments such as $+(item1, item2, ..., itemN)&lt;br /&gt;
&lt;br /&gt;
 here we have so $+ me text  ;returns &#039;&#039;here we have some text&#039;&#039;&lt;br /&gt;
 $+(here,we,have,some,te $+ xt)  ;returns &#039;&#039;herewehavesometext&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When used that way, the identifier doesn&#039;t look too useful. But when we have a variable or identifier as an item, it&#039;s necessary to use either of these $+.&lt;br /&gt;
&lt;br /&gt;
 [[msg]] [[$chan]] You are [[$nick]] ( $+ [[$fulladdress]] $+ ) could return &#039;&#039;You are Dana (Dana!dana@script.quakenet.org)&#039;&#039;&lt;br /&gt;
 [[msg]] [[$chan]] You are very smart $+([[$nick]],;) welcome to [[$chan]] $+ . could return &#039;&#039;You are very smart Dana; welcome to #brainiacs.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notice how if we had used $chan. or $nick; mIRC would look for identifiers with these names and return nothing.&lt;br /&gt;
&lt;br /&gt;
[[Category:Other Identifiers]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=DollarPlus&amp;diff=6006</id>
		<title>DollarPlus</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=DollarPlus&amp;diff=6006"/>
		<updated>2013-07-10T21:44:42Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: redirect to $+ as this is now possible as page name. Keeping as redirect so old links keep working&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#Redirect [[$+]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Listing_hash_tables_and_their_contents&amp;diff=6005</id>
		<title>Listing hash tables and their contents</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Listing_hash_tables_and_their_contents&amp;diff=6005"/>
		<updated>2013-07-10T19:34:03Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: Created page with &amp;quot;When you are working on a script that uses hash tables, sometimes you want to see their contents. In contrast to text or ini files, you can&amp;#039;t just view them in an easy way. Th...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When you are working on a script that uses hash tables, sometimes you want to see their contents. In contrast to text or ini files, you can&#039;t just view them in an easy way. That&#039;s where this script comes into play.&lt;br /&gt;
&lt;br /&gt;
You can install it by opening the script editor (Alt+R), creating a new script file (File -&amp;gt; New) and then copy paste the script into it.&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
 ***************************************************************************************&lt;br /&gt;
 *&lt;br /&gt;
 *  hlist.mrc by Jay2k1 @ QuakeNet, 2013&lt;br /&gt;
 *&lt;br /&gt;
 *  shows the contents of hash tables in alphabetically sorted custom windows&lt;br /&gt;
 *&lt;br /&gt;
 ***************************************************************************************&lt;br /&gt;
 *&lt;br /&gt;
 *  USAGE&lt;br /&gt;
 *&lt;br /&gt;
 *  /hlist [-c|--close] [(partial) table name]&lt;br /&gt;
 *&lt;br /&gt;
 *  When used without options, /hlist will open a sorted window for every hash table and display their contents.&lt;br /&gt;
 *  When used with a hash table name, it will only display that hash table&#039;s contents.&lt;br /&gt;
 *  It can be used with partial names, e.g. you have the tables &amp;quot;joins_#help&amp;quot; and &amp;quot;joins_#help.script&amp;quot;, the&lt;br /&gt;
 *  command &#039;/hlist joins&#039; would display both of these.&lt;br /&gt;
 *  The -c switch closes the windows. Again, you can specify a full or partial hash table name.&lt;br /&gt;
 *&lt;br /&gt;
 ***************************************************************************************&lt;br /&gt;
 *&lt;br /&gt;
 *  SETTINGS&lt;br /&gt;
 */&lt;br /&gt;
 [[alias]] -l hlist.pad {&lt;br /&gt;
   ; set this to $true if you want the hash table data column to be padded (only useful with monospaced font,&lt;br /&gt;
   ; e.g. Fixedsys) or to $false if not.&lt;br /&gt;
   [[return]] [[$true]]&lt;br /&gt;
 }&lt;br /&gt;
 [[alias]] -l hlist.prefix {&lt;br /&gt;
   ; this is the prefix for the custom window&#039;s names. Default is HT_&lt;br /&gt;
   [[return]] HT_&lt;br /&gt;
 }&lt;br /&gt;
 /*&lt;br /&gt;
 ***************************************************************************************&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
 [[alias]] hlist {&lt;br /&gt;
   ; without any arguments, list all hash tables&lt;br /&gt;
   [[If-Then-Else|if]] ![[$1-|$1]] { [[Local_Variables|var]] %a = [[$hget]](0) | [[while]] %a { hlist.show [[$hget]](%a) | [[dec]] %a } }&lt;br /&gt;
 &lt;br /&gt;
   ; closing windows&lt;br /&gt;
   [[If-Then-Else|elseif]] ([[$1-|$1]] == -c) || ([[$1-|$1]] == --close) {&lt;br /&gt;
 &lt;br /&gt;
     ; without further arguments, close all windows&lt;br /&gt;
     [[If-Then-Else|if]] ![[$1-|$2]] {&lt;br /&gt;
       [[Local_Variables|var]] %a = [[$window_(remote)|$window(]][[DollarPlus|$+]](@,$hlist.prefix,*),0)&lt;br /&gt;
 &lt;br /&gt;
       [[while]] %a {&lt;br /&gt;
         window -c [[$window_(remote)|$window(]][[DollarPlus|$+]](@,$hlist.prefix,*),%a)&lt;br /&gt;
         [[dec]] %a&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     ; otherwise, close requested windows&lt;br /&gt;
     [[If-Then-Else|else]] {&lt;br /&gt;
       [[If-Then-Else|if]] ([[$window_(remote)|$window(]][[DollarPlus|$+]](@,$hlist.prefix,[[$1-|$2]]))) window -c [[$v1]]&lt;br /&gt;
       [[If-Then-Else|else]] {&lt;br /&gt;
         [[Local_Variables|var]] %a = [[$window_(remote)|$window(]][[DollarPlus|$+]](@,$hlist.prefix,*,[[$1-|$2]],*),0)&lt;br /&gt;
         [[while]] %a {&lt;br /&gt;
           window -c [[$window_(remote)|$window(]][[DollarPlus|$+]](@,$hlist.prefix,*,[[$1-|$2]],*),%a)&lt;br /&gt;
           [[dec]] %a&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   ; list hash tables by wildcard match if no matching table exists&lt;br /&gt;
   [[If-Then-Else|elseif]] ![[$hget]]([[$1-|$1]]) {&lt;br /&gt;
     [[Local_Variables|var]] %a = [[$hget]](0)&lt;br /&gt;
     [[If-Then-Else|if]] !%a { [[echo]] -ag hlist: there are no hash tables | [[return]] }&lt;br /&gt;
     [[while]] %a {&lt;br /&gt;
       [[If-Then-Else|if]] ([[$1-|$1]] isin [[$hget]](%a)) hlist.show [[$hget]](%a)&lt;br /&gt;
       [[dec]] %a&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   ; list specified hash table&lt;br /&gt;
   else hlist.show [[$1-|$1]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ; alias hlist.show: opens a custom window and populates it with contents of a given hash table&lt;br /&gt;
 ; expects: hash table name as $1&lt;br /&gt;
 ; returns: -&lt;br /&gt;
 [[alias]] -l hlist.show {&lt;br /&gt;
   [[Local_Variables|var]] %a = [[$hget]]([[$1-|$1]],0).item, %w = [[DollarPlus|$+]](@,$hlist.prefix,[[$1-|$1]],[[$chr]](160),[,%a,]), %len = 0&lt;br /&gt;
   [[If-Then-Else|if]] [[$window_(remote)|$window(]]%w) { [[clear]] %w }&lt;br /&gt;
   [[If-Then-Else|else]] { window -ls %w }&lt;br /&gt;
 &lt;br /&gt;
   [[If-Then-Else|if]] $hlist.pad {&lt;br /&gt;
     ; get length of the longest item name&lt;br /&gt;
     [[while]] %a {&lt;br /&gt;
       [[If-Then-Else|if]] ([[$len]]([[$hget]]([[$1-|$1]],%a).item) &amp;gt; %len) [[Local_Variables|var]] %len = [[$v1]]&lt;br /&gt;
       [[dec]] %a&lt;br /&gt;
     }&lt;br /&gt;
     [[Local_Variables|var]] %a = [[$hget]]([[$1-|$1]],0).item&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   ; loop through hash table items and add them into the window&lt;br /&gt;
   [[while]] %a {&lt;br /&gt;
     [[Local_Variables|var]] %i = [[$hget]]([[$1-|$1]],%a).item&lt;br /&gt;
     [[aline]] %w [[DollarPlus|$+]](%i,[[$str]]([[$chr]](160),[[$calc]](%len - [[$len]](%i)))) =&amp;gt; [[$hget]]([[$1-|$1]],%a).data&lt;br /&gt;
     [[dec]] %a&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
{{Author|Jay2k1}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Archive]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=YouTube_parser&amp;diff=6004</id>
		<title>YouTube parser</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=YouTube_parser&amp;diff=6004"/>
		<updated>2013-07-10T18:22:07Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: fixed $regml link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As the description says, this script retrieves information about youtube videos from the YouTube API and posts them to the channel whenever a youtube link is posted. You can install it by opening the script editor (Alt+R), creating a new script file (File -&amp;gt; New) and then copy paste the script into it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Make sure to replace the channels (#foo,#bar) in the &#039;&#039;on TEXT&#039;&#039; event line with the channels you want the script to be active in.&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
 ********************************************************************************************************&lt;br /&gt;
 * &lt;br /&gt;
 *  youtube.mrc by Jay2k1 @ QuakeNet, 2013&lt;br /&gt;
 * &lt;br /&gt;
 *  Whenever a youtube link is posted in the channels #foo or #bar, this script retrieves the video&#039;s details&lt;br /&gt;
 *  from the youtube API and post them to the channel. It looks like this:&lt;br /&gt;
 * &lt;br /&gt;
 *  &amp;lt;Jay2k1&amp;gt; http://www.youtube.com/watch?v=oHg5SJYRHA0&lt;br /&gt;
 *  &amp;lt;Bot&amp;gt; &#039;RickRoll&#039; by cotter548, 00:03:34, 68213084 views, rating: 87% (259236/38751)&lt;br /&gt;
 * &lt;br /&gt;
 *********************************************************************************************************&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
 ; on text event: regex check for messages containing youtube.com or youtu.be, match the URL&lt;br /&gt;
 on $*:TEXT:/(youtu\.be\/.*?(\s|$)|youtube\.com\/.*?(\s|$))/:#foo,#bar:{&lt;br /&gt;
 &lt;br /&gt;
   ; use another regex to extract the video ID from the matched URL&lt;br /&gt;
   [[noop]] [[$regex]]([[$regml]](1),/(\?v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]{11})/)&lt;br /&gt;
 &lt;br /&gt;
   ; call the youtube script with the channel and the video ID, if there is one&lt;br /&gt;
   youtube [[$$]][[$regml|regml]](2) [[$chan_(remote)|$chan]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ; alias youtube: opens a socket connection to youtube&lt;br /&gt;
 ; expects: youtube video ID as $1, #channel as $2&lt;br /&gt;
 ; returns: -&lt;br /&gt;
 [[alias]] -l youtube {&lt;br /&gt;
   ; create a unique socket name to allow for multiple connections at a time&lt;br /&gt;
   [[Local_Variables|var]] %sock = youtube. [[DollarPlus|$+]] [[$ticks]]&lt;br /&gt;
   [[sockopen]] %sock gdata.youtube.com 80&lt;br /&gt;
   ; store video ID and channel in socket mark&lt;br /&gt;
   [[sockmark]] %sock [[$1-]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:SOCKOPEN:youtube.*:{&lt;br /&gt;
   ; obligatory error check&lt;br /&gt;
   [[If-Then-Else|if]] $sockerr { [[return]] }&lt;br /&gt;
 &lt;br /&gt;
   ; send our request&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] GET /feeds/mobile/videos/ [[DollarPlus|$+]] [[$gettok]]([[$sock]]([[$sockname]]).mark,1,32) [[DollarPlus|$+]] ?v=2&amp;amp;prettyprint=true HTTP/1.1&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] Host: [[$sock]]([[$sockname]]).addr&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] [[$crlf]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:SOCKREAD:youtube.*:{&lt;br /&gt;
   [[If-Then-Else|if]] $sockerr { [[return]] }&lt;br /&gt;
 &lt;br /&gt;
   ; receive answer to the request into a variable&lt;br /&gt;
   [[Local_Variables|var]] %data | [[Sockread|sockread]] %data&lt;br /&gt;
 &lt;br /&gt;
   ; while there&#039;s bytes in the sockread buffer...&lt;br /&gt;
   [[while]] $sockbr {&lt;br /&gt;
 &lt;br /&gt;
     ; extract things of interest out of the source code into a hash table&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;title&amp;gt;*&amp;lt;/title&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] title [[$regsubex]](%data,/(.*&amp;lt;title&amp;gt;|&amp;lt;/title&amp;gt;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:duration seconds=&#039;*&#039;/&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] dur [[$duration]]([[$regsubex]](%data,/(.*seconds=&#039;|&#039;/&amp;gt;.*)/g,),3) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:statistics favoriteCount=&#039;*&#039; viewCount=&#039;*&#039;/&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] views [[$regsubex]](%data,/(.*viewCount=&#039;|&#039;/&amp;gt;)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:rating numDislikes=&#039;*&#039; numLikes=&#039;*&#039;/&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] likes [[$regsubex]](%data,/(.*numLikes=&#039;|&#039;/&amp;gt;.*)/g,) | [[hadd]] -m [[$sockname]] dislikes [[$regsubex]](%data,/(.*numDislikes=&#039;|&#039;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;name&amp;gt;*&amp;lt;/name&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] uploader [[$regsubex]](%data,/(.*&amp;lt;name&amp;gt;|&amp;lt;/name&amp;gt;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:uploaded&amp;gt;*&amp;lt;/yt:uploaded&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] uploaded [[$left]]([[$regsubex]](%data,/(.*&amp;lt;yt:uploaded&amp;gt;|&amp;lt;/yt:uploaded&amp;gt;.*)/g,),10) }&lt;br /&gt;
 &lt;br /&gt;
     ; if we have seven items in our hash table, we have all data we need&lt;br /&gt;
     [[If-Then-Else|if]] [[$hget]]([[$sockname]],0).item == 7 {&lt;br /&gt;
       [[Local_Variables|var]] %t = [[$sockname]]&lt;br /&gt;
       [[msg]] [[$gettok]]([[$sock]]([[$sockname]]).mark,2,32) &#039; [[DollarPlus|$+]] [[$hget]](%t,title) [[DollarPlus|$+]] &#039; by [[$hget]](%t,uploader) [[DollarPlus|$+]] , [[$hget]](%t,dur) [[DollarPlus|$+]] , [[$hget]](%t,views) views, rating: [[$round]]([[$calc]]([[$hget]](%t,likes) / ([[$hget]](%t,likes) + [[$hget]](%t,dislikes)) * 100),1) [[DollarPlus|$+]] % ( [[DollarPlus|$+]] [[$hget]](%t,likes) [[DollarPlus|$+]] / [[DollarPlus|$+]] [[$hget]](%t,dislikes) [[DollarPlus|$+]] )&lt;br /&gt;
       [[sockclose]] %t&lt;br /&gt;
       [[hfree]] %t&lt;br /&gt;
       [[return]]&lt;br /&gt;
     }&lt;br /&gt;
     [[Sockread|sockread]] %data&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Archive]]&lt;br /&gt;
&lt;br /&gt;
{{Author|Jay2k1}}&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=YouTube_parser&amp;diff=6003</id>
		<title>YouTube parser</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=YouTube_parser&amp;diff=6003"/>
		<updated>2013-07-10T18:13:56Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: Created page with &amp;quot;As the description says, this script retrieves information about youtube videos from the YouTube API and posts them to the channel whenever a youtube link is posted. You can i...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As the description says, this script retrieves information about youtube videos from the YouTube API and posts them to the channel whenever a youtube link is posted. You can install it by opening the script editor (Alt+R), creating a new script file (File -&amp;gt; New) and then copy paste the script into it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Make sure to replace the channels (#foo,#bar) in the &#039;&#039;on TEXT&#039;&#039; event line with the channels you want the script to be active in.&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
 ********************************************************************************************************&lt;br /&gt;
 * &lt;br /&gt;
 *  youtube.mrc by Jay2k1 @ QuakeNet, 2013&lt;br /&gt;
 * &lt;br /&gt;
 *  Whenever a youtube link is posted in the channels #foo or #bar, this script retrieves the video&#039;s details&lt;br /&gt;
 *  from the youtube API and post them to the channel. It looks like this:&lt;br /&gt;
 * &lt;br /&gt;
 *  &amp;lt;Jay2k1&amp;gt; http://www.youtube.com/watch?v=oHg5SJYRHA0&lt;br /&gt;
 *  &amp;lt;Bot&amp;gt; &#039;RickRoll&#039; by cotter548, 00:03:34, 68213084 views, rating: 87% (259236/38751)&lt;br /&gt;
 * &lt;br /&gt;
 *********************************************************************************************************&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
 ; on text event: regex check for messages containing youtube.com or youtu.be, match the URL&lt;br /&gt;
 on $*:TEXT:/(youtu\.be\/.*?(\s|$)|youtube\.com\/.*?(\s|$))/:#foo,#bar:{&lt;br /&gt;
 &lt;br /&gt;
   ; use another regex to extract the video ID from the matched URL&lt;br /&gt;
   [[noop]] [[$regex]]([[$regml]](1),/(\?v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]{11})/)&lt;br /&gt;
 &lt;br /&gt;
   ; call the youtube script with the channel and the video ID, if there is one&lt;br /&gt;
   youtube [[$$]][[regml]](2) [[$chan_(remote)|$chan]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ; alias youtube: opens a socket connection to youtube&lt;br /&gt;
 ; expects: youtube video ID as $1, #channel as $2&lt;br /&gt;
 ; returns: -&lt;br /&gt;
 [[alias]] -l youtube {&lt;br /&gt;
   ; create a unique socket name to allow for multiple connections at a time&lt;br /&gt;
   [[Local_Variables|var]] %sock = youtube. [[DollarPlus|$+]] [[$ticks]]&lt;br /&gt;
   [[sockopen]] %sock gdata.youtube.com 80&lt;br /&gt;
   ; store video ID and channel in socket mark&lt;br /&gt;
   [[sockmark]] %sock [[$1-]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:SOCKOPEN:youtube.*:{&lt;br /&gt;
   ; obligatory error check&lt;br /&gt;
   [[If-Then-Else|if]] $sockerr { [[return]] }&lt;br /&gt;
 &lt;br /&gt;
   ; send our request&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] GET /feeds/mobile/videos/ [[DollarPlus|$+]] [[$gettok]]([[$sock]]([[$sockname]]).mark,1,32) [[DollarPlus|$+]] ?v=2&amp;amp;prettyprint=true HTTP/1.1&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] Host: [[$sock]]([[$sockname]]).addr&lt;br /&gt;
   [[sockwrite]] -n [[$sockname]] [[$crlf]]&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 on *:SOCKREAD:youtube.*:{&lt;br /&gt;
   [[If-Then-Else|if]] $sockerr { [[return]] }&lt;br /&gt;
 &lt;br /&gt;
   ; receive answer to the request into a variable&lt;br /&gt;
   [[Local_Variables|var]] %data | [[Sockread|sockread]] %data&lt;br /&gt;
 &lt;br /&gt;
   ; while there&#039;s bytes in the sockread buffer...&lt;br /&gt;
   [[while]] $sockbr {&lt;br /&gt;
 &lt;br /&gt;
     ; extract things of interest out of the source code into a hash table&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;title&amp;gt;*&amp;lt;/title&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] title [[$regsubex]](%data,/(.*&amp;lt;title&amp;gt;|&amp;lt;/title&amp;gt;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:duration seconds=&#039;*&#039;/&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] dur [[$duration]]([[$regsubex]](%data,/(.*seconds=&#039;|&#039;/&amp;gt;.*)/g,),3) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:statistics favoriteCount=&#039;*&#039; viewCount=&#039;*&#039;/&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] views [[$regsubex]](%data,/(.*viewCount=&#039;|&#039;/&amp;gt;)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:rating numDislikes=&#039;*&#039; numLikes=&#039;*&#039;/&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] likes [[$regsubex]](%data,/(.*numLikes=&#039;|&#039;/&amp;gt;.*)/g,) | [[hadd]] -m [[$sockname]] dislikes [[$regsubex]](%data,/(.*numDislikes=&#039;|&#039;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;name&amp;gt;*&amp;lt;/name&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] uploader [[$regsubex]](%data,/(.*&amp;lt;name&amp;gt;|&amp;lt;/name&amp;gt;.*)/g,) }&lt;br /&gt;
     [[If-Then-Else|if]] (*&amp;lt;yt:uploaded&amp;gt;*&amp;lt;/yt:uploaded&amp;gt;* iswm %data) { [[hadd]] -m [[$sockname]] uploaded [[$left]]([[$regsubex]](%data,/(.*&amp;lt;yt:uploaded&amp;gt;|&amp;lt;/yt:uploaded&amp;gt;.*)/g,),10) }&lt;br /&gt;
 &lt;br /&gt;
     ; if we have seven items in our hash table, we have all data we need&lt;br /&gt;
     [[If-Then-Else|if]] [[$hget]]([[$sockname]],0).item == 7 {&lt;br /&gt;
       [[Local_Variables|var]] %t = [[$sockname]]&lt;br /&gt;
       [[msg]] [[$gettok]]([[$sock]]([[$sockname]]).mark,2,32) &#039; [[DollarPlus|$+]] [[$hget]](%t,title) [[DollarPlus|$+]] &#039; by [[$hget]](%t,uploader) [[DollarPlus|$+]] , [[$hget]](%t,dur) [[DollarPlus|$+]] , [[$hget]](%t,views) views, rating: [[$round]]([[$calc]]([[$hget]](%t,likes) / ([[$hget]](%t,likes) + [[$hget]](%t,dislikes)) * 100),1) [[DollarPlus|$+]] % ( [[DollarPlus|$+]] [[$hget]](%t,likes) [[DollarPlus|$+]] / [[DollarPlus|$+]] [[$hget]](%t,dislikes) [[DollarPlus|$+]] )&lt;br /&gt;
       [[sockclose]] %t&lt;br /&gt;
       [[hfree]] %t&lt;br /&gt;
       [[return]]&lt;br /&gt;
     }&lt;br /&gt;
     [[Sockread|sockread]] %data&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Archive]]&lt;br /&gt;
&lt;br /&gt;
{{Author|Jay2k1}}&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$ifmatch&amp;diff=5993</id>
		<title>$ifmatch</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$ifmatch&amp;diff=5993"/>
		<updated>2013-06-28T15:05:50Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: grammar naziing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Returns the first parameter of an if-then-else comparison.&lt;br /&gt;
 $ifmatch&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; $ifmatch is deprecated and has been replaced by &#039;&#039;$v1&#039;&#039; and &#039;&#039;$v2&#039;&#039;.  You should switch to using &#039;&#039;$v1&#039;&#039; and &#039;&#039;$v2&#039;&#039; in case $ifmatch is no longer supported in future versions.&lt;br /&gt;
&lt;br /&gt;
== $v1 &amp;amp; $v2 ==&lt;br /&gt;
These return the first and second parameters of an if-then-else comparison.&lt;br /&gt;
 $v1&lt;br /&gt;
 $v2&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
 [[If-Then-Else|if]] ([[$banmask]] [[If-Then-Else#iswm|iswm]] [[$ial]]([[$me]])) { [[echo]] -ag The ban mask $v1 matches my mask of $v2 }&lt;br /&gt;
The above example is a snippet that could be used inside an [[On ban]] event, which will check to see if the ban mask set matches your host mask.&lt;br /&gt;
If the comparison is successful $v2 is set to your [[:Category:IAL|IAL&#039;s]] host mask.&lt;br /&gt;
&lt;br /&gt;
[[Category:Remote Identifiers]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Template:User_fr&amp;diff=5977</id>
		<title>Template:User fr</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Template:User_fr&amp;diff=5977"/>
		<updated>2013-06-22T21:35:56Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: fixed encoding issue&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Category:Stubs&amp;diff=5967</id>
		<title>Category:Stubs</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Category:Stubs&amp;diff=5967"/>
		<updated>2013-06-22T20:48:38Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: Added to wiki category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The articles in this category is concidered incomplete by their authors. This means even the user writting it knew that there were missing certain things. Once these articles individually contain all the information related to them the stub templates in them may be removed.&lt;br /&gt;
&lt;br /&gt;
A list of pages of commands, identifiers and events that are still missing can be found here: [[Missing pages]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Wiki]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=$input&amp;diff=5957</id>
		<title>$input</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=$input&amp;diff=5957"/>
		<updated>2013-06-22T14:53:50Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: /* Options */ removed beta notice from b option&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Input is a multi-purpose identifier for requesting input from a user in an auto-rendered pop up dialog, similar to [[$?]].&lt;br /&gt;
&lt;br /&gt;
 $input(prompt [,options] [,window] [,title] [,text])&lt;br /&gt;
&lt;br /&gt;
* Prompt is the text you wish to display to the user. This is usually to tell the user what you wish to be inputted. You may use a [[$crlf]] to force a line break.&lt;br /&gt;
* Options is a list of option flags. Defaults to an &amp;quot;OK&amp;quot; and &amp;quot;Cancel&amp;quot; button which return [[$true]] or [[$false]] respetively.&lt;br /&gt;
* Window is the name of the window to be used as parent window.&lt;br /&gt;
* Title is the title you wish to give the input dialog box.&lt;br /&gt;
* Text is the default text to be entered when used with &amp;quot;e&amp;quot;&lt;br /&gt;
The options, window, title, and text are optional parameters.&lt;br /&gt;
&lt;br /&gt;
==Options==&lt;br /&gt;
&amp;lt;table border=1 rules=all cellpadding=4&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;e&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Show an editbox for input. &amp;quot;OK&amp;quot; and &amp;quot;Cancel&amp;quot; are default buttons. [[$null]] is returned if &amp;quot;Cancel&amp;quot; is pressed, and the text is returned if &amp;quot;OK&amp;quot; is pressed.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;p&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Show input password editbox. (Replaces text in editbox with stars)&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;o&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Show an &amp;quot;OK&amp;quot; button.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;y&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Show a &amp;quot;Yes&amp;quot; and &amp;quot;No&amp;quot; button.&amp;lt;br&amp;gt;&lt;br /&gt;
* When used with e, returns the text or [[$null]] respectively.&lt;br /&gt;
* When used without e, returns [[$true]] or [[$false]] respectively.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;n&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Show a &amp;quot;Yes&amp;quot; &amp;quot;No&amp;quot; and &amp;quot;Cancel&amp;quot; button.&amp;lt;br&amp;gt;&lt;br /&gt;
* When used with e, returns the text, [[$null]] or [[$null]] respectively.&amp;lt;br&amp;gt;&lt;br /&gt;
* When used without e, returns [[$true]] [[$false]] and [[$null]] respectively.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;r&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Show a &amp;quot;Retry&amp;quot; and &amp;quot;Cancel&amp;quot; button.&amp;lt;br&amp;gt;&lt;br /&gt;
* When used with e, returns the text or [[$null]] respectively.&amp;lt;br&amp;gt;&lt;br /&gt;
* When used without e, returns [[$true]] or [[$false]] respectively.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;v&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Return &amp;quot;$ok&amp;quot; &amp;quot;$yes&amp;quot; &amp;quot;$no&amp;quot; &amp;quot;$retry&amp;quot; or &amp;quot;$cancel&amp;quot; instead of [[$true]] or [[$false]]. Does not work when used with e.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;g&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Aligns buttons to the right instead of centering them.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;b&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Disables buttons for a second when dialog is displayed.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;iqwhct&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Shows the info, question, warning, hand, delete and star icons respectively.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;d&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Plays system sound associated with the specified icons.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;s&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Indicates that a window has been specified.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;a&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Actives the input dialog automatically.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;u&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Uses the current window as the parent. Do not use with &amp;quot;s&amp;quot; or if a window has been indicated.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;kN&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Gives the user N seconds to respond. If they do not, either [[$null]] is returned (when used with e), $timeout is returned (used with v), or $false is returned.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;m&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Indicates that multiple text parameters have been specified. They will be displayed in a combobox. The first text item is the default item (a reference to an item in the list), the rest are the items in the list.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Note==&lt;br /&gt;
This identifier cannot be used in a script event. One way around this is to use /[[scon]] or a /[[timer]] to initiate an input request after the script ends. &amp;lt;br /&amp;gt;&lt;br /&gt;
Example: &lt;br /&gt;
 on *:text:Foo:#:{ /timer 1 0 echo -a $?=&amp;quot;Bar?&amp;quot; }&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[$?]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Remote Identifiers]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=How_to_make_your_own_theme&amp;diff=5948</id>
		<title>How to make your own theme</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=How_to_make_your_own_theme&amp;diff=5948"/>
		<updated>2013-06-22T13:18:19Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: /* Miscellaneous */ fixed padding examples, added hint for padding mode prefix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=User:Jay2k1&amp;diff=5947</id>
		<title>User:Jay2k1</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=User:Jay2k1&amp;diff=5947"/>
		<updated>2013-06-22T11:45:57Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: Created page with &amp;quot;{{Babel-2|de|en-3}}  &amp;lt;table border=&amp;quot;0&amp;quot;&amp;gt; &amp;lt;tr&amp;gt; &amp;lt;td&amp;gt;Image:sgthartman.png&amp;lt;/td&amp;gt; &amp;lt;td&amp;gt;   &amp;lt;table border=&amp;quot;0&amp;quot;&amp;gt;   &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Age&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;{{age|1984|4|9}}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;   &amp;lt;tr valign=&amp;quot;...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Babel-2|de|en-3}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table border=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;[[Image:sgthartman.png]]&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
  &amp;lt;table border=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Age&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;{{age|1984|4|9}}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr valign=&amp;quot;top&amp;quot; height=&amp;quot;40&amp;quot;&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Country&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Germany&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Words of wisdom&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Coffee!&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
[[Category:Members]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=File:Sgthartman.png&amp;diff=5946</id>
		<title>File:Sgthartman.png</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=File:Sgthartman.png&amp;diff=5946"/>
		<updated>2013-06-22T11:45:28Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: User Avatar of Jay2k1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;User Avatar of Jay2k1&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Pushmode&amp;diff=5801</id>
		<title>Pushmode</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Pushmode&amp;diff=5801"/>
		<updated>2013-06-22T00:40:13Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: pushmode script by wiebe. Queues and dumps modes together as much as possible.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUSHMODE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 ;info:&lt;br /&gt;
 ;&lt;br /&gt;
 ;  by wiebe @ QuakeNet&lt;br /&gt;
 ;  version 1.31     (written and tested on mIRC 6.15)&lt;br /&gt;
 ;&lt;br /&gt;
 ;  last edit: Fri Apr 30 2004&lt;br /&gt;
 ;&lt;br /&gt;
 ;&lt;br /&gt;
 ;What does this script do?&lt;br /&gt;
 ;&lt;br /&gt;
 ;  Queues and dumps modes together as much as possible.&lt;br /&gt;
 ;&lt;br /&gt;
 ;&lt;br /&gt;
 ;Some examples:&lt;br /&gt;
 ;&lt;br /&gt;
 ;  Example 1: from within same command&lt;br /&gt;
 ;  voicing some users with the following command:&lt;br /&gt;
 ;   //var %x = $nick($chan,0,r) | while (%x) { mode $chan +v $nick($chan,%x,r) | dec %x }&lt;br /&gt;
 ;  and this happens:&lt;br /&gt;
 ;&lt;br /&gt;
 ;   [18:45:32] * dev-mirc sets mode: +v zyrtepf&lt;br /&gt;
 ;   [18:45:32] * dev-mirc sets mode: +v zcttchv&lt;br /&gt;
 ;   [18:45:32] * dev-mirc sets mode: +v yznzko&lt;br /&gt;
 ;   [18:45:32] * dev-mirc sets mode: +v yuxf&lt;br /&gt;
 ;   [18:45:32] * dev-mirc sets mode: +v twyqh&lt;br /&gt;
 ;   [18:45:34] * dev-mirc sets mode: +v pitqxpg&lt;br /&gt;
 ;   [18:45:36] * dev-mirc sets mode: +v nsln&lt;br /&gt;
 ;   [18:45:38] * dev-mirc sets mode: +v moypfnk&lt;br /&gt;
 ;   [18:45:40] * dev-mirc sets mode: +v gibuhee&lt;br /&gt;
 ;   [18:45:42] * dev-mirc sets mode: +v evuwntm&lt;br /&gt;
 ;&lt;br /&gt;
 ;  This sends a mode command +v &amp;lt;nick&amp;gt; for each nick&lt;br /&gt;
 ;&lt;br /&gt;
 ;  Now we do the same but with pushmode instead of the normal mode command:&lt;br /&gt;
 ;   //var %x = $nick($chan,0,r) | while (%x) { pushmode $chan +v $nick($chan,%x,r) | dec %x }&lt;br /&gt;
 ;  and this happens:&lt;br /&gt;
 ;&lt;br /&gt;
 ;   [18:48:03] * dev-mirc sets mode: +vvvvvv zyrtepf zcttchv yznzko yuxf twyqh pitqxpg&lt;br /&gt;
 ;   [18:48:04] * dev-mirc sets mode: +vvvv nsln moypfnk gibuhee evuwntm&lt;br /&gt;
 ;&lt;br /&gt;
 ;  The modes were now pushed together, so only 2 mode commands are needed instead of 10&lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 ;&lt;br /&gt;
 ;  Example 2: the same event repeated&lt;br /&gt;
 ;  An normal anti-flood script for example does this:&lt;br /&gt;
 ;&lt;br /&gt;
 ;   [18:23:32] &amp;lt;zcttchv&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITHOUT PUSHMODE&lt;br /&gt;
 ;   [18:23:32] &amp;lt;evuwntm&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITHOUT PUSHMODE&lt;br /&gt;
 ;   [18:23:32] &amp;lt;moypfnk&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITHOUT PUSHMODE&lt;br /&gt;
 ;   [18:23:33] &amp;lt;zyrtepf&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITHOUT PUSHMODE&lt;br /&gt;
 ;   [18:23:33] &amp;lt;gibuhee&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITHOUT PUSHMODE&lt;br /&gt;
 ;   [18:23:33] &amp;lt;yznzko&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITHOUT PUSHMODE&lt;br /&gt;
 ;   [18:23:33] &amp;lt;yuxf&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITHOUT PUSHMODE&lt;br /&gt;
 ;   [18:23:33] &amp;lt;pitqxpg&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITHOUT PUSHMODE&lt;br /&gt;
 ;   [18:23:33] &amp;lt;nsln&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITHOUT PUSHMODE&lt;br /&gt;
 ;   [18:23:33] &amp;lt;twyqh&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITHOUT PUSHMODE&lt;br /&gt;
 ;   [18:23:33] * dev-mirc sets mode: +b *!*qgeqd@8V5Ry4.8vtU30.virtual&lt;br /&gt;
 ;   [18:23:33] * dev-mirc sets mode: +b *!*ihgkzu@8V5Ry4.8vtU30.virtual&lt;br /&gt;
 ;   [18:23:33] * dev-mirc sets mode: +b *!*dqqyex@8V5Ry4.8vtU30.virtual&lt;br /&gt;
 ;   [18:23:36] * dev-mirc sets mode: +b *!*qfzzq@8V5Ry4.8vtU30.virtual&lt;br /&gt;
 ;   [18:23:40] * dev-mirc sets mode: +b *!*alavec@8V5Ry4.8vtU30.virtual&lt;br /&gt;
 ;   [18:23:44] * dev-mirc sets mode: +b *!*avwy@8V5Ry4.8vtU30.virtual&lt;br /&gt;
 ;   [18:23:48] * dev-mirc sets mode: +b *!*tqkukhp@8V5Ry4.8vtU30.virtual&lt;br /&gt;
 ;   [18:23:52] * dev-mirc sets mode: +b *!*xrvdohn@8V5Ry4.8vtU30.virtual&lt;br /&gt;
 ;   [18:23:56] * dev-mirc sets mode: +b *!*ujundvh@8V5Ry4.8vtU30.virtual&lt;br /&gt;
 ;   [18:24:00] * dev-mirc sets mode: +b *!*kid@8V5Ry4.8vtU30.virtual&lt;br /&gt;
 ;&lt;br /&gt;
 ;  The anti-flood script sends each ban with a mode command&lt;br /&gt;
 ;&lt;br /&gt;
 ;  The same script using pushmode does the following:&lt;br /&gt;
 ;&lt;br /&gt;
 ;   [18:25:11] &amp;lt;zcttchv&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITH PUSHMODE&lt;br /&gt;
 ;   [18:25:11] &amp;lt;evuwntm&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITH PUSHMODE&lt;br /&gt;
 ;   [18:25:11] &amp;lt;moypfnk&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITH PUSHMODE&lt;br /&gt;
 ;   [18:25:11] &amp;lt;zyrtepf&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITH PUSHMODE&lt;br /&gt;
 ;   [18:25:11] &amp;lt;gibuhee&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITH PUSHMODE&lt;br /&gt;
 ;   [18:25:11] &amp;lt;yznzko&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITH PUSHMODE&lt;br /&gt;
 ;   [18:25:11] &amp;lt;yuxf&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITH PUSHMODE&lt;br /&gt;
 ;   [18:25:11] &amp;lt;pitqxpg&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITH PUSHMODE&lt;br /&gt;
 ;   [18:25:11] &amp;lt;nsln&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITH PUSHMODE&lt;br /&gt;
 ;   [18:25:12] &amp;lt;twyqh&amp;gt; AVERAGE ANTI FLOOD SCRIPT WITH PUSHMODE&lt;br /&gt;
 ;   [18:25:12] * dev-mirc sets mode: +bbbbbb *!*qgeqd@8V5Ry4.8vtU30.virtual *!*ihgkzu@8V5Ry4.8vtU30.virtual *!*dqqyex@8V5Ry4.8vtU30.virtual *!*qfzzq@8V5Ry4.8vtU30.virtual *!*alavec@8V5Ry4.8vtU30.virtual *!*avwy@8V5Ry4.8vtU30.virtual&lt;br /&gt;
 ;   [18:25:13] * dev-mirc sets mode: +bbbb *!*tqkukhp@8V5Ry4.8vtU30.virtual *!*xrvdohn@8V5Ry4.8vtU30.virtual *!*ujundvh@8V5Ry4.8vtU30.virtual *!*kid@8V5Ry4.8vtU30.virtual&lt;br /&gt;
 ;&lt;br /&gt;
 ;  The anti-flood script sends the modes to pushmode, which turns 10 mode commands into 2&lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 ;&lt;br /&gt;
 ;  Example 3: multiple events&lt;br /&gt;
 ;  Some form of a bitchmode script:&lt;br /&gt;
 ;&lt;br /&gt;
 ;   on @!*:op:#channel:{ if ($opnick != $me) { mode $chan -o $opnick } }&lt;br /&gt;
 ;   on @!*:voice:#channel:{ if ($vnick != $me) { mode $chan -v $vnick } }&lt;br /&gt;
 ;   on @!*:help:#channel:{ if ($hnick != $me) { mode $chan -h $hnick } }&lt;br /&gt;
 ;   on @!*:mode:#channel:{&lt;br /&gt;
 ;     if (n isincs $1) &amp;amp;&amp;amp; (n !isincs $gettok($chan($chan).mode,1,32)) { mode $chan +n }&lt;br /&gt;
 ;     if (t isincs $1) &amp;amp;&amp;amp; (t !isincs $gettok($chan($chan).mode,1,32)) { mode $chan +t }&lt;br /&gt;
 ;   }&lt;br /&gt;
 ;&lt;br /&gt;
 ;   [13:54:31] * wiebe sets mode: -nt+ovh nick1 nick2 nick3&lt;br /&gt;
 ;   [13:54:31] * dev-mirc sets mode: +n&lt;br /&gt;
 ;   [13:54:31] * dev-mirc sets mode: +t&lt;br /&gt;
 ;   [13:54:31] * dev-mirc sets mode: -o nick1&lt;br /&gt;
 ;   [13:54:31] * dev-mirc sets mode: -v nick2&lt;br /&gt;
 ;   [13:54:31] * dev-mirc sets mode: -h nick3&lt;br /&gt;
 ;&lt;br /&gt;
 ;  With pushmode:&lt;br /&gt;
 ;&lt;br /&gt;
 ;   on @!*:op:#channel:{ if ($opnick != $me) { pushmode $chan -o $opnick } }&lt;br /&gt;
 ;   on @!*:voice:#channel:{ if ($vnick != $me) { pushmode $chan -v $vnick } }&lt;br /&gt;
 ;   on @!*:help:#channel:{ if ($hnick != $me) { pushmode $chan -h $hnick } }&lt;br /&gt;
 ;   on @!*:mode:#channel:{&lt;br /&gt;
 ;     if (n isincs $1) &amp;amp;&amp;amp; (n !isincs $gettok($chan($chan).mode,1,32)) { pushmode $chan +n }&lt;br /&gt;
 ;     if (t isincs $1) &amp;amp;&amp;amp; (t !isincs $gettok($chan($chan).mode,1,32)) { pushmode $chan +t }&lt;br /&gt;
 ;   }&lt;br /&gt;
 ;&lt;br /&gt;
 ;   [13:55:36] * wiebe sets mode: -nt+ohv nick1 nick2 nick3&lt;br /&gt;
 ;   [13:55:36] * dev-mirc sets mode: -ohv+nt nick1 nick2 nick3&lt;br /&gt;
 ;&lt;br /&gt;
 ;  only 1 mode line needed for the 4 events&lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 ;&lt;br /&gt;
 ;&lt;br /&gt;
 ;How to use this script?&lt;br /&gt;
 ;&lt;br /&gt;
 ;  pushmode [-cdflnprswuNeM] &amp;lt;channel&amp;gt; &amp;lt;+/-mode&amp;gt; [arg]&lt;br /&gt;
 ;&lt;br /&gt;
 ;    can be used to push channel modes together, see below&lt;br /&gt;
 ;&lt;br /&gt;
 ;&lt;br /&gt;
 ;   The script has 4 different queue&#039;s,&lt;br /&gt;
 ;   a queue for single modes (like +m) is emptied everytime pushmode is sending modes&lt;br /&gt;
 ;   a faster queue, a normal queue (default) and a slower queue for modes with a parameter (like +b banmask)&lt;br /&gt;
 ;   first the faster queue is emptied, then the default queue and last the slower queue&lt;br /&gt;
 ;&lt;br /&gt;
 ;   The -n switch (next) queues the mode in the faster queue, the -l switch (low) can be used for the slower queue&lt;br /&gt;
 ;   this is only for modes with a parameter&lt;br /&gt;
 ;     pushmode #channel +v nick      adds +v nick to the default queue&lt;br /&gt;
 ;     pushmode -l #channel -v nick   adds -v nick to the slower queue&lt;br /&gt;
 ;     pushmode -n #channel +o nick   adds +o nick to the faster queue&lt;br /&gt;
 ;&lt;br /&gt;
 ;   The -c switch (clear) can be used to clear the queues&lt;br /&gt;
 ;   the -l (low), -d (default), -n (next) and -s (single) switch&lt;br /&gt;
 ;   can be used to clear a specific queue or multiple queues&lt;br /&gt;
 ;     pushmode -c                    clears all queues for all channels&lt;br /&gt;
 ;     pushmode -dc                   clears the default queue for all channels&lt;br /&gt;
 ;     pushmode -nc #channel          clears the faster queue for #channel&lt;br /&gt;
 ;     pushmode -cs #channel          clears the single queue for #channel&lt;br /&gt;
 ;     pushmode -cdl #channel         clears the default and slower queue for #channel&lt;br /&gt;
 ;&lt;br /&gt;
 ;   The -f switch (flush) starts to empty the queue at once without waiting for the timer to start it&lt;br /&gt;
 ;     pushmode -f                    starts pushmode for all channels&lt;br /&gt;
 ;     pushmode -f #channel           starts pushmode for #channel&lt;br /&gt;
 ;     pushmode -f #channel +o nick   starts pushmode for #channel after adding +o nick to the queue&lt;br /&gt;
 ;&lt;br /&gt;
 ;   The -p switch (passive) can be used to only add a mode to the queue,&lt;br /&gt;
 ;   but it will not cause pushmode to empty the queue,&lt;br /&gt;
 ;   this mode will be send the next time pushmode is dumping modes&lt;br /&gt;
 ;   or when the number of modes in the queues equals $modespl &lt;br /&gt;
 ;     pushmode -p #channel +b                queues in the default queue and&lt;br /&gt;
 ;                                            sends +b (request banlist) the next time pushmode is dumping modes&lt;br /&gt;
 ;     pushmode -p #channel -b *!*@host.com   queues in the default queue and&lt;br /&gt;
 ;                                            sends -b *!*@host.com the next chance it gets&lt;br /&gt;
 ;&lt;br /&gt;
 ;   The -r switch (remove) removes a mode from the queue,&lt;br /&gt;
 ;   the -l (low), -d (default) and -n (next) switch&lt;br /&gt;
 ;   can be used to remove a mode from a specific queue or from multiple queues&lt;br /&gt;
 ;   when combined with the -w a wildcardmatch is done&lt;br /&gt;
 ;   if you want to clear the entire queue, it is better (read faster) to use the -c switch&lt;br /&gt;
 ;   usefull when you want to set a key with pushmode and you first clear any +k and -k modes&lt;br /&gt;
 ;     pushmode -dr #channel +b *!*@host.com    removes +b *!*@host.com from the default queue&lt;br /&gt;
 ;     pushmode -r #channel +v nick             removes +v nick from all queues&lt;br /&gt;
 ;     pushmode -rw #channel +b *               removes all bans from all queues&lt;br /&gt;
 ;     pushmode -rw #channel +?                 removes all single + modes from the queue&lt;br /&gt;
 ;     pushmode -rdl #channel +k key            removes +k key from the default and slower queue&lt;br /&gt;
 ;&lt;br /&gt;
 ;   The -uN switch can be used to remove a ban after N seconds using pushmode&lt;br /&gt;
 ;   using 0 for N, makes the script remove the ban from the internal tempban list&lt;br /&gt;
 ;   this will not remove the ban from the channel&lt;br /&gt;
 ;     pushmode -u120 #channel +b *!*@host.com        removes the ban *!*@host.com after 120 seconds&lt;br /&gt;
 ;     pushmode -u0 #channel +b *!*@leave.this.ban    removes *!*@leave.this.ban from the internal tempban list&lt;br /&gt;
 ;&lt;br /&gt;
 ;   The -eM switch (expire) removes the mode from the queue after M seconds,&lt;br /&gt;
 ;   so if the mode is not send within M seconds, it will not be send&lt;br /&gt;
 ;     pushmode -e10 #channel +m      mode +m will only be send within 10 seconds or not&lt;br /&gt;
 ;     pushmode -e60 #channel +l 100  mode +l 100 will only be send within 60 seconds or not&lt;br /&gt;
 ;&lt;br /&gt;
 ;   Combinations are possible, for example:&lt;br /&gt;
 ;     pushmode -nfpe60u600 #channel +b *!*user@*.host.com&lt;br /&gt;
 ;&lt;br /&gt;
 ;   The script can voice/devoice users even if they changed nick since the mode was in the queue&lt;br /&gt;
 ;   this can be done by giving nick!user@host as parameter&lt;br /&gt;
 ;   the default settings makes the script understand that @%+ is ohv, if you are on a server with additional&lt;br /&gt;
 ;   modes which can be set on users on a channel, you have to edit the prefix setting below&lt;br /&gt;
 ;   the target needs to be in your IAL list for this to work&lt;br /&gt;
 ;   the script adds/removes a tag to the IAL using ialmark and finds the nick when sending the mode&lt;br /&gt;
 ;   other scripts using ialmark may break this part&lt;br /&gt;
 ;&lt;br /&gt;
 ;     pushmode #channel +v goober!~bla@123.abc.isp.com                  will voice the user goober, even if he would&lt;br /&gt;
 ;                                                                       change nick before the mode is send&lt;br /&gt;
 ;&lt;br /&gt;
 ;     pushmode #channel -h somenick!someuser@abc.users.undernet.org     dehalfops somenick, even if he would&lt;br /&gt;
 ;                                                                       change nick before the mode is send&lt;br /&gt;
 ;&lt;br /&gt;
 ;     pushmode #channel +o dev-mirc!dev-mirc@def.users.quakenet.org     will op dev-mirc, even if he would&lt;br /&gt;
 ;                                                                       change nick before the mode is send&lt;br /&gt;
 ;&lt;br /&gt;
 ;&lt;br /&gt;
 ;  pushuser &amp;lt;+/-mode&amp;gt; [arg]&lt;br /&gt;
 ;&lt;br /&gt;
 ;    can be used for usermodes, usefull if you have several scripts setting usermodes on connect&lt;br /&gt;
 ;    pushuser will send them all at once instead of N times a mode command&lt;br /&gt;
 ;&lt;br /&gt;
 ;&lt;br /&gt;
 ;  Pushmode (pushuser) can only take 1 mode at a time&lt;br /&gt;
 ;  The - or + needs to be included&lt;br /&gt;
 ;  The script does not allow duplicates in the same queue&lt;br /&gt;
 ;  Temp bans work only if nick!user@host format is used (like *!*@host.com and not *host.com or just host.com)&lt;br /&gt;
 ;    this is because of the isban operator&lt;br /&gt;
 ;&lt;br /&gt;
 ;  Script is uses $modespl (MODES= setting),&lt;br /&gt;
 ;  here meaning how many parameter modes (like +b banmask) can be put into 1 line&lt;br /&gt;
 ;  the number of modes without parameter (like +m) is unlimited&lt;br /&gt;
 ;  if you want to use this script on a server where this is different, you have to change the script a bit&lt;br /&gt;
 ;  see the pushmode.dump alias&lt;br /&gt;
 ;&lt;br /&gt;
 ;  Some checks are done on the modes, like if the mode exists, if the mode makes &amp;quot;sense&amp;quot; etc.&lt;br /&gt;
 ;  it uses $chanmodes (with b,k,l,imnpst as default modes), checks op/halfop status.&lt;br /&gt;
 ;  you can see the checks and change them in the pushmode.dump alias&lt;br /&gt;
 ;&lt;br /&gt;
 ;&lt;br /&gt;
 ;What use has this script?&lt;br /&gt;
 ;&lt;br /&gt;
 ;  not only can you simply &#039;queue&#039; mode changes from within the same event or script&lt;br /&gt;
 ;  but mode changes by all scripts can be pushed together&lt;br /&gt;
 ;&lt;br /&gt;
 ;&lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHMODE.DELAY ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 ; when first called, the script will wait N seconds before sending a mode change&lt;br /&gt;
 [[alias]] -l pushmode.delay {&lt;br /&gt;
   [[return]] 1&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHMODE.RESTART ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 ; set here the delay (seconds) pushmode should have between multiple mode lines&lt;br /&gt;
 ; after sending a mode change and there are items left in the queue,&lt;br /&gt;
 ; it will wait N seconds before sending the next mode change&lt;br /&gt;
 alias -l pushmode.restart {&lt;br /&gt;
   return 2&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHMODE.BAN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 ; set here the delay (seconds) for checking which bans are to be unset&lt;br /&gt;
 ; a timer runs with this interval&lt;br /&gt;
 ; it checks the temp bans set by this script for all channels and unbans them with pushmode&lt;br /&gt;
 ; settings this to 600 (10 min) for example, makes a temp ban set for 5min being unset after 5~15 minutes&lt;br /&gt;
 ; so this setting defines how accurate the time of a temp ban is&lt;br /&gt;
 alias -l pushmode.ban {&lt;br /&gt;
   return 600&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHMODE.PREFIX ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 ; set here what modes can be set on a user on a channel (this is NOT b or any other list mode)&lt;br /&gt;
 ; default @ = o, % = h, + = v&lt;br /&gt;
 ; leave empty if you dont want to use this&lt;br /&gt;
 ; if you are not sure what this is, leave it&lt;br /&gt;
 ; replace each char with their mode char, @ is o for example&lt;br /&gt;
 alias -l pushmode.prefix {&lt;br /&gt;
   return $nickmode&lt;br /&gt;
   ; should $nickmode not work, remove it and use the following line&lt;br /&gt;
   return [[$replace]]([[$prefix]],@,o,%,h,+,v)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHMODE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 ; pushmode [-cdflnprswuNeM] &amp;lt;channel&amp;gt; &amp;lt;+/-mode&amp;gt; [arg]&lt;br /&gt;
 alias pushmode {&lt;br /&gt;
   [[var]] %f, %q, %p, %e, %u&lt;br /&gt;
 &lt;br /&gt;
   ; part for switches&lt;br /&gt;
   [[if]] ([[$left]]($1,1) == -) {&lt;br /&gt;
 &lt;br /&gt;
     ; c switch is there&lt;br /&gt;
     if (c [[isin]] $1) {&lt;br /&gt;
 &lt;br /&gt;
       ; no channel&lt;br /&gt;
       if (!$2) {&lt;br /&gt;
 &lt;br /&gt;
         ; d switch is there, clear all default queues for this connection&lt;br /&gt;
         if (d isin $1) { $pushmode.queue($+($cid,.pushmode.*.default)).clear }&lt;br /&gt;
 &lt;br /&gt;
         ; n switch is there, clear all next queues for this connection&lt;br /&gt;
         if (n isin $1) { $pushmode.queue($+($cid,.pushmode.*.next)).clear }&lt;br /&gt;
 &lt;br /&gt;
         ; l switch is there, clear all low queues for this connection&lt;br /&gt;
         if (l isin $1) { $pushmode.queue($+($cid,.pushmode.*.low)).clear }&lt;br /&gt;
 &lt;br /&gt;
         ; s switch is there, clear all single queues for this connection&lt;br /&gt;
         if (s isin $1) { $pushmode.queue($+($cid,.pushmode.*.single)).clear }&lt;br /&gt;
 &lt;br /&gt;
         ; no other switches, clear all queues for this connection&lt;br /&gt;
         if (n !isin $1) &amp;amp;&amp;amp; (d !isin $1) &amp;amp;&amp;amp; (l !isin $1) &amp;amp;&amp;amp; (s !isin $1) { $pushmode.queue($+($cid,.pushmode.*)).clear }&lt;br /&gt;
       }&lt;br /&gt;
       [[else]] {&lt;br /&gt;
 &lt;br /&gt;
         ; d switch is there, clear the default queue for the channel&lt;br /&gt;
         if (d isin $1) { $pushmode.queue($+($cid,.pushmode.,$hash($2,32),.default)).clear }&lt;br /&gt;
 &lt;br /&gt;
         ; n switch is there, clear the next queue for the channel&lt;br /&gt;
         if (n isin $1) { $pushmode.queue($+($cid,.pushmode.,$hash($2,32),.next)).clear }&lt;br /&gt;
 &lt;br /&gt;
         ; l switch is there, clear the low queue for the channel&lt;br /&gt;
         if (l isin $1) { $pushmode.queue($+($cid,.pushmode.,$hash($2,32),.low)).clear }&lt;br /&gt;
 &lt;br /&gt;
         ; s switch is there, clear the single queue for this connection&lt;br /&gt;
         if (s isin $1) { $pushmode.queue($+($cid,.pushmode.,$hash($2,32),.single)).clear }&lt;br /&gt;
 &lt;br /&gt;
         ; no other switches, clear all queues for the channel&lt;br /&gt;
         if (n !isin $1) &amp;amp;&amp;amp; (d !isin $1) &amp;amp;&amp;amp; (l !isin $1) &amp;amp;&amp;amp; (s !isin $1) {&lt;br /&gt;
           $pushmode.queue($+($cid,.pushmode.,$hash($2,32),.next)).clear&lt;br /&gt;
           $pushmode.queue($+($cid,.pushmode.,$hash($2,32),.default)).clear&lt;br /&gt;
           $pushmode.queue($+($cid,.pushmode.,$hash($2,32),.low)).clear&lt;br /&gt;
           $pushmode.queue($+($cid,.pushmode.,$hash($2,32),.single)).clear&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       return&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     ; f switch is there, set a var&lt;br /&gt;
     if (f isin $1) { var %f = 1 }&lt;br /&gt;
 &lt;br /&gt;
     ; n switch is there, set a var&lt;br /&gt;
     if (n isin $1) { var %q = next }&lt;br /&gt;
 &lt;br /&gt;
     ; l switch is there, set a var&lt;br /&gt;
     [[elseif]] (l isin $1) { var %q = low }&lt;br /&gt;
 &lt;br /&gt;
     ; p switch is there, set a var&lt;br /&gt;
     if (p isin $1) { var %p = 1 }&lt;br /&gt;
 &lt;br /&gt;
     ; u or e switch is used, set a var&lt;br /&gt;
     if (u isin $1) || (e isin $1) { var %string = [[$remove]]($1,-,d,c,f,l,n,p,r,s,w) , %x = 1&lt;br /&gt;
 &lt;br /&gt;
       ; loop through all chars&lt;br /&gt;
       [[while]] (%x &amp;lt;= [[$len]](%string)) {&lt;br /&gt;
 &lt;br /&gt;
         ; found u, set a var&lt;br /&gt;
         if ([[$mid]](%string,%x,1) == u) { var %y = [[$calc]](%x +1)&lt;br /&gt;
 &lt;br /&gt;
           ; as long as it is numbers, set a var, next char&lt;br /&gt;
           while ([[$mid]](%string,%y,1) [[isnum]]) { var %u = %u $+ $mid(%string,%y,1) | inc %y }&lt;br /&gt;
         }&lt;br /&gt;
 &lt;br /&gt;
         ; found e, set a var&lt;br /&gt;
         if ($mid(%string,%x,1) == e) { var %y = $calc(%x +1)&lt;br /&gt;
 &lt;br /&gt;
           ; as long as it is numbers, set a var, next char&lt;br /&gt;
           while ($mid(%string,%y,1) isnum) { var %e = %e $+ $mid(%string,%y,1) | inc %y }&lt;br /&gt;
         }&lt;br /&gt;
         [[inc]] %x&lt;br /&gt;
       }&lt;br /&gt;
 &lt;br /&gt;
       ; &#039;%e&#039; is a number, set a var&lt;br /&gt;
       if (%e isnum) { var %e = -e $+ %e }&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     ; u switch is there with a number, +b and a banmask, add to the hash table, make it decrease each second&lt;br /&gt;
     if (u isin $1) &amp;amp;&amp;amp; ($3 == +b) &amp;amp;&amp;amp; ($4) &amp;amp;&amp;amp; (%u &amp;gt; 0) {&lt;br /&gt;
       [[hadd]] -m $+([[$cid]],.pushmode.,[[$hash]]($2,32),.bans) $4 %u | [[hdec]] -c $+($cid,.pushmode.,$hash($2,32),.bans) $4&lt;br /&gt;
 &lt;br /&gt;
       ; check the timer, start the timer&lt;br /&gt;
       if (![[$timer]]($+($cid,.pushmode.bans))) {&lt;br /&gt;
         .[[timer]] $+ $cid $+ .pushmode.bans 1 $$pushmode.ban pushmode.tempban&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     ; number with u is 0&lt;br /&gt;
     if (%u == 0) &amp;amp;&amp;amp; ($3 == +b) &amp;amp;&amp;amp; ($4) {&lt;br /&gt;
 &lt;br /&gt;
       ; check if it is already in the hash table as temp ban,  delete it&lt;br /&gt;
       if ([[$hget]]($+($cid,.pushmode.,$hash($2,32),.bans))) &amp;amp;&amp;amp; ($hget($+($cid,.pushmode.,$hash($2,32),.bans),$4)) {&lt;br /&gt;
         [[hdel]] $+($cid,.pushmode.,$hash($2,32),.bans) $4&lt;br /&gt;
 &lt;br /&gt;
         ; check if the hash table is empty, free the hash table&lt;br /&gt;
         if ($hget($+($cid,.pushmode.,$hash($2,32),.bans),0).item == 0) {&lt;br /&gt;
           [[hfree]] $+($cid,.pushmode.,$hash($2,32),.bans)&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       return&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     ; r switch is there and mode &#039;$3&#039; &lt;br /&gt;
     if (r isin $1) &amp;amp;&amp;amp; ($3) {&lt;br /&gt;
 &lt;br /&gt;
       ; w switch is there&lt;br /&gt;
       if (w isin $1) {&lt;br /&gt;
 &lt;br /&gt;
         ; no parameter, remove the mode from the single queue&lt;br /&gt;
         if ($4 == [[$null]]) { pushmode.queue -rw $+($cid,.pushmode.,$hash($2,32),.single) $3 }&lt;br /&gt;
         else {&lt;br /&gt;
 &lt;br /&gt;
           ; d switch is there, remove the mode from the default queue&lt;br /&gt;
           if (d isin $1) { pushmode.queue -rw $+($cid,.pushmode.,$hash($2,32),.default) $3-4 }&lt;br /&gt;
 &lt;br /&gt;
           ; n switch is there, remove the mode from the next queue&lt;br /&gt;
           if (n isin $1) { pushmode.queue -rw $+($cid,.pushmode.,$hash($2,32),.next) $3-4 }&lt;br /&gt;
 &lt;br /&gt;
           ; l switch is there, remove the mode from the low queue&lt;br /&gt;
           if (l isin $1) { pushmode.queue -rw $+($cid,.pushmode.,$hash($2,32),.low) $3-4 }&lt;br /&gt;
 &lt;br /&gt;
           ; no other switch is there, remove the mode from all queues&lt;br /&gt;
           if (n !isin $1) &amp;amp;&amp;amp; (d !isin $1) &amp;amp;&amp;amp; (l !isin $1) {&lt;br /&gt;
             pushmode.queue -rw $+($cid,.pushmode.,$hash($2,32),.next) $3-4 | pushmode.queue -rw $+($cid,.pushmode.,$hash($2,32),.low) $3-4 | pushmode.queue -rw $+($cid,.pushmode.,$hash($2,32),.default) $3-4&lt;br /&gt;
           }&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       else {&lt;br /&gt;
 &lt;br /&gt;
         ; no parameter, remove mode from the single queue&lt;br /&gt;
         if ($4 == $null) { pushmode.queue -r $+($cid,.pushmode.,$hash($2,32),.single) $3 }&lt;br /&gt;
         else {&lt;br /&gt;
 &lt;br /&gt;
           ; d switch is there, remove mode form the default queue&lt;br /&gt;
           if (d isin $1) { pushmode.queue -r $+($cid,.pushmode.,$hash($2,32),.default) $3-4 }&lt;br /&gt;
 &lt;br /&gt;
           ; n switch is there, remove mode form next queue&lt;br /&gt;
           if (n isin $1) { pushmode.queue -r $+($cid,.pushmode.,$hash($2,32),.next) $3-4 }&lt;br /&gt;
 &lt;br /&gt;
           ; l switch is there, remove mode form the low queue&lt;br /&gt;
           if (l isin $1) { pushmode.queue -r $+($cid,.pushmode.,$hash($2,32),.low) $3-4 }&lt;br /&gt;
 &lt;br /&gt;
           ; no other switch is there, remove mode form all queues&lt;br /&gt;
           if (n !isin $1) &amp;amp;&amp;amp; (d !isin $1) &amp;amp;&amp;amp; (l !isin $1) &amp;amp;&amp;amp; (s !isin $1) {&lt;br /&gt;
             pushmode.queue -r $+($cid,.pushmode.,$hash($2,32),.next) $3-4 | pushmode.queue -r $+($cid,.pushmode.,$hash($2,32),.low) $3-4 | pushmode.queue -r $+($cid,.pushmode.,$hash($2,32),.default) $3-4&lt;br /&gt;
           }&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       return&lt;br /&gt;
     }&lt;br /&gt;
     [[tokenize]] 32 $2-&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   ; leave multiple modes out&lt;br /&gt;
   tokenize 32 $1 $left($2,2) $3&lt;br /&gt;
 &lt;br /&gt;
   ; &#039;$2&#039; starts with &#039;+&#039; or with &#039;-&#039;, we are on channel &#039;$1&#039;&lt;br /&gt;
   if ([[$istok]](+ -,$left($2,1),32)) &amp;amp;&amp;amp; ($me ison $1) {&lt;br /&gt;
 &lt;br /&gt;
     ; &#039;$3&#039; does exist&lt;br /&gt;
     if ($3 != $null) {&lt;br /&gt;
 &lt;br /&gt;
       ; -n switch was used, queue mode &#039;$2 $3&#039; in the next queue&lt;br /&gt;
       if (%q == next) { pushmode.queue %e $+($cid,.pushmode.,$hash($1,32),.next) $2-3 }&lt;br /&gt;
 &lt;br /&gt;
       ; -l switch was used, queue mode &#039;$2 $3&#039; in the low queue&lt;br /&gt;
       elseif (%q == low) { pushmode.queue %e $+($cid,.pushmode.,$hash($1,32),.low) $2-3 }&lt;br /&gt;
 &lt;br /&gt;
       ; use default queue, queue mode &#039;$2 $3&#039; in the &#039;default&#039; queue&lt;br /&gt;
       else { pushmode.queue %e $+($cid,.pushmode.,$hash($1,32),.default) $2-3 }&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     ; the mode does not have a parameter, queue mode &#039;$2&#039; it in the single queue&lt;br /&gt;
     else { pushmode.queue $+($cid,.pushmode.,$hash($1,32),.single) $2 }&lt;br /&gt;
 &lt;br /&gt;
     ; check if the timer is not already running and check the -p switch, start the timer&lt;br /&gt;
     if (!$timer($+($cid,.pushmode.,$hash($1,32)))) &amp;amp;&amp;amp; (%p != 1) {&lt;br /&gt;
       .timer $+ $cid $+ .pushmode. $+ $hash($1,32) 1 $$pushmode.delay pushmode.dump $1&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     ; no timer, and passive switch, set a var&lt;br /&gt;
     if (!$timer($+($cid,.pushmode.,$hash($1,32)))) &amp;amp;&amp;amp; (%p == 1) {&lt;br /&gt;
       var %x = 1, %queue = .next .default .low, %q = 1, %t = 0&lt;br /&gt;
 &lt;br /&gt;
       ; loop through each queue, inc var, next queue&lt;br /&gt;
       while ($gettok(%queue,%q,32)) {&lt;br /&gt;
         inc %t $pushmode.queue($+($cid,.pushmode.,$hash($1,32),$gettok(%queue,%q,32))).size | inc %q&lt;br /&gt;
       }&lt;br /&gt;
 &lt;br /&gt;
       ; at least $modespl modes in the queues, start the timer&lt;br /&gt;
       if (%t &amp;gt;= $modespl) {&lt;br /&gt;
         .timer $+ $cid $+ .pushmode. $+ $hash($1,32) 1 $$pushmode.delay pushmode.dump $1&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     ; f switch was used&lt;br /&gt;
     if (%f == 1) {&lt;br /&gt;
 &lt;br /&gt;
       ; no channel, set a var&lt;br /&gt;
       if (!$1) { var %x = $chan(0)&lt;br /&gt;
 &lt;br /&gt;
         ; loop through all the channels, stop the timer, run &#039;pushmode.dump chan&#039;, decrease &#039;%x&#039; and go on to the next channel&lt;br /&gt;
         while (%x) {&lt;br /&gt;
           .timer $+ $+($cid,.pushmode.,$hash($chan(%x),32)) off | pushmode.dump $chan(%x) | dec %x&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
 &lt;br /&gt;
       ; we are on &#039;$1&#039;, stop the timer, run &#039;pushmode.dump $1&#039;&lt;br /&gt;
       elseif ($me ison $1) {&lt;br /&gt;
         .timer $+ $+($cid,.pushmode.,$hash($1,32)) off | pushmode.dump $1&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHMODE.DUMP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 ; $1 = #channel&lt;br /&gt;
 alias -l pushmode.dump {&lt;br /&gt;
 &lt;br /&gt;
   ; we are on channel &#039;$1&#039;,  set vars&lt;br /&gt;
   if ($me ison $1) { var %x = 1, %queue = .next .default .low, %q = 1, %mode, %check, %smode&lt;br /&gt;
 &lt;br /&gt;
     ; loop through each queue&lt;br /&gt;
     while ($gettok(%queue,%q,32)) {&lt;br /&gt;
 &lt;br /&gt;
       ; we loop as long as &#039;%x&#039; &amp;lt;= &#039;$modespl&#039; and as long as the size of the queue is greater then 0&lt;br /&gt;
       while (%x &amp;lt;= $modespl) &amp;amp;&amp;amp; ($pushmode.queue($+($cid,.pushmode.,$hash($1,32),$gettok(%queue,%q,32))).size &amp;gt; 0) {&lt;br /&gt;
 &lt;br /&gt;
         ; save the next item in a var&lt;br /&gt;
         var %next = $pushmode.queue($+($cid,.pushmode.,$hash($1,32),$gettok(%queue,%q,32))).next&lt;br /&gt;
 &lt;br /&gt;
         ; check if mode is not already going to be set&lt;br /&gt;
         if (!$istokcs(%check,%next,44)) &amp;amp;&amp;amp; (%next) { var %1 = $gettok(%next,1,32), %2 = $gettok(%next,2,32)&lt;br /&gt;
 &lt;br /&gt;
           ; some checks / examples of checks&lt;br /&gt;
           if (%1 === +o) &amp;amp;&amp;amp; (%2 isop $1) { }&lt;br /&gt;
           elseif (%1 === -o) &amp;amp;&amp;amp; (%2 ![[isop]] $1) { }&lt;br /&gt;
           elseif (%1 === +h) &amp;amp;&amp;amp; (%2 [[ishop]] $1) { }&lt;br /&gt;
           elseif (%1 === -h) &amp;amp;&amp;amp; (%2 ![[ison]] $1) { }&lt;br /&gt;
           elseif (%1 === +v) &amp;amp;&amp;amp; (%2 [[isvoice]] $1) { }&lt;br /&gt;
           elseif (%1 === -v) &amp;amp;&amp;amp; (%2 !ison $1) { }&lt;br /&gt;
           elseif (%1 === +b) &amp;amp;&amp;amp; (%2 [[isban]] $1) { }&lt;br /&gt;
           elseif (%1 === +l) &amp;amp;&amp;amp; ((%2 !isnum) || (%2 &amp;lt; 1)) { }&lt;br /&gt;
           elseif (%1 === +l) &amp;amp;&amp;amp; (%2 == [[$chan]]($1).limit) { }&lt;br /&gt;
           elseif (%1 === +k) &amp;amp;&amp;amp; ($chan($1).key) { }&lt;br /&gt;
           elseif (%1 === -k) &amp;amp;&amp;amp; (%2 !=== $chan($1).key) { }&lt;br /&gt;
           elseif ($right(%1,1) === o) &amp;amp;&amp;amp; ($me !isop $1) { }&lt;br /&gt;
           elseif ($right(%1,1) === h) &amp;amp;&amp;amp; ($me !isop $1) { }&lt;br /&gt;
           elseif ($me !isop $1) &amp;amp;&amp;amp; ($me !ishop $1) { }&lt;br /&gt;
 &lt;br /&gt;
           ; add &#039;%next&#039; to &#039;%check&#039;, add the mode in the var&lt;br /&gt;
           else { var %check = $addtok(%check,%next,44) | var %mode = $+($gettok(%mode,1,32),$gettok(%next,1,32)) $gettok(%mode,2-,32) $gettok(%next,2,32) }&lt;br /&gt;
           inc %x&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
       inc %q&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     ; we loop as long as the size of the single queue is greater then 0, set vars&lt;br /&gt;
     while ($pushmode.queue($+($cid,.pushmode.,$hash($1,32),.single)).size &amp;gt; 0) {&lt;br /&gt;
       var %next = $pushmode.queue($+($cid,.pushmode.,$hash($1,32),.single)).next&lt;br /&gt;
       var %a = $+($gettok($chanmodes,1,44),b), %b = $+($gettok($chanmodes,2,44),k)&lt;br /&gt;
       var %c = $+($gettok($chanmodes,3,44),l), %d = $+($gettok($chanmodes,4,44),imnpst)&lt;br /&gt;
 &lt;br /&gt;
       ; some checks / examples of checks&lt;br /&gt;
       if ($right(%next,1) isincs %b) { }&lt;br /&gt;
       elseif ($right(%next,1) isincs %c) &amp;amp;&amp;amp; ($left(%next,1) == +) { }&lt;br /&gt;
       elseif ($right(%next,1) isincs %b) { }&lt;br /&gt;
       elseif ($me !isop $1) &amp;amp;&amp;amp; ($me !ishop $1) &amp;amp;&amp;amp; ($right(%next,1) !isincs %a) { }&lt;br /&gt;
 &lt;br /&gt;
       ; add next mode to the var&lt;br /&gt;
       else { var %smode = $+(%smode,%next) }&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     ; if the ibl isnt filled for that channel, add +b to request the banlist&lt;br /&gt;
     ; if you want this uncomment the following line&lt;br /&gt;
     ;if (b !isincs %smode) &amp;amp;&amp;amp; (!$chan($1).ibl) { var %smode = $+(%smode,+b) }&lt;br /&gt;
 &lt;br /&gt;
     ; add the mode in the var&lt;br /&gt;
     var %mode = $+($gettok(%mode,1,32),%smode) $gettok(%mode,2-,32)&lt;br /&gt;
 &lt;br /&gt;
     ; there are modes in &#039;%mode&#039;, send the modes&lt;br /&gt;
     if (%mode) { .quote MODE $1 %mode }&lt;br /&gt;
     var %q = 1&lt;br /&gt;
 &lt;br /&gt;
     ; loop through the queues&lt;br /&gt;
     while ($gettok(%queue,%q,32)) {&lt;br /&gt;
 &lt;br /&gt;
       ; items left, break&lt;br /&gt;
       if ($pushmode.queue($+($cid,.pushmode.,$hash($1,32),$gettok(%queue,%q,32))).size &amp;gt; 0) { break }&lt;br /&gt;
       inc %q&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     ; loop was ended with break, start the timer&lt;br /&gt;
     if (%q &amp;lt;= $numtok(%queue,32)) {&lt;br /&gt;
       .timer $+ $cid $+ .pushmode. $+ $hash($1,32) 1 $$pushmode.restart pushmode.dump $1&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHUSER ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 ; $1 = +/-mode, $2 = param&lt;br /&gt;
 alias pushuser {&lt;br /&gt;
 &lt;br /&gt;
   ; remove multiple modes, only use the 1st one given&lt;br /&gt;
   tokenize 32 $left($1,2) $2&lt;br /&gt;
 &lt;br /&gt;
   ; &#039;$2&#039; is 2 chars long and &#039;$1&#039; starts with &#039;+&#039; or with &#039;-&#039;&lt;br /&gt;
   if ($len($1) == 2) &amp;amp;&amp;amp; ($istok(+ -, $left($1,1),32)) {&lt;br /&gt;
 &lt;br /&gt;
     ; &#039;$2&#039; exists, add the mode to the user queue&lt;br /&gt;
     if ($2 != $null) { pushmode.queue $+($cid,.user) $1-2 }&lt;br /&gt;
 &lt;br /&gt;
     ; &#039;$2&#039; does not exist, add the mode to the user queue&lt;br /&gt;
     else { pushmode.queue $+($cid,.user) $1 }&lt;br /&gt;
 &lt;br /&gt;
     ; check if the timer already runs, start the timer&lt;br /&gt;
     if (!$timer($+($cid,.pushuser))) {&lt;br /&gt;
       .timer $+ $cid $+ .pushuser 1 $$pushmode.delay pushuser.dump&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHUSER.DUMP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 alias -l pushuser.dump {&lt;br /&gt;
 &lt;br /&gt;
   ; loop as long as there are items in the user queue, set a var with the next item, add the mode to the var&lt;br /&gt;
   while ($pushmode.queue($+($cid,.user)).size &amp;gt; 0) { var %next = $pushmode.queue($+($cid,.user)).next&lt;br /&gt;
   var %mode = $+($gettok(%mode,1,32),$gettok(%next,1,32)) $gettok(%mode,2-,32) $gettok(%next,2,32) }&lt;br /&gt;
 &lt;br /&gt;
   ; if &#039;%mode&#039; exists, send the modes&lt;br /&gt;
   if (%mode) { .[[quote]] MODE $me %mode }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHMODE.QUEUE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 ; pushmode.queue [-eNrw] table mode param&lt;br /&gt;
 alias -l pushmode.queue {&lt;br /&gt;
   var %e&lt;br /&gt;
 &lt;br /&gt;
   ; switch is used&lt;br /&gt;
   if ($left($1,1) == -) {&lt;br /&gt;
 &lt;br /&gt;
     ; got a switch, there are numbers, set a var&lt;br /&gt;
     if (e isin $1) { if ($right($1,-2) isnum) { var %e = $+(-u,$right($1,-2)) } }&lt;br /&gt;
 &lt;br /&gt;
     ; r switch, w switch, set var&lt;br /&gt;
     if (r isin $1) { if (w isin $1) { var %x = $hfind($2,$3-4,0,w).data&lt;br /&gt;
         while (%x) {&lt;br /&gt;
 &lt;br /&gt;
           ; check hash table, delete&lt;br /&gt;
           if ($gettok($hget($2,$hfind($2,$3-4,%x,w).data),1,32) === $3) || ($3 iswm $gettok($hget($2,$hfind($2,$3-4,%x,w).data),1,32)) {&lt;br /&gt;
             hdel $2 $hfind($2,$3-4,%x,w).data&lt;br /&gt;
           }&lt;br /&gt;
           dec %x&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
 &lt;br /&gt;
       ; no w switch, set vars&lt;br /&gt;
       else {&lt;br /&gt;
         var %param = $replace($4,\,\\,|,\|,$chr(40),$+(\,$chr(40)),$chr(41),$+(\,$chr(41)),$chr(91),$+(\,$chr(91)),$chr(93),$+(\,$chr(93)),^,\^,$chr(123),$+(\,$chr(123)),$chr(125),$+(\,$chr(125)),.,\.,$,\$,+,\+,*,\*,?,\?)&lt;br /&gt;
         var %mode = \ $+ $left($3,1) $+ $chr(91) $+ $replace($left($3,2),\,\\,|,\|,$chr(40),$+(\,$chr(40)),$chr(41),$+(\,$chr(41)),$chr(91),$+(\,$chr(91)),$chr(93),$+(\,$chr(93)),^,\^,$chr(123),$+(\,$chr(123)),$chr(125),$+(\,$chr(125)),.,\.,$,\$,+,\+,*,\*,?,\?) $+ $chr(93)&lt;br /&gt;
 &lt;br /&gt;
         ; check hash table, delete&lt;br /&gt;
         if ($hfind($2,%mode %param,1,r).data) { hdel $2 $hfind($2,%mode %param,1,r).data }&lt;br /&gt;
       }&lt;br /&gt;
 &lt;br /&gt;
       ; 1 item left, free hash table&lt;br /&gt;
       if ($hget($2,0).item == 1) { hfree $2 }&lt;br /&gt;
       return&lt;br /&gt;
     }&lt;br /&gt;
     tokenize 32 $2-4&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   ; mode is a usermode, it matches *!*@* and no * or ? are there, and its not for the umode queue&lt;br /&gt;
   if ($right($2,1) isin $pushmode.prefix) &amp;amp;&amp;amp; (*!*@* iswm $3) &amp;amp;&amp;amp; (* !isin $3) &amp;amp;&amp;amp; (? !isin $3) &amp;amp;&amp;amp; (*.user !iswm $1) {&lt;br /&gt;
 &lt;br /&gt;
     ; the user is in the ial, add tag to ialmark, tokenize&lt;br /&gt;
     if ($ial($gettok($3,1,33))) {&lt;br /&gt;
       .ialmark $gettok($3,1,33) $ial($gettok($3,1,33)).mark $+($1,.,$iif($hget($1,last),$calc($ifmatch +1),1))&lt;br /&gt;
       tokenize 32 $1 $2 $+(*!,$gettok($3,2,33))&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     ; user is not in ial, tokenize&lt;br /&gt;
     else { tokenize 32 $1 $2 $gettok($3,1,33) }&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   ; set a var, prefix special chars in a regex with a \&lt;br /&gt;
   var %param = $replace($3,\,\\,|,\|,$chr(40),$+(\,$chr(40)),$chr(41),$+(\,$chr(41)),$chr(91),$+(\,$chr(91)),$chr(93),$+(\,$chr(93)),^,\^,$chr(123),$+(\,$chr(123)),$chr(125),$+(\,$chr(125)),.,\.,$,\$,+,\+,*,\*,?,\?)&lt;br /&gt;
   var %mode = \ $+ $left($2,1) $+ $chr(91) $+ $replace($left($2,2),\,\\,|,\|,$chr(40),$+(\,$chr(40)),$chr(41),$+(\,$chr(41)),$chr(91),$+(\,$chr(91)),$chr(93),$+(\,$chr(93)),^,\^,$chr(123),$+(\,$chr(123)),$chr(125),$+(\,$chr(125)),.,\.,$,\$,+,\+,*,\*,?,\?) $+ $chr(93)&lt;br /&gt;
 &lt;br /&gt;
   ; there is a 2nd parameter and mode &#039;%mode %param&#039; is not already in the queue, where &#039;%mode&#039; is case sensitive&lt;br /&gt;
   if ($2 != $null) &amp;amp;&amp;amp; ($hfind($1,%mode %param,0,r).data == 0) {&lt;br /&gt;
 &lt;br /&gt;
     ; increase item &#039;last&#039;, add mode &#039;$2-&#039; to the hashtable with item name that &#039;last&#039; has&lt;br /&gt;
     hinc -m $1 last | hadd $+(-m,%e) $1 $hget($1,last) $2-&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   ; propertie is next and hash table &#039;$1&#039; exists, increase item &#039;first&#039;&lt;br /&gt;
   elseif ($isid) &amp;amp;&amp;amp; ($prop == next) &amp;amp;&amp;amp; ($hget($1)) { hinc -m $1 first&lt;br /&gt;
 &lt;br /&gt;
     ; &#039;first&#039; is smaller or equal to &#039;last&#039;, set vars&lt;br /&gt;
     if ($hget($1,first) &amp;lt;= $hget($1,last)) {&lt;br /&gt;
       var %next = $hget($1,$hget($1,first)), %number = $hget($1,first)&lt;br /&gt;
       var %mode = $gettok(%next,1,32), %param = $gettok(%next,2,32)&lt;br /&gt;
 &lt;br /&gt;
       ; mode is a usermode, parameter matches *!*@*, set var&lt;br /&gt;
       if ($right(%mode,1) isin $pushmode.prefix) &amp;amp;&amp;amp; (*!*@* iswm %param) {&lt;br /&gt;
         var %x = $ial(%param,0)&lt;br /&gt;
         while (%x) { var %nick = $ial(%param,%x).nick&lt;br /&gt;
 &lt;br /&gt;
           ; the tag is there, remove it, set var, stop loop&lt;br /&gt;
           if ($wildtok($ial(%nick).mark,$+($1,.,%number),1,32)) {&lt;br /&gt;
             .ialmark %nick $remove($ial(%nick).mark,$ifmatch)&lt;br /&gt;
             var %next = %mode %nick | break&lt;br /&gt;
           }&lt;br /&gt;
           dec %x&lt;br /&gt;
         }&lt;br /&gt;
 &lt;br /&gt;
         ; no matches found, clear var&lt;br /&gt;
         if (%x == 0) { var %next = $null }&lt;br /&gt;
       }&lt;br /&gt;
 &lt;br /&gt;
       ; delete this item from the hashtable&lt;br /&gt;
       hdel $1 $hget($1,first)&lt;br /&gt;
 &lt;br /&gt;
       ; this is the last item, free the hash table&lt;br /&gt;
       if ($hget($1,first) &amp;gt;= $hget($1,last)) { hfree $1 }&lt;br /&gt;
       return %next&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   ; called as identifier ($alias) and propertie is size ($alias().size)&lt;br /&gt;
   ; decrease number of items with 1, (1 item in queue, and last is there)&lt;br /&gt;
   elseif ($isid) &amp;amp;&amp;amp; ($prop == size) { return $iif($calc($hget($1,0).item -1) &amp;gt;= 0,$ifmatch,0) }&lt;br /&gt;
 &lt;br /&gt;
   ; called as identifier ($alias) and propertie is clear ($alias().clear), free hashtables that match $1&lt;br /&gt;
   elseif ($isid) &amp;amp;&amp;amp; ($prop == clear) { hfree -w $1 }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHMODE.TEMPBAN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 alias -l pushmode.tempban {&lt;br /&gt;
   var %x = 1&lt;br /&gt;
 &lt;br /&gt;
   ; loop through the channels&lt;br /&gt;
   while (%x &amp;lt;= $chan(0)) {&lt;br /&gt;
 &lt;br /&gt;
     ; loop as long as a match is found, items with values 0 or lower&lt;br /&gt;
     while ($hfind($+($cid,.pushmode.,$hash($chan(%x),32),.bans),/^[0-]/,1,r).data) {&lt;br /&gt;
 &lt;br /&gt;
       ; ibl is not filled, or the ban is set, use pushmode to remove the ban&lt;br /&gt;
       if (!$chan(%x).ibl) || ($hfind($+($cid,.pushmode.,$hash($chan(%x),32),.bans),/^[0-]/,1,r).data isban $chan(%x)) {&lt;br /&gt;
         pushmode $chan(%x) -b $hfind($+($cid,.pushmode.,$hash($chan(%x),32),.bans),/^[0-]/,1,r).data&lt;br /&gt;
       }&lt;br /&gt;
 &lt;br /&gt;
       ; del the item from the hash table&lt;br /&gt;
       hdel $+($cid,.pushmode.,$hash($chan(%x),32),.bans) $hfind($+($cid,.pushmode.,$hash($chan(%x),32),.bans),/^[0-]/,1,r).data&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     ; check if hash table is empty and the hash table exists, remove hash table&lt;br /&gt;
     if ($hget($+($cid,.pushmode.,$hash($chan(%x),32),.bans),0).item == 0) &amp;amp;&amp;amp; ($hget($+($cid,.pushmode.,$hash($chan(%x),32),.bans))) {&lt;br /&gt;
       hfree $+($cid,.pushmode.,$hash($chan(%x),32),.bans)&lt;br /&gt;
     }&lt;br /&gt;
     inc %x&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   ; start the timer&lt;br /&gt;
   .timer $+ $cid $+ .pushmode.bans 1 $$pushmode.ban pushmode.tempban&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DISCONNECT EVENT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
 on *:disconnect: { pushmode -c }&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Archive]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
	<entry>
		<id>https://script.quakenet.org/wiki/index.php?title=Else&amp;diff=5789</id>
		<title>Else</title>
		<link rel="alternate" type="text/html" href="https://script.quakenet.org/wiki/index.php?title=Else&amp;diff=5789"/>
		<updated>2013-06-21T23:30:54Z</updated>

		<summary type="html">&lt;p&gt;Jay2k1: fixed redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#redirect [[If-Then-Else]]&lt;/div&gt;</summary>
		<author><name>Jay2k1</name></author>
	</entry>
</feed>