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 

Modify: joinnotify.tcl

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


Joined: 10 Aug 2010
Posts: 13
Location: Sofia, Bulgaria

PostPosted: Sat Aug 14, 2010 2:48 pm    Post subject: Modify: joinnotify.tcl Reply with quote

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

Code:
#############################################################
# 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:)
Back to top
View user's profile Send private message Visit poster's website
Luminous
Op


Joined: 12 Feb 2010
Posts: 146

PostPosted: Sat Aug 14, 2010 3:35 pm    Post subject: Reply with quote

I added this line:
Code:
 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:

#############################################################
# 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
)
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