| View previous topic :: View next topic |
| Author |
Message |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Tue Sep 07, 2010 10:15 am Post subject: relay script |
|
|
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
| Code: | 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
Thanks for any help _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Sep 07, 2010 11:21 am Post subject: |
|
|
Instead of:
| Code: |
if {[lsearch -exact [channel info $c] {+pipe}] != "-1"} {
|
you should use:
| Code: |
if {[channel get $c pipe]} {
# channel is +pipe, do something
} else {
# channel is -pipe, do something else
}
|
As for the rest, it's a simple bind for msg and a combination of 'channel set' +/-pipe. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Wed Sep 08, 2010 5:00 am Post subject: |
|
|
Done the above just crashed it
Any further help would be appreciated _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Wed Sep 08, 2010 5:55 am Post subject: |
|
|
What exactly have you tried that crashed it?  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Wed Sep 08, 2010 8:32 am Post subject: |
|
|
| caesar wrote: | What exactly have you tried that crashed it?  |
you should use:
| Code: |
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 _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
doggo Halfop
Joined: 05 Jan 2010 Posts: 97
|
Posted: Wed Sep 08, 2010 10:48 am Post subject: |
|
|
| Code: | # 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
| Code: | !join #chan - this joins the channel and sets +pipe
!leave #chan - this makes the bot leave the channel |
_________________ NON geeky!! http://gotcode4u.com/ |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Wed Sep 08, 2010 4:02 pm Post subject: |
|
|
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 _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
doggo Halfop
Joined: 05 Jan 2010 Posts: 97
|
Posted: Wed Sep 08, 2010 7:59 pm Post subject: |
|
|
change
| Code: | #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 |
to
| Code: | #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 |
and
| Code: | #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} { |
to
| Code: | #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} { |
and your good to go  _________________ NON geeky!! http://gotcode4u.com/ |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Thu Jul 14, 2011 10:37 am Post subject: |
|
|
Hey
Ive been using this code on an older bot 6 19 im now trying to use it on 6 20 without success
| Code: | # 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" |
This is the error im getting
| Code: | 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
Many thanks _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Thu Jul 14, 2011 2:16 pm Post subject: |
|
|
| Code: | # 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."
}
}
} |
_________________ speechles' eggdrop tcl archive
Last edited by speechles on Thu Jul 14, 2011 3:17 pm; edited 5 times in total |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Thu Jul 14, 2011 2:59 pm Post subject: |
|
|
thanks speechless
following error
| Code: | [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) |
_________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Thu Jul 14, 2011 3:11 pm Post subject: |
|
|
| blake wrote: | thanks speechless
following error
| Code: | [22:59:46] missing close-brace
while executing
"proc juggle_chan {nick u h text {j 0}} { ] |
|
DOH! I missed a ending curly-brace in there, my bad. Try the edited code above it should work now.  _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Thu Jul 14, 2011 4:07 pm Post subject: |
|
|
Thanks speechless working great now _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
heartbroken Op

Joined: 23 Jun 2011 Posts: 106 Location: somewhere out there
|
Posted: Fri Jul 15, 2011 10:18 am Post subject: wanna ask something |
|
|
hi ..
may i ask you something about this code ?
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 ?
thnx.. _________________ Life iS Just a dReaM oN tHE wAy to DeaTh |
|
| Back to top |
|
 |
|