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 

Message to users who connect to my server

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


Joined: 18 Dec 2011
Posts: 4

PostPosted: Sun Dec 18, 2011 11:34 am    Post subject: Message to users who connect to my server Reply with quote

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 Smile
Back to top
View user's profile Send private message
Johannes13
Halfop


Joined: 10 Oct 2010
Posts: 46

PostPosted: Tue Jan 31, 2012 2:46 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Regex
Voice


Joined: 19 Mar 2011
Posts: 19

PostPosted: Mon Feb 13, 2012 11:15 am    Post subject: Reply with quote

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:

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.
Back to top
View user's profile Send private message
Get_A_Fix
Master


Joined: 07 May 2005
Posts: 206
Location: New Zealand

PostPosted: Fri Feb 24, 2012 12:24 pm    Post subject: Reply with quote

Alternatively

Code:

# 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.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
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