Hey im using this script which I have slightly modified that relays text from one channel to another we currently use this as a script that has a training function on my irc
setudef flag pipe
set pipechannel "#Trainingroom1"
bind pubm - * pipemsgecho
proc pipemsgecho { n u h c t } {
if {[lsearch -exact [channel info $c] {+pipe}] != "-1"} {
global pipechannel
putserv "privmsg $pipechannel :$t"
}
}
Currently i have to join the partyline of my bot and do .chanset channel +pipe
What im looking to be able to do is send a privmsg to the bot such as +pipechannel #channelname the bot will then need to join the #channame and set the .chanset #channame +pipe this will also need to be able to do the opposite with -pipechannel #channel name the bot then leaves the channel and set .chanset #channame -pipe
if {[channel get $c pipe]} {
# channel is +pipe, do something
} else {
# channel is -pipe, do something else
}
I did so and the bot died on rehash
to be honest im baffled on were to start full stop with how to get it to join a channel and set the chanset option im okay on changing stuff and some how modifying things that i have all ready its just knowing how start something from scratch that gets me stumped
# Rls: egghelp.org +pipe
# Date: 08/09/10
# Coded by: doggo
# Contact: #alt.binaries.inner-sanctum@EFNET
#############################################
#the channel flag and the channel name for all the piped stuff to go to.
setudef flag pipe
set pipechannel "#PIPED_TO_CHANNEL" # change this to your own
#the binds set to bot master ONLY
bind pubm -|- * pipe_proc
bind pub m|m !join join_chan
bind pub m|m !leave leave_chan
#the pipe : pipes all puplic msg's on a +piped channel to the one you set above
proc pipe_proc { nickname hostname handle channel arg } {
if {[channel get $channel pipe] == 1 } {
putquick "PRIVMSG $::pipechannel :$arg"
} else {
putlog "Attention $channel is not +pipe."
}
}
#joins the channel and sets the joined channel +pipe.
proc join_chan {nick uhost hand chan arg} {
set _join "[lindex $arg 0]"
set success 0
if {[expr { $_join == "" || [expr { [string index $_join 0] != "#"}] } ]} {
puthelp "PRIVMSG $nick :!join <#channel>"
return 1
} else {
set success 1
channel add $_join
putserv "PRIVMSG $nick :Joined $_join."
}
if { $success == "1" } {
channel set $_join +pipe
putserv "PRIVMSG $nick :Set $_join +pipe"
} else {
putserv "PRIVMSG $nick :Error setting +pipe on $_join."
}
}
# no need to set -pipe as all channel records are removed anyway.
proc leave_chan {nick uhost hand chan arg} {
set leave "[lindex $arg 0]"
if {[expr { $leave == "" || [expr { [string index $leave 0] != "#"}] } ]} {
puthelp "PRIVMSG $nick :Command usage:!leave <#channel>."
return 1
} else {
channel remove $leave
putserv "PRIVMSG $nick :left $leave."
}
}
putlog "egghelp.org +pipe by doggo #alt.biniries.inner-sanctum @EFNET"
hope this helps, works as you wanted just change the binds to suit..
will only work if user has the +m flag and the bot is on the channel
Thanks doggo works exactly how i need it to but one small problem about 3 of my bots will be using this script and will all be in the same channel but need to pipe text from different channels so is it possible to change it to msg bind rather then pubm
#joins the channel and sets the joined channel +pipe.
proc join_chan {nick uhost hand chan arg} {
# no need to set -pipe as all channel records are removed anyway.
proc leave_chan {nick uhost hand chan arg} {
#joins the channel and sets the joined channel +pipe.
proc join_chan {nick uhost hand arg} {
# no need to set -pipe as all channel records are removed anyway.
proc leave_chan {nick uhost hand arg} {
# Rls: egghelp.org +pipe
# Date: 08/09/10
# Coded by: doggo
# Contact: #alt.binaries.inner-sanctum@EFNET
#############################################
#the channel flag and the channel name for all the piped stuff to go to.
setudef flag pipe
set pipechannel "#PIPED_TO_CHANNEL" # change this to your own
#the binds set to bot master ONLY
bind pubm -|- * pipe_proc
bind msg m|m !join join_chan
bind msg m|m !leave leave_chan
#the pipe : pipes all puplic msg's on a +piped channel to the one you set above
proc pipe_proc { nickname hostname handle arg } {
if {[channel get $channel pipe] == 1 } {
putquick "PRIVMSG $::pipechannel :$arg"
} else {
putlog "Attention $channel is not +pipe."
}
}
#joins the channel and sets the joined channel +pipe.
proc join_chan {nick uhost hand arg} {
set _join "[lindex $arg 0]"
set success 0
if {[expr { $_join == "" || [expr { [string index $_join 0] != "#"}] } ]} {
puthelp "PRIVMSG $nick :!join <#channel>"
return 1
} else {
set success 1
channel add $_join
putserv "PRIVMSG $nick :Joined $_join."
}
if { $success == "1" } {
channel set $_join +pipe
putserv "PRIVMSG $nick :Set $_join +pipe"
} else {
putserv "PRIVMSG $nick :Error setting +pipe on $_join."
}
}
# no need to set -pipe as all channel records are removed anyway.
proc leave_chan {nick uhost hand chan arg} {
set leave "[lindex $arg 0]"
if {[expr { $leave == "" || [expr { [string index $leave 0] != "#"}] } ]} {
puthelp "PRIVMSG $nick :Command usage:!leave <#channel>."
return 1
} else {
channel remove $leave
putserv "PRIVMSG $nick :left $leave."
}
}
putlog "egghelp.org +pipe by doggo #alt.biniries.inner-sanctum @EFNET"
wrong # args: should be "set varName ?newValue?"
while executing
"set pipechannel "#Trainingroom" # change this to your own "
(file "scripts/pipe.tcl" line 9)
invoked from within
"source scripts/pipe.tcl"
(file "eggdrop.conf" line 1359)
Any ideas on how to correct this as ive said above i had no problems on an older version bot
# the channel flag and the channel name for all the piped stuff to go to.
# change this to your own
set pipechannel "#PIPED_TO_CHANNEL"
# flag
setudef flag pipe
# the binds set to bot master ONLY
bind pubm -|- * pipe_proc
bind msg m|m !join [list juggle_chan 0]
bind msg m|m !part [list juggle_chan 1]
# pipe flag
# pipes all puplic msg's on a +piped channel to the one you set above
proc pipe_proc {n u h channel text} {
if {[channel get $channel pipe]} {
putserv "PRIVMSG $::pipechannel :$text"
}
}
# juggle channel
# determine join or part and act accordingly
proc juggle_chan {j nick u h text} {
set chan [lindex [split $text] 0]
if {![string length $chan] || [string first {#} $chan] != 0} {
# 0 = join
if {$j == 0} {
puthelp "PRIVMSG $nick :!join <#channel>"
# anything else, part
} else {
puthelp "PRIVMSG $nick :!part <#channel>"
}
} else {
# 0 = join
if {$j == 0} {
channel add $chan
channel set $chan +pipe
putserv "PRIVMSG $nick :Joined $chan. Set +pipe on $chan."
# anything else, part
} else {
channel remove $chan
putserv "PRIVMSG $nick :Parted $chan. Unset +pipe on $chan."
}
}
}
Last edited by speechles on Thu Jul 14, 2011 3:17 pm, edited 5 times in total.
[22:59:46] missing close-brace
while executing
"proc juggle_chan {nick u h text {j 0}} { ]
set chan [lindex [split $text] 0]
if {![string length $chan] || [string first {#} $chan] != 0} {
..."
(file "scripts/pipe.tcl" line 23)
invoked from within
"source scripts/pipe.tcl"
(file "eggdrop.conf" line 1345)
[22:59:46] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
i would like to ask that how can we set a nick or some of nicks in +piped channel .i mean if we would like to see only these nicks what typed in +piped channel ?.
how can we set nick/s in channel with this code ?