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.

Modify: joinnotify.tcl

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
erotism
Voice
Posts: 13
Joined: Tue Aug 10, 2010 7:39 am
Location: Sofia, Bulgaria
Contact:

Modify: joinnotify.tcl

Post by erotism »

I found a very useful script archive, but I want to ask someone can you help me to change it a little ...

Code: Select all

#############################################################
# joinnotify.tcl v1.0 by greenbear <greenbear@defragged.org>
#
# Someone asked for it, so here it is.
#
# It sends you a email when any of the nicks specified
# join one of the channels specified.
#
# notify you when any of theese nicks join your chan
set ppl "nick1 nick2"

# your email addy
set mail "email@addy.com"

# channels you want to monitor
set mailchans "#channel1 #channel2"

bind join - * notify
proc notify {nick uhost handle chan}  {
 global ppl mail mailchans

  if {![file exists emptyfile] } {
      set tempfile [open emptyfile w]
      puts $tempfile " "
      close $tempfile
  }

  if {([lsearch -exact [string tolower $ppl] [string tolower $nick]] != -1) && ([lsearch -exact [string tolower $mailchans] [$
     putlog "$nick ($uhost) joined $chan, emailing $mail about it."
     exec mail -s "$nick ($uhost) joined $chan" $mail < emptyfile
  }
}
This is the script .. My idea is if you can eliminate static nicks and to ensure that the bot to see when entering the channel if the user has added to his userfile, and have +S flag is then sent to email to me..

Vignette:
The idea of the whole job is to receive mail2sms on my phone when someone added with +S flag and *hostmask* in bot userfile joining the channels..

I strongly hope someone can help. Thank you in advance:)
L
Luminous
Op
Posts: 146
Joined: Fri Feb 12, 2010 1:00 pm

Post by Luminous »

I added this line:

Code: Select all

 if {[validuser $handle] && [matchattr $handle |S $chan]} {
, which I think is what you want... it checks to see if the handle of the person joining is in the userfile and has the +S flag on the channel. Proc halts and does nothing otherwise.

Note that to give the user +S on the channel, you need to do ".chattr handle |+S" in the partyline. The "|" separates global from channel flags. In case you didn't know...

Code: Select all

#############################################################
# joinnotify.tcl v1.0 by greenbear <greenbear@defragged.org>
#
# Someone asked for it, so here it is.
#
# It sends you a email when any of the nicks specified
# join one of the channels specified.
#
# notify you when any of theese nicks join your chan
set ppl "nick1 nick2"

# your email addy
set mail "email@addy.com"

# channels you want to monitor
set mailchans "#channel1 #channel2"

bind join - * notify
proc notify {nick uhost handle chan}  {
 if {[validuser $handle] && [matchattr $handle |S $chan]} {
 global ppl mail mailchans

  if {![file exists emptyfile] } {
      set tempfile [open emptyfile w]
      puts $tempfile " "
      close $tempfile
  }

  if {([lsearch -exact [string tolower $ppl] [string tolower $nick]] != -1) && ([lsearch -exact [string tolower $mailchans] [$
     putlog "$nick ($uhost) joined $chan, emailing $mail about it."
     exec mail -s "$nick ($uhost) joined $chan" $mail < emptyfile
  } 
  }
return
)
Post Reply