Scripting Operators » History » Version 44
Per Amundsen, 11/21/2015 09:46 PM
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 | 10 | Per Amundsen | |_.Syntax |_.Name |_<.Result | |
28 | |=. <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 | |_.Syntax |_.Name |_<.Result | |
||
66 | |=. %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 | |_.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 | |_.Syntax |_.Name |_<.Result | |
||
142 | |=. %x ison %y |
||
143 | 1 | Per Amundsen | %x isop %y |
144 | %x ishop %y |
||
145 | 43 | Per Amundsen | *%x isadmin %y* |
146 | 35 | Per Amundsen | *%x isowner %y* |
147 | 1 | Per Amundsen | %x isvoice %y |
148 | %x isreg %y |
||
149 | 23 | Per Amundsen | %x ischan |
150 | %x isban %y |
||
151 | 41 | Per Amundsen | %x isinvite %y |
152 | %x isexcept %y |
||
153 | 23 | Per Amundsen | |^. Is On |
154 | Is an Operator |
||
155 | Is a Halfop |
||
156 | is a Protected Operator |
||
157 | Is a Channel Owner |
||
158 | Is a Voice |
||
159 | Is a Regular |
||
160 | Is a Channel |
||
161 | Is a ban |
||
162 | Ia a Invite |
||
163 | Is a Except |
||
164 | 24 | Per Amundsen | |^. True, if nick %x is on channel %y. |
165 | 23 | Per Amundsen | True, if nick %x is an operators on channel %y. |
166 | 1 | Per Amundsen | True, if nick %x is a halfop on channel %y. |
167 | 43 | Per Amundsen | True, if nick %x is a protected/admin operator on channel %y. |
168 | 23 | Per Amundsen | True, if nick %x is a channel owner on channel %y. |
169 | True, if nick %x is a voice on channel %y. |
||
170 | True, if nick %x is a regular user on channel %y. |
||
171 | True, if channel %x is a channel you are on. |
||
172 | True, if ban address %x is a ban on channel %y. (taken from IBL) |
||
173 | True, if invite address %x is a invite on channel %y. (taken from IIL) |
||
174 | True, if except address %x is a except on channel %y. (taken from IEL) |
||
175 | 19 | Per Amundsen | | |
176 | 28 | Per Amundsen | |
177 | h2. List-related Operators |
||
178 | |||
179 | |_.Syntax |_.Name |_<.Result | |
||
180 | |=. %x isaop |
||
181 | %x isaop %y |
||
182 | %x isavoice |
||
183 | %x isavoice %y |
||
184 | %x isignore |
||
185 | %x isignore %y |
||
186 | %x isnotify |
||
187 | |^. TODO |
||
188 | TODO |
||
189 | TODO |
||
190 | TODO |
||
191 | In Ignore List |
||
192 | In Ignore List For Type |
||
193 | TODO |
||
194 | |^. TODO |
||
195 | TODO |
||
196 | TODO |
||
197 | TODO |
||
198 | True, if host %x is in the ignore list. |
||
199 | True, if host %x is in the ignore list for type %y. |
||
200 | TODO |
||
201 | 1 | Per Amundsen | | |
202 | 28 | Per Amundsen | |
203 | h2. Other Operators |
||
204 | |||
205 | |_.Syntax |_.Name |_<.Result | |
||
206 | 35 | Per Amundsen | |=. *%x isurl* |
207 | 28 | Per Amundsen | |^. Is a url |
208 | |^. True, if %x is a url. |
||
209 | | |