Project

General

Profile

Scripting Operators » History » Version 34

Per Amundsen, 10/22/2015 04:18 PM

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