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