Difference between revisions of "$ifmatch"

From Scriptwiki
Jump to: navigation, search
m (added link to #The_Operators)
m (Highlighting the note.)
 
(2 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
  $ifmatch
 
  $ifmatch
  
'''Note:''' $ifmatch is depreciated now and has been replaced by ''$v1'' and ''$v2''.  You should switch to using ''$v1'' and ''$v2'' incase $ifmatch is no longer supported in future versions.
+
<span style="color:#FF0000">'''Note:''' $ifmatch is deprecated and has been replaced by ''$v1'' and ''$v2''.  You should switch to using ''$v1'' and ''$v2'' in case $ifmatch is no longer supported in future versions.</span>
  
 
== $v1 & $v2 ==
 
== $v1 & $v2 ==
Line 10: Line 10:
  
 
== Example ==
 
== Example ==
  [[If-Then-Else|if]] ([[$me]] [[If-Then-Else#The_Operators|isin]] [[$read]](quotes.txt)) { [[echo]] -ag My nickname is in random quote: $v2 }
+
  [[If-Then-Else|if]] ([[$banmask]] [[If-Then-Else#iswm|iswm]] [[$ial]]([[$me]])) { [[echo]] -ag The ban mask $v1 matches my mask of $v2 }
In the above example we check if $me is in the text returned by $read. If the comparison is sucessful $v2 is set to what ever $read returned.
+
The above example is a snippet that could be used inside an [[On ban]] event, which will check to see if the ban mask set matches your host mask.
 +
If the comparison is successful $v2 is set to your [[:Category:IAL|IAL's]] host mask.
  
 
[[Category:Remote Identifiers]]
 
[[Category:Remote Identifiers]]

Latest revision as of 17:08, 28 June 2013

Returns the first parameter of an if-then-else comparison.

$ifmatch

Note: $ifmatch is deprecated and has been replaced by $v1 and $v2. You should switch to using $v1 and $v2 in case $ifmatch is no longer supported in future versions.

$v1 & $v2

These return the first and second parameters of an if-then-else comparison.

$v1
$v2

Example

if ($banmask iswm $ial($me)) { echo -ag The ban mask $v1 matches my mask of $v2 }

The above example is a snippet that could be used inside an On ban event, which will check to see if the ban mask set matches your host mask. If the comparison is successful $v2 is set to your IAL's host mask.