This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Copy PM's to a channel

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
o
onair
Voice
Posts: 6
Joined: Tue Jul 25, 2006 9:11 am

Copy PM's to a channel

Post by onair »

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,
Z
Zero
Voice
Posts: 4
Joined: Tue Jul 25, 2006 4:17 am

Post by Zero »

Code: Select all

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..."
}
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Code: Select all

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
o
onair
Voice
Posts: 6
Joined: Tue Jul 25, 2006 9:11 am

Post by onair »

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: Select all

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"
}
o
onair
Voice
Posts: 6
Joined: Tue Jul 25, 2006 9:11 am

Post by onair »

oeps i was forgotten to say many thanks to zero and Tosser^^
quick response and great help thank you guys ;)
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Code: Select all

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
o
onair
Voice
Posts: 6
Joined: Tue Jul 25, 2006 9:11 am

Post by onair »

It give a error at line 3, Tosser^^

» missing close-brace while executing
o
onair
Voice
Posts: 6
Joined: Tue Jul 25, 2006 9:11 am

Post by onair »

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 \] {[}
Z
Zero
Voice
Posts: 4
Joined: Tue Jul 25, 2006 4:17 am

Post by Zero »

Try this

Code: Select all

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."
    }
  }
}
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Code: Select all

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.
o
onair
Voice
Posts: 6
Joined: Tue Jul 25, 2006 9:11 am

Post by onair »

oké that seems to work, thank guys for the great support ;)
Post Reply