我正在制作黑名单脚本,到目前为止它工作得很好。我正在添加一个nick和reason,它保存和删除fine.
alias -l txt { return C:UsershifinDesktopmibbitnamesbadnick.txt }
alias -l mychan { return #mastercontrol }
ON *:TEXT:!add *:$($mychan): {
write $qt($txt) $2-
msg $chan 4ADD Watched nick - $2-
}
ON *:TEXT:!del *:$($mychan): {
write -d $qt($txt) $2-
msg $chan 3DELETED Watched nick - $2-
}
ON *:TEXT:!viewlist:$($mychan): {
var %t = $lines($txt)
if (!$file($txt)) { msg $chan The file is empty! | return }
msg $chan 6LIST Incoming PM
msg $nick Start of file.. - (Lines: %t $+ )
var %i = 1
while (%i <= %t) {
var %r = $read($txt,n,%i)
if (%r) { msg $nick %r }
inc %i
}
msg $nick End of file. - (Size: $bytes($file($txt).size).suf $+ )
}
从这个脚本…我正在使用匹配的代码来查看Nick是否在此文件上,这工作正常
var %NaughtyList = $read(C:UsershifinDesktopmibbitnamesbadnick.txt, sw, $4)
if (%NaughtyList) {
/msg #mastercontrol 9,1Connected Watched Nick - $4
splay -w C:/Users/hifin/Desktop/New_Server_Bot/mIRC/sounds/message.wav
}
现在. .这是我需要改变的,但我做不到。atm . .我正在寻找一个匹配的TXT瓷砖尼克总是由$4指定…但. .我希望脚本消息通道的nick - reason从txt文件代替。而ATM只显示已连接到Nick - $4 (Nick)
txt文件在像这样的单独行中包含nick reason
gary troublemaker
radomly testuser
julie needs help with channel
我可以编辑一下,以便脚本输出有关匹配的Nick "one_answers"原因请从TXT文件
$read()
与s
开关返回文本后的匹配的词,根据文档:
//echo $read(info.txt, s, mirc)
Scans the file info.txt for a line beginning with the word mirc and returns the text following the match value.
您可以将$read()
与$readn
结合使用,如果找到匹配,则返回行号,并执行如下操作:
var %NaughtyList = $read($txt, s, $1)
if ($readn) {
var %buf = $read($txt, $readn)
msg #mastercontrol Connected Watched $gettok(%buf, 1, 32) - $gettok(%buf, 2-, 32)
splay -w C:/Users/hifin/Desktop/New_Server_Bot/mIRC/sounds/message.wav
}
这将获取刻痕和原因并输出
Connected Watched julie - needs help with channel
搜索julie
.