Jump to content

tidy trax

Members
  • Posts

    49
  • Joined

  • Last visited

Everything posted by tidy trax

  1. You only need one / unless you want the things you're adding to the variable to evaluate an extra time, for example: See the difference?
  2. I'd actually go for the /filter method: alias loadsongs { if ($isfile(mp3s.txt)) filter -fk mp3s.txt addtodialog } alias addtodialog did -a mp3 1 $replace($duration($calc($mp3($1-).length /1000)),mins,m,secs,s,min,m,sec,s) $chr(9) $gettok($nopath(%i),-1,46)
  3. You'll have to use a piece of software such as songwriter (google it).
  4. I don't know how much 500MB ram and 20GB disk space would affect the cost, but the one I'm getting for £800 has a 3Ghz processor, decent (not the best, but decent) graphics card, 500MB ram and 80GB disk space.
  5. You're both right. mIRC waits for the raw 005 numeric (usually this numeric tells you what the server supports) before determining how to make the notify list work, if mIRC is told the server supports the WATCH command it will use that, then the server will automatically tell you when someone gets online. Otherwise, mIRC will send the ISON command on a timer.
  6. tidy trax

    SocketBot

    Both of your points are totally flawed. 1) mIRC and your bot (or any other client, for that matter) will flood out the same if you send too much data in such a little time. It makes no difference what you use to connect. 2) mIRC has to parse a script every time data comes through the socket rather than just doing whatever it wants to do. There's no question that your socket bot is going to be slower.
  7. tidy trax

    LISTVIEWS

    You're missing the <dialog> parameter in SetControlMDX: mdx SetControlMDX $dname 1 ListView report nosortheader rowselect single > $view
  8. It worked for me. Your method isn't a very good one because they can just open up the script in notepad and see the password. I know you could just remove that part of the script altogether but many people don't know how to edit scripts.
  9. Updated again: /* What does /monitorfile do? /monitorfile will watch a file and tell you when the file is modified or deleted, it will send a 'monitorfile' signal with either 'FILE_DELETE' or 'FILE_CHANGE' as the first parameter followed by the file that was being watched. If you don't use a . with the /monitorfile command (/.monitorfile) then you will also see some information in the active window when files are changed or deleted. All error/information messages should replicate mIRCs own messages. /monitorfile uses a 5 second interval to check for changes in files. How do I use /monitorfile? The syntax is: /monitorfile [-l|-s] <file> If you specify -l then the files matching the wildcard string in <file> will be listed. If you specify -s then the files matching the wildcard string in <file> will stop being monitored. Otherwise, the specified file will start being monitored. How do I use $monitorfile? The syntax is: $monitorfile(<file>,<N>) This identifier will return the Nth monitored file matching the wildcard string in <file>, if you specify 0 as <N> then the amount of matching files will be returned. How does /monitorfile work? (For scripters) /monitorfile will store the crc value of a file when you start monitoring a file and check the current crc value against the stored one every 5 seconds. If the value doesn't match then the FILE_CHANGE signal will be sent and the new crc value will be stored. If the file no longer exists when /monitorfile goes to check the current crc value then the FIlE_DELETE signal will be sent and the timer will be stopped. Can you give me an example of using this? on *:start:{ .monitorfile $mircini } on *:signal:monitorfile:{ if ($1 == FILE_CHANGE) && ($2- == $mircini) { echo $color(info) -afilr Hi $+($me,!) mIRC will just revert all changes to mirc.ini so $& there's no point in changing it unless you used the options dialog. :) } } How can I contact you? You can email me at [email protected] or [email protected] You can also find me in #mIRC or #mirc.net on IRC at irc.undernet.org but I am not always there. Have you made any changes to this snippet since it was first made? v2: Added -s and -l switches. v3: Fixed -s not stopping all matching files from being monitored. Fixed hfree bug when table didn't exist. Now uses '<' to replace spaces instead of '\s' */ alias checkfile { if (!$isfile($1-)) { .signal -n monitorfile FILE_DELETE $1- if ($hget(monitorfile)) { hdel monitorfile $replace($1-,$chr(32),<) if (!$hget(monitorfile,0).item) { hfree monitorfile } } $+(.timermonitorfile,$replace($1-,$chr(32),<)) off if (!$line($active,0)) { linesep -a } echo $color(info) -afilqr * /monitorfile: No longer monitoring $+(',$1-') for changes (File was deleted). linesep -a return } if ($crc($1-) != $hget(monitorfile,$replace($1-,$chr(32),<))) { hadd -m monitorfile $replace($1-,$chr(32),<) $v1 .signal -n monitorfile FILE_CHANGE $1- if (!$line($active,0)) { linesep -a } echo $color(info) -afilqr * /monitorfile: File $+(',$1-') has changed. linesep -a } } alias monitorfile { if (!$isid) { if ($istok(-l -s,$1,32)) { if ($hget(monitorfile)) { var %i = 1 tokenize 32 $1 $replace($2,$chr(32),<) if ($1 == -s) { while ($hfind(monitorfile,$2,1,w)) { echo $color(info) -afilqr * /monitorfile: No longer monitoring $+(',$replace($hfind(monitorfile,$2,1,w),<,$chr(32)),') $& for changes (Stopped by user). linesep -a $+(.timermonitorfile,$hfind(monitorfile,$2,1,w)) off hdel monitorfile $hfind(monitorfile,$2,1,w) } } else { if ($2 == $null) { tokenize 32 -l * } if (!$line($active,0)) { linesep -a } echo $color(info) -afilr * Monitoring files: var %i = 1 while ($hfind(monitorfile,$2,%i,w)) { echo $color(info2) -afilr $hfind(monitorfile,$2,%i,w) inc %i } } if (!$hget(monitorfile,0).item) { hfree monitorfile } linesep -a } return } if (!$isfile($1-)) { if (!$line($active,0)) { linesep -a } echo $color(info) -abfilr * /monitorfile: No such file $+(',$1-') linesep -a return } hadd -m monitorfile $replace($1-,$chr(32),<) $crc($1-) $+(.timermonitorfile,$replace($1-,$chr(32),<)) 0 5 $+($iif(!$show,.),checkfile) $1- if (!$line($active,0)) { linesep -a } echo $color(info) -afilqr * /monitorfile: Now monitoring $+(',$1-') for changes. linesep -a } else { return $hfind(monitorfile,$1,$iif($2 != $null,$v1,1),w) } }
  10. You're only supposed to put the part inside the code tags in remote and you have to change the "<password in md5 format>" part like I said in the last post.
  11. Then you did something wrong. Read through what I said slowly.
  12. on *:start:{ if ($md5($input(Enter password:, dip, Password request)) == <password in md5 format>) { server blah blah } else { exit } } Type //echo -a $md5(<password you want to use>) to get the md5 hash of the password, then you can change <password in md5 format> to that hash.
  13. Updated: /* What does /monitorfile do? /monitorfile will watch a file and tell you when the file is modified or deleted, it will send a 'monitorfile' signal with either 'FILE_DELETE' or 'FILE_CHANGE' as the first parameter followed by the file that was being watched. If you don't use a . with the /monitorfile command (/.monitorfile) then you will also see some information in the active window when files are changed or deleted. All error/information messages should replicate mIRCs own messages. /monitorfile uses a 5 second interval to check for changes in files. How do I use /monitorfile? The syntax is: /monitorfile [-l|-s] <file> If you specify -l then the files matching the wildcard string in <file> will be listed. If you specify -s then the files matching the wildcard string in <file> will stop being monitored. Otherwise, the specified file will start being monitored. How do I use $monitorfile? The syntax is: $monitorfile(<file>,<N>) This identifier will return the Nth monitored file matching the wildcard string in <file>, if you specify 0 as <N> then the amount of matching files will be returned. How does /monitorfile work? (For scripters) /monitorfile will store the crc value of a file when you start monitoring a file and check the current crc value against the stored one every 5 seconds. If the value doesn't match then the FILE_CHANGE signal will be sent and the new crc value will be stored. If the file no longer exists when /monitorfile goes to check the current crc value then the FIlE_DELETE signal will be sent and the timer will be stopped. Can you give me an example of using this? on *:start:{ .monitorfile $mircini } on *:signal:monitorfile:{ if ($1 == FILE_CHANGE) && ($2- == $mircini) { echo $color(info) -afilr Hi $+($me,!) mIRC will just revert all changes to mirc.ini so $& there's no point in changing it unless you used the options dialog. :) } } How can I contact you? You can email me at [email protected] or [email protected] You can also find me in #mIRC or #mirc.net on IRC at irc.undernet.org but I am not always there. */ alias checkfile { if (!$isfile($1-)) { .signal -n monitorfile FILE_DELETE $1- hdel monitorfile $replace($1-,$chr(32),\s) if (!$hget(monitorfile,0).item) { hfree monitorfile } $+(.timermonitorfile,$replace($1-,$chr(32),\s)) off if (!$line($active,0)) { linesep -a } echo $color(info) -afilqr * /monitorfile: No longer monitoring $+(',$1-') for changes (File was deleted). linesep -a return } if ($crc($1-) != $hget(monitorfile,$replace($1-,$chr(32),\s))) { hadd -m monitorfile $replace($1-,$chr(32),\s) $v1 .signal -n monitorfile FILE_CHANGE $1- if (!$line($active,0)) { linesep -a } echo $color(info) -afilqr * /monitorfile: File $+(',$1-') has changed. linesep -a } } alias monitorfile { if (!$isid) { if ($istok(-l -s,$1,32)) { var %i = 1 if ($1 == -l) { if ($2 == $null) { tokenize 32 -l * } if (!$line($active,0)) { linesep -a } echo $color(info) -afilr * Monitoring files: } tokenize 32 $1 $replace($2,$chr(32),\s) while ($hfind(monitorfile,$2,%i,w)) { if ($1 == -s) { if (!$line($active,0)) { linesep -a } echo $color(info) -afilqr * /monitorfile: No longer monitoring $+(',$replace($hfind(monitorfile,$2,%i,w),\s,$chr(32)),') $& for changes (Stopped by user). linesep -a $+(.timermonitorfile,$hfind(monitorfile,$2,%i,w)) off hdel monitorfile $hfind(monitorfile,$2,%i,w) } else { echo $color(info) -afilr * $hfind(monitorfile,$2,%i,w) } inc %i } if (!$hget(monitorfile,0).item) { hfree monitorfile } linesep -a return } if (!$isfile($1-)) { if (!$line($active,0)) { linesep -a } echo $color(info) -abfilr * /monitorfile: No such file $+(',$1-') linesep -a return } hadd -m monitorfile $replace($1-,$chr(32),\s) $crc($1-) $+(.timermonitorfile,$replace($1-,$chr(32),\s)) 0 5 $+($iif(!$show,.),checkfile) $1- if (!$line($active,0)) { linesep -a } echo $color(info) -afilqr * /monitorfile: Now monitoring $+(',$1-') for changes. linesep -a } else { return $hfind(monitorfile,$1,$iif($2 != $null,$v1,1),w) } }
  14. There isn't a section for just mIRC snippets/addons so i'll post this here. This snippet will monitor files for changes and tell you when they're changed or deleted. Note: this snippet will only work on mIRC 6.16, if you want to use it in older versions of mIRC then you can simply change '$v1' to '$ifmatch' on line 52. /* What does /monitorfile do? /monitorfile will watch a file and tell you when the file is modified or deleted, it will send a 'monitorfile' signal with either 'FILE_DELETE' or 'FILE_CHANGE' as the first parameter followed by the file that was being watched. If you don't use a . with the /monitorfile command (/.monitorfile) then you will also see some information in the active window when files are changed or deleted. All error/information messages should replicate mIRCs own messages. /monitorfile uses a 5 second interval to check for changes in files. How do I use /monitorfile? The syntax is: /monitorfile [off] <file> If you specify [off] then the specified file will no longer be monitored. Otherwise, the specified file will start being monitored. How does /monitorfile work? (For scripters) /monitorfile will store the crc value of a file when you start monitoring a file and check the current crc value against the stored one every 5 seconds. If the value doesn't match then the FILE_CHANGE signal will be sent and the new crc value will be stored. If the file no longer exists when /monitorfile goes to check the current crc value then the FIlE_DELETE signal will be sent and the timer will be stopped. Can you give me an example of using this? on *:start:{ .monitorfile $mircini } on *:signal:monitorfile:{ if ($1 == FILE_CHANGE) && ($2- == $mircini) { echo $color(info) -afilr Hi $+($me,!) mIRC will just revert all changes to mirc.ini so $& there's no point in changing it unless you used the options dialog. :) } } How can I contact you? You can email me at [email protected] or [email protected] You can also find me in #mIRC or #mirc.net on IRC at irc.undernet.org but I am not always there. */ alias checkfile { if (!$isfile($1-)) { .signal -n monitorfile FILE_DELETE $1- hdel monitorfile $replace($1-,$chr(32),\s) if (!$hget(monitorfile,0).item) { hfree monitorfile } $+(.timermonitorfile,$replace($1-,$chr(32),\s)) off echo $color(info) -afilqr * /monitorfile: No longer monitoring $+(',$1-') for changes (File was deleted). linesep -a return } if ($crc($1-) != $hget(monitorfile,$replace($1-,$chr(32),\s))) { hadd -m monitorfile $replace($1-,$chr(32),\s) $v1 .signal -n monitorfile FILE_CHANGE $1- echo $color(info) -afilqr * /monitorfile: File $+(',$1-') has changed. linesep -a } } alias monitorfile { if ($1 == off) && ($hget(monitorfile,$replace($2-,$chr(32),\s))) { hdel monitorfile $replace($2-,$chr(32),\s) if (!$hget(monitorfile,0).item) { hfree monitorfile } $+(.timermonitorfile,$replace($2-,$chr(32),\s)) off echo $color(info) -afilqr * /monitorfile: No longer monitoring $+(',$1-') for changes (Stopped by user). linesep -a return } if (!$isfile($1-)) { if (!$line($active,0)) { linesep -a } echo $color(info) -abfilr * /monitorfile: No such file $+(',$1-') linesep -a return } hadd -m monitorfile $replace($1-,$chr(32),\s) $crc($1-) $+(.timermonitorfile,$replace($1-,$chr(32),\s)) 0 5 $+($iif(!$show,.),checkfile) $1- echo $color(info) -afilqr * /monitorfile: Now monitoring $+(',$1-') for changes. }
  15. I would stick to only using images in the top right hand corner of channel windows as it gets annoying if you can't read the text because of an image.
  16. I like it, my only suggestion is that you add a keyboard accelerator to your "geekIRC" menu in the menubar. You can do this by putting an & before the letter you want to act as the accelerator, so if you used "&geekIRC" Alt+g would access that menu.
  17. It does go down. It sets the channel limit to <number of users> + 1, that is still going down as a user has just left.
  18. on @*:join:#:{ mode $chan +l $calc($nick($chan,0) + 1) } on @!*:part:#:{ mode $chan +l $calc($nick($chan,0) + 1) } on !*:quit:{ var %i = 1 while ($comchan($nick,%i)) { if ($comchan($nick,%i).op) { mode $comchan($nick,%i) +l $calc($nick($comchan($nick,%i),0) + 1) } inc %i } } on @*:kick:#:{ if ($knick != $me) { mode $chan +l $calc($nick($chan,0) + 1) } }
  19. All of the modes Webagent posted are usermodes, not channel modes. i, h, s and t (Channel modes, not user) mean the same on IRCX as they do on IRCD, IRCU and MSN.
  20. tidy trax

    help

    Since there's no $chan in a query, which channel would you like to op them in? 1st? 2nd? 3rd?
  21. Tutorial Begin Wildcard & Regular Expression Tutorial Keywords: String: A string is just a single character or multiple characters. Character: A character is a single letter, number or other thing from the keyboard. Wildcard: A wildcard is a character that can be used to match multiple or single characters without having to specify the characters to match. Note: a basic understanding of remote events and user levels is assumed. This tutorial is intended to give a basic understanding of wildcards (*, ?, &) and regular expressions ($regex, $regml, $regsub). Wildcards and regular expression patterns will be blue, text that can be changed will be red and keywords will be green. Wildcards: & Matches 1 or more characters seperated by a space. on *:text:hello &:#: This will match hello world, hello person or any other 2 word sentence starting with hello. on *:text:& hello:#: This will match any 2 word sentence ending with hello. * Matches 0 or more characters, and it doesn't matter what they are seperated by. on *:text:hello*:#: This will match helloish, hellobullo or any other word starting with hello, providing hello are the first 5 characters in the string. on *:text:*hello:#: This will match any word ending with hello, providing hello are the last 5 characters in the string. ? Matches 1 character and can be used anywhere in the string. on *:text:h?llo:#: This will match h followed by a character followed by llo. So it will match hello, hallo, hullo, hillo, hollo, hbllo, etc. Regular Expressions: Modifiers: Usage: $regex([name,]string,pattern), where [name,] is optional (used to reference the regex later using $regml([name,]N)), string is the string you want to search, and pattern is the pattern you want to find in the string. We'll start with one of the most basic regular expressions there is. //echo -a $regex(hello world,/hello/) This will be "1", because it found a match, hello is in hello world. However if you were to use a capital h in hello: //echo -a $regex(hello world,/Hello/) It will be "0", because regular expressions are case-sensitive by default. There are two ways to solve this "problem" (sometimes it's useful). Number one: //echo -a $regex(hello world,/(?i)Hello/) The (?i) means that everything up until (?-i) will be matched case-insensitively, if no (?-i) is specified then everything up until the end of the string is matched case-insensitively. Number two: //echo -a $regex(hello world,/Hello/i) The /i means the whole pattern is matched case-insensitively. Now let's look at matching multiple patterns in a string. //echo -a $regex(hello hello hello,/hello/) Even though hello is in hello hello hello 3 times, it will only match once, because by default regular expressions will find a match and then stop searching. Solution: //echo -a $regex(hello hello hello,/hello/g) This will be "3" because the /g tells it to return all matches. | means OR. //echo -a $regex(abc,/abd|abc/) Is "1" because it's set to match abc or abd and abc matched. ^ and $: ^ means the string has to start with the first character/group. $ means the string has to end with the first character/group. Examples //echo -a $regex(hello,/^h/) is "1" because "hello" starts with "h". //echo -a $regex(hello,/o$/) is "1" because "hello" ends with "o". //echo -a $regex(hello,/^hello$/) is "1" because "hello" matched "hello" exactly. Parentheses: Parentheses (( and )) are used to set what appears in $regml(). See the $regml area of this tutorial for more info. Character classes: Character classes generally look like this: [characters here]. //echo -a $regex(hello,/[aeiou]/) Instead of matching aeiou it will match a or e or i or o or u. You can also use a-z for all lower case letters, A-Z for all upper case letters and 0-9 for all numbers. You can also use multiple characters inside the group, eg: [a-zA-Z] will be any letter, [a-zA-Z0-9_] will be any letter, number or an underscore (_) (same as \w) ^ negates the group. [^a-z] means anything except a lower case letter, where as if you had left the ^ out, it would be any lower case letter. Switches: \w is any word character, number or an underscore (_) ([a-zA-Z0-9_]) \W is any non-word character, number or an underscore (_) ([^a-zA-Z0-9_], opposite of \w) \s is any whitespace character. \S is any non-whitespace character. \d is any digit ([0-9], 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9). \D is any non-digit ([^0-9]). \Q..\E can be used to escape a group of characters, it should be used as an alternative to \ (Eg. //echo -a $regex(\\,/\Q\\E/g)) Note: \ can also be used as an "escape character", so if you wanted to match \, you would use: /\\/. Quantifiers: {1,} means "1 or more times". {,1} means "1 or less times". {1} means "1 time". {1,3} means "1, 2, or 3 times". Examples \d{1} will match any digit. \d{,3} will match 3 or less digits. \d{3} will match 3 digits only. \d{3,} will match any 3 digits or more. Note: {} will only match the previous character, or string inside grouping brackets, a\d{3} will be 3 digits, not a\da\da\d, however (a\d){3} will be a\da\da\d * means 0 or more characters ({0,}) ? means 0 or 1 characters ({0,1}) + means 1 or more characters ({1,}) Examples \d* means 0 or more digits. \d+ means 1 or more digits. \d? means 0 or 1 digits. Note: do not mix quantifiers up with wildcards. Grouping Grouping is used to make quantifiers apply to a whole string, rather than the preceeding character. Examples: \da? means there has to be a digit followed by a possible a. (\da)? means there might be a digit followed by a possible a. Note: grouping also uses the same thing as you use to set $regml. Numbered and named matches You can use numbers and names to make a match you can reference later in the expression. To fill a numbered match you use (expression), to fill a named match you use (?P<name>expression) To retrieve a numbered match you use \N (where N refers to the Nth match), to retrieve a named match you use (?P=name) Examples: //echo -a $regex(abb,/^a(\1$/) will return "1" because "b" was matched in "abb", then it was matched again in the back reference //echo -a $regex(abc,/^a(\1$/) will return "0" because "b" was matched in "abc", then it wasn't matched again in the back reference //echo -a $regex(abb,/^a(?P<bee>(?P=bee)$/) will return "1" because "b" was matched in "abb", then it was matched again in the back reference. //echo -a $regex(abc,/^a(?P<bee>(?P=bee)$/) will return "0" because "b" was matched in "abc", then it wasn't matched again in the back reference. Note: when filling a named match using (?P<name><expression>), the actual <> characters are required. Greediness Greedy quantifiers try to match as much as possible. Ungreedy quantifiers try to match as little as possible. Greedy \d+ has to match 1 case of 1 or more digits. \d* has to match 1 case of 0 or more digits. \d? has to match 1 case of 1 or 0 digits. Ungreedy (\d+)? has to match 0 or 1 cases of 1 or more digits. (\d*)? has to match 0 or 1 cases of 0 or more digits. (\d?)? has to match 0 or 1 cases of 1 or 0 digits. Examples: //echo -a $regex(ababcabababc,/((ab)+c)/) matches "ababcabababc" because the expression tried to match as many cases of "abc" possible, it had to match at least one case of abc. //echo -a $regex(ababcabababc,/((ab)+?c)/) matches "ababc" because the expression tried to match as little cases of "abc" possible - it will, however, match something if it's in the string - it had to match at least 0 cases of abc. .: . will match any character except a newline. Examples .* means 0 or more characters. .+ means 1 or more characters. .? means 0 or 1 characters. Positive Lookahead, negative lookahead, positive lookback, negative lookback and non-capturing: ?= is positive lookahead, ?! is negative lookahead, ?<= is positive lookback, ?<! is negative lookback and ?: is non-capturing. ?= will look ahead in the pattern to see if the pattern following ?= is matched, if it isn't matched, it will stop trying to match anything. ?<= will look back in the pattern to see if the pattern behind ?<= has been matched, if it hasn't been matched, it will stop trying to match anything. ?! will look ahead in the pattern to see if the pattern following ?! isn't matched, if it is matched, it will stop trying to match anything. ?<! will look back in the pattern to see if the pattern behind ?<! isn't matched, if it is matched, it will stop trying to match anything. ?: won't fill $regml when placed inside grouping brackets, therefore speeding the regex up. Examples //echo -a $regex(foobar,/foo(?=a)bar/) will be "0", because the lookahead has found that foo followed by an "a" wouldn't match, so it won't continue with the rest of the pattern. //echo -a $regex(foobar,/foo(?=b)bar/) will be "1", because the lookahead has found that "foo" followed by a "b" would match, so it will continue with the rest of the pattern. //echo -a $regex(foobar,/foo(?<=o)bar/) will be "1", because the lookback has found that an "o" was found in "foo", so it will continue with the rest of the pattern. //echo -a $regex(foobar,/foo(?<=x)bar/) will be "0", because the lookback has found that "x" wasn't found in "foo", so it won't continue with the rest of the pattern. //echo -a $regex(foobar,/foo(?!a)bar/) will be "1", because the lookahead has found that "foo" isn't followed by an "a", so it will continue with the rest of the pattern. //echo -a $regex(foobar,/foo(?!b)bar/) will be "0", because the lookahead has found that "foo" is followed by a "b", so it won't continue with the rest of the pattern. //echo -a $regex(foobar,/foo(?<!bar)bar/) will be "1", because the lookback has found that "bar" wasn't matched, so it will continue with the rest of the pattern. //echo -a $regex(foobar,/foo(?<!foo)bar/) will be "0", because the lookback has found that "foo" was matched, so it won't continue with the rest of the pattern. //echo -a $regex(foobar,/foo(?:bar|bas)/) will be "1", and is exactly the same as //echo -a $regex(foobar,/foo(bar|bas)/) except using ?: will stop it filling $regml() with anything. Note: by now you should already know what grouping brackets and | (OR) do. If-then-else The basic syntax for if-then-else is (?(if)then|else) Examples //echo -a $regex(foobar,/foo(?(?<=foo)bar|foo)/) will return 1 because the if statement (?<=foo) found that foo was matched, so then bar was matched instead of foo. //echo -a $regex(foobar,/foo(?(?<=foo)foo|bar)/) will return 0 because the if statement (?<=foo) found that foo was matched, so then foo wasn't matched. Comments The basic syntax for a comment is (?#comment) Examples //echo -a $regex(abc,/ab(?#the next letter is c)c/) //echo -a $regex(abc,/a(?#the next letter is b)bc/) $regml $regml is used to reference certain matches made in $regex, I will only give some basic examples on this. //echo -a $regex(hello world,/(hello)/) $regml(1) Will echo "1 hello" because it matched hello inside the grouping brackets. //echo -a $regex(hello world hellor world,/(hell.*)/) $regml(1) $regml(2) Will echo "1 hello world hellor world" because it matched hell.* once inside the grouping brackets and $regml(2) will return $null ($chr(0)). $regsub $regsub is used to replace matches with other text/matches. The syntax is $regsub(string,pattern,replace text,var), i will only give one example. //var %x | //.echo -q $regsub(hello world,/world/,,%x) | //echo -s %x This will match "world" in "hello world" and replace it with $null ($chr(0)). Please send any questions to tidy_trax <at> mirc <dot> net Tutorial End Updates (Date format: dd/mm/yyyy): 06/12/2004 Fixed a few errors, added some extra examples of greediness.
  22. Yeah you're right, minimum and maximum values are optional, my mistake.
  23. tidy trax

    help

    Rudeboy, there is no $chan in a query.
  24. on *:dialog:modules:sclick:*: { if ($did == 4) { if ($did(1).sel == 2) { .load -rs " $+ $scriptdirajoin.mrc" modulelist.write } elseif ($did(1).sel == 3) { .load -rs " $+ $scriptdiraident.mrc" modulelist.write } } elseif ($did == 5) { if ($did(1).sel == 2) { .unload -rs " $+ $scriptdirajoin.mrc" modulelist.write } elseif ($did(1).sel == 3) { .unload -rs " $+ $scriptdiraident.mrc" modulelist.write } } }
  25. Either use what thegatekeeper said or: tokenize 44 %mirc.adminsonline did -a dname id $*
×
×
  • Create New...