;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MIRCDEBUG ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;info: ; ; by wiebe @ QuakeNet ; version 1.1 (written and tested on mIRC 6.15) ; ; this script uses 'backward propagation of error' for :error handling which is added in 6.15 ; if you want to use this script for an older version of mIRC visit my website http://wiebe.hopto.org/ ; ; last edit: Tue Jun 29 2004 ; ; ;What does this script do? ; you can execute mIRC code on a bot from a channel (similair to !tcl scripts on eggdrops) ; write '!raw ' or '!mirc ' ; ; ;Some examples: ; wiebe is me, and dev-mirc is my bot ; ; [13:01:02] <@wiebe> !raw if ($nick isop $chan) { return $true } ; [13:01:03] <@dev-mirc> result: $true - duration: 0 ms ; ; [13:01:41] <@wiebe> !mirc $fulladdress ; [13:01:42] <@dev-mirc> result: wiebe!wiebe@Wiebe.users.quakenet.org - duration: 0 ms ; ; [13:03:15] <@wiebe> !raw var %x = 1 | while (%x <= 5) { msg $chan x is now %x | inc %x } ; [13:03:16] <@dev-mirc> x is now 1 ; [13:03:16] <@dev-mirc> x is now 2 ; [13:03:16] <@dev-mirc> x is now 3 ; [13:03:16] <@dev-mirc> x is now 4 ; [13:03:16] <@dev-mirc> x is now 5 ; [13:03:17] <@dev-mirc> result: - duration: 10 ms ; ; [13:04:36] <@wiebe> !mirc if ( ; [13:04:37] <@dev-mirc> result: * /if: insufficient parameters (line 1, aliases.ini) - duration: 0 ms ; ; [13:05:24] <@wiebe> !raw alias cow return moo | cow | alias cow ; [13:05:25] <@dev-mirc> result: moo - duration: 0 ms ; ; ;How to use this script? ; make sure *ONLY* you and *YOU ALONE* can use this. ; the script gives *TOTAL* control over mIRC (and thus over your PC) ; by default a user with level 9999 has access to this, ; so to use this script add yourself with level 9999 (or change the level required in the script) ; ; ;How does this script work? ; simply said, it creates an alias from the given code and calls this as an identifier ; ; ;Why is this script useful? ; this script works better then $eval(code..), why? ; $eval can not handle command seperator |, if, elseif, else, while loops and errors ; ; script can be used to explain mIRC code to other users, like in script help channels or to test/debug code ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TEXT EVENT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; a channel on text event, make sure you set a userlevel that only you have! ; this script gives TOTAL control over mIRC ; if you change the level, make sure the $ prefix stays ; if you want it to work in query's aswell, change # to * on $9999:text:/^(!raw|!mirc)\b/i:#:{ ; save the value that '$ticks' has at this moment, save where to send the message var %x = $ticks, %target = $iif($chan,$chan,$nick) ; no code part, show how to use this script, goto result if ($0 == 1) { var %result = usage $1-  | goto result } ; create an alias with the code '$2-' ; we add 'tokenize 32 $!1-' here, if we do not do this, '$1' will be 1 string (with spaces included if any) ; ; this is because $alias(string one,string two) ; in the alias, '$1' will be 'string one' and '$2' will be 'string two' ; and '$1-' will be 'string one string two' ; this is fixed by adding the above code ; ; if the code starts with a '$' or a '%' then we include 'return' aswell, ; so '!raw $identifier' or '!raw %variable' works ; . command prefix is used to hide any output from the command ; add 'return $!result' in case 'return ' is used in an alias (called as /alias not as $identifier) .alias mircdebugalias tokenize 32 $!1- $chr(124) $iif($istok($ %,$left($2,1),32),return  $!+) $2- $chr(124) return $!result ; in the msg to '$chan' we call the alias as an identifier with '$1-' as parameters and get the result, var %result = $mircdebugalias($1-), %result = $iif((!$istok($crlf $cr $lf,$strip(%result),32)) && ($strip(%result) != $null),%result,) ; result part :result ; we are still connected ; no need to continue if /quit or /server or whatever was used that disconnected us from irc if ($status == connected) { msg %target result: %result $+  - duration: $calc($ticks - %x) ms } goto end ; error handling, save error, reseterror, goto result part :error { | var %result = $error | reseterror | goto result } ; end part, remove the alias :end { | .alias mircdebugalias } }