Project

General

Profile

Scripting Operators » History » Version 48

Per Amundsen, 06/12/2016 08:06 AM

1 39 Per Amundsen
{{>toc}}
2
3 1 Per Amundsen
h1. Scripting Operators
4
5 31 Per Amundsen
AdiIRC supports various operators for use in [[/if]] [[/else]] [[/elseif]] [[/while]] and [[$iif]] expressions.
6 1 Per Amundsen
7 42 Per Amundsen
[[/var]], [[/set]], [[$calc]] supports it's own set of [[Arithmetic Operators|arithmetic expression]].
8 30 Per Amundsen
9 33 Per Amundsen
All operators supports the "!" sign to reverse the operation. 
10 32 Per Amundsen
11 35 Per Amundsen
Operators in bold is AdiIRC only.
12
13 34 Per Amundsen
*Example*
14
15
<pre>
16
; check if 5 is lower than 4.
17
if (5 < 4) echo true
18
else echo false
19 36 Per Amundsen
20 38 Per Amundsen
; Reverse check if 5 is lower than 4 same, as 5 > 4.
21 36 Per Amundsen
if (5 !< 4) echo true
22
else echo false
23 34 Per Amundsen
</pre>
24
25 10 Per Amundsen
h2. Math Comparison Operators
26 13 Per Amundsen
27 45 Mr. BS
|_.Syntax |_.Name |_.Result |
28 10 Per Amundsen
 |=. <notextile>%x == %y</notextile>
29 11 Per Amundsen
<notextile>%x = %y</notextile>
30 12 Per Amundsen
<notextile>%x != %y</notextile>
31 16 Per Amundsen
<notextile>%x !== %y</notextile>
32 12 Per Amundsen
<notextile>%x < %y</notextile>
33
<notextile>%x > %y</notextile>
34
<notextile>%x <= %y</notextile>
35
<notextile>%x >= %y</notextile>
36
<notextile>%x // %y</notextile>
37
<notextile>%x \\ %y</notextile>
38
<notextile>%x & %y</notextile>
39
 |^. Equal
40 15 Per Amundsen
Equal
41 1 Per Amundsen
Not equal
42 16 Per Amundsen
Not equal
43 10 Per Amundsen
Less than
44
Greater than
45
Less than or equal to
46
Greater than or equal to
47
Multiple Of (Divides)
48
Not Multiple Of (Not Divides)
49
Bitwise And
50
 |^. True, if %x is equal to %y.
51
True, if %x is equal to %y.
52 16 Per Amundsen
True, if %x is not equal to %y.
53 10 Per Amundsen
True, if %x is not equal to %y.
54
True, if %x is strictly less than %y.
55
True, if %x is strictly greater than %y.
56
True, if %x is less than or equal to %y.
57
True, if %x is greater than or equal to %y.
58
True, if %x divides %y.
59
True, if %x does not divides %y.
60
True, if (bit representation of) %x AND %y is a none zero.
61 14 Per Amundsen
 |
62 17 Per Amundsen
63
h2. String Comparison Operators
64
65 45 Mr. BS
|_.Syntax |_.Name |_.Result |
66 17 Per Amundsen
 |=. %x isin %y
67
%x isincs %y
68
%x iswm %y
69
%x iswmcs %y
70
%x isnum
71
%x isnum N
72
%x isnum N-
73
%x isnum N-M
74
%x isletter
75
%x isletter N
76
%x isalnum
77
%x isalpha
78
%x islower
79
%x isupper
80
 |^. Is In
81
Is In (case sensitive)
82
Wildcard Matching
83
Wildcard Matching (case sensitive)	
84
Is Digit
85
Is Digit, Equal to
86
Is Digit, Greater than or equal to
87
Is Digit, in Range
88
Is a Letter
89
Is a Letter In A List
90
Alphanumeric Characters
91
Alphabetic Characters
92
All lower case letters
93
All upper case letters
94
 |^. True, if %x is fully found inside %y.
95
True, if %x is fully found inside (case sensitive) %y.
96
True, if wildcard string %x matches %y.
97
True, if wildcard string %x matches (case sensitive) %y.
98
True, if %x is a number.
99
True, if %x is number N.
100
True, if %x is number N or greater.
101
True, if %x is a number between N and M (inclusively).
102
True, if %x is a letter.
103
True, if %x is a letter in a list of letters.
104
True, if %x contains only alphabetic or numeric characters.
105
True, if %x contains only alphabetic characters.
106
True, if %x contains only lower case letters.
107
True, if %x contains only upper case letters.
108
 |
