egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Copy PM's to a channel

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
onair
Voice


Joined: 25 Jul 2006
Posts: 6

PostPosted: Tue Jul 25, 2006 9:18 am    Post subject: Copy PM's to a channel Reply with quote

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
View user's profile Send private message
Zero
Voice


Joined: 25 Jul 2006
Posts: 4

PostPosted: Tue Jul 25, 2006 11:02 am    Post subject: Reply with quote

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
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Tue Jul 25, 2006 12:23 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
onair
Voice


Joined: 25 Jul 2006
Posts: 6

PostPosted: Tue Jul 25, 2006 12:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
onair
Voice


Joined: 25 Jul 2006
Posts: 6

PostPosted: Tue Jul 25, 2006 12:54 pm    Post subject: Reply with quote

oeps i was forgotten to say many thanks to zero and Tosser^^
quick response and great help thank you guys Wink
Back to top
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Tue Jul 25, 2006 1:08 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
onair
Voice


Joined: 25 Jul 2006
Posts: 6

PostPosted: Tue Jul 25, 2006 2:27 pm    Post subject: Reply with quote

It give a error at line 3, Tosser^^

» missing close-brace while executing
Back to top
View user's profile Send private message
onair
Voice


Joined: 25 Jul 2006
Posts: 6

PostPosted: Tue Jul 25, 2006 2:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zero
Voice


Joined: 25 Jul 2006
Posts: 4

PostPosted: Tue Jul 25, 2006 3:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Tue Jul 25, 2006 4:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
onair
Voice


Joined: 25 Jul 2006
Posts: 6

PostPosted: Tue Jul 25, 2006 4:59 pm    Post subject: Reply with quote

oké that seems to work, thank guys for the great support Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber