Project

General

Profile

Scripting Operators » History » Version 35

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