| View previous topic :: View next topic |
| Author |
Message |
onair Voice
Joined: 25 Jul 2006 Posts: 6
|
Posted: Tue Jul 25, 2006 9:18 am Post subject: Copy PM's to a channel |
|
|
I'm looking for a script that copy the private message text to a mainchannel, so when someone pm's my bot it will copy the whole line in the main channel, when it's possible i can choose the nicks so that not all the pm's will show in the main channel
thank in advance, |
|
| Back to top |
|
 |
Zero Voice
Joined: 25 Jul 2006 Posts: 4
|
Posted: Tue Jul 25, 2006 11:02 am Post subject: |
|
|
| Code: |
set ::mainchan "#channel"
bind msgm - * msg:mainchan
proc msg:mainchan {nick host hand arg} {
puthelp "PRIVMSG $::mainchan "$nick Query: $arg"
puthelp "PRIVMSG $nick :Sorry I'm a Eggdrop..."
}
|
|
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Tue Jul 25, 2006 12:23 pm Post subject: |
|
|
| Code: |
set ::mainchan "#channel"
bind msgm - * msg:mainchan
proc msg:mainchan {nick host hand arg} {
puthelp "PRIVMSG $::mainchan :$nick Query: $arg"
puthelp "PRIVMSG $nick :Sorry I'm a Eggdrop..."
}
|
Fixed error made by Zero _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
onair Voice
Joined: 25 Jul 2006 Posts: 6
|
Posted: Tue Jul 25, 2006 12:38 pm Post subject: |
|
|
Yeps works just fine, i already found a script on this lovely site, but it shows [ & ] like {[} & /] do you know guys why? thats the script
| Code: |
bind msg - !say msg_say
proc msg_say {nick uhost hand args} {
global botnick
if {[llength [lindex $args 0]]<2} {
putserv "NOTICE $nick :/msg $botnick !say <#chan> <something to say>"
} else {
set chan [lindex [lindex $args 0] 0]
if { ![validchan $chan]} {
putserv "NOTICE $nick :\"$chan\": invalid chan."
return 0
}
set msg [lrange [lindex $args 0] 1 end]
}
#putchan $chan $msg
putserv "PRIVMSG $chan :$msg"
}
|
|
|
| Back to top |
|
 |
onair Voice
Joined: 25 Jul 2006 Posts: 6
|
Posted: Tue Jul 25, 2006 12:54 pm Post subject: |
|
|
oeps i was forgotten to say many thanks to zero and Tosser^^
quick response and great help thank you guys  |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Tue Jul 25, 2006 1:08 pm Post subject: |
|
|
| Code: | bind msg - !say msg_say
proc msg_say {nick uhost hand arg} {
if {$arg == ""} {
putserv "NOTICE $nick :Syntax: /msg $::botnick $::lastbind <#channel> <message>."
} else {
set chan [lindex [split $arg] 0]
set message [lrange $arg 1 end]
if {[string index $chan 0] != "#"} {
putserv "NOTICE $nick :Channel must start with '#'."
} elseif {![validchan $chan]} {
putserv "NOTICE $nick :Invalid channel '$chan'."
} elseif {$message == ""} {
putserv "NOTICE $nick :No message entered. Please use: /msg $::botnick !say $chan <message here>."
} else {
putserv "PRIVMSG $chan :$message"
putserv "NOTICE $nick :Message sent to $chan."
}
} |
Not tested, but should work... _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
onair Voice
Joined: 25 Jul 2006 Posts: 6
|
Posted: Tue Jul 25, 2006 2:27 pm Post subject: |
|
|
It give a error at line 3, Tosser^^
» missing close-brace while executing |
|
| Back to top |
|
 |
onair Voice
Joined: 25 Jul 2006 Posts: 6
|
Posted: Tue Jul 25, 2006 2:50 pm Post subject: |
|
|
oké the error is gone it was a forgotten } but still got the same problem:
(20:46:22) -> *botnick* !say #channel test ] [
(20:46:23) (botnick): test \] {[} |
|
| Back to top |
|
 |
Zero Voice
Joined: 25 Jul 2006 Posts: 4
|
Posted: Tue Jul 25, 2006 3:25 pm Post subject: |
|
|
Try this
| Code: |
bind msg - !say msg_say
proc msg_say {nick uhost hand arg} {
if {$arg == ""} {
putserv "NOTICE $nick :Syntax: /msg $::botnick $::lastbind <#channel> <message>."
} else {
set chan [lindex [split $arg] 0]
set message [join [lrange [split $arg] 1 end]]
if {[string index $chan 0] != "#"} {
putserv "NOTICE $nick :Channel must start with '#'."
} elseif {![validchan $chan]} {
putserv "NOTICE $nick :Invalid channel '$chan'."
} elseif {$message == ""} {
putserv "NOTICE $nick :No message entered. Please use: /msg $::botnick !say $chan <message here>."
} else {
putserv "PRIVMSG $chan :$message"
putserv "NOTICE $nick :Message sent to $chan."
}
}
}
|
|
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Tue Jul 25, 2006 4:17 pm Post subject: |
|
|
| Code: | bind msg - !say msg_say
proc msg_say {nick uhost hand arg} {
if {[llength [set arg [split $arg]]] < 2} {
putserv "NOTICE $nick :Syntax: /msg $::botnick $::lastbind <#channel> <message>."
} else {
if {[string index [set chan [lindex $arg 0]] != "#" || ![validchan $chan]} {
putserv "NOTICE $nick :Invalid channel '$chan'."
} else {
putserv "PRIVMSG $chan :[join [lrange $arg 1 end]]"
putserv "NOTICE $nick :Message sent to $chan."
}
}
} |
a much cleaner version. |
|
| Back to top |
|
 |
onair Voice
Joined: 25 Jul 2006 Posts: 6
|
Posted: Tue Jul 25, 2006 4:59 pm Post subject: |
|
|
oké that seems to work, thank guys for the great support  |
|
| Back to top |
|
 |
|