; /highl
; by blink (12/3/2006)
; code to highlight one-line aliases and/or codes.
;
; ======================================
;
; usage: /highl <alias/code>
;
; examples:
;
; /highl alias me if ($me ison #regex) { goto true | echo -a NO | return | :true | echo -a YES }
;
; /highl //tokenize
;
; ======================================
;
; side notes:
; -You must NOT use double-slash (//) in the alias so it won't evaluate the string
; while handling it.
; -Zeropad single digit numbers in case you want to edit output coloring.
;
alias highl {
;you can edit colors below that point
;but note to zero-pad one-digit numbers.
var %trigger 04
var %digits 05
var %switches 13
var %statments&linkers 06
var %brackets 07
var %goto 14
var %identifiers 3
var %variables 10
var %brackets&c 12
;DON'T EDIT BELOW THIS POINT
var %a = $1-
noop $regsub(%a,/(if\s\x28\S+?\x29\s)([^\x29:]\S+)/S,$+(\1,$chr(32),$chr(32),%trigger,\2),%a)
noop $regsub(%a,/(?<=\x28|\x2c|\s)(\d+?)(?=\x29|\x2c|\s|$)/g,$+($chr(3),%digits,\1),%a)
noop $regsub(%a,/(^alias\s\S+\s)(?!\x7b)(\S+)/,$+(\1,$chr(3),%trigger,\2),%a)
noop $regsub(%a,/(\A)(?(1)(alias)\s(\S+))/,$+($chr(3),%trigger,\2,$chr(32),\3),%a)
noop $regsub(%a,/(?<=\s)(\!?(?:\\\\|\/\/|&|[<>]?=[<>]?|==?=?|isin(?:cs)? $&
|iswm(?:cs)?|isnum|isletter|isalnum|isalpha|islower|isupper|ison|isop| $&
isvoice|isreg|ischan|isban|isnotify))(?=[\s\x29])/ig,$+($chr(3),%statments&linkers,\1),%a)
noop $regsub(%a,/(?<=(?:\x7b|\|)\s)((\/\/|\!)?(?(2)(?!\2))(?<!:)\S+)/g,$+($chr(3),%trigger,\1),%a)
noop $regsub(%a,/(?<=\s)(&&?|\|\|?|=)(?=\s)/ig,$+($chr(3),%statments&linkers,\1),%a)
noop $regsub(%a,/(?<=\|\s)([^:]\S+)/g,$+($chr(3),%trigger,\1),%a)
noop $regsub(%a,/(?<=^|\s)([\x7b\x7d])(?=\s|$)/g,$+($chr(3),%brackets,\1),%a)
noop $regsub(%a,/(\$(?!v?\d+)\S+?)(?=\x28|\x29|\x2c|\s|$)/g,$+($chr(3),%identifiers,\1),%a)
noop $regsub(%a,/(\%(?!v?\d+)\S+?)(?=\x28|\x29|\x2c|\s|$)/g,$+($chr(3),%variables,\1),%a)
noop $regsub(%a,/((?<=\||\x7b)\x0f\s\S+\s)(\-\S+)(?=\s)/g,$+(\1,$chr(32),$chr(3),%switches,\2),%a)
noop $regsub(%a,/([\x28\x29])/g,$+($chr(3),%brackets&c,\1),%a)
noop $regsub(%a,/(\$[^\x28]+?)(?=\x29|\x2c|\s|$)/g,$+($chr(3),%identifiers,\1),%a)
noop $regsub(%a,/(\%\S+)/g,$+($chr(3),%variables,\1),%a)
noop $regsub(%a,/(?<=\x0f|\S)(\x2c)(?=\S*?\x29)/g,$+($chr(3),%brackets&c,\1),%a)
noop $regsub(%a,/(\A)(?(1)(\/\/\!?\S+))/,$+($chr(3),%trigger,\2),%a)
noop $regsub(%a,/(?<=\x7c\x0f\s)\x03\d\d?(:\S+)/g,$+($chr(3),%goto,\1),%a)
if ($istok(query channel,$window($active).type,32)) && ($status = connected) say %a
else echo -ae %a
}
Подсветка однострочного mIRC кода
Автор tvrsh, 15 янв 2009 17:44
В этой теме нет ответов
#1
Отправлено 15 января 2009 - 17:44
Скопируйте код в раздел Remote нажав Alt+R.
http://ircnet.su/
#egghelp @ IrcNet.Ru
#egghelp @ IrcNet.Ru
Количество пользователей, читающих эту тему: 1
0 пользователей, 1 гостей, 0 анонимных