109 19 Per Amundsen
110 40 Per Amundsen
h2. Lexicographical String Comparison Operators
111 19 Per Amundsen
112 45 Mr. BS
|_.Syntax |_.Name |_.Result |
113 22 Per Amundsen
 |=. <notextile>a == b</notextile>
114
<notextile >a === b</notextile>
115
<notextile >str1 == str2</notextile>
116
<notextile >str1 === str2</notextile>
117 19 Per Amundsen
a < b
118
a > b
119
str1 < str2
120 1 Per Amundsen
str1 > str2
121
 |^. Case insensitive character comparison
122
Case sensitive character comparison
123
Case insensitive String comparison
124
Case sensitive String comparison
125 25 Per Amundsen
Lexicographically Less Than
126 1 Per Amundsen
Lexicographically Greater Than
127
Lexicographically Less Than
128
Lexicographically Greater Than
129
 |^. True, if character a is equal to character b, case insensitive.
130
True, if character a is equal to character b, case sensitive.
131
True, if str1 equals str2 in a case insensitive manner.
132
True, if str1 equals str2 in a case sensitive manner.
133
True, if the [[$asc]](a) comes before [[$asc]](b)
134
True, if the [[$asc]](a) comes after [[$asc]](b)
135
True, if str1 comes before str2
136
True, if str1 comes after str2
137 23 Per Amundsen
 |
138
139
h2. Channel-related Operators
140
141 45 Mr. BS
|_.Syntax |_.Name |_.Result |
142 23 Per Amundsen
 |=. %x ison %y
143 1 Per Amundsen
%x isop %y
144
%x ishop %y
145 46 Per Amundsen
%x ishelp %y
146 43 Per Amundsen
*%x isadmin %y*
147 35 Per Amundsen
*%x isowner %y*
148 1 Per Amundsen
%x isvoice %y
149
%x isreg %y
150 23 Per Amundsen
%x ischan
151
%x isban %y
152 41 Per Amundsen
%x isinvite %y
153
%x isexcept %y
154 23 Per Amundsen
 |^. Is On
155
Is an Operator
156
Is a Halfop
157 47 Per Amundsen
Is a Halfop
158 23 Per Amundsen
is a Protected Operator
159
Is a Channel Owner
160
Is a Voice
161
Is a Regular
162
Is a Channel
163
Is a ban
164
Ia a Invite
165
Is a Except
166 24 Per Amundsen
 |^. True, if nick %x is on channel %y.
167 23 Per Amundsen
True, if nick %x is an operators on channel %y.
168 46 Per Amundsen
True, if nick %x is a halfop on channel %y.
169 1 Per Amundsen
True, if nick %x is a halfop on channel %y.
170 43 Per Amundsen
True, if nick %x is a protected/admin operator on channel %y.
171 23 Per Amundsen
True, if nick %x is a channel owner on channel %y.
172
True, if nick %x is a voice on channel %y.
173
True, if nick %x is a regular user on channel %y.
174
True, if channel %x is a channel you are on.
175
True, if ban address %x is a ban on channel %y. (taken from IBL)
176
True, if invite address %x is a invite on channel %y. (taken from IIL)
177
True, if except address %x is a except on channel %y. (taken from IEL)
178 19 Per Amundsen
 |
179 28 Per Amundsen
180
h2. List-related Operators
181
182 45 Mr. BS
|_.Syntax |_.Name |_.Result |
183 28 Per Amundsen
 |=. %x isaop
184
%x isaop %y
185
%x isavoice
186
%x isavoice %y	
187
 %x isignore
188
%x isignore %y
189
%x isnotify
190
 |^. TODO
191
TODO
192
TODO
193
TODO
194
In Ignore List
195
In Ignore List For Type
196 48 Per Amundsen
In Notify List
197 28 Per Amundsen
 |^. TODO
198
TODO
199
TODO
200
TODO
201 48 Per Amundsen
True, if host %x is in the Ignore list.
202
True, if host %x is in the Ignore list for type %y.
203
True, if nick %x is in the Notify list.
204 1 Per Amundsen
 |
205 28 Per Amundsen
206
h2. Other Operators
207
208 45 Mr. BS
|_.Syntax |_.Name |_.Result |
209 35 Per Amundsen
 |=. *%x isurl*
210 28 Per Amundsen
 |^. Is a url
211
 |^.  True, if %x is a url.
212
 |