通常我们从不为某人编写脚本,而是询问他到目前为止所做的事情,然后指出他的失败或帮助他一点点。
但是因为你提到的脚本听起来不错,所以我冒昧地自己实现了它。
如果您不熟悉 mSL,我建议您只触摸以下标识符:
FromNetwork、FromChannel、ToNetwork和ToChannel
代码
;###
;### TextPublisher v1
;### Author: Orel Eraki
;### Email: orel.eraki@gmail.com
;###
;### Usage:
;### - Pretty simple, just edit the identifier settings.
;### - For enable/disable change "TextPublisherEnable" identifier to 1 or 0
;### Settings
alias -l TextPublisherEnable return 1
alias -l TextPublisherFormat return ×tamp < &+ &nick &+ > &1-
alias -l TextPublisherMatchText return *text*
alias -l TextPublisherFromNetwork return Network1
alias -l TextPublisherFromChannel return #Channel1
alias -l TextPublisherToNetwork return Network2
alias -l TextPublisherToChannel return #Channel2
;### Functions
alias -l FindNetworkCid {
if ($1) {
var %i = 1, %n = $scon(0), %temp
while (%i <= %n) {
if ($scon(%i).status == connected && $scon(%i).network == $1) {
return $scon(%i).cid
}
inc %i
}
}
return
}
;### Events
on *:text:$($TextPublisherMatchText):$($TextPublisherFromChannel): {
if ($TextPublisherEnable && $network == $TextPublisherFromNetwork) {
var %networkId = $FindNetworkCid($TextPublisherToNetwork)
if (%networkId) {
scid -t1 %networkId if ($TextPublisherToChannel ischan) { msg $TextPublisherToChannel $eval($replace($TextPublisherFormat, &, $chr(36)), 2) }
}
}
}