View Single Post
Old 08-02-2004, 08:43 AM  
buffi
Junior Member
 
Join Date: Jul 2004
Posts: 18
Default

Hi All,
I also used that script and managed to get it working but it announces only if the windrop is also running dszbot.tcl
without that it wont announce on the channel. I want it to be a selfscript.

this is the script :
Code:
set bncchecking "1"
set cmdpre "!"

# SETUP THIS ONLY IF YOU HAVE BNC for your SERVER
set bnc(LIST) "localhost:4147"
set bnc(NAME) "Home"
set bnc(SECTIONS) "GAMES/APPS"
set bnc(USER) "SiteBoT"
set bnc(PASS) "12345678"
set bnc(TIMEOUT) 10

set announce(BNC) "%bold%color0%sitename%color%bold - %bold%color12%sections:%color%bold%color0 %host is%color %status"

set binary(NCFTPLS) "C:/WINDOWS/system32/Setup/Driver/ioFTPD/windrop/scripts/ncftpls.exe"

set disable(NCFTPLS) 0

# set the blowfish encrytion key (empty = no encryption)
set blfs(KEY) ""

# set the blowfish header tag
set blfs(HEADER) "mcps"

set procs {
${cmdpre}bncroc_bnc
}

bind pub -|- [set cmdpre]bnc proc_bnc

proc sndchan {puttype chan args} {
global splitter blfs
foreach line [split [lindex $args 0] $splitter(CHAR)] {
if { $blfs(KEY) != "" } {
set eline [encrypt $blfs(KEY) $line]
$puttype "PRIVMSG $chan :$blfs(HEADER) $eline"
} else {$puttype "PRIVMSG $chan :$line"}
}
}

proc proc_bnc { nick uhost hand chan arg } {
global bnc announce binary disable
if { $disable(NCFTPLS) == 0 } {
foreach eachbnc $bnc(LIST) eachname $bnc(NAME) eachsection $bnc(SECTIONS) {
if {$eachbnc == ""} {continue}
set output $announce(BNC)
set now1 [clock clicks -milliseconds]
set status [catch { exec -- $binary(NCFTPLS) -u $bnc(USER) -p $bnc(PASS) -t $bnc(TIMEOUT) -r 00 ftp://$eachbnc } result]
set now2 "Response time: %bold[expr ([clock clicks -milliseconds] - $now1)]%boldms"
if { ([regexp \[.\]*ncftpls\:\ cannot\ open\[.\]* $result] > 0) } { set bncchk "%bold%color4DOWN%color%bold" ; set bncspeed "" } else { set bncchk "%bold%color9UP%color%bold" ; set bncspeed $now2 }
set output [replacevar $output "%host" $eachbnc]
set output [replacevar $output "%status" $bncchk]
set output [replacevar $output "%speed" $bncspeed]
set output [replacevar $output "%sitename" $eachname]
set output [replacevar $output "%sections" $eachsection]
set output [basicreplace $output "BNCS"]
sndchan "puthelp" $nick $output
}
}
}

proc basicreplace {strin section} {
	#putlog "proc basicreplace"
	global bncchecking
	set output [replacevar $strin "%bncchecking" $bncchecking]
	set output [replacevar $output "%bold" "\002"]
	set output [replacevar $output "%color" "\003"]
	set output [replacevar $output "%uline" "\037"]
	return "$output"
}
proc replacevar {strin what withwhat} {

set output $strin
set replacement $withwhat
set cutpos 0
while { [string first $what $output] != -1 } {
set cutstart [expr [string first $what $output] - 1]
set cutstop [expr $cutstart + [string length $what] + 1]
set output [string range $output 0 $cutstart]$replacement[string range $output $cutstop end]
}
return $output
}
where do i need to set the channel that i want it to post on???

pls help thanks
buffi is offline   Reply With Quote