mirc treebar 脚本随机触发一组无效参数
mirc treebar script firing off a set invaild parameters randomly
下面是我在我的 mirc 客户端中用于我的 treebar 的脚本,它在状态 window */set:invalid parameters 中触发,不确定它是哪个设置以及我尝试过的大多数修复,包括检查对于不匹配的 () 或 [] 只会导致其他错误。任何帮助查找无效参数的位置将不胜感激。
;--[Startup event]
on *:START: { startsektor }
;--[Aliases]--
alias startsektor { switch }
;--[switchbar]
alias switch {
if ($dialog(switchbar)) { dialog -x switchbar }
dialog -m switchbar switchbar
}
dialog switchbar {
title "switchbar"
size -1 -1 135 445
option pixels
}
on *:dialog:switchbar:init:*: {
dcx Mark $dname DCX_Switch
xdialog -q $dname +r cross
xdialog -c $dname 1 treeview 0 0 135 839 showsel hasbuttons haslines
xdid -i $dname 1 +b $color(1)
xdid -i $dname 1 +l $color(0)
xdid -f $dname 1 +ab ansi 8 ariel
.timer 1 0 xdock -m $dialog($dname).hwnd +l
.timer 1 0 iSwitch
}
alias -l xSwitch {
if (%New. [ $+ [ $+($scon(),$active) ] ] == On) { xdid -j switchbar 1 $xdid(switchbar,1,$+($chr(9),,$chr(9)),).find -1 7 }
else { xdid -v switchbar 1 $xdid(switchbar,1,$+($chr(9),,$chr(9)),).find $chr(9) }
}
alias -l eSwitch {
if ($scon().server) { xdid -v switchbar 1 $xdid(switchbar,1,$+($chr(9),*,$chr(9)),W,$calc( + 1)).find $chr(9) $scon().server }
elseif (!$scon().server) { xdid -v switchbar 1 $xdid(switchbar,1,$+($chr(9),*,$chr(9)),W,$calc( + 1)).find $chr(9) (Not Connected) }
}
alias iSwitch {
xdid -r switchbar 1
xdid -w switchbar 1 +n 0 icons/10.ico
xdid -w switchbar 1 +n 0 icons/22.ico
xdid -w switchbar 1 +n 0 icons/adminprotection.ico
xdid -w switchbar 1 +n 0 icons/userlist2.ico
xdid -w switchbar 1 +n 0 icons/star.ico
xdid -w switchbar 1 +n 0 icons/10.ico
xdid -w switchbar 1 +n 0 icons/star.ico
var %scid = 1
while (%scid <= $scon(0)) {
scon %scid
if (!$server) { xdid -a switchbar 1 %scid $chr(9) +ceb 3 3 0 0 0 $color(0) $color(0) [Not Connected] $chr(9) This server is NOT connected. }
elseif ($server) { xdid -a switchbar 1 %scid $chr(9) +ceb 2 2 0 0 0 $color(0) $color(0) $server $chr(9) Server - $server $chr(124) Connected at - $time(ddd hh:nn:ss tt)
xdid -a switchbar 1 %scid 1 $chr(9) +ce 1 1 0 0 0 $color(0) $color(0) Channels ( $+ $chan(0) $+ )
var %c = 1
while (%c <= $chan(0)) {
xdid -a switchbar 1 %scid 1 -1 $chr(9) +ce $iif(%New. [ $+ [ $+($server,$chan(%c)) ] ],6 6,5 5) 0 0 0 $color(0) $color(0) $iif(%New. [ $+ [ $+($server,$chan(%c)) ] ] == On,$+($chr(40),$chan(%c),$chr(41)),$chan(%c)) $chr(9) $chan(%c) - $iif(%New. [ $+ [ $+($server,$chan(%c)) ] ] == On,New Message,No new messages)
inc %c
}
xdid -a switchbar 1 %scid 2 $chr(9) +ce 4 4 0 0 0 $color(0) $color(0) Query ( $+ $query(0) $+ )
var %q = 1
while (%q <= $query(0)) {
xdid -a switchbar 1 %scid 2 -1 $chr(9) +ce $iif(%New. [ $+ [ $+($server,$query(%q)) ] ],4 4,1 1) 0 0 0 $color(0) $color(0) $iif(%New. [ $+ [ $+($server,$query(%q)) ] ] == On,$+($chr(40),$query(%q),$chr(41)),$query(%q)) $chr(9) $query(%q) - $iif(%New. [ $+ [ $+($server,$query(%q)) ] ] == On,New Message,No new messages)
inc %q
}
}
inc %scid
}
xdid -a switchbar 1 %scid 3 $chr(9) +ceb 5 5 0 0 0 $color(0) $color(0) Windows ( $+ $window(0) $+ )
var %win = $window(0)
var %w = 1
while (%w <= %win) {
xdid -a switchbar 1 %scid 3 -1 $chr(9) +ce 5 5 0 0 0 $color(0) $color(0) $window(%w)
inc %w
}
}
on *:ACTIVE:*: { set %New. [ $+ [ $+($server,$active) ] ] Off | iSwitch }
on *:TEXT:*:#: {
if ($active == $chan) { halt }
elseif (%New. [ $+ [ $+($server,$chan) ] ] !== On) { set %New. [ $+ [ $+($server,$chan) ] ] On | iSwitch }
}
on *:TEXT:*:?: {
if ($active == $nick) { halt }
elseif (%New. [ $+ [ $+($server,$nick) ] ] !== On) { set %New. [ $+ [ $+($server,$nick) ] ] On | iSwitch }
}
on *:ACTION:*:#: {
if ($active == $chan) { halt }
elseif (%New. [ $+ [ $+($server,$chan) ] ] !== On) { set %New. [ $+ [ $+($server,$chan) ] ] On | iSwitch }
}
on *:ACTION:*:?: {
if ($active == $nick) { halt }
elseif (%New. [ $+ [ $+($server,$nick) ] ] !== Yes) { set %New. [ $+ [ $+($server,$nick) ] ] On | iSwitch }
}
on *:CONNECT: { iSwitch }
on *:DISCONNECT: { iSwitch }
on *:RAWMODE: {
if ($active == $chan) { halt }
elseif (%New. [ $+ [ $+($server,$chan) ] ] !== On) { set %New [ $+ [ $+($server,$chan) ] ] On | -Switch }
}
on *:OPEN:?: { set %New. [ $+ [ $+($server,$nick) ] ] On | iSwitch }
on *:OPEN:#: { set %New. [ $+ [ $+($server,$chan) ] ] On | iSwitch }
alias DCX_switch {
if ( = mouse) { halt }
var %command =
tokenize 32 -
if (%command = sclick) {
set %target $remove($xdid(switchbar,1).seltext,$chr(40),$chr(41))
if (@* iswm %target) { window -a $window() | halt }
If (~* iswm %target) { window -a %target }
scon
if ( == 1) && (!) { list }
elseif (#* iswm %target) { window -a %target }
elseif ($query()) { window -a $query() }
elseif (!) { window -a "Status Window" }
}
}
在触发 ACTIVE
时出现错误。
on *:ACTIVE:*: { set %New. [ $+ [ $+($server,$active) ] ] Off | iSwitch }
发生这种情况是因为 $active
设置了 space,而焦点 window 是 状态 Window。
结果:%New.IRC.FoobarServer.comStatus Window Off
可能的解决方法是 将 space 替换为 下划线 (_
)
set %New. [ $+ [ $+($server,$replace($active, $chr(32), _)) ] ] Off
下面是我在我的 mirc 客户端中用于我的 treebar 的脚本,它在状态 window */set:invalid parameters 中触发,不确定它是哪个设置以及我尝试过的大多数修复,包括检查对于不匹配的 () 或 [] 只会导致其他错误。任何帮助查找无效参数的位置将不胜感激。
;--[Startup event]
on *:START: { startsektor }
;--[Aliases]--
alias startsektor { switch }
;--[switchbar]
alias switch {
if ($dialog(switchbar)) { dialog -x switchbar }
dialog -m switchbar switchbar
}
dialog switchbar {
title "switchbar"
size -1 -1 135 445
option pixels
}
on *:dialog:switchbar:init:*: {
dcx Mark $dname DCX_Switch
xdialog -q $dname +r cross
xdialog -c $dname 1 treeview 0 0 135 839 showsel hasbuttons haslines
xdid -i $dname 1 +b $color(1)
xdid -i $dname 1 +l $color(0)
xdid -f $dname 1 +ab ansi 8 ariel
.timer 1 0 xdock -m $dialog($dname).hwnd +l
.timer 1 0 iSwitch
}
alias -l xSwitch {
if (%New. [ $+ [ $+($scon(),$active) ] ] == On) { xdid -j switchbar 1 $xdid(switchbar,1,$+($chr(9),,$chr(9)),).find -1 7 }
else { xdid -v switchbar 1 $xdid(switchbar,1,$+($chr(9),,$chr(9)),).find $chr(9) }
}
alias -l eSwitch {
if ($scon().server) { xdid -v switchbar 1 $xdid(switchbar,1,$+($chr(9),*,$chr(9)),W,$calc( + 1)).find $chr(9) $scon().server }
elseif (!$scon().server) { xdid -v switchbar 1 $xdid(switchbar,1,$+($chr(9),*,$chr(9)),W,$calc( + 1)).find $chr(9) (Not Connected) }
}
alias iSwitch {
xdid -r switchbar 1
xdid -w switchbar 1 +n 0 icons/10.ico
xdid -w switchbar 1 +n 0 icons/22.ico
xdid -w switchbar 1 +n 0 icons/adminprotection.ico
xdid -w switchbar 1 +n 0 icons/userlist2.ico
xdid -w switchbar 1 +n 0 icons/star.ico
xdid -w switchbar 1 +n 0 icons/10.ico
xdid -w switchbar 1 +n 0 icons/star.ico
var %scid = 1
while (%scid <= $scon(0)) {
scon %scid
if (!$server) { xdid -a switchbar 1 %scid $chr(9) +ceb 3 3 0 0 0 $color(0) $color(0) [Not Connected] $chr(9) This server is NOT connected. }
elseif ($server) { xdid -a switchbar 1 %scid $chr(9) +ceb 2 2 0 0 0 $color(0) $color(0) $server $chr(9) Server - $server $chr(124) Connected at - $time(ddd hh:nn:ss tt)
xdid -a switchbar 1 %scid 1 $chr(9) +ce 1 1 0 0 0 $color(0) $color(0) Channels ( $+ $chan(0) $+ )
var %c = 1
while (%c <= $chan(0)) {
xdid -a switchbar 1 %scid 1 -1 $chr(9) +ce $iif(%New. [ $+ [ $+($server,$chan(%c)) ] ],6 6,5 5) 0 0 0 $color(0) $color(0) $iif(%New. [ $+ [ $+($server,$chan(%c)) ] ] == On,$+($chr(40),$chan(%c),$chr(41)),$chan(%c)) $chr(9) $chan(%c) - $iif(%New. [ $+ [ $+($server,$chan(%c)) ] ] == On,New Message,No new messages)
inc %c
}
xdid -a switchbar 1 %scid 2 $chr(9) +ce 4 4 0 0 0 $color(0) $color(0) Query ( $+ $query(0) $+ )
var %q = 1
while (%q <= $query(0)) {
xdid -a switchbar 1 %scid 2 -1 $chr(9) +ce $iif(%New. [ $+ [ $+($server,$query(%q)) ] ],4 4,1 1) 0 0 0 $color(0) $color(0) $iif(%New. [ $+ [ $+($server,$query(%q)) ] ] == On,$+($chr(40),$query(%q),$chr(41)),$query(%q)) $chr(9) $query(%q) - $iif(%New. [ $+ [ $+($server,$query(%q)) ] ] == On,New Message,No new messages)
inc %q
}
}
inc %scid
}
xdid -a switchbar 1 %scid 3 $chr(9) +ceb 5 5 0 0 0 $color(0) $color(0) Windows ( $+ $window(0) $+ )
var %win = $window(0)
var %w = 1
while (%w <= %win) {
xdid -a switchbar 1 %scid 3 -1 $chr(9) +ce 5 5 0 0 0 $color(0) $color(0) $window(%w)
inc %w
}
}
on *:ACTIVE:*: { set %New. [ $+ [ $+($server,$active) ] ] Off | iSwitch }
on *:TEXT:*:#: {
if ($active == $chan) { halt }
elseif (%New. [ $+ [ $+($server,$chan) ] ] !== On) { set %New. [ $+ [ $+($server,$chan) ] ] On | iSwitch }
}
on *:TEXT:*:?: {
if ($active == $nick) { halt }
elseif (%New. [ $+ [ $+($server,$nick) ] ] !== On) { set %New. [ $+ [ $+($server,$nick) ] ] On | iSwitch }
}
on *:ACTION:*:#: {
if ($active == $chan) { halt }
elseif (%New. [ $+ [ $+($server,$chan) ] ] !== On) { set %New. [ $+ [ $+($server,$chan) ] ] On | iSwitch }
}
on *:ACTION:*:?: {
if ($active == $nick) { halt }
elseif (%New. [ $+ [ $+($server,$nick) ] ] !== Yes) { set %New. [ $+ [ $+($server,$nick) ] ] On | iSwitch }
}
on *:CONNECT: { iSwitch }
on *:DISCONNECT: { iSwitch }
on *:RAWMODE: {
if ($active == $chan) { halt }
elseif (%New. [ $+ [ $+($server,$chan) ] ] !== On) { set %New [ $+ [ $+($server,$chan) ] ] On | -Switch }
}
on *:OPEN:?: { set %New. [ $+ [ $+($server,$nick) ] ] On | iSwitch }
on *:OPEN:#: { set %New. [ $+ [ $+($server,$chan) ] ] On | iSwitch }
alias DCX_switch {
if ( = mouse) { halt }
var %command =
tokenize 32 -
if (%command = sclick) {
set %target $remove($xdid(switchbar,1).seltext,$chr(40),$chr(41))
if (@* iswm %target) { window -a $window() | halt }
If (~* iswm %target) { window -a %target }
scon
if ( == 1) && (!) { list }
elseif (#* iswm %target) { window -a %target }
elseif ($query()) { window -a $query() }
elseif (!) { window -a "Status Window" }
}
}
在触发 ACTIVE
时出现错误。
on *:ACTIVE:*: { set %New. [ $+ [ $+($server,$active) ] ] Off | iSwitch }
发生这种情况是因为 $active
设置了 space,而焦点 window 是 状态 Window。
结果:%New.IRC.FoobarServer.comStatus Window Off
可能的解决方法是 将 space 替换为 下划线 (_
)
set %New. [ $+ [ $+($server,$replace($active, $chr(32), _)) ] ] Off