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.

Message to users who connect to my server

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
r
rUMENcho
Voice
Posts: 4
Joined: Sun Dec 18, 2011 11:32 am

Message to users who connect to my server

Post by rUMENcho »

Hi,

I have an IRC server (ratbox 3.0) and i want to make one oper bot who will send a message to everyone who connect to my server.

Can anybody help me with this tcl?

Thanks :)
J
Johannes13
Halfop
Posts: 46
Joined: Sun Oct 10, 2010 11:38 am

Post by Johannes13 »

It is simple:
1st: Your bot need to get all user connected messages. This is usually done by OPERing the bot.
2nd: You need the raw line that the server sends out to all opers (or peoples who should see such a thing).

Now you can use [bind raw] and extraxt the nick from that message with regexp. After you have the nick just send him a NOTICE. Sure, a PRIVMSG would work as well, but this would be annoying.
R
Regex
Voice
Posts: 19
Joined: Sat Mar 19, 2011 1:23 pm

Post by Regex »

Of course, this script may use..

If your connection message like that;

*** Notice -- Client connecting on port 6667: CLubber (mirc@85.97.---.--) [clients]

You may, send a message who connects your server.

Code: Select all

bind raw * notice connection
proc connection {from keyword arg} {
  global botnick
  if {[string match -nocase "*Client connecting on port*" $arg]} {
    set nick [lindex $arg 9]
    set port [string range [lindex [split [lindex $arg 8] ":"] 0] 0 end]
    set ident [string range [lindex [split [lindex $arg 10] "@"] 0] 1 end]
    set host [string range [lindex [split [lindex $arg 10] "@"] 1] 0 end-1]
    putquick "PRIVMSG $nick Hi $nick!"
    putquick "PRIVMSG $nick -"
    putquick "PRIVMSG $nick Your Ident: $ident"
    putquick "PRIVMSG $nick Your IP: $host"
    putquick "PRIVMSG $nick Your Port: $port"
    putquick "PRIVMSG $nick -"
    putquick "PRIVMSG $nick Welcome to our server, irc.server.com"
    putquick "PRIVMSG $nick If you have any ircd/services question you may join #help channel."
    putquick "PRIVMSG $nick If you have any nick/server/ban question you may join #operhelp channel."
  }
}
Your bot must be OPER. Otherwise it doesn't work.
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

Alternatively

Code: Select all

# Server Notice catch - Notices to users on connect.

# Edit the lines below to reflect what notice to send. If you add more, or remove some, don't forget to add/remove from the global arguments, under proc.
set line1 "this is the first line to send to the connecting user."
set line2 "this is the second line."
set line3 "if you need a third, then this too."

# set a list of exempt nicknames, or leave "" for none.
set nonotice {
  "nick1"
  "nick2"
  "nick3"
}

# ------ CODE BELOW ------
bind raw - NOTICE server:notices
proc server:notices {from keyword arg} {
  global nonotice line1 line2 line3

    if {[string match -nocase "*Client connecting on*" $arg]} {
      set nick [lindex [split $arg] 9]
      foreach nonick $nonotice {
        if {[string equal -nocase $nonick $nick]} {return}
        putquick "NOTICE $nick :$line1"
        putquick "NOTICE $nick :$line2"
        putquick "NOTICE $nick :$line3"
      }
   }

    if {[string match -nocase "*Client connecting at*" $arg]} {
      set nick [lindex [split $arg] 8]
      foreach nonick $nonotice {
        if {[string equal -nocase $nonick $nick]} {return}
        putquick "NOTICE $nick :$line1"
        putquick "NOTICE $nick :$line2"
        putquick "NOTICE $nick :$line3"
      }
   }
} 

putlog "Connection Messenger loaded."
Easily modified to suit.
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
Post Reply