https://en.wikichip.org/w/api.php?action=feedcontributions&user=Westor&feedformat=atom
WikiChip - User contributions [en]
2024-03-28T16:13:57Z
User contributions
MediaWiki 1.28.1
https://en.wikichip.org/w/index.php?title=mirc/on_events/on_join&diff=99563
mirc/on events/on join
2021-11-16T19:10:47Z
<p>Westor: Added more examples</p>
<hr />
<div>{{mirc title|On Join - Events}}<br />
The '''ON JOIN''' event triggers when the mIRC client, or a remote user, joins a channel.<br />
<br />
'''Note''': When you join a channel yourself, $nick($chan,0) is always 1 inside the on join event because mIRC has to send /names to get the nickname; if you want to undertake some processing once the channel user list is complete, then use RAW 366 which indicates the end of the user list. Similarly, if you're an operator on the channel, you won't be opped inside the on join event, and should use ON OP event instead.<br />
<br />
== Synopsis ==<br />
<pre>ON <level>:JOIN:<#[,#]>:<commands></pre><br />
<br />
== Parameters ==<br />
<span style="display: inline-block; width: 105px;">'''<level>'''</span>The level for the event to trigger.<br />
<br />
<span style="display: inline-block; width: 105px;">'''<#,[,#]>'''</span>The text that to be matched. Can also be a {{mirc|wildcard}}.<br />
<br />
<div style="background-color: rgba(0,0,0,.06); display: block;"><span style="border-right: 1px dashed rgba(0,0,0,.15); display: inline-block; margin-left: 105px; margin-right: 25px; width: 60px;">'''[,#]'''</span>Specific channel names</div><br />
<br />
<span style="display: inline-block; width: 105px;">'''<commands>'''</span>The commands to be performed when the event listener's criteria is met.<br />
<br />
== Examples ==<br />
<br />
The following example makes use of the [[on me - mIRC|ON ME]] event, which triggers only when the local mIRC client triggers the event, not remote users.<br />
<source lang="mIRC">ON ME:*:JOIN:#testing: { msg $chan Hello $chan - Today is $day and time is $time }</source><br />
<br />
The following example works for everyone else who joins but except your self.<br />
<source lang="mIRC">ON !*:JOIN:#mychan: { msg $chan Hey $nick $+ ! Welcome in our channel. }</source><br />
<br />
Who ever joins, send them a greeting:<br />
<source lang="mIRC">ON *:JOIN:#:msg # Welcome to # $+ , $nick $+ !</source><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|2.1a}}<br />
<br />
== See Also ==<br />
* [[on part - mIRC|ON PART]]<br />
* {{mIRC|on events|List of on events}}<br />
{{mIRC on event list}}<br />
<br />
[[Category:mIRC on events|join]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$msgtags&diff=99332
mirc/identifiers/$msgtags
2021-09-22T12:41:24Z
<p>Westor: /* Example */</p>
<hr />
<div>{{mirc title|$msgtags Identifier}}'''$msgtags''' returns the full @ prefixed tags line (IRCv3 message tags) which are removed from incoming server messages. $msgtags() returns informations about specifics tags<br />
<br />
<br />
== Synopsis ==<br />
<pre>$msgtags<br />
$msgtags(tag|N)<br />
</pre><br />
<br />
== Parameters ==<br />
* '''tag''' - returns the tag if it exists, $null otherwise<br />
* '''N''' - returns the Nth tag, if N = 0, returns the total number of tags<br />
<br />
== Properties ==<br />
If a parameter is provided, you can use the following properties:<br />
* '''.tag''' - returns the name of the Nth tag<br />
* '''.key''' - returns the associated value of the Nth tag or of the given '''tag'''<br />
<br />
== Example ==<br />
<source lang="mIRC"><br />
ON *:TEXT:*:#: { echo $chan INFO: $nick -> $msgtags(account) -> $msgtags(msgid).tag -> $msgtags(msgid).key - Total: $msgtags(0) }<br />
</source><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|7.42}}<br />
<br />
== See Also ==<br />
<br />
[[Category:mIRC identifiers]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/commands/timer&diff=99099
mirc/commands/timer
2021-07-26T12:54:28Z
<p>Westor: /* Example */</p>
<hr />
<div>{{mirc title|/timer Command}}<br />
The '''/timer command''' can be used to create a general purpose timer. A [[timer]] is a way to execute code at some specific interval or time and delay. [[Timers]] can be named and unnamed. Unnamed timers will get the lowest numeric timer index available. Named timers are specifically useful if you need to recall that timer at a later period - to pause it, resume it, or simply reset it. Starting a timer with a name that already exists will override the old timer. Timers are not blocking command, they <br />
only get executed after the alias/event/etc is complete, losing the access to the local scope.<br />
<br />
== Synopsis ==<br />
/timers [off]<br />
/timer[n|name] [off]<br />
/timer[n|name] [-cdeomhipPrzN] [time] <repetitions> <interval> <nowiki><code></nowiki><br />
<br />
== Switches ==<br />
Creation Manipulators<br />
* '''-o''' - Creates a offline timer<br />
* '''-c''' - Creates a catch-up timer<br />
* '''-h''' - Creates a high-resolution timer (interval is in millisecond just like -m)<br />
<br />
Attributes<br />
* '''-m''' - Treats the interval parameter as milliseconds instead of seconds<br />
* '''-d''' - Keeps the order of all -d timers<br />
* '''-i''' - Dynamically associates itself with the active connection<br />
<br />
Manipulator<br />
* '''-e''' - Executes the code associated with a timer (note: it decrease the number of repetition of the timer, probably resets the time counter as well)<br />
* '''-p''' - Pauses a timer, but the countdown is not paused, this switch should serve no real purpose because of the countdown weirdness, -P was added to pause correctly the countdown.<br />
* '''-P''' - Makes a real pause of the timer, countdown included.<br />
* '''-r''' - Resumes a timer paused with -p or -P<br />
* '''-z'''N - Resets an online timer; N=2 resets total time, N=1, resets current time, and N=0 is the same as N=1 AND N=2<br />
<br />
== Parameters ==<br />
* '''[off]''' - A literal 'off' keyword, used to turn off a timer.<br />
* '''[n|name]''' - The name or index of the timer<br />
* '''[time]''' - Time to activate the timer, for example '15:30' for 3:30PM<br />
* '''<repetitions>''' - The amount of times the timer should repeat itself. A repetition value of '0' will repeat forever.<br />
* '''<interval>''' - The delay between two consecutive timer executions<br />
* '''<nowiki><code></nowiki>''' - Code to be executed.<br />
<br />
== {{mIRC|$ctimer}} & {{mIRC|$ltimer}} ==<br />
<br />
{{mIRC|$ctimer}} can be used to return the name of the timer which triggered the current script while {{mIRC|$ltimer}} returns the name of the last timer which triggered.<br />
<br />
== Quirks ==<br />
<br />
You can check the {{mIRC|msl injection}} page to learn more about /timer's double evaluation issues.<br />
<br />
/timer also has a special evaluation routine which checks for variable assignement (except /var), for example:<br />
<br />
//timer -ho 1 0 set -s %test 5 $(|) unset -s %test<br />
<br />
Works correctly: /timer does not evaluate the variable %test both times as it recognize the assignement.<br />
<br />
However this behavior is too intrusive, it is not possible to properly check for variable assigment:<br />
<br />
//var -s %a inc,%b somevalue | timer -ho 1 0 echo -s %a %b<br />
<br />
here the variable %b's value disappear completely<br />
<br />
== Example ==<br />
Below is a simple count down timer that uses a call-back alias once per second:<br />
<br />
<syntaxhighlight lang="mIRC">alias example {<br />
; start cou<br />
var %reps = 5<br />
<br />
; call the timer %reps times after 1 second delay each<br />
.timer %reps 1 count-down<br />
<br />
; print the first count<br />
count-down<br />
}<br />
alias -l count-down {<br />
echo -a Count: $timer($ltimer).reps<br />
}</syntaxhighlight><br />
<br />
The above code will generate the following output:<br />
<br />
<pre>Count: 5<br />
Count: 4<br />
Count: 3<br />
Count: 2<br />
Count: 1<br />
Count: 0</pre><br />
<br />
A more basic example of a message being delayed for 3 seconds:<br />
<br />
<syntaxhighlight lang="mIRC">on *:text:!foo:#foo:{<br />
; delay the message for 3 seconds<br />
timer 1 3 msg #foo Bar!<br />
}</syntaxhighlight><br />
<br />
A repetition of '0' can also be used to mean an repeat forever:<br />
<br />
<syntaxhighlight lang="mIRC">alias cur_time {<br />
timer 0 1 echo -s $!time(hh:nn:ss)<br />
}</syntaxhighlight><br />
<br />
Ending timers by using 'off' parameter, you can also end timers using wildcards.<br />
<br />
<syntaxhighlight lang="mIRC"><br />
alias test_timers {<br />
; /test_timers<br />
<br />
; creating 3 different names timers<br />
/timer[test_one] 1 3 echo -a Test one<br />
/timer[test_two] 1 6 echo -a Test two<br />
/timer[test_three] 1 10 echo -at Test three<br />
<br />
; End only one of them<br />
/timer[test_one] off<br />
<br />
; Ending all the timers created with 'test_' prefix<br />
/timer[test_*] off<br />
}<br />
</syntaxhighlight><br />
<br />
== Compatibility ==<br />
Added: mIRC 3.3, 3.4<br />
<br />
== See also ==<br />
* [[List of commands - mIRC|List of commands]]<br />
* [[List of identifiers - mIRC|List of identifiers]]<br />
* {{mIRC|$timer}}<br />
* {{mIRC|$ctimer}}<br />
* {{mIRC|$ltimer}}<br />
* {{mIRC|$time}}<br />
* {{mIRC|$date}}<br />
* {{mIRC|$gmt}}<br />
* {{mIRC|$asctime}}<br />
* {{mIRC|/scid}}<br />
* {{mIRC|/scon}}<br />
{{mIRC command list}}<br />
<br />
[[Category:mIRC commands|timer command - mIRC]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$urlget&diff=98586
mirc/identifiers/$urlget
2021-02-28T22:29:53Z
<p>Westor: /* Example */</p>
<hr />
<div>{{mirc title|$urlget identifier}}'''$urlget''' sends a HEAD/GET/POST/PUT/PATCH/DELETE to an http server. Returns an ID.<br />
<br />
== Synopsis ==<br />
<pre>$urlget(url,hgpuadfbrtic,target,alias,headers,body)<br />
$urlget(N/ID)[.prop]<br />
</pre><br />
<br />
== Parameters ==<br />
<br />
* '''url''' - the url to access, must be prefixed with http:// or https:// (maximum url characters are <b>2000</b>)<br />
* '''hgpuadfbrtic''' - switches to indicate how to proceed:<br />
** '''hgpuad''' - '''h''' for HEAD, '''g''' for GET, '''p''' for POST, '''u''' for PUT, '''a''' for PATCH, '''d''' for DELETE<br />
** '''fb''' - '''f''' to output the answer (without the responses headers) to a file, '''b''' to ouput to a binvar<br />
** '''r''' - resumes the processing<br />
** '''t''' - uses .part file if necessary<br />
** '''i''' - ignores SSL errors<br />
** '''c''' - cancel the processing<br />
* '''target''' - the output: the filename if you used '''f''', or a &binvar for '''b'''<br />
* '''alias''' - the name of the alias that is called at the end, this alias is called as a command with one parameter passed to it: the ID<br />
* '''headers''' - optional, a &binvar containing the headers to be sent, separated by $crlf<br />
* '''body''' - optional, a &binvar containing the data to be sent when you are POSTing<br />
* '''ID/N''' - the Nth urlget or the urlget referenced by the ID<br />
<br />
== Properties ==<br />
<br />
* '''.url''' - returns the url used<br />
* '''.redirect''' - returns the value of the location header if available<br />
* '''.method''' - returns the method used (GET/POST)<br />
* '''.type''' - returns the type of output, (binvar/file)<br />
* '''.target''' - returns the value of target (name of the binvar or filename)<br />
* '''.alias''' - returns the name of the alias used<br />
* '''.id''' - returns the ID.<br />
* '''.state''' - returns the state (ok, connect, download, fail)<br />
* '''.size''' - returns the value of the content-lenght header<br />
* '''.resume''' - returns 0 or 1 depending on if you are resumed/paused?<br />
* '''.rcvd''' - returns the number of bytes received after the header, could be different from .size after a failed download.<br />
* '''.time''' - returns the time taken to complete the processing, in millisecond<br />
* '''.reply''' - returns the response headers<br />
<br />
== Example ==<br />
Usage: /download https://www.mirc.com/versions.txt<br />
<source lang="mIRC"><br />
alias download {<br />
if (!$1) { return }<br />
<br />
if ($1 isnum) { <br />
if ($urlget($1).state == fail) { echo 4 -at Error: Connection issues! | return }<br />
<br />
.run notepad.exe $qt($urlget($1).target)<br />
}<br />
else {<br />
var %file = source.txt<br />
<br />
write -c $qt(%file)<br />
<br />
return $urlget($1,gfi,%file,download)<br />
}<br />
}</source><br />
<br />
----------<br />
<br />
Type /urlget.test<br />
<source lang="mIRC">; > POST / HTTP/1.1<br />
; > Accept: */*<br />
; > Test: Header<br />
; > Accept-Encoding: gzip, deflate<br />
; > User-Agent: mIRC<br />
; > Host: localhost<br />
; > Content-Length: 19<br />
; > Connection: Keep-Alive<br />
; > Cache-Control: no-cache<br />
; > foo1=bar1&foo2=bar2<br />
; < HTTP/1.1 200 OK<br />
; < Connection: close<br />
; < Content-Length: 5<br />
; < hello<br />
; url http://localhost/<br />
; redirect http://localhost/<br />
; method post<br />
; type binvar<br />
; target &target<br />
; alias urlget.callback<br />
; id 1027<br />
; state ok<br />
; size 5<br />
; resume 0<br />
; rcvd 5<br />
; time 125<br />
; reply HTTP/1.1 200 OKConnection: closeContent-Length: 5<br />
; response hello<br />
<br />
<br />
<br />
alias urlget.test {<br />
urlget.listen <br />
var %url = $iif($1,$1,http://localhost/)<br />
bset -t &header 1 Test: Header<br />
bset -t &body 1 foo1=bar1&foo2=bar2<br />
<br />
var %id = $urlget(%url,pb,&target,urlget.callback,&header,&body)<br />
}<br />
<br />
alias urlget.callback {<br />
var %id = $1<br />
<br />
echo -agi9 url $urlget(%id).url<br />
echo -agi9 redirect $urlget(%id).redirect<br />
echo -agi9 method $urlget(%id).method<br />
echo -agi9 type $urlget(%id).type<br />
echo -agi9 target $urlget(%id).target<br />
echo -agi9 alias $urlget(%id).alias<br />
echo -agi9 id $urlget(%id).id<br />
echo -agi9 state $urlget(%id).state<br />
echo -agi9 size $urlget(%id).size<br />
echo -agi9 resume $urlget(%id).resume<br />
echo -agi9 rcvd $urlget(%id).rcvd<br />
echo -agi9 time $urlget(%id).time<br />
echo -agi9 reply $urlget(%id).reply<br />
<br />
if ($urlget(%id).type == binvar) {<br />
echo -agi9 response $bvar($urlget(%id).target,1-3000).text<br />
}<br />
}<br />
<br />
alias urlget.listen {<br />
if (!$sock(urlget.listen)) socklisten -d 127.0.0.1 urlget.listen 80<br />
}<br />
<br />
on *:socklisten:urlget.listen:{<br />
var %sockname = urlget.client. $+ $ticks<br />
if ($sock(%sockname)) return<br />
<br />
sockaccept %sockname<br />
}<br />
<br />
on *:sockread:urlget.client.*:{<br />
var %header<br />
<br />
if (!$sock($sockname).mark) {<br />
sockread %header<br />
while (%header != $null) {<br />
echo 3 -ag > %header<br />
if ($regex(%header,Content-Length: (\d+))) {<br />
hadd -m $sockname content-length $regml(1)<br />
}<br />
sockread %header<br />
}<br />
if ($sockbr) sockmark $sockname $true<br />
}<br />
<br />
if ($sock($sockname).mark) && ($sock($sockname).rq) {<br />
sockread &read<br />
<br />
while ($sockbr) {<br />
hinc $sockname content-read $sockbr<br />
echo 6 -agi2 > $bvar(&read,1-3000).text<br />
<br />
sockread &read<br />
}<br />
}<br />
<br />
if ($hget($sockname,content-length) == 0) || ($v1 == $hget($sockname,content-read)) {<br />
socket.respond $sockname hello<br />
hfree -w $sockname<br />
}<br />
}<br />
<br />
alias -l sockwrite {<br />
echo 12 -ag < $3-<br />
sockwrite $1-<br />
}<br />
<br />
alias -l socket.respond {<br />
var %sockname = $$1, %data = $2-<br />
sockwrite -n %sockname HTTP/1.1 200 OK<br />
sockwrite -n %sockname Connection: close<br />
sockwrite -n %sockname Content-Length: $len(%data)<br />
sockwrite -n %sockname $+($crlf,%data)<br />
}</source><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|7.56}}<br />
<br />
== See also ==<br />
* {{mIRC|/url}}<br />
* {{mIRC|$url}}<br />
{{mIRC identifier list}}<br />
<br />
[[Category:mIRC identifiers|urlget]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$urlget&diff=98585
mirc/identifiers/$urlget
2021-02-28T22:26:17Z
<p>Westor: </p>
<hr />
<div>{{mirc title|$urlget identifier}}'''$urlget''' sends a HEAD/GET/POST/PUT/PATCH/DELETE to an http server. Returns an ID.<br />
<br />
== Synopsis ==<br />
<pre>$urlget(url,hgpuadfbrtic,target,alias,headers,body)<br />
$urlget(N/ID)[.prop]<br />
</pre><br />
<br />
== Parameters ==<br />
<br />
* '''url''' - the url to access, must be prefixed with http:// or https:// (maximum url characters are <b>2000</b>)<br />
* '''hgpuadfbrtic''' - switches to indicate how to proceed:<br />
** '''hgpuad''' - '''h''' for HEAD, '''g''' for GET, '''p''' for POST, '''u''' for PUT, '''a''' for PATCH, '''d''' for DELETE<br />
** '''fb''' - '''f''' to output the answer (without the responses headers) to a file, '''b''' to ouput to a binvar<br />
** '''r''' - resumes the processing<br />
** '''t''' - uses .part file if necessary<br />
** '''i''' - ignores SSL errors<br />
** '''c''' - cancel the processing<br />
* '''target''' - the output: the filename if you used '''f''', or a &binvar for '''b'''<br />
* '''alias''' - the name of the alias that is called at the end, this alias is called as a command with one parameter passed to it: the ID<br />
* '''headers''' - optional, a &binvar containing the headers to be sent, separated by $crlf<br />
* '''body''' - optional, a &binvar containing the data to be sent when you are POSTing<br />
* '''ID/N''' - the Nth urlget or the urlget referenced by the ID<br />
<br />
== Properties ==<br />
<br />
* '''.url''' - returns the url used<br />
* '''.redirect''' - returns the value of the location header if available<br />
* '''.method''' - returns the method used (GET/POST)<br />
* '''.type''' - returns the type of output, (binvar/file)<br />
* '''.target''' - returns the value of target (name of the binvar or filename)<br />
* '''.alias''' - returns the name of the alias used<br />
* '''.id''' - returns the ID.<br />
* '''.state''' - returns the state (ok, connect, download, fail)<br />
* '''.size''' - returns the value of the content-lenght header<br />
* '''.resume''' - returns 0 or 1 depending on if you are resumed/paused?<br />
* '''.rcvd''' - returns the number of bytes received after the header, could be different from .size after a failed download.<br />
* '''.time''' - returns the time taken to complete the processing, in millisecond<br />
* '''.reply''' - returns the response headers<br />
<br />
== Example ==<br />
<br />
Type /urlget.test<br />
<source lang="mIRC">; > POST / HTTP/1.1<br />
; > Accept: */*<br />
; > Test: Header<br />
; > Accept-Encoding: gzip, deflate<br />
; > User-Agent: mIRC<br />
; > Host: localhost<br />
; > Content-Length: 19<br />
; > Connection: Keep-Alive<br />
; > Cache-Control: no-cache<br />
; > foo1=bar1&foo2=bar2<br />
; < HTTP/1.1 200 OK<br />
; < Connection: close<br />
; < Content-Length: 5<br />
; < hello<br />
; url http://localhost/<br />
; redirect http://localhost/<br />
; method post<br />
; type binvar<br />
; target &target<br />
; alias urlget.callback<br />
; id 1027<br />
; state ok<br />
; size 5<br />
; resume 0<br />
; rcvd 5<br />
; time 125<br />
; reply HTTP/1.1 200 OKConnection: closeContent-Length: 5<br />
; response hello<br />
<br />
<br />
<br />
alias urlget.test {<br />
urlget.listen <br />
var %url = $iif($1,$1,http://localhost/)<br />
bset -t &header 1 Test: Header<br />
bset -t &body 1 foo1=bar1&foo2=bar2<br />
<br />
var %id = $urlget(%url,pb,&target,urlget.callback,&header,&body)<br />
}<br />
<br />
alias urlget.callback {<br />
var %id = $1<br />
<br />
echo -agi9 url $urlget(%id).url<br />
echo -agi9 redirect $urlget(%id).redirect<br />
echo -agi9 method $urlget(%id).method<br />
echo -agi9 type $urlget(%id).type<br />
echo -agi9 target $urlget(%id).target<br />
echo -agi9 alias $urlget(%id).alias<br />
echo -agi9 id $urlget(%id).id<br />
echo -agi9 state $urlget(%id).state<br />
echo -agi9 size $urlget(%id).size<br />
echo -agi9 resume $urlget(%id).resume<br />
echo -agi9 rcvd $urlget(%id).rcvd<br />
echo -agi9 time $urlget(%id).time<br />
echo -agi9 reply $urlget(%id).reply<br />
<br />
if ($urlget(%id).type == binvar) {<br />
echo -agi9 response $bvar($urlget(%id).target,1-3000).text<br />
}<br />
}<br />
<br />
alias urlget.listen {<br />
if (!$sock(urlget.listen)) socklisten -d 127.0.0.1 urlget.listen 80<br />
}<br />
<br />
on *:socklisten:urlget.listen:{<br />
var %sockname = urlget.client. $+ $ticks<br />
if ($sock(%sockname)) return<br />
<br />
sockaccept %sockname<br />
}<br />
<br />
on *:sockread:urlget.client.*:{<br />
var %header<br />
<br />
if (!$sock($sockname).mark) {<br />
sockread %header<br />
while (%header != $null) {<br />
echo 3 -ag > %header<br />
if ($regex(%header,Content-Length: (\d+))) {<br />
hadd -m $sockname content-length $regml(1)<br />
}<br />
sockread %header<br />
}<br />
if ($sockbr) sockmark $sockname $true<br />
}<br />
<br />
if ($sock($sockname).mark) && ($sock($sockname).rq) {<br />
sockread &read<br />
<br />
while ($sockbr) {<br />
hinc $sockname content-read $sockbr<br />
echo 6 -agi2 > $bvar(&read,1-3000).text<br />
<br />
sockread &read<br />
}<br />
}<br />
<br />
if ($hget($sockname,content-length) == 0) || ($v1 == $hget($sockname,content-read)) {<br />
socket.respond $sockname hello<br />
hfree -w $sockname<br />
}<br />
}<br />
<br />
alias -l sockwrite {<br />
echo 12 -ag < $3-<br />
sockwrite $1-<br />
}<br />
<br />
alias -l socket.respond {<br />
var %sockname = $$1, %data = $2-<br />
sockwrite -n %sockname HTTP/1.1 200 OK<br />
sockwrite -n %sockname Connection: close<br />
sockwrite -n %sockname Content-Length: $len(%data)<br />
sockwrite -n %sockname $+($crlf,%data)<br />
}</source><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|7.56}}<br />
<br />
== See also ==<br />
* {{mIRC|/url}}<br />
* {{mIRC|$url}}<br />
{{mIRC identifier list}}<br />
<br />
[[Category:mIRC identifiers|urlget]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$urlget&diff=98584
mirc/identifiers/$urlget
2021-02-28T22:22:15Z
<p>Westor: </p>
<hr />
<div>{{mirc title|$urlget identifier}}'''$urlget''' sends a HEAD/GET/POST/PUT/PATCH/DELETE to an http server. Returns an ID.<br />
<br />
<u>NOTE</u>: URL parameter maximum length characters are <b>2000</b>.<br />
<br />
== Synopsis ==<br />
<pre>$urlget(url,hgpuadfbrtic,target,alias,headers,body)<br />
$urlget(N/ID)[.prop]<br />
</pre><br />
<br />
== Parameters ==<br />
<br />
* '''url''' - the url to access, must be prefixed with http:// or https://<br />
* '''hgpuadfbrtic''' - switches to indicate how to proceed:<br />
** '''hgpuad''' - '''h''' for HEAD, '''g''' for GET, '''p''' for POST, '''u''' for PUT, '''a''' for PATCH, '''d''' for DELETE<br />
** '''fb''' - '''f''' to output the answer (without the responses headers) to a file, '''b''' to ouput to a binvar<br />
** '''r''' - resumes the processing<br />
** '''t''' - uses .part file if necessary<br />
** '''i''' - ignores SSL errors<br />
** '''c''' - cancel the processing<br />
* '''target''' - the output: the filename if you used '''f''', or a &binvar for '''b'''<br />
* '''alias''' - the name of the alias that is called at the end, this alias is called as a command with one parameter passed to it: the ID<br />
* '''headers''' - optional, a &binvar containing the headers to be sent, separated by $crlf<br />
* '''body''' - optional, a &binvar containing the data to be sent when you are POSTing<br />
* '''ID/N''' - the Nth urlget or the urlget referenced by the ID<br />
<br />
== Properties ==<br />
<br />
* '''.url''' - returns the url used<br />
* '''.redirect''' - returns the value of the location header if available<br />
* '''.method''' - returns the method used (GET/POST)<br />
* '''.type''' - returns the type of output, (binvar/file)<br />
* '''.target''' - returns the value of target (name of the binvar or filename)<br />
* '''.alias''' - returns the name of the alias used<br />
* '''.id''' - returns the ID.<br />
* '''.state''' - returns the state (ok, connect, download, fail)<br />
* '''.size''' - returns the value of the content-lenght header<br />
* '''.resume''' - returns 0 or 1 depending on if you are resumed/paused?<br />
* '''.rcvd''' - returns the number of bytes received after the header, could be different from .size after a failed download.<br />
* '''.time''' - returns the time taken to complete the processing, in millisecond<br />
* '''.reply''' - returns the response headers<br />
<br />
== Example ==<br />
<br />
Type /urlget.test<br />
<source lang="mIRC">; > POST / HTTP/1.1<br />
; > Accept: */*<br />
; > Test: Header<br />
; > Accept-Encoding: gzip, deflate<br />
; > User-Agent: mIRC<br />
; > Host: localhost<br />
; > Content-Length: 19<br />
; > Connection: Keep-Alive<br />
; > Cache-Control: no-cache<br />
; > foo1=bar1&foo2=bar2<br />
; < HTTP/1.1 200 OK<br />
; < Connection: close<br />
; < Content-Length: 5<br />
; < hello<br />
; url http://localhost/<br />
; redirect http://localhost/<br />
; method post<br />
; type binvar<br />
; target &target<br />
; alias urlget.callback<br />
; id 1027<br />
; state ok<br />
; size 5<br />
; resume 0<br />
; rcvd 5<br />
; time 125<br />
; reply HTTP/1.1 200 OKConnection: closeContent-Length: 5<br />
; response hello<br />
<br />
<br />
<br />
alias urlget.test {<br />
urlget.listen <br />
var %url = $iif($1,$1,http://localhost/)<br />
bset -t &header 1 Test: Header<br />
bset -t &body 1 foo1=bar1&foo2=bar2<br />
<br />
var %id = $urlget(%url,pb,&target,urlget.callback,&header,&body)<br />
}<br />
<br />
alias urlget.callback {<br />
var %id = $1<br />
<br />
echo -agi9 url $urlget(%id).url<br />
echo -agi9 redirect $urlget(%id).redirect<br />
echo -agi9 method $urlget(%id).method<br />
echo -agi9 type $urlget(%id).type<br />
echo -agi9 target $urlget(%id).target<br />
echo -agi9 alias $urlget(%id).alias<br />
echo -agi9 id $urlget(%id).id<br />
echo -agi9 state $urlget(%id).state<br />
echo -agi9 size $urlget(%id).size<br />
echo -agi9 resume $urlget(%id).resume<br />
echo -agi9 rcvd $urlget(%id).rcvd<br />
echo -agi9 time $urlget(%id).time<br />
echo -agi9 reply $urlget(%id).reply<br />
<br />
if ($urlget(%id).type == binvar) {<br />
echo -agi9 response $bvar($urlget(%id).target,1-3000).text<br />
}<br />
}<br />
<br />
alias urlget.listen {<br />
if (!$sock(urlget.listen)) socklisten -d 127.0.0.1 urlget.listen 80<br />
}<br />
<br />
on *:socklisten:urlget.listen:{<br />
var %sockname = urlget.client. $+ $ticks<br />
if ($sock(%sockname)) return<br />
<br />
sockaccept %sockname<br />
}<br />
<br />
on *:sockread:urlget.client.*:{<br />
var %header<br />
<br />
if (!$sock($sockname).mark) {<br />
sockread %header<br />
while (%header != $null) {<br />
echo 3 -ag > %header<br />
if ($regex(%header,Content-Length: (\d+))) {<br />
hadd -m $sockname content-length $regml(1)<br />
}<br />
sockread %header<br />
}<br />
if ($sockbr) sockmark $sockname $true<br />
}<br />
<br />
if ($sock($sockname).mark) && ($sock($sockname).rq) {<br />
sockread &read<br />
<br />
while ($sockbr) {<br />
hinc $sockname content-read $sockbr<br />
echo 6 -agi2 > $bvar(&read,1-3000).text<br />
<br />
sockread &read<br />
}<br />
}<br />
<br />
if ($hget($sockname,content-length) == 0) || ($v1 == $hget($sockname,content-read)) {<br />
socket.respond $sockname hello<br />
hfree -w $sockname<br />
}<br />
}<br />
<br />
alias -l sockwrite {<br />
echo 12 -ag < $3-<br />
sockwrite $1-<br />
}<br />
<br />
alias -l socket.respond {<br />
var %sockname = $$1, %data = $2-<br />
sockwrite -n %sockname HTTP/1.1 200 OK<br />
sockwrite -n %sockname Connection: close<br />
sockwrite -n %sockname Content-Length: $len(%data)<br />
sockwrite -n %sockname $+($crlf,%data)<br />
}</source><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|7.56}}<br />
<br />
== See also ==<br />
* {{mIRC|/url}}<br />
* {{mIRC|$url}}<br />
{{mIRC identifier list}}<br />
<br />
[[Category:mIRC identifiers|urlget]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$window&diff=81671
mirc/identifiers/$window
2018-08-16T21:07:16Z
<p>Westor: /* Synopsis */</p>
<hr />
<div>{{mirc title|$window Identifier}}'''$window''' returns information about the specified window for the current connection.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC">$window(N/name)</source><br />
<br />
== Parameters ==<br />
<br />
* '''N''' - The Nth @custom window, if N is 0, returns the total number of windows.<br />
* '''Name''' - The name of query/channel/@custom window, or "status window"<br />
<br />
'''Note''': you can use -1 or @desktop to refer to the screen, -2 or @mirc to refer to the main mIRC window, and -3 or @mdi to refer to the mdi window where all others windows inside mIRC are displayed, these @name are reserved. You can use the .x .y .w .h .dx .dy .dw .dh properties with these parameters to get the size of these windows (or your screen's size)<br />
<br />
== Properties ==<br />
* '''x,y,w,h''' - the left, top positions, and the width and height of the window respectively<br />
* '''dx,dy''' - the left, top positions of the window relative to the desktop<br />
* '''cx,cy''' - the left, top positions of the window relative to the primary monitor<br />
* '''dw,dh''' - the width and height of the text display area<br />
* '''bw,bh''' - the width and height of the bitmap for a graphic window<br />
* '''mdi''' - $true if the window is mdi, otherwise returns $false<br />
* '''title''' - text in the titlebar of the window<br />
* '''state''' - returns minimized/maximized/hidden/normal<br />
* '''font''' - the name of the window's font<br />
* '''fontsize''' - the window's font size<br />
* '''fontbold''' - $true if the font is bold, otherwise returns $false<br />
* '''fontitalic''' - $true if the font is italic, otherwise returns $false<br />
* '''fontcs''' - the character set of the current font<br />
* '''logfile''' - the path\filename of the window's logfile if one is open<br />
* '''stamp''' - timestamp setting, $true or $false<br />
* '''icon''' - returns on/off depending on whether icon is visible<br />
* '''ontop''' - returns ontop status for a window, $true or $false<br />
* '''type''' - returns window type: status,channel,custom,query,etc...<br />
* '''anysc''' - returns $true or $false to indicate if the /window was created using the -i switch<br />
* '''wid''' - returns the window id number<br />
* '''cid''' - returns the connection id number associated with that window. Changes based on active network if @window created using the -i switch<br />
* '''hwnd''' - returns the window handle number<br />
* '''sbtext''' - sbtext returns the switchbar button text<br />
* '''sbcolor''' the name of the switchbar highlight color, event/message/highlight, or $null if not colored<br />
* '''sbstate''' - returns switchbar button state for a window, 0=hidden 1=not hidden<br />
* '''tbtext''' - returns the treebar button text<br />
* '''tbstate''' - returns treebar button state for a window, 0=hidden 1=not hidden<br />
* '''idle''' - returns the number of second elapsed since someone different from you talked in a channel/query<br />
* '''lb''' - returns 0 if the window has no listbox, 1 if it has a listbox, or 2 if it has a side listbox<br />
<br />
== Example ==<br />
<br />
<source lang="mIRC"><br />
//echo -a There are $window(0) custom windows open $iif($window(1),The first custom window listed in 'window' menu is $v1)<br />
//echo -a Custom window @test $iif($window(@test),Does,Does Not) exist.<br />
//echo -a Channel named #test $iif($window(#test),is open on this .cid,is not open on this .cid but might be open on other .cid)<br />
</source><br />
<br />
<source lang="mIRC"><br />
//var %i $window(0) , %list | while (%i) { var %list $window(%i).sbtext %list | dec %i } | echo -a These are the @custom windows as shown in the switchbar: %list (windows listed without @ were created using -k switch) <br />
//echo -a The font of the active window is: $window($active).font $window($active).fontsize $iif($window($active).fontbold,Bold) $iif($window($active).fontitalic,Italic)<br />
//window -ea @test | titlebar @test This text appears in the titlebar | [ $iif($window(@test).type == listbox,aline,echo) ] @test The titlebar of this window shows $window(@test).title<br />
//window -c @test | window -ekaido @test | timertest 99 1 echo @test $!timer(test).reps $!asctime The Connection id $!window(@test).cid $!scid( $!window(@test).cid ).network changes as you click between windows attached to different connections<br />
</source><br />
<br />
<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.0}}<br />
<br />
== See Also ==<br />
{{mIRC|/window}}<br />
<br />
[[Category:mIRC identifiers|window]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$round&diff=81670
mirc/identifiers/$round
2018-08-16T21:06:43Z
<p>Westor: /* Synopsis */</p>
<hr />
<div>{{mirc title|$round Identifier}}'''$round''' returns a floating point number rounded to a number of decimal.<br />
<br />
<br />
== Synopsis ==<br />
<source lang="mIRC">$round(N,D)</source><br />
<br />
== Parameters ==<br />
<br />
* '''N''' - The number you want to round, can be negative. <br />
* '''D''' - The number of decimal to round. This parameter is optional, but appears to not alter the number otherwise returned by $calc().<br />
<br />
You can use the letter 'e' or 'd' as *10^N for '''N''' and '''D''', $round(5e6,2) = $round($calc(5*10^6),2)<br />
<br />
<br />
'''Note''': mIRC's floating point accuracy is currently at 6 places, so D has no effect outside the range 0-6. Rounding to D fractional digits can show fewer than D digits because it does not pad trailing zeroes.<br />
<br />
== Properties ==<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC"><br />
//echo -a $round(4.98472,3)<br />
<br />
Even though $pi has 20 decimal places, all results limited to 6 places. Note that $calc also rounds to 6 places:<br />
//echo -a $pi calc: $calc($pi) round: $round($pi,7)<br />
result: 3.14159265358979323846 calc: 3.141593 round: 3.141593<br />
<br />
Because of floating point translation to/from base 10, the result is not always the fraction expected:<br />
//var %i 1 , %list | while (%i isnum 1-100) { var %list %list $round(%i $+ .05 ,1) | inc %i } | echo -a round: %list<br />
result: round: 1.1 2 3 4 5 6 7 8.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 16.1 17.1 18.1 19.1 20.1 21.1 22.1 23.1 24.1 25.1 26.1 27.1 28.1 29.1 30.1 31.1 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100<br />
</source><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.1}}<br />
<br />
== See Also ==<br />
* {{mIRC|$int}}<br />
* {{mIRC|$ceil}}<br />
* {{mIRC|$floor}}<br />
* {{mIRC|$abs}}<br />
* {{mIRC|$calc}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$cosh&diff=81669
mirc/identifiers/$cosh
2018-08-16T21:06:20Z
<p>Westor: /* Parameters */</p>
<hr />
<div>{{mirc title|$cosh Identifier}}<br />
'''$cosh''' returns the hyperbolic cosine of an angle of N radians.<br />
<br />
<br />
== Synopsis ==<br />
<source lang="mIRC">$cosh(<N>)[.deg]</source><br />
<br />
== Switches ==<br />
None<br />
<br />
== Parameters ==<br />
<br />
* '''N''' - This is the angle in radians for which you wish to retrieve the hyperbolic cosine.<br />
<br />
You can use the letter 'e' or 'd' as *10^N, <source lang="mIRC">$cosh(5e6) = $cosh($calc(5*10^6))</source><br />
<br />
== Properties ==<br />
<br />
'''deg''' - Sees N as degrees in a 360 degree circle instead of radians.<br />
<br />
== Example ==<br />
<br />
<source lang="mIRC">//echo -a $cosh(30).deg</source><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|7.33}}<br />
<br />
== See also ==<br />
* {{mIRC|$acos}}<br />
* {{mIRC|$cos}}<br />
* {{mIRC|$sin}}<br />
* {{mIRC|$asin}}<br />
* {{mIRC|$sinh}}<br />
* {{mIRC|$tan}}<br />
* {{mIRC|$atan}}<br />
* {{mIRC|$atan2}}<br />
* {{mIRC|$tanh}}<br />
* [[List of identifiers - mIRC]]<br />
{{mIRC identifier list}}<br />
<br />
[[Category:mIRC identifiers|cosh]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$cosh&diff=81668
mirc/identifiers/$cosh
2018-08-16T21:05:47Z
<p>Westor: /* Example */</p>
<hr />
<div>{{mirc title|$cosh Identifier}}<br />
'''$cosh''' returns the hyperbolic cosine of an angle of N radians.<br />
<br />
<br />
== Synopsis ==<br />
<source lang="mIRC">$cosh(<N>)[.deg]</source><br />
<br />
== Switches ==<br />
None<br />
<br />
== Parameters ==<br />
<br />
* '''N''' - This is the angle in radians for which you wish to retrieve the hyperbolic cosine.<br />
<br />
You can use the letter 'e' or 'd' as *10^N, $cosh(5e6) = $cosh($calc(5*10^6))<br />
<br />
== Properties ==<br />
<br />
'''deg''' - Sees N as degrees in a 360 degree circle instead of radians.<br />
<br />
== Example ==<br />
<br />
<source lang="mIRC">//echo -a $cosh(30).deg</source><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|7.33}}<br />
<br />
== See also ==<br />
* {{mIRC|$acos}}<br />
* {{mIRC|$cos}}<br />
* {{mIRC|$sin}}<br />
* {{mIRC|$asin}}<br />
* {{mIRC|$sinh}}<br />
* {{mIRC|$tan}}<br />
* {{mIRC|$atan}}<br />
* {{mIRC|$atan2}}<br />
* {{mIRC|$tanh}}<br />
* [[List of identifiers - mIRC]]<br />
{{mIRC identifier list}}<br />
<br />
[[Category:mIRC identifiers|cosh]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$cosh&diff=81667
mirc/identifiers/$cosh
2018-08-16T21:05:31Z
<p>Westor: /* Synopsis */</p>
<hr />
<div>{{mirc title|$cosh Identifier}}<br />
'''$cosh''' returns the hyperbolic cosine of an angle of N radians.<br />
<br />
<br />
== Synopsis ==<br />
<source lang="mIRC">$cosh(<N>)[.deg]</source><br />
<br />
== Switches ==<br />
None<br />
<br />
== Parameters ==<br />
<br />
* '''N''' - This is the angle in radians for which you wish to retrieve the hyperbolic cosine.<br />
<br />
You can use the letter 'e' or 'd' as *10^N, $cosh(5e6) = $cosh($calc(5*10^6))<br />
<br />
== Properties ==<br />
<br />
'''deg''' - Sees N as degrees in a 360 degree circle instead of radians.<br />
<br />
== Example ==<br />
<br />
<pre>//echo -a $cosh(30).deg</pre><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|7.33}}<br />
<br />
== See also ==<br />
* {{mIRC|$acos}}<br />
* {{mIRC|$cos}}<br />
* {{mIRC|$sin}}<br />
* {{mIRC|$asin}}<br />
* {{mIRC|$sinh}}<br />
* {{mIRC|$tan}}<br />
* {{mIRC|$atan}}<br />
* {{mIRC|$atan2}}<br />
* {{mIRC|$tanh}}<br />
* [[List of identifiers - mIRC]]<br />
{{mIRC identifier list}}<br />
<br />
[[Category:mIRC identifiers|cosh]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$sqrt&diff=81666
mirc/identifiers/$sqrt
2018-08-16T21:05:12Z
<p>Westor: /* Synopsis */</p>
<hr />
<div>{{mirc title|$sqrt identifier}}'''$sqrt''' returns the square root.<br />
<br />
<br />
== Synopsis ==<br />
<source lang="mIRC">$sqrt(<N>)</source><br />
<br />
== Parameters ==<br />
* '''N''' - Number for which the square root is returned<br />
<br />
If N is negative, returns $null. You can use the letter 'e' or 'd' as *10^N, $sqrt(5e6) = $sqrt($calc(5*10^6))<br />
<br />
Square Root is limited to 6 decimal places. When squared, it often has a rounding error difference from the original N.<br />
<br />
== Example ==<br />
<source lang="mIRC"><br />
//echo -a $sqrt(3) is the same as $calc(3^.5)<br />
; returns: 1.732051 is the same as 1.732051<br />
</source><br />
<br />
<source lang="mIRC"><br />
//var %i 7 | echo -a $calc( $sqrt(%i) * $sqrt(%i) )<br />
; slight rounding error due to decimal limited to 6 places: 6.999998<br />
</source><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.3}}<br />
<br />
== See also ==<br />
* {{mIRC|$calc}}<br />
{{mIRC identifier list}}<br />
<br />
[[Category:mIRC identifiers|sqrt]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$intersect&diff=81665
mirc/identifiers/$intersect
2018-08-16T21:04:49Z
<p>Westor: /* Example */</p>
<hr />
<div>{{mirc title|$intersect Identifier}}'''$intersect''' returns the point at which two lines/rays intersect.<br />
<br />
'''Note''': $intersect does not return a point on overlaping line/ray<br />
<br />
<br />
== Synopsis ==<br />
<source lang="mIRC">$intersect(x1,y1,x2,y2,x3,y3,x4,y4,method)</source><br />
<br />
== Parameters ==<br />
* '''x1''' - the x coordinate of the first point for the first line/ray<br />
* '''y1''' - the y coordinate of the first point for the first line/ray<br />
* '''x2''' - the x coordinate of the second point for the first line/ray<br />
* '''y2''' - the y coordinate of the second point for the first line/ray<br />
* '''x3''' - the x coordinate of the first point for the second line/ray<br />
* '''y3''' - the y coordinate of the first point for the second line/ray<br />
* '''x4''' - the x coordinate of the second point for the second line/ray<br />
* '''y4''' - the y coordinate of the second point for the second line/ray<br />
* '''method''' - optional, by default the method is line/line, if specified can be "lr" for line/ray (first point is line and second is ray), "rl" for ray/line and "rr" for ray/ray<br />
<br />
"Ray" means the line defined by two points can expand infinitely in the two directions to try to cross the other line/ray whereas "line" means it doesn't expand.<br />
<br />
You can use the letter 'e' or 'd' as *10^N, for any coordinate parameters $intersect(5e6,y,x1,x1) = $intersect($calc(5*10^6),y,x1,y1)<br />
<br />
== Properties ==<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC"><br />
alias test_inter {<br />
window -c @ti<br />
window -pfdoCB @ti -1 -1 400 200<br />
var %x 50,%y 50,%x1 64,%y1 64<br />
var %x2 100,%y2 25,%x3 75,%y3 75<br />
drawline -r @ti 0 1 %x %y %x1 %y1<br />
drawline -r @ti 0 1 %x2 %y2 %x3 %y3<br />
titlebar @ti > $intersect(%x,%y,%x1,%y1,%x2,%y2,%x3,%y3) - $intersect(%x,%y,%x1,%y1,%x2,%y2,%x3,%y3,lr) - $intersect(%x,%y,%x1,%y1,%x2,%y2,%x3,%y3,rl) - $intersect(%x,%y,%x1,%y1,%x2,%y2,%x3,%y3,rr)<br />
}<br />
</source><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|7.33}}<br />
<br />
== See Also ==<br />
{{mIRC|$inellipse}}<br />
{{mIRC|$inroundrect}}<br />
{{mIRC|$inpoly}}<br />
{{mIRC|$inrect}}<br />
<br />
<br />
[[Category:mIRC identifiers|intersect]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$intersect&diff=81664
mirc/identifiers/$intersect
2018-08-16T21:04:17Z
<p>Westor: /* Synopsis */</p>
<hr />
<div>{{mirc title|$intersect Identifier}}'''$intersect''' returns the point at which two lines/rays intersect.<br />
<br />
'''Note''': $intersect does not return a point on overlaping line/ray<br />
<br />
<br />
== Synopsis ==<br />
<source lang="mIRC">$intersect(x1,y1,x2,y2,x3,y3,x4,y4,method)</source><br />
<br />
== Parameters ==<br />
* '''x1''' - the x coordinate of the first point for the first line/ray<br />
* '''y1''' - the y coordinate of the first point for the first line/ray<br />
* '''x2''' - the x coordinate of the second point for the first line/ray<br />
* '''y2''' - the y coordinate of the second point for the first line/ray<br />
* '''x3''' - the x coordinate of the first point for the second line/ray<br />
* '''y3''' - the y coordinate of the first point for the second line/ray<br />
* '''x4''' - the x coordinate of the second point for the second line/ray<br />
* '''y4''' - the y coordinate of the second point for the second line/ray<br />
* '''method''' - optional, by default the method is line/line, if specified can be "lr" for line/ray (first point is line and second is ray), "rl" for ray/line and "rr" for ray/ray<br />
<br />
"Ray" means the line defined by two points can expand infinitely in the two directions to try to cross the other line/ray whereas "line" means it doesn't expand.<br />
<br />
You can use the letter 'e' or 'd' as *10^N, for any coordinate parameters $intersect(5e6,y,x1,x1) = $intersect($calc(5*10^6),y,x1,y1)<br />
<br />
== Properties ==<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC"><br />
alias test_inter {<br />
window -c @ti<br />
window -pfdoCB @ti -1 -1 400 200<br />
var %x 50,%y 50,%x1 64,%y1 64<br />
var %x2 100,%y2 25,%x3 75,%y3 75<br />
drawline -r @ti 0 1 %x %y %x1 %y1<br />
drawline -r @ti 0 1 %x2 %y2 %x3 %y3<br />
titlebar @ti > $intersect(%x,%y,%x1,%y1,%x2,%y2,%x3,%y3) - $intersect(%x,%y,%x1,%y1,%x2,%y2,%x3,%y3,lr) - $intersect(%x,%y,%x1,%y1,%x2,%y2,%x3,%y3,rl) - $intersect(%x,%y,%x1,%y1,%x2,%y2,%x3,%y3,rr)<br />
}<br />
</source><br />
<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|7.33}}<br />
<br />
== See Also ==<br />
{{mIRC|$inellipse}}<br />
{{mIRC|$inroundrect}}<br />
{{mIRC|$inpoly}}<br />
{{mIRC|$inrect}}<br />
<br />
<br />
[[Category:mIRC identifiers|intersect]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$sinh&diff=81663
mirc/identifiers/$sinh
2018-08-16T21:03:48Z
<p>Westor: /* Example */</p>
<hr />
<div>{{mirc title|$sinh Identifier}}'''$sinh''' returns the hyperbolic sine (hypersine) of an angle of N radians.<br />
<br />
<br />
== Synopsis ==<br />
<source lang="mIRC">$sinh(<N>)[.deg]</source><br />
<br />
== Parameters ==<br />
* '''N''' - This is the angle in radians for which you wish to retrieve the hypersine.<br />
<br />
You can use the letter 'e' or 'd' as *10^N, $sinh(5e6) = $sinh($calc(5*10^6))<br />
<br />
== Properties ==<br />
* '''deg''' - Sees N as degrees in a 360 degree circle instead of radians.<br />
<br />
== Example ==<br />
<br />
<source lang="mIRC">//echo -a There are 2x pi radians in a circle, so a radian is $calc(360 / (2*$pi) ) degrees<br />
//var %e 2.718281 | var %angle $calc( 30 * $pi / 180) | echo -a $sinh(%angle) same as $calc( ((%e ^ %angle) - (%e ^ (0 - %angle) )) /2 )<br />
//var %angle 30 | echo -a $sinh(%angle).deg same as $sinh( $calc( %angle * $pi / 180) ) except for rounding<br />
</source><br />
<br />
Unlike {{mIRC|$sin}}, <source lang="mIRC">$sinh(N degrees).deg</source> is not the same as <source lang="mIRC">$sinh( N + 360 degrees).deg</source><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|7.33}}<br />
<br />
== See also ==<br />
* {{mIRC|$cos}}<br />
* {{mIRC|$acos}}<br />
* {{mIRC|$cosh}}<br />
* {{mIRC|$sin}}<br />
* {{mIRC|$asin}}<br />
* {{mIRC|$tan}}<br />
* {{mIRC|$atan}}<br />
* {{mIRC|$atan2}}<br />
* {{mIRC|$tanh}}<br />
* [[List of identifiers - mIRC]]<br />
{{mIRC identifier list}}<br />
<br />
[[Category:mIRC identifiers|sinh]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$sinh&diff=81662
mirc/identifiers/$sinh
2018-08-16T21:03:03Z
<p>Westor: /* Synopsis */</p>
<hr />
<div>{{mirc title|$sinh Identifier}}'''$sinh''' returns the hyperbolic sine (hypersine) of an angle of N radians.<br />
<br />
<br />
== Synopsis ==<br />
<source lang="mIRC">$sinh(<N>)[.deg]</source><br />
<br />
== Parameters ==<br />
* '''N''' - This is the angle in radians for which you wish to retrieve the hypersine.<br />
<br />
You can use the letter 'e' or 'd' as *10^N, $sinh(5e6) = $sinh($calc(5*10^6))<br />
<br />
== Properties ==<br />
* '''deg''' - Sees N as degrees in a 360 degree circle instead of radians.<br />
<br />
== Example ==<br />
<br />
<pre>//echo -a There are 2x pi radians in a circle, so a radian is $calc(360 / (2*$pi) ) degrees<br />
//var %e 2.718281 | var %angle $calc( 30 * $pi / 180) | echo -a $sinh(%angle) same as $calc( ((%e ^ %angle) - (%e ^ (0 - %angle) )) /2 )<br />
//var %angle 30 | echo -a $sinh(%angle).deg same as $sinh( $calc( %angle * $pi / 180) ) except for rounding<br />
</pre><br />
<br />
Unlike {{mIRC|$sin}}, $sinh(N degrees).deg is not the same as $sinh( N + 360 degrees).deg<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|7.33}}<br />
<br />
== See also ==<br />
* {{mIRC|$cos}}<br />
* {{mIRC|$acos}}<br />
* {{mIRC|$cosh}}<br />
* {{mIRC|$sin}}<br />
* {{mIRC|$asin}}<br />
* {{mIRC|$tan}}<br />
* {{mIRC|$atan}}<br />
* {{mIRC|$atan2}}<br />
* {{mIRC|$tanh}}<br />
* [[List of identifiers - mIRC]]<br />
{{mIRC identifier list}}<br />
<br />
[[Category:mIRC identifiers|sinh]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$sin&diff=81661
mirc/identifiers/$sin
2018-08-16T21:02:30Z
<p>Westor: /* Example */</p>
<hr />
<div>{{mirc title|$sin Identifier}}'''$sin''' returns the sine of an angle of N radians.<br />
<br />
<br />
== Synopsis ==<br />
<source lang="mIRC">$sin(<N>)[.deg]</source><br />
<br />
== Parameters ==<br />
* '''N''' -This is the angle in radians for which you wish to retrieve the sine.<br />
<br />
You can use the letter 'e' or 'd' as *10^N, $sin(5e6) = $sin($calc(5*10^6))<br />
<br />
== Properties ==<br />
* '''deg''' - Sees N as degrees in a 360 degree circle instead of radians.<br />
<br />
== Example ==<br />
Sine is the ratio of the Opposite Side / Hypotenuse of a right triangle, so in a right triangle from the position of an angle of 60 degrees, the length of the Opposite side is .866025 as long as the hypotenuse. As with {{mIRC|$calc|$calc()}}, the returned fraction is limited to 6 decimal places.<br />
<br />
<source lang="mIRC">//echo -a There are 2x pi radians in a circle, so a radian is $calc(360 / (2*$pi) ) degrees<br />
//var %i 60 | echo -a $sin(%i).deg is the same as $sin( $calc(%i * $left($pi,8) / 180) )<br />
</source><br />
<br />
$sin accepts numbers larger than 1 rotation of a circle, as if the angle loops past the origin and continues. Assuming you are using the .deg property, angles above 360 degrees return the same result of the angle modulo 360.<br />
<br />
<source lang="mIRC">//var %i 400 | echo -a $sin(%i).deg is the same as $sin( $calc(%i % 360) ).deg</source><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.31}}<br />
<br />
== See also ==<br />
* {{mIRC|$cos}}<br />
* {{mIRC|$acos}}<br />
* {{mIRC|$cosh}}<br />
* {{mIRC|$asin}}<br />
* {{mIRC|$sinh}}<br />
* {{mIRC|$tan}}<br />
* {{mIRC|$atan}}<br />
* {{mIRC|$atan2}}<br />
* {{mIRC|$tanh}}<br />
* [[List of identifiers - mIRC]]<br />
{{mIRC identifier list}}<br />
<br />
[[Category:mIRC identifiers|sin]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$sin&diff=81660
mirc/identifiers/$sin
2018-08-16T21:02:10Z
<p>Westor: /* Synopsis */</p>
<hr />
<div>{{mirc title|$sin Identifier}}'''$sin''' returns the sine of an angle of N radians.<br />
<br />
<br />
== Synopsis ==<br />
<source lang="mIRC">$sin(<N>)[.deg]</source><br />
<br />
== Parameters ==<br />
* '''N''' -This is the angle in radians for which you wish to retrieve the sine.<br />
<br />
You can use the letter 'e' or 'd' as *10^N, $sin(5e6) = $sin($calc(5*10^6))<br />
<br />
== Properties ==<br />
* '''deg''' - Sees N as degrees in a 360 degree circle instead of radians.<br />
<br />
== Example ==<br />
Sine is the ratio of the Opposite Side / Hypotenuse of a right triangle, so in a right triangle from the position of an angle of 60 degrees, the length of the Opposite side is .866025 as long as the hypotenuse. As with {{mIRC|$calc|$calc()}}, the returned fraction is limited to 6 decimal places.<br />
<br />
<pre>//echo -a There are 2x pi radians in a circle, so a radian is $calc(360 / (2*$pi) ) degrees<br />
//var %i 60 | echo -a $sin(%i).deg is the same as $sin( $calc(%i * $left($pi,8) / 180) )<br />
</pre><br />
<br />
$sin accepts numbers larger than 1 rotation of a circle, as if the angle loops past the origin and continues. Assuming you are using the .deg property, angles above 360 degrees return the same result of the angle modulo 360.<br />
<br />
<pre>//var %i 400 | echo -a $sin(%i).deg is the same as $sin( $calc(%i % 360) ).deg</pre><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.31}}<br />
<br />
== See also ==<br />
* {{mIRC|$cos}}<br />
* {{mIRC|$acos}}<br />
* {{mIRC|$cosh}}<br />
* {{mIRC|$asin}}<br />
* {{mIRC|$sinh}}<br />
* {{mIRC|$tan}}<br />
* {{mIRC|$atan}}<br />
* {{mIRC|$atan2}}<br />
* {{mIRC|$tanh}}<br />
* [[List of identifiers - mIRC]]<br />
{{mIRC identifier list}}<br />
<br />
[[Category:mIRC identifiers|sin]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$hypot&diff=81659
mirc/identifiers/$hypot
2018-08-16T21:01:43Z
<p>Westor: /* Synopsis */</p>
<hr />
<div>{{mirc title|$hypot Identifier}}'''$hypot''' returns the hypotenuse for the other 2 sides of a right triangle.<br />
<br />
<br />
== Synopsis ==<br />
<source lang="mIRC">$hypot(<A>,<B>)</source><br />
<br />
== Switches ==<br />
None<br />
<br />
== Parameters ==<br />
<br />
* '''A''' - One of the shorter sides of the right triangle<br />
* '''B''' - The other of the shorter sides of the right triangle<br />
<br />
Doesn't matter which order the short sides are given. You can use the letter 'e' or 'd' as *10^N, $hypot(5e6,1) = $hypot($calc(5*10^6),1)<br />
<br />
== Properties ==<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC">//var %a 3 | var %b 4 | echo -a $hypot(%a,%b) is the same as $sqrt( $calc( %a ^2 + %b ^2 ) )<br />
</source><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|7.33}}<br />
<br />
== See also ==<br />
* {{mIRC|$cos}}<br />
* {{mIRC|$acos}}<br />
* {{mIRC|$cosh}}<br />
* {{mIRC|$sin}}<br />
* {{mIRC|$asin}}<br />
* {{mIRC|$sinh}}<br />
* {{mIRC|$tan}}<br />
* {{mIRC|$atan}}<br />
* {{mIRC|$atan2}}<br />
* {{mIRC|$tanh}}<br />
* [[List of identifiers - mIRC]]<br />
{{mIRC identifier list}}<br />
[[Category:mIRC identifiers|hypot]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$cos&diff=81658
mirc/identifiers/$cos
2018-08-16T20:58:45Z
<p>Westor: /* Example */</p>
<hr />
<div>{{mirc title|$cos Identifier}}<br />
'''$cos''' returns the [[cosine]] of an angle of N radians.<br />
<br />
<br />
== Synopsis ==<br />
<source lang="mIRC">$cos(<N>)[.deg]</source><br />
<br />
== Switches ==<br />
None<br />
<br />
== Parameters ==<br />
<br />
* '''N''' - This is the angle in radians for which you wish to retrieve the cosine.<br />
<br />
You can use the letter 'e' or 'd' as *10^N, $cos(5e6) = $cos($calc(5*10^6))<br />
<br />
== Properties ==<br />
<br />
* '''deg''' - Sees N as degrees in a 360 degree circle instead of radians.<br />
<br />
== Example ==<br />
<br />
Cosine is the ratio of the Adjacent Side / Hypotenuse of a right triangle, so in a right triangle from the position of an angle of 30 degrees, the length of the Adjacent side is .866025 as long as the hypotenuse. As with {{mIRC|$calc|$calc()}}, the returned fraction is limited to 6 decimal places.<br />
<br />
<source lang="mIRC">//echo -a There are 2x pi radians in a circle, so a radian is $calc(360 / (2*$pi) ) degrees<br />
//var %i 30 | echo -a $cos(%i).deg is the same as $cos( $calc(%i * $left($pi,8) / 180) )<br />
</source><br />
<br />
$cos accepts numbers larger than 1 rotation of a circle, as if the angle loops past the origin and continues. Assuming you are using the .deg property, angles above 360 degrees return the same result of the angle modulo 360.<br />
<br />
<source lang="mIRC">//var %i 400 | echo -a $cos(%i).deg is the same as $cos( $calc(%i % 360) ).deg</source><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.31}}<br />
<br />
== See also ==<br />
* {{mIRC|$acos}}<br />
* {{mIRC|$cosh}}<br />
* {{mIRC|$sin}}<br />
* {{mIRC|$asin}}<br />
* {{mIRC|$sinh}}<br />
* {{mIRC|$tan}}<br />
* {{mIRC|$atan}}<br />
* {{mIRC|$atan2}}<br />
* {{mIRC|$tanh}}<br />
* [[List of identifiers - mIRC]]<br />
{{mIRC identifier list}}<br />
<br />
[[Category:mIRC identifiers|cos]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$cos&diff=81657
mirc/identifiers/$cos
2018-08-16T20:58:22Z
<p>Westor: /* Synopsis */</p>
<hr />
<div>{{mirc title|$cos Identifier}}<br />
'''$cos''' returns the [[cosine]] of an angle of N radians.<br />
<br />
<br />
== Synopsis ==<br />
<source lang="mIRC">$cos(<N>)[.deg]</source><br />
<br />
== Switches ==<br />
None<br />
<br />
== Parameters ==<br />
<br />
* '''N''' - This is the angle in radians for which you wish to retrieve the cosine.<br />
<br />
You can use the letter 'e' or 'd' as *10^N, $cos(5e6) = $cos($calc(5*10^6))<br />
<br />
== Properties ==<br />
<br />
* '''deg''' - Sees N as degrees in a 360 degree circle instead of radians.<br />
<br />
== Example ==<br />
<br />
Cosine is the ratio of the Adjacent Side / Hypotenuse of a right triangle, so in a right triangle from the position of an angle of 30 degrees, the length of the Adjacent side is .866025 as long as the hypotenuse. As with {{mIRC|$calc|$calc()}}, the returned fraction is limited to 6 decimal places.<br />
<br />
<pre>//echo -a There are 2x pi radians in a circle, so a radian is $calc(360 / (2*$pi) ) degrees<br />
//var %i 30 | echo -a $cos(%i).deg is the same as $cos( $calc(%i * $left($pi,8) / 180) )<br />
</pre><br />
<br />
$cos accepts numbers larger than 1 rotation of a circle, as if the angle loops past the origin and continues. Assuming you are using the .deg property, angles above 360 degrees return the same result of the angle modulo 360.<br />
<br />
<pre>//var %i 400 | echo -a $cos(%i).deg is the same as $cos( $calc(%i % 360) ).deg</pre><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.31}}<br />
<br />
== See also ==<br />
* {{mIRC|$acos}}<br />
* {{mIRC|$cosh}}<br />
* {{mIRC|$sin}}<br />
* {{mIRC|$asin}}<br />
* {{mIRC|$sinh}}<br />
* {{mIRC|$tan}}<br />
* {{mIRC|$atan}}<br />
* {{mIRC|$atan2}}<br />
* {{mIRC|$tanh}}<br />
* [[List of identifiers - mIRC]]<br />
{{mIRC identifier list}}<br />
<br />
[[Category:mIRC identifiers|cos]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$sha384&diff=81656
mirc/identifiers/$sha384
2018-08-16T20:57:30Z
<p>Westor: /* Error Messages */</p>
<hr />
<div>{{mirc title|$sha384 identifier}}'''$sha384''' calculates the sha384 hash of a text string, {{mirc|binary variables|binary variable}}, or disk file. The hash digest is 384-bits, shown as 96 lower-case hexadecimal characters.<br />
== Synopsis ==<br />
<source lang="mIRC">$sha384(plaintext|&binaryvar|filename,[N])</source><br />
<br />
== Parameters ==<br />
'''plaintext''' - Used with N = 0, the string for which you want the sha384 hash<br />
<br />
'''&binaryvar''' - A binary variable, used with N = 1, returns the sha384 hash of the content of the binvar<br />
<br />
'''filename''' - A filename, used with N = 2, returns the sha384 hash of the content of the file<br />
<br />
'''N:''' Default 0. Optional integer 0-2, where 0 indicates data is treated as plaintext, 1 indicates a &binary variable, 2 treats data as contents of a filename<br /><br />
<br />
If the N parameter isn't used, the default 0 is used (which is different than $crc which has default of N=2.)<br />
<br />
* Note: sha384 is a 'one way' cryptographic hash that's part of the SHA2 family, which also contains the sha224 sha256 and sha512 hashes, of which mIRC has not added sha224. sha384 is identical to the sha512 hash except for having a different initial 512-bit 'magic' constant, and that the hash digest displays only 6 of the 64-bit hashing variables instead of displaying all 8. This makes it no faster or slower than sha512, and no less or more secure than using the first 96 digits of the sha512 hash. Due to the 64 hex digits which aren't displayed, sha384 has 128 bits of strength against the 'length extension' attack, which is an attack against incorrect authentication using $sha384(<secret> <public string>) instead of using $hmac(public string, secret, sha512).<br />
== Properties ==<br />
None<br />
== Example ==<br />
Echo the SHA384 hash of plain text string ''abc'' to the active window:<br />
<source lang="mIRC">//echo -a $sha384(abc)</source><br />
or<br />
<source lang="mIRC">//echo -a $sha384(abc,0)</source><br />
The DATA is case-sensitive, so hash of "abc" is different than hash of "ABC"<br />
<br />
Echo the SHA384 hash of the zero-length null string to the active window:<br />
<source lang="mIRC">//echo -a $sha384($null)</source><br />
<br />
Echo the SHA384 hash of the first 1000 bytes of the mIRC program you're running to the active window:<br />
<source lang="mIRC">//bread $qt($mircexe) 0 1000 &snip | echo -a $sha384(&snip,1)</source><br />
<br />
Echo the SHA384 hash of the contents of the entire mIRC program you're running to the active window:<br />
<source lang="mIRC">//echo -a $sha384($mircexe,2)</source><br />
<br />
Note that because the default is N=0, '''$sha384($mircexe)''' is the SHA384 hash for the plaintext text string of the drive:\path\filename for the mIRC you're running, and not the hash of the filename contents. This differs from $crc($mircexe) giving the checksum of the filename contents because $crc has default of N=2.<br /><br />
mIRC v7.x Unicode-encodes bytes 128-255 to utf8 before providing to $sha384, if the text doesn't have code points above 255, you can avoid the utf8 encoding issue by using /bset to create a binvar with the -a switch.<br />
<br />
<source lang="mIRC">//var %a chloé | bset -t &bin1 1 %a | bset -ta &bin2 1 %a | echo -a $sha1(&bin1,1) vs $sha1(&bin2,1) or $bvar(&bin1,1-) vs $bvar(&bin2,1-)</source><br />
<br />
== Error Messages ==<br />
Note that $sha384 differs from $crc in that it generates error for non-existent files instead of returning hash of $null string. Also, hex string returned by $sha384 is lowercase while $crc returns uppercase hex.<br />
<br />
<source lang="mIRC">* Error accessing file: $sha384</source><br />
Either file does not exist, or file permissions don't allow the file to be read. i.e. $sha384(non-existent-file,2) or $sha384(c:\hiberfil.sys,2)<br />
<br />
<source lang="mIRC">* Invalid parameters: $sha384</source><br />
Either using a zero-length/non-existent binary variable or specifying an N outside the 0-2 valid range.<br />
<br />
<pre>Both above errors halt execution of the script</pre><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|7.42}}<br />
== See also ==<br />
{{collist<br />
|count = 3<br />
|style = width: 60%; display: inherit;<br />
|<br />
* {{mIRC|$sha1}}<br />
* {{mIRC|$sha256}}<br />
* {{mIRC|$sha512}}<br />
* {{mIRC|$hmac}}<br />
* {{mIRC|$hotp}}<br />
* {{mIRC|$totp}}<br />
* {{mIRC|$md5}}<br />
* {{mIRC|$crc}}<br />
}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$sha384&diff=81655
mirc/identifiers/$sha384
2018-08-16T20:56:29Z
<p>Westor: /* Example */</p>
<hr />
<div>{{mirc title|$sha384 identifier}}'''$sha384''' calculates the sha384 hash of a text string, {{mirc|binary variables|binary variable}}, or disk file. The hash digest is 384-bits, shown as 96 lower-case hexadecimal characters.<br />
== Synopsis ==<br />
<source lang="mIRC">$sha384(plaintext|&binaryvar|filename,[N])</source><br />
<br />
== Parameters ==<br />
'''plaintext''' - Used with N = 0, the string for which you want the sha384 hash<br />
<br />
'''&binaryvar''' - A binary variable, used with N = 1, returns the sha384 hash of the content of the binvar<br />
<br />
'''filename''' - A filename, used with N = 2, returns the sha384 hash of the content of the file<br />
<br />
'''N:''' Default 0. Optional integer 0-2, where 0 indicates data is treated as plaintext, 1 indicates a &binary variable, 2 treats data as contents of a filename<br /><br />
<br />
If the N parameter isn't used, the default 0 is used (which is different than $crc which has default of N=2.)<br />
<br />
* Note: sha384 is a 'one way' cryptographic hash that's part of the SHA2 family, which also contains the sha224 sha256 and sha512 hashes, of which mIRC has not added sha224. sha384 is identical to the sha512 hash except for having a different initial 512-bit 'magic' constant, and that the hash digest displays only 6 of the 64-bit hashing variables instead of displaying all 8. This makes it no faster or slower than sha512, and no less or more secure than using the first 96 digits of the sha512 hash. Due to the 64 hex digits which aren't displayed, sha384 has 128 bits of strength against the 'length extension' attack, which is an attack against incorrect authentication using $sha384(<secret> <public string>) instead of using $hmac(public string, secret, sha512).<br />
== Properties ==<br />
None<br />
== Example ==<br />
Echo the SHA384 hash of plain text string ''abc'' to the active window:<br />
<source lang="mIRC">//echo -a $sha384(abc)</source><br />
or<br />
<source lang="mIRC">//echo -a $sha384(abc,0)</source><br />
The DATA is case-sensitive, so hash of "abc" is different than hash of "ABC"<br />
<br />
Echo the SHA384 hash of the zero-length null string to the active window:<br />
<source lang="mIRC">//echo -a $sha384($null)</source><br />
<br />
Echo the SHA384 hash of the first 1000 bytes of the mIRC program you're running to the active window:<br />
<source lang="mIRC">//bread $qt($mircexe) 0 1000 &snip | echo -a $sha384(&snip,1)</source><br />
<br />
Echo the SHA384 hash of the contents of the entire mIRC program you're running to the active window:<br />
<source lang="mIRC">//echo -a $sha384($mircexe,2)</source><br />
<br />
Note that because the default is N=0, '''$sha384($mircexe)''' is the SHA384 hash for the plaintext text string of the drive:\path\filename for the mIRC you're running, and not the hash of the filename contents. This differs from $crc($mircexe) giving the checksum of the filename contents because $crc has default of N=2.<br /><br />
mIRC v7.x Unicode-encodes bytes 128-255 to utf8 before providing to $sha384, if the text doesn't have code points above 255, you can avoid the utf8 encoding issue by using /bset to create a binvar with the -a switch.<br />
<br />
<source lang="mIRC">//var %a chloé | bset -t &bin1 1 %a | bset -ta &bin2 1 %a | echo -a $sha1(&bin1,1) vs $sha1(&bin2,1) or $bvar(&bin1,1-) vs $bvar(&bin2,1-)</source><br />
<br />
== Error Messages ==<br />
Note that $sha384 differs from $crc in that it generates error for non-existent files instead of returning hash of $null string. Also, hex string returned by $sha384 is lowercase while $crc returns uppercase hex.<br />
<br />
<pre>* Error accessing file: $sha384</pre><br />
Either file does not exist, or file permissions don't allow the file to be read. i.e. $sha384(non-existent-file,2) or $sha384(c:\hiberfil.sys,2)<br />
<br />
<pre>* Invalid parameters: $sha384</pre><br />
Either using a zero-length/non-existent binary variable or specifying an N outside the 0-2 valid range.<br />
<br />
<pre>Both above errors halt execution of the script</pre><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|7.42}}<br />
== See also ==<br />
{{collist<br />
|count = 3<br />
|style = width: 60%; display: inherit;<br />
|<br />
* {{mIRC|$sha1}}<br />
* {{mIRC|$sha256}}<br />
* {{mIRC|$sha512}}<br />
* {{mIRC|$hmac}}<br />
* {{mIRC|$hotp}}<br />
* {{mIRC|$totp}}<br />
* {{mIRC|$md5}}<br />
* {{mIRC|$crc}}<br />
}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$sha384&diff=81654
mirc/identifiers/$sha384
2018-08-16T20:55:26Z
<p>Westor: /* Synopsis */</p>
<hr />
<div>{{mirc title|$sha384 identifier}}'''$sha384''' calculates the sha384 hash of a text string, {{mirc|binary variables|binary variable}}, or disk file. The hash digest is 384-bits, shown as 96 lower-case hexadecimal characters.<br />
== Synopsis ==<br />
<source lang="mIRC">$sha384(plaintext|&binaryvar|filename,[N])</source><br />
<br />
== Parameters ==<br />
'''plaintext''' - Used with N = 0, the string for which you want the sha384 hash<br />
<br />
'''&binaryvar''' - A binary variable, used with N = 1, returns the sha384 hash of the content of the binvar<br />
<br />
'''filename''' - A filename, used with N = 2, returns the sha384 hash of the content of the file<br />
<br />
'''N:''' Default 0. Optional integer 0-2, where 0 indicates data is treated as plaintext, 1 indicates a &binary variable, 2 treats data as contents of a filename<br /><br />
<br />
If the N parameter isn't used, the default 0 is used (which is different than $crc which has default of N=2.)<br />
<br />
* Note: sha384 is a 'one way' cryptographic hash that's part of the SHA2 family, which also contains the sha224 sha256 and sha512 hashes, of which mIRC has not added sha224. sha384 is identical to the sha512 hash except for having a different initial 512-bit 'magic' constant, and that the hash digest displays only 6 of the 64-bit hashing variables instead of displaying all 8. This makes it no faster or slower than sha512, and no less or more secure than using the first 96 digits of the sha512 hash. Due to the 64 hex digits which aren't displayed, sha384 has 128 bits of strength against the 'length extension' attack, which is an attack against incorrect authentication using $sha384(<secret> <public string>) instead of using $hmac(public string, secret, sha512).<br />
== Properties ==<br />
None<br />
== Example ==<br />
Echo the SHA384 hash of plain text string ''abc'' to the active window:<br />
<pre>//echo -a $sha384(abc)<br />
or<br />
//echo -a $sha384(abc,0)</pre><br />
The DATA is case-sensitive, so hash of "abc" is different than hash of "ABC"<br />
<br />
Echo the SHA384 hash of the zero-length null string to the active window:<br />
<pre>//echo -a $sha384($null)</pre><br />
<br />
Echo the SHA384 hash of the first 1000 bytes of the mIRC program you're running to the active window:<br />
<pre>//bread $qt($mircexe) 0 1000 &snip | echo -a $sha384(&snip,1)</pre><br />
<br />
Echo the SHA384 hash of the contents of the entire mIRC program you're running to the active window:<br />
<pre>//echo -a $sha384($mircexe,2)</pre><br />
<br />
Note that because the default is N=0, '''$sha384($mircexe)''' is the SHA384 hash for the plaintext text string of the drive:\path\filename for the mIRC you're running, and not the hash of the filename contents. This differs from $crc($mircexe) giving the checksum of the filename contents because $crc has default of N=2.<br /><br />
mIRC v7.x Unicode-encodes bytes 128-255 to utf8 before providing to $sha384, if the text doesn't have code points above 255, you can avoid the utf8 encoding issue by using /bset to create a binvar with the -a switch.<br />
<br />
<pre>//var %a chloé | bset -t &bin1 1 %a | bset -ta &bin2 1 %a | echo -a $sha1(&bin1,1) vs $sha1(&bin2,1) or $bvar(&bin1,1-) vs $bvar(&bin2,1-)</pre><br />
<br />
== Error Messages ==<br />
Note that $sha384 differs from $crc in that it generates error for non-existent files instead of returning hash of $null string. Also, hex string returned by $sha384 is lowercase while $crc returns uppercase hex.<br />
<br />
<pre>* Error accessing file: $sha384</pre><br />
Either file does not exist, or file permissions don't allow the file to be read. i.e. $sha384(non-existent-file,2) or $sha384(c:\hiberfil.sys,2)<br />
<br />
<pre>* Invalid parameters: $sha384</pre><br />
Either using a zero-length/non-existent binary variable or specifying an N outside the 0-2 valid range.<br />
<br />
<pre>Both above errors halt execution of the script</pre><br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|7.42}}<br />
== See also ==<br />
{{collist<br />
|count = 3<br />
|style = width: 60%; display: inherit;<br />
|<br />
* {{mIRC|$sha1}}<br />
* {{mIRC|$sha256}}<br />
* {{mIRC|$sha512}}<br />
* {{mIRC|$hmac}}<br />
* {{mIRC|$hotp}}<br />
* {{mIRC|$totp}}<br />
* {{mIRC|$md5}}<br />
* {{mIRC|$crc}}<br />
}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/groups&diff=81653
mirc/groups
2018-08-16T20:53:49Z
<p>Westor: </p>
<hr />
<div>Inside the script editor, you can use group to disable/enable a whole piece of code, an alias, an on text event, a menu, a dialog etc.<br />
<br />
<source lang="mIRC"><br />
#group_name off<br />
alias myalias {<br />
echo -a hey!<br />
}<br />
#group_name end<br />
</source><br />
<br />
Effectively disables the '''myalias''' alias. The keyword that can appear after the #group_name on top are "on" to enable it or "off", to disable it. At the bottom the keyword is always "end".<br />
<br />
You can use {{mIRC|/enable}} #group and {{mIRC|/disable}} #group to enable/disable a group, you can use {{mIRC|$group}} to get the state of a group, its name, and the file in which the group can be found.</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/regex&diff=81652
mirc/regex
2018-08-16T20:50:32Z
<p>Westor: /* General Information */</p>
<hr />
<div>{{mirc title|RegEx}}<br />
Regular expressions, from here on referred to as '''regex''', can be used to perform complicated pattern matching operations. Users should already be familiar with, and comfortable using, Regular expressions at this point. The [[regular expressions|Regular Expressions]] page contains more detailed information for users who are new to regex but a reminder of the syntax will be provided at the end.<br />
<br />
'''Note''': a back reference is the same as a capturing group.<br />
<br />
== General Information ==<br />
mIRC uses the 8bits version of [[PCRE library]] to implement regex with the following options enabled:<br />
<br />
* --enable-utf8<br />
* --enable-unicode-properties<br />
* --with-match-limit - around 1,000,000<br />
* --with-match-limit-recursion - 999<br />
<br />
mIRC has four custom modifiers for regex:<br />
* S - Strips control codes from the input before matching (not supported by $hfind).<br />
* g - Performs global matches: after one match has been found, mIRC tries to match again from the current position.<br />
* F - Enable the correct regex behavior: before mIRC 7.44, non participating capturing group were ignored in $regml, see http://forums.mirc.com/ubbthreads.php/topics/260397/Bug_$regmlex#Post260397<br />
* u - Enable the (*UCP) option (makes \b and \w works for unicode letters) and the (*UTF8) option (forces the string and pattern to be interpreted as utf8). <br />
<br />
mIRC does not allow you to retrieve the full match. You can access simple captures but you cannot access named capture. Here is an alias which allow you to get the full match (made by jaytea):<br />
<br />
<source lang="mIRC"><br />
;$regexm(input,regex,Nth) returns the Nth full match<br />
alias regexm {<br />
noop $regex(full, $2, /^(?|m(.)?|(/)|^)(.*?)(?:\1(?!.*\1)(.*)$)?$/usD)<br />
noop $regex(pcre, $regmlex(full, 1, 2), /^((?:(?!\((?:(?:MARK|PRUNE|SKIP|THEN|\*(?=:))(?::[^()]*)?|ACCEPT|COMMIT)\))\(\*.*?\))*)(.*)/us)<br />
if (!$regex( , $+(/, $regmlex(pcre, 1, 1), |, $regmlex(pcre, 1, 2), /))) {<br />
echo -eagc i * $!regexm: Invalid expression ( $+ $regerrstr $+ )<br />
return<br />
}<br />
var %char, %exp<br />
while ($chr($r(2048, 55295)) isin $1) /<br />
%char = $v1<br />
var %exp = $+(m, $regmlex(full, 1, 1), $regmlex(pcre, 1, 1), (?: $+ $regmlex(pcre, 1, 2) $+ \E)(?(R)|\K), $regmlex(full, 1, 1), $regmlex(full, 1, 3))<br />
var %str = $regsubex($1, %exp, %char) .<br />
if (!$pos(%str, %char, $regex($1, $2))) {<br />
noop $regex(check, $regsubex($1, $2, %char), / %char ( %char ?)/gxu)<br />
%str = $regsubex(fix, $left(%str, -2), / %char \K/gxu, $regml(check, \n)) .<br />
}<br />
noop $regex(final, $left(%str, -2), $+(/\Q, $replacecs($regsubex($1, $2, %char), \E, \E\\E\Q, %char, \E(.*?)\Q $+ %char), \E/u))<br />
if ($prop == pos) && ($3. isnum 1- $regml(final, 0)) return $calc(1 + $regml(final, $3).pos - $3)<br />
returnex $regml(final, $3 1)<br />
}</source><br />
<br />
<br />
mIRC remembers up to 50 regex matches. After 50 matches, the first match is overwritten and the backreferences for that match are lost.<br />
<br />
Example: <br />
<br />
/(This is) (a ) pattern/<br />
<br />
This represent one regular expression (or one pattern) with 2 captured backreferences.<br />
<br />
== Regex Identifiers ==<br />
The four main identifiers, ''$regex'', ''$regsub'', ''$regml'', and ''$regsubex'', can take an optional ''Name'' as a parameter. This name can be used to get the backreference captured by the regex match. If a name is not specified, mIRC uses a default one.<br />
<br />
=== $regex ===<br />
<source lang="mIRC">$regex([name],<input>,<regex>)</source><br />
<br />
The sample above performs a regular expression match and returns the number of matches found.<br />
<br />
If the /g modifier is used, that number can be greater than 1.<br />
You may see a negative value being returned if an error occured:<br />
* -8 - you reached the maximum number of backtracks allowed, for example: $regex($str(a,4000),(a+a+)*b)<br />
* -21 - you reached an internal recursion limit, for example: $regex($str(a, 1000), (a)+)<br />
<br />
=== $regml ===<br />
<source lang=mIRC>$regml([name],N)</source><br />
''$regml'' can be used to return the Nth back-reference. It takes the optional [name] used in $regex/$regsub/$regsubex. As with all other aspects of mIRC identifier, if ''0'' is specified as the Nth reference, then the total number of backreferences is returned.<br />
<br />
$regml also has a ''.pos'' property, which returns the position within the input where the capture occurred.<br />
<br />
Below is an example of a regular expression, using ''name'' as the optional ''[Name]'' property, and then using $regml to reference the match(es):<br />
<source lang="mIRC">//noop $regex(name, test, /([es])/g) | echo -a $regml(name, 0) : $regml(name, 1) -- $regml(name, 2)</source> would display "2 : e -- s"<br />
<br />
'''Note''': $regml is a list of all captures accross all the matches made (/g modifier), which is often enough, but can be a problem in some cases.<br />
<source lang="mIRC">//noop $regex(name, teasat, /([es])(a)/g) | echo -a $regml(name, 0) : $regml(name, 1) -- $regml(name, 2) -- $regml(name,3) -- $regml(name,4)</source>would display "2 : e -- a -- s -- a "<br />
You can now access the Nth captured group for a given match number with {{mIRC|$regmlex}}.<br />
<br />
=== $regmlex ===<br />
<source lang=mIRC>$regmlex([name],M,N)</source><br />
<br />
<br />
As stated above for $regml, when /g is used, $regml can be inconvenient: you cannot get all the captured group for a given match number for sure when you don't know about the pattern or input string in advance, this identifier allows you to retrieve these captured groups (backreferences). M is the Mth match and N is the Nth capturing group, N default to 1 if not specified. It supports the same properties as $regml.<br />
<br />
<br />
=== $regsub ===<br />
<source lang="mIRC">$regsub([name], <input>, <regex>, <subtext>, <%varname>)</source><br />
Performs a regular expression match, like $regex, and then performs a substitution using <subtext>. Returns the number of substitution made and fills <%varname> with the resulting text<br />
<br />
<source lang="mIRC">//var %res | noop $regsub(name,test,/([es])/g,t,%res) | echo -a $regml(name,0) : $regml(name,1) -- $regml(name,2) : %res</source><br />
<br />
=== $regsubex ===<br />
<source lang="mIRC">$regsubex([name],<input>,<regex>,<subtext>)</source><br />
$regsubex is a more modern version of $regsub, in that it performs the match, then the substitution, and finally returns the result of the substitution.<br />
<br />
This time, <subtext> is evaluated during substitution so you can use %variables and $identifiers there, they will be evaluated.<br />
<br />
'''Note''': You can now use $regsubex the same way as $regsub to get it to return the number of match and filling a %variable with the result, the name is required, both also supports output to a binvar: $regsubex(name,<input>,<regex>,<subtext>,%var|&binvar)<br />
<br />
==== Markers, $1- and Nested $regsubex calls ====<br />
<br />
Special markers can be used inside the <subtext> parameter of $regsubex:<br />
<br />
* \0 - Returns the number of matches.<br />
* \n - Returns the current match number.<br />
* \t - Returns the current match text (same as $regml(\n)).<br />
* \a - Returns all matching items.<br />
* \A - Returns a non-spaced version of \a.<br />
* \1 \2 \N ... - Returns the Nth back-reference made for a given match<br />
<br />
<source lang="mIRC">$regsubex(a@bc@ef,/([a-z])([a-z])/g,<\1><\n><\t><\a><\A><\2>)</source><br />
<br />
Here you have two matches with two backreferences made per match:<br />
<br />
First match is on 'bc':<br />
* \1 is 'b'<br />
* \2 is 'c'<br />
* \n is 1 because it's the first match.<br />
* \t is the current matchtext (same as $regml(\n)), which is 'b'<br />
* \a is "b c" while \A is "bc"<br />
Second match is on 'ef':<br />
* \1 is 'e'<br />
* \2 is 'f'<br />
* \n is 2 because it's the second match.<br />
* \t is the current matchtext (same as $regml(\n)), which is 'c' and not 'e' (\n is 2), it is important to note that when you have more than one backreference and more than one match (because of the /g modifier), \t is a bit meaningless.<br />
* \a is "e f" while \A is "ef"<br />
<br />
The way mIRC evaluates those markers is special, it is important at this point to talk about the main steps happening when evaluating $identifiers:<br />
* Process '''[ ]''', which evaluates any variables/identifiers inside of the brackets once, and '''[[ ]]''', which turns into '''[ ]'''.<br />
* Separates the identifier's parameters and evaluates each parameter once. These evaluations take place in order from left to right.<br />
* Passes the parameters to the identifier<br />
<br />
'''$regsubex''' is a bit different, it has its own parsing routine. By design, '''$regsubex''' must not evaluate the ''subtext'' parameter before doing the regex match. The steps for '''$regsubex''' are shown below:<br />
* Process [ ] and [[ ]].<br />
* Seperate parameters, evaluate the 'input' and the 'regex' parameters.<br />
* Perform the regex match.<br />
* Tokenize '''$1-''' according to the number of markers used in the 'subtext' parameters.<br />
* Replaces any markers used in the subtext with their corresponding '''$N''' identifiers's values.<br />
* Evaluate the '''subtext''' parameter (one or more times, if /g is used).<br />
* Performs the substitutions and returns the result.<br />
<br />
mIRC internally uses '''$1-''' to store the values of the markers, it means the previous tokenization of $1- cannot be used in the '''subtext''' parameter (it is restored after). <br />
<br />
The way mIRC does this is quite special, it checks how many markers you have and creates a list of tokens (so, with $1-). Each token is assigned a value and mIRC then replaces the markers with the corresponding $N value before evaluating that result.<br />
<br />
Let's have a look at an example, consider the following subtext:<br />
<source lang="mIRC">\t \t \1 \n</source><br />
mIRC assigns the value of \t to ''$1'' & ''$2'', \1 is assigned to ''$3'' and finally, \n is assigned to ''$4''.<br />
<br />
Then each marker is replaced with their corresponding values, the subtext becomes:<br />
<source lang="mIRC">$1 $2 $3 $4</source><br />
And now mIRC evaluates that for each match and use it as a replacement.<br />
<br />
'''Note''': If the form '''\N''' is used in the subtext, where N is a positive number greater-than or equal to 1 (such as '''\1'''), and there is no such back-reference number in the pattern, mIRC will use the value of '''$regml(\n + N - 1)'''.<br />
<br />
An example of this is shown below:<br />
<source lang="mIRC">$regsubex(abcdefgij,/([a-z])/g,<\6>)</source><br />
Here we have a break-down of the results of this regex:<br />
* The '''\6''' doesn't mean anything, as there are not 6 back-references made in the pattern (only one backreference, the pattern will, however, be applied 6 times and more because of the /g modifier)<br />
* When ''a'' is matched, '''\n''' is ''1'', and only one marker is used. Therefore, '''$1''' (used to represent \6) is filled with ''$regml(1 + 6 -1) = $regml(6)'', which is '''f'''<br />
* When ''b'' is matched, '''\n''' is ''2'', '''$1''' is then filled with ''$regml(2 + 6 - 1) = $regml(7)'', which is '''g'''<br />
* And so on until '''\n + N - 1''' is greater than the total number of back-references, which at this point, '''$null''' is used.<br />
<br />
==== Nested calls ====<br />
Nested '''$regsubex''' calls are possible, but caution must be taken with markers.<br />
<br />
First of all, if you use the /g modifier in either the outer or the inner $regsubex call and you need to use the different backreferences made in either of them, you must give a name to either one or both of them, otherwise, the call of the inner $regsubex will overwrite the backreferences of the outer $regsubex (if you don't use a name, mIRC use a default name, which would be the same here).<br />
<br />
When mIRC replaces the markers, it will do so on the whole subtext parameter, consider:<br />
<source lang="mIRC">$regsubex(name,abcdefcdab,/(cd)/g,$regsubex(\t,/(.)/g,$upper(\t)))</source><br />
<br />
In the above example, the outer '''$regsubex''' will make the regex match, then it will loop on the result and replace ''\t'' accordingly everywhere in the subtext. Notice the subtext of the outer '''$regsubex''' is:<br />
<source lang="mIRC">$regsubex(\t,/(.)/g,$upper(\t))</source><br />
All occurences of '''\t''' (can appear anywhere and it can be touching others characters) are changed with their corresponding $N value, even the one inside '''$upper'''; this means that the code won't work as expected. Typically we want this '''\t''' inside $upper() to be the corresponding value from the inner $regsubex, not the outer one.<br />
<br />
The idea is to get mIRC to see something other than '''\t''' (inside that $upper()) when looking for markers from the outer '''$regsubex''' context.<br />
<br />
A simple $+ cannot be used:<br />
<source lang="mIRC">$regsubex(\t,/(.)/g,$upper( \ $+ t ))</source><br />
Having this as the subtext of the $regsubex would end up calling '''$upper(\t)''' with plain text "\t", because the '''$+''' is going to be evaluated after the inner $regsubex made his own regex match & loop over its results, which is after both $regsubex looked for markers. Something need to be done before the markers of the inner $regsubex are replaced but after the outer $regsubex made his match: when the outer $regsubex is ready to loop over its result.<br />
<br />
The solution is to use the '''<nowiki>[[ \ $+ t ]]</nowiki>''' construct:<br />
<source lang="mIRC">$regsubex(name,abcdefcdab,/(cd)/g,$regsubex(\t,/(.)/g,$upper( [[ \ $+ t ]] )))</source><br />
<br />
Indeed, the processing of '''<nowiki>[ ] and [[ ]]</nowiki>''' is done for the whole line. mIRC first changes this line into:<br />
<source lang="mIRC">$regsubex(name,abcdefcdab,/(cd)/g,$regsubex(\t,/(.)/g,$upper( [ \ $+ t ] )))</source><br />
<br />
The example above conveys how only the '''[[ ]]''' has changed. Remember '''$+''' was not evaluated because the subtext parameter of $regsubex is not evaluated until the regex match is performed.<br />
<br />
Now, the outer '''$regsubex''' is evaluated, it gets its parameters (without evaluating the subtext), makes the regex match, and calls the subtext for each match, the subtext is:<br />
<source lang="mIRC">$regsubex(<value of \t from the outer $regsubex>,/(.)/g,$upper( [ \ $+ t ] ))</source><br />
<br />
And when this $regsubex evaluates (for each replacement of the outer $regsubex) [ \ $+ t ] will first produce \t, and everything works as we wanted.<br />
<br />
The more nested $regsubex you have, the more you have to make sure each subtext has the correct number of [[ ]].<br />
<br />
Obviously, you can make this cleaner by calling a custom alias as the subtext with the markers passed as parameters and doing the nested $regsubex call here, but this is possible.<br />
<br />
==== No Marker ====<br />
<br />
You cannot use a marker inside the subtext of the inner $regsubex to get the value of the marker of the outer $regsubex context, that's why our previous example fails:<br />
<br />
<source lang="mIRC">$regsubex(name,abcdefcdab,/(cd)/g,$regsubex(\t,/(.)/g,$upper(\t)))</source><br />
<br />
You are tempted to think that \t inside $upper should always be "cd", because that's the only value that \t can have from the outer $regsubex and we just saw how the marker are replaced for the whole subtext, no matter where it appears. However, we also saw that mIRC does not blindly replace the markers with their real value, it uses the intermediate tokens identifiers ($1 etc), this is required otherwise element such as ) would be taken as closing parenthesis for identifier for example, or comma as argument seperator inside an identifier:<br />
<br />
Two markers are used in the subtext of the outer $regsubex, so mIRC make the match, cd is found twice so a two iterations loop is made, each time replacing the match with the evaluation of the subtext parameter. Right before that loop, because two markers are used, mIRC fills $1 with \t as well as $2 with \t and then evaluate the subtext, which gives before evaluation:<br />
<br />
<source lang="mIRC">$regsubex($1,/(.)/g,$upper( $+ $2 $+ )))</source><br />
<br />
However remember that the subtext is not evaluated before the regex match is done, so only $1 gets evaluated here:<br />
<br />
<source lang="mIRC">$regsubex(cd,/(.)/g,$upper( $+ $2 $+ )))</source><br />
<br />
As you can see, mIRC adds the '''$+''' if the markers have text surrounding them, that's why you don't need to space them out like identifiers.<br />
You might understand why it's failing at this point: $2 has no value in this example because no marker are used in this inner $regsubex's subtext parameter, so $2 is $null.<br />
<br />
So how do you use the value of the marker of the outer $regsubex inside the subtext of the inner $regsubex?<br />
<br />
The solution is to use '''<nowiki>[[ \t ]]</nowiki>''':<br />
<br />
<source lang="mIRC">$regsubex(name,abcdefcdab,/(cd)/g,$regsubex(\t,/(.)/g,$upper( [[ \t ]] )))</source><br />
<br />
As we saw, mIRC will first turn this line into<br />
<br />
<source lang="mIRC">$regsubex(name,abcdefcdab,/(cd)/g,$regsubex(\t,/(.)/g,$upper( [ \t ] )))</source><br />
<br />
Then the outer $regsubex will make the regex match and replaces markers so the subtext of the outer regsubex becomes:<br />
<br />
<source lang="mIRC">$regsubex($1,/(.)/g,$upper( [ $+ $2 $+ ] )))</source><br />
<br />
The difference is that you now have a pair of bracket, which are processed first, forcing the evaluation of $2, which has the correct value at this point.<br />
<br />
'''Note''': the more you are nesting, the more you need to get mIRC to see the correct things, which easily gets ugly, calling an alias in the subtext to do the replacement is recommended.<br />
<br />
== /filter ==<br />
{{mIRC|/filter}} supports the ''-g'' switch, which uses a regular expression. It is important to note that the back-reference value cannot be obtained using '''$regml''' if a custom alias is used as the output (''-k''). In order to be able to use '''$regml''', '''$regex''' would need to be called.<br />
<br />
== $hfind ==<br />
'''$hfind''' can be used along with '''regex'''. However, '''$hfind''' does not support the custom '''S''' modifier.<br />
<br />
== /write, $read, $fline, etc ==<br />
These, and many more, are various places where [[regular expression|Regular Expression]] can be used.<br />
<br />
== Syntax ==<br />
<br />
This part is meant to document all the different features of PCRE that work with mIRC, and to explain a bit of regular expression works.<br />
<br />
A regular expression is a pattern that is matched against a subject string from left to right. Most characters stand for themselves in a pattern, and match the corresponding characters in the subject.<br />
<br />
As a trivial example, the pattern "The quick brown fox" matches a portion of a subject string that is identical to itself.<br />
<br />
The power of regular expressions comes from the ability to include alternatives and repetitions in the pattern.<br />
<br />
These are encoded in the pattern by the use of metacharacters, which do not stand for themselves but instead are interpreted in some special way.<br />
<br />
There are two different sets of metacharacters: those that are recognized anywhere in the pattern except within square brackets, and those that are recognized within square brackets.<br />
<br />
=== Outside square brackets ===<br />
<br />
The metacharacters are as follows:<br />
<br />
\ general escape character with several uses<br />
^ assert start of string (or line, in multiline mode)<br />
$ assert end of string (or line, in multiline mode)<br />
. match any character except newline (by default)<br />
[ start character class definition<br />
| start of alternative branch<br />
( start subpattern<br />
) end subpattern<br />
? extends the meaning of '(', also 0 or 1 quantifier, also "quantifier minimizer"<br />
* 0 or more quantifier<br />
+ 1 or more quantifier, also "possessive quantifier"<br />
{ start min/max quantifier<br />
<br />
=== Inside a character class ===<br />
<br />
Part of a pattern that is in square brackets is called a "character class".<br />
<br />
In a character class the only metacharacters are:<br />
<br />
\ general escape character<br />
^ negate the class, but only if the first character<br />
- indicates character range<br />
[ POSIX character class (only if followed by POSIX syntax)<br />
] terminates the character class<br />
<br />
=== The Backslash \ ===<br />
<br />
The backslash character has several uses. Firstly, if it is followed by a character that is not a number or a letter, it takes away any special meaning that character may have.<br />
<br />
This use of backslash as an escape character applies both inside and outside character classes.<br />
<br />
Another usage of the backslash is to represent non printable character, they can all be used inside a character class:<br />
<br />
\a Bel character, ascii 07<br />
\cx where x is any ascii character. The precise effect of \cx on ASCII characters is as follows: if x is a lower case letter, it is converted to upper case. Then bit 6 of the character (hex 40) is inverted. Thus \cA to \cZ become hex 01 to hex 1A (A is 41, Z is 5A), but \c{ becomes hex 3B ({ is 7B), and \c; becomes hex 7B (; is 3B). If the data item (byte or 16-bit value) following \c has a value greater than 127, a compile-time error occurs. This locks out non-ASCII characters.<br />
\e escape character, ascii 27<br />
\f form feed character, ascii 12<br />
\n linefeed character, ascii 10<br />
\r carriage return character, ascii 13<br />
\t tab character, ascii 09<br />
\0dd character with octal code 0dd. After \0, up to two further octal digits are read. If there are fewer than two digits, just those that are present are used. Thus the sequence \0\x\015 specifies two binary zeros followed by a CR character. Make sure you supply two digits after the initial zero if the pattern character that follows is itself an octal digit.<br />
\ddd character with octal code ddd, or back reference<br />
\o{ddd..} character with octal code ddd.. The escape \o must be followed by a sequence of octal digits, enclosed in braces. An error occurs if this is not the case. This escape is an addition to Perl; it provides way of specifying character code points as octal numbers greater than 0777, and it also allows octal numbers and back references to be unambiguously specified.<br />
\xhh character with hex code hh<br />
\x{hhh..} character with hex code hhh..<br />
<br />
For greater clarity and unambiguity, it is best to avoid following \ by a digit greater than zero. Instead, use \o{} or \x{} to specify character numbers, and \g{} to specify back references. The following paragraphs describe the old, ambiguous syntax.<br />
<br />
The handling of a backslash followed by a digit other than 0 is complicated, and Perl has changed in recent releases, causing PCRE also to change.<br />
<br />
Outside a character class, PCRE reads the digit and any following digits as a decimal number.<br />
If the number is less than 8, or if there have been at least that many previous capturing left parentheses in the expression, the entire sequence is taken as a back reference.<br />
<br />
Inside a character class, or if the decimal number following \ is greater than 7 and there have not been that many capturing subpatterns, PCRE handles \8 and \9 as the literal characters "8" and "9", and otherwise re-reads up to three octal digits following the backslash, using them to generate a data character. Any subsequent digits stand for themselves. <br />
<br />
For example:<br />
<br />
\040 is another way of writing an ASCII space<br />
\40 is the same, provided there are fewer than 40 previous capturing subpatterns<br />
\7 is always a back reference<br />
\11 might be a back reference, or another way of writing a tab<br />
\011 is always a tab<br />
\0113 is a tab followed by the character "3"<br />
\113 might be a back reference, otherwise the character with octal code 113<br />
\377 might be a back reference, otherwise the value 255 (decimal)<br />
\81 is either a back reference, or the two characters "8" and "1"<br />
<br />
Note that octal values of 100 or greater that are specified using this syntax must not be introduced by a leading zero, because no more than three octal digits are ever read.<br />
<br />
By default, after \x that is not followed by {, from zero to two hexadecimal digits are read (letters can be in upper or lower case).<br />
Any number of hexadecimal digits may appear between \x{ and }. If a character other than a hexadecimal digit appears between \x{ and }, or if there is no terminating }, an error occurs.<br />
<br />
Characters that are specified using octal or hexadecimal numbers are limited to certain values, less than 0x10ffff and a valid codepoint.<br />
<br />
Invalid Unicode codepoints are the range 0xd800 to 0xdfff (the so called "surrogate" codepoints), and 0xffef.<br />
<br />
All the sequences that define a single character value can be used both inside and outside character classes. In addition, inside a character class, \b is interpreted as the backspace character (ascii 08).<br />
<br />
\N matches a non newline character, (same as the dot '.' without single line mode (/s modifier), it is not allowed inside a character class.<br />
<br />
\g+N or \g-N is a relative back reference, it matches the value of the capturing group that can be found by counting as many opening parentheses of named or numbered capturing groups as specified by the number from right to left starting at the backreference. (a)(b)(c)(d)\g<-3> matches abcdb.<br />
<br />
Another use of backslash is for specifying generic character types:<br />
<br />
\d any decimal digit<br />
\D any character that is not a decimal digit<br />
\h any horizontal white space character<br />
\H any character that is not a horizontal white space character<br />
\s any white space character<br />
\S any character that is not a white space character<br />
\v any vertical white space character<br />
\V any character that is not a vertical white space character<br />
\w any "word" character<br />
\W any "non-word" character<br />
[[Category:mIRC|regex]]</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$lof&diff=44561
mirc/identifiers/$lof
2017-06-12T15:07:29Z
<p>Westor: /* See Also */</p>
<hr />
<div><br />
<br />
{{mirc title|$lof Identifier}}'''$lof(filename)''' Returns the bytes size information about the specified file, same as ''$file().size'' identifier.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$lof(filename)</source><br />
<br />
== Parameters ==<br />
<br />
'''* Filename''' = ''The filename that you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Examples ==<br />
<source lang="mIRC">//echo -a $lof($mircexe)</source><br />
<br />
It will return the bytes size of the mirc.exe file that you already using.<br />
<br />
<source lang="mIRC">//echo -a $lof(mirc.ini)</source><br />
<br />
It will return the bytes size (e.g: 14056) of the mirc.ini file that you already using.<br />
<br />
<source lang="mIRC">//echo -a $bytes($lof($mircini)).suf</source><br />
<br />
It will return the original size (e.g: 14KB) of the mirc.ini file that you already using.<br />
<br />
<br />
'''NOTE:''' It will return "'''$null'''" if the file doesn't exists to the path.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|4.52}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$file}}<br />
* {{mIRC|$mircini}}<br />
* {{mIRC|$mircdir}}<br />
* {{mIRC|$null}}<br />
* {{mIRC|$bytes}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$lof&diff=44559
mirc/identifiers/$lof
2017-06-12T15:03:19Z
<p>Westor: /* Examples */</p>
<hr />
<div><br />
<br />
{{mirc title|$lof Identifier}}'''$lof(filename)''' Returns the bytes size information about the specified file, same as ''$file().size'' identifier.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$lof(filename)</source><br />
<br />
== Parameters ==<br />
<br />
'''* Filename''' = ''The filename that you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Examples ==<br />
<source lang="mIRC">//echo -a $lof($mircexe)</source><br />
<br />
It will return the bytes size of the mirc.exe file that you already using.<br />
<br />
<source lang="mIRC">//echo -a $lof(mirc.ini)</source><br />
<br />
It will return the bytes size (e.g: 14056) of the mirc.ini file that you already using.<br />
<br />
<source lang="mIRC">//echo -a $bytes($lof($mircini)).suf</source><br />
<br />
It will return the original size (e.g: 14KB) of the mirc.ini file that you already using.<br />
<br />
<br />
'''NOTE:''' It will return "'''$null'''" if the file doesn't exists to the path.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|4.52}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$file}}<br />
* {{mIRC|$mircini}}<br />
* {{mIRC|$mircdir}}<br />
* {{mIRC|$null}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$lof&diff=44558
mirc/identifiers/$lof
2017-06-12T15:01:58Z
<p>Westor: /* Examples */</p>
<hr />
<div><br />
<br />
{{mirc title|$lof Identifier}}'''$lof(filename)''' Returns the bytes size information about the specified file, same as ''$file().size'' identifier.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$lof(filename)</source><br />
<br />
== Parameters ==<br />
<br />
'''* Filename''' = ''The filename that you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Examples ==<br />
<source lang="mIRC">//echo -a $lof($mircexe)</source><br />
<br />
It will return the bytes size of the mirc.exe file that you already using.<br />
<br />
<source lang="mIRC">//echo -a $lof(mirc.ini)</source><br />
<br />
It will return the bytes size of the mirc.ini file that you already using.<br />
<br />
<source lang="mIRC">//echo -a $bytes($lof($mircini)).suf</source><br />
<br />
It will return the original size of the mirc.ini file that you already using.<br />
<br />
'''NOTE:''' It will return "'''$null'''" if the file doesn't exists to the path.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|4.52}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$file}}<br />
* {{mIRC|$mircini}}<br />
* {{mIRC|$mircdir}}<br />
* {{mIRC|$null}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$lof&diff=44557
mirc/identifiers/$lof
2017-06-12T15:01:14Z
<p>Westor: Created page with " {{mirc title|$lof Identifier}}'''$lof(filename)''' Returns the bytes size information about the specified file, same as ''$file().size'' identifier. == Synopsis == <source..."</p>
<hr />
<div><br />
<br />
{{mirc title|$lof Identifier}}'''$lof(filename)''' Returns the bytes size information about the specified file, same as ''$file().size'' identifier.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$lof(filename)</source><br />
<br />
== Parameters ==<br />
<br />
'''* Filename''' = ''The filename that you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Examples ==<br />
<source lang="mIRC">//echo -a $lof($mircexe)</source><br />
<br />
It will return the bytes size of the mirc.exe file that you already using.<br />
<br />
<source lang="mIRC">//echo -a $lof($mircini)</source><br />
<br />
It will return the bytes size of the mirc.ini file that you already using.<br />
<br />
<source lang="mIRC">//echo -a $bytes($lof($mircini)).suf</source><br />
<br />
It will return the original size of the mirc.ini file that you already using.<br />
<br />
'''NOTE:''' It will return "'''$null'''" if the file doesn't exists to the path.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|4.52}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$file}}<br />
* {{mIRC|$mircini}}<br />
* {{mIRC|$mircdir}}<br />
* {{mIRC|$null}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$shortfn&diff=44556
mirc/identifiers/$shortfn
2017-06-12T14:52:23Z
<p>Westor: Created page with " {{mirc title|$shortfn Identifier}}'''$shortfn(path)''' Returns short version of a long filename. == Synopsis == <source lang="mIRC"> $shortfn(path)</source> == Parameters..."</p>
<hr />
<div><br />
<br />
{{mirc title|$shortfn Identifier}}'''$shortfn(path)''' Returns short version of a long filename.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$shortfn(path)</source><br />
<br />
== Parameters ==<br />
<br />
'''* Path''' = ''The direction/path that you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Examples ==<br />
<source lang="mIRC">//echo -a $shortfn($longfn($mircdir))</source><br />
<br />
It will return for example the "'''C:\Users\westor\DOCUME~1\mIRC\'''" short path version of the specified direction.<br />
<br />
<source lang="mIRC">//echo -a $shortfn(C:\Users\westor\Documents\mIRC\)</source><br />
<br />
It will return "'''C:\Users\westor\DOCUME~1\mIRC\'''" short path version of the long version one that you have specified.<br />
<br />
<br />
'''NOTE:''' In order to return the short version of the path, the path MUST be exists.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.7}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$longfn}}<br />
* {{mIRC|$exists}}<br />
* {{mIRC|$isdir}}<br />
* {{mIRC|$mircdir}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$longfn&diff=44555
mirc/identifiers/$longfn
2017-06-12T14:47:37Z
<p>Westor: /* Examples */</p>
<hr />
<div><br />
<br />
{{mirc title|$longfn Identifier}}'''$longfn(path)''' Returns long version of a short filename.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$longfn(path)</source><br />
<br />
== Parameters ==<br />
<br />
'''* Path''' = ''The direction/path that you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Examples ==<br />
<source lang="mIRC">//echo -a $longfn($shortfn($mircdir))</source><br />
<br />
It will return for example the "'''C:\Users\westor\Documents\mIRC\'''" long path version of the specified direction.<br />
<br />
<source lang="mIRC">//echo -a $longfn(C:\Users\westor\DOCUME~1\mIRC\)</source><br />
<br />
It will return "'''C:\Users\westor\Documents\mIRC\'''" long path version of the short version one that you have specified.<br />
<br />
<br />
'''NOTE:''' In order to return the long version of the path, the path MUST be exists.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.7}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$shortfn}}<br />
* {{mIRC|$exists}}<br />
* {{mIRC|$isdir}}<br />
* {{mIRC|$mircdir}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$longfn&diff=44554
mirc/identifiers/$longfn
2017-06-12T14:46:47Z
<p>Westor: /* Examples */</p>
<hr />
<div><br />
<br />
{{mirc title|$longfn Identifier}}'''$longfn(path)''' Returns long version of a short filename.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$longfn(path)</source><br />
<br />
== Parameters ==<br />
<br />
'''* Path''' = ''The direction/path that you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Examples ==<br />
<source lang="mIRC">//echo -a $longfn($mircdir)</source><br />
<br />
It will return for example the "'''C:\Users\westor\Documents\mIRC\'''" long path version of the specified direction.<br />
<br />
<source lang="mIRC">//echo -a $longfn(C:\Users\westor\DOCUME~1\mIRC\)</source><br />
<br />
It will return "'''C:\Users\westor\Documents\mIRC\'''" long path version of the short version one that you have specified.<br />
<br />
<br />
'''NOTE:''' In order to return the long version of the path, the path MUST be exists.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.7}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$shortfn}}<br />
* {{mIRC|$exists}}<br />
* {{mIRC|$isdir}}<br />
* {{mIRC|$mircdir}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$longfn&diff=44553
mirc/identifiers/$longfn
2017-06-12T14:46:22Z
<p>Westor: /* Example */</p>
<hr />
<div><br />
<br />
{{mirc title|$longfn Identifier}}'''$longfn(path)''' Returns long version of a short filename.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$longfn(path)</source><br />
<br />
== Parameters ==<br />
<br />
'''* Path''' = ''The direction/path that you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Examples ==<br />
<source lang="mIRC">//echo -a $longfn($mircdir)</source><br />
<br />
It will return for example the "'''C:\Users\westor\Documents\mIRC\'''" long path version of the specified direction.<br />
<br />
<source lang="mIRC">//echo -a $longfn(C:\Users\westor\DOCUME~1\mIRC\)</source><br />
<br />
It will return "'''C:\Users\westor\Documents\mIRC\'''" long path version of the short version one that you have specified.<br />
<br />
'''NOTE:''' In order to return the long version of the path, the path MUST be exists.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.7}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$shortfn}}<br />
* {{mIRC|$exists}}<br />
* {{mIRC|$isdir}}<br />
* {{mIRC|$mircdir}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$longfn&diff=44552
mirc/identifiers/$longfn
2017-06-12T14:46:00Z
<p>Westor: Created page with " {{mirc title|$longfn Identifier}}'''$longfn(path)''' Returns long version of a short filename. == Synopsis == <source lang="mIRC"> $longfn(path)</source> == Parameters ==..."</p>
<hr />
<div><br />
<br />
{{mirc title|$longfn Identifier}}'''$longfn(path)''' Returns long version of a short filename.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$longfn(path)</source><br />
<br />
== Parameters ==<br />
<br />
'''* Path''' = ''The direction/path that you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC">//echo -a $longfn($mircdir)</source><br />
<br />
It will return for example the "'''C:\Users\westor\Documents\mIRC\'''" long path version of the specified direction.<br />
<br />
<source lang="mIRC">//echo -a $longfn(C:\Users\westor\DOCUME~1\mIRC\)</source><br />
<br />
It will return "'''C:\Users\westor\Documents\mIRC\'''" long path version of the short version one that you have specified.<br />
<br />
'''NOTE:''' In order to return the long version of the path, the path MUST be exists.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.7}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$shortfn}}<br />
* {{mIRC|$exists}}<br />
* {{mIRC|$isdir}}<br />
* {{mIRC|$mircdir}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$isdde&diff=44551
mirc/identifiers/$isdde
2017-06-12T14:31:57Z
<p>Westor: /* Paramters */</p>
<hr />
<div><br />
<br />
{{mirc title|$isdde Identifier}}'''$isdde(text)''' Returns $true if the specified dde name is in use, $false otherwise.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$isdde(text)</source><br />
<br />
== Parameters ==<br />
<br />
'''* Text''' = ''The DDE name you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC">//echo -a $isdde(mIRC)</source><br />
<br />
It will return '''$true''' if the currently mIRC using DDE name is the one that you specified, otherwise will be '''$false'''.<br />
<br />
<br />
'''NOTE''': The default mIRC dde name is "'''mIRC'''", if you would never change that from the options then is gonna be that for ever.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.41}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$dde}}<br />
* {{mIRC|$ddename}}<br />
* {{mIRC|/dde}}<br />
* {{mIRC|/ddeserver}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$int&diff=44550
mirc/identifiers/$int
2017-06-12T14:31:46Z
<p>Westor: /* Paramters */</p>
<hr />
<div><br />
<br />
{{mirc title|$int Identifier}}'''$int(number)''' Returns the integer part of a floating point number with no rounding.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$int(N)</source><br />
<br />
== Parameters ==<br />
<br />
* '''N''' = The number you want the integer part of<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC">//echo -a $int(1.99999999999999)</source><br />
<br />
It will return '''1''' because it's integer the given number value.<br />
<br />
<source lang="mIRC">//echo -a $int(1.9999999999999999)</source><br />
<br />
It will return '''2''' because it's integer the given number value.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.1}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$round}}<br />
* {{mIRC|$calc}}<br />
* {{mIRC|$floor}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$isdir&diff=44549
mirc/identifiers/$isdir
2017-06-12T14:31:21Z
<p>Westor: /* See Also */</p>
<hr />
<div><br />
<br />
{{mirc title|$isdir Identifier}}'''$isdir(path)''' Returns $true if the specified directory exists, otherwise $false, (same as $exists).<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$isdir(path)</source><br />
<br />
== Parameters ==<br />
<br />
'''* Path''' = ''The direction/path you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC">//echo -a $isdir($mircdir)</source><br />
<br />
It will return '''$true''' because is checking if the mIRC direction is exists or not, as you using the mIRC it always be true.<br />
<br />
<source lang="mIRC">//echo -a $isdir($mircdirtest)</source><br />
<br />
It will return '''$true''' if inside your mIRC direction there is an folder named "test", otherwise will be '''$false'''.<br />
<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.5}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$exists}}<br />
* {{mIRC|$isfile}}<br />
* {{mIRC|$true}}<br />
* {{mIRC|$false}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$isfile&diff=44548
mirc/identifiers/$isfile
2017-06-12T14:31:05Z
<p>Westor: /* See Also */</p>
<hr />
<div><br />
<br />
{{mirc title|$isfile Identifier}}'''$isfile(path)''' Returns $true if the specified file exists, otherwise $false, (same as $exists).<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$isfile(path)</source><br />
<br />
== Parameters ==<br />
<br />
'''* Path''' = ''The direction/path of the filename you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC">//echo -a $isfile($mircexe)</source><br />
<br />
It will return '''$true''' because is checking if the mirc.exe exists or not, as you using the mIRC it always be true.<br />
<br />
<source lang="mIRC">//echo -a $isfile($mircdirtest.txt)</source><br />
<br />
It will return '''$true''' if inside your mIRC direction there is an file named as "test.txt", otherwise will be '''$false'''.<br />
<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.5}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$exists}}<br />
* {{mIRC|$isdir}}<br />
* {{mIRC|$true}}<br />
* {{mIRC|$false}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$isdir&diff=44547
mirc/identifiers/$isdir
2017-06-12T14:30:16Z
<p>Westor: </p>
<hr />
<div><br />
<br />
{{mirc title|$isdir Identifier}}'''$isdir(path)''' Returns $true if the specified directory exists, otherwise $false, (same as $exists).<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$isdir(path)</source><br />
<br />
== Parameters ==<br />
<br />
'''* Path''' = ''The direction/path you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC">//echo -a $isdir($mircdir)</source><br />
<br />
It will return '''$true''' because is checking if the mIRC direction is exists or not, as you using the mIRC it always be true.<br />
<br />
<source lang="mIRC">//echo -a $isdir($mircdirtest)</source><br />
<br />
It will return '''$true''' if inside your mIRC direction there is an folder named "test", otherwise will be '''$false'''.<br />
<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.5}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$exists}}<br />
* {{mIRC|$isfile}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$isfile&diff=44546
mirc/identifiers/$isfile
2017-06-12T14:29:14Z
<p>Westor: /* Paramters */</p>
<hr />
<div><br />
<br />
{{mirc title|$isfile Identifier}}'''$isfile(path)''' Returns $true if the specified file exists, otherwise $false, (same as $exists).<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$isfile(path)</source><br />
<br />
== Parameters ==<br />
<br />
'''* Path''' = ''The direction/path of the filename you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC">//echo -a $isfile($mircexe)</source><br />
<br />
It will return '''$true''' because is checking if the mirc.exe exists or not, as you using the mIRC it always be true.<br />
<br />
<source lang="mIRC">//echo -a $isfile($mircdirtest.txt)</source><br />
<br />
It will return '''$true''' if inside your mIRC direction there is an file named as "test.txt", otherwise will be '''$false'''.<br />
<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.5}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$exists}}<br />
* {{mIRC|$isdir}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$isfile&diff=44545
mirc/identifiers/$isfile
2017-06-12T14:28:37Z
<p>Westor: Created page with " {{mirc title|$isfile Identifier}}'''$isfile(path)''' Returns $true if the specified file exists, otherwise $false, (same as $exists). == Synopsis == <source lang="mIRC"> $i..."</p>
<hr />
<div><br />
<br />
{{mirc title|$isfile Identifier}}'''$isfile(path)''' Returns $true if the specified file exists, otherwise $false, (same as $exists).<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$isfile(path)</source><br />
<br />
== Paramters ==<br />
<br />
'''* Path''' = ''The direction/path of the filename you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC">//echo -a $isfile($mircexe)</source><br />
<br />
It will return '''$true''' because is checking if the mirc.exe exists or not, as you using the mIRC it always be true.<br />
<br />
<source lang="mIRC">//echo -a $isfile($mircdirtest.txt)</source><br />
<br />
It will return '''$true''' if inside your mIRC direction there is an file named as "test.txt", otherwise will be '''$false'''.<br />
<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.5}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$exists}}<br />
* {{mIRC|$isdir}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$isdir&diff=44544
mirc/identifiers/$isdir
2017-06-12T14:23:49Z
<p>Westor: Created page with " {{mirc title|$isdir Identifier}}'''$isdir(path)''' Returns $true if the specified directory exists, otherwise $false, (same as $exists). == Synopsis == <source lang="mIRC">..."</p>
<hr />
<div><br />
<br />
{{mirc title|$isdir Identifier}}'''$isdir(path)''' Returns $true if the specified directory exists, otherwise $false, (same as $exists).<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$isdir(path)</source><br />
<br />
== Paramters ==<br />
<br />
'''* Path''' = ''The direction/path you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC">//echo -a $isdir($mircdir)</source><br />
<br />
It will return '''$true''' because is checking if the mIRC direction is exists or not, as you using the mIRC it always be true.<br />
<br />
<source lang="mIRC">//echo -a $isdir($mircdirtest)</source><br />
<br />
It will return '''$true''' if inside your mIRC direction there is an folder named "test", otherwise will be '''$false'''.<br />
<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.5}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$exists}}<br />
* {{mIRC|$isfile}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$isdde&diff=44542
mirc/identifiers/$isdde
2017-06-12T14:16:00Z
<p>Westor: /* Paramters */</p>
<hr />
<div><br />
<br />
{{mirc title|$isdde Identifier}}'''$isdde(text)''' Returns $true if the specified dde name is in use, $false otherwise.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$isdde(text)</source><br />
<br />
== Paramters ==<br />
<br />
'''* Text''' = ''The DDE name you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC">//echo -a $isdde(mIRC)</source><br />
<br />
It will return '''$true''' if the currently mIRC using DDE name is the one that you specified, otherwise will be '''$false'''.<br />
<br />
<br />
'''NOTE''': The default mIRC dde name is "'''mIRC'''", if you would never change that from the options then is gonna be that for ever.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.41}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$dde}}<br />
* {{mIRC|$ddename}}<br />
* {{mIRC|/dde}}<br />
* {{mIRC|/ddeserver}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$isdde&diff=44541
mirc/identifiers/$isdde
2017-06-12T14:14:50Z
<p>Westor: /* Example */</p>
<hr />
<div><br />
<br />
{{mirc title|$isdde Identifier}}'''$isdde(text)''' Returns $true if the specified dde name is in use, $false otherwise.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$isdde(text)</source><br />
<br />
== Paramters ==<br />
<br />
'''* N''' = ''The DDE name you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC">//echo -a $isdde(mIRC)</source><br />
<br />
It will return '''$true''' if the currently mIRC using DDE name is the one that you specified, otherwise will be '''$false'''.<br />
<br />
<br />
'''NOTE''': The default mIRC dde name is "'''mIRC'''", if you would never change that from the options then is gonna be that for ever.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.41}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$dde}}<br />
* {{mIRC|$ddename}}<br />
* {{mIRC|/dde}}<br />
* {{mIRC|/ddeserver}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$isdde&diff=44540
mirc/identifiers/$isdde
2017-06-12T14:14:21Z
<p>Westor: </p>
<hr />
<div><br />
<br />
{{mirc title|$isdde Identifier}}'''$isdde(text)''' Returns $true if the specified dde name is in use, $false otherwise.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$isdde(text)</source><br />
<br />
== Paramters ==<br />
<br />
'''* N''' = ''The DDE name you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC">//echo -a $isdde(mIRC)</source><br />
<br />
It will return '''$true''' if the currently mIRC using DDE name is the one that you specified, otherwise will be '''$false'''.<br />
<br />
'''NOTE''': The default mIRC dde name is "'''mIRC'''", if you would never change that from the options then is gonna be that for ever.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.41}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$dde}}<br />
* {{mIRC|$ddename}}<br />
* {{mIRC|/dde}}<br />
* {{mIRC|/ddeserver}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$isdde&diff=44539
mirc/identifiers/$isdde
2017-06-12T14:13:51Z
<p>Westor: Created page with " {{mirc title|$isdde Identifier}}'''$isdde(text)''' Returns $true if the specified dde name is in use, $false otherwise. == Synopsis == <source lang="mIRC"> $isdde(text)</so..."</p>
<hr />
<div><br />
<br />
{{mirc title|$isdde Identifier}}'''$isdde(text)''' Returns $true if the specified dde name is in use, $false otherwise.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$isdde(text)</source><br />
<br />
== Paramters ==<br />
<br />
'''* N''' = ''The text you want to check for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC">//echo -a $isdde(mIRC)</source><br />
<br />
It will return '''$true''' if the currently mIRC using DDE name is the one that you specified, otherwise will be '''$false'''.<br />
<br />
'''NOTE''': The default mIRC dde name is "'''mIRC'''", if you would never change that from the options then is gonna be that for ever.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.41}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$dde}}<br />
* {{mIRC|$ddename}}<br />
* {{mIRC|/dde}}<br />
* {{mIRC|/ddeserver}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$int&diff=44537
mirc/identifiers/$int
2017-06-12T13:53:33Z
<p>Westor: Created page with " {{mirc title|$int Identifier}}'''$int(number)''' Returns the integer part of a floating point number with no rounding. == Synopsis == <source lang="mIRC"> $int(N)</source>..."</p>
<hr />
<div><br />
<br />
{{mirc title|$int Identifier}}'''$int(number)''' Returns the integer part of a floating point number with no rounding.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$int(N)</source><br />
<br />
== Paramters ==<br />
<br />
'''N (number)''' = ''Will be the given number that you want to use for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Example ==<br />
<source lang="mIRC">//echo -a $int(1.99999999999999)</source><br />
<br />
It will return '''1''' because it's integer the given number value.<br />
<br />
<source lang="mIRC">//echo -a $int(1.9999999999999999)</source><br />
<br />
It will return '''2''' because it's integer the given number value.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|5.1}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$round}}<br />
* {{mIRC|$calc}}<br />
* {{mIRC|$floor}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$r&diff=44533
mirc/identifiers/$r
2017-06-12T13:40:37Z
<p>Westor: Created page with " {{mirc title|$r Identifier}}'''$r(value1,value2)''' This works in two ways. If you supply it with numbers for v1 and v2, it returns a random number between v1 and v2. If you..."</p>
<hr />
<div><br />
<br />
{{mirc title|$r Identifier}}'''$r(value1,value2)''' This works in two ways. If you supply it with numbers for v1 and v2, it returns a random number between v1 and v2. If you supply it with letters, it returns a random letter between letters v1 and v2. (same as $rand)<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$r(value1,value2)</source><br />
<br />
== Paramters ==<br />
<br />
'''Value1''' = ''Will be the first given value that you want to use for.''<br />
<br />
'''Value2''' = ''Will be the second given value that you want to use for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Examples ==<br />
<source lang="mIRC">//echo -a $r(0,10)</source><br />
<br />
It will return an random number between 0 up to 10.<br />
<br />
<source lang="mIRC">//echo -a $r(a,z)</source><br />
<br />
It will return an lower case random letter between a up to z.<br />
<br />
<source lang="mIRC">//echo -a $r(A,Z)</source><br />
<br />
It will return an upper case random number between A up to Z.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|2.1a}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$rand}}<br />
* {{mIRC|$v1}}<br />
* {{mIRC|$v2}}</div>
Westor
https://en.wikichip.org/w/index.php?title=mirc/identifiers/$rand&diff=44532
mirc/identifiers/$rand
2017-06-12T13:38:50Z
<p>Westor: /* Example */</p>
<hr />
<div><br />
<br />
{{mirc title|$rand Identifier}}'''$rand(value1,value2)''' This works in two ways. If you supply it with numbers for v1 and v2, it returns a random number between v1 and v2. If you supply it with letters, it returns a random letter between letters v1 and v2.<br />
<br />
== Synopsis ==<br />
<source lang="mIRC"><br />
$rand(value1,value2)</source><br />
<br />
== Paramters ==<br />
<br />
'''Value1''' = ''Will be the first given value that you want to use for.''<br />
<br />
'''Value2''' = ''Will be the second given value that you want to use for.''<br />
<br />
== Properties ==<br />
<br />
None<br />
<br />
== Examples ==<br />
<source lang="mIRC">//echo -a $rand(0,10)</source><br />
<br />
It will return an random number between 0 up to 10.<br />
<br />
<source lang="mIRC">//echo -a $rand(a,z)</source><br />
<br />
It will return an lower case random letter between a up to z.<br />
<br />
<source lang="mIRC">//echo -a $rand(A,Z)</source><br />
<br />
It will return an upper case random number between A up to Z.<br />
<br />
== Compatibility ==<br />
{{mIRC compatibility|2.1a}}<br />
<br />
== See Also ==<br />
[[Category:MIRC identifiers]]<br />
* {{mIRC|$r}}<br />
* {{mIRC|$v1}}<br />
* {{mIRC|$v2}}</div>
Westor