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 

kick user not in list

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


Joined: 08 May 2006
Posts: 18

PostPosted: Sat Mar 24, 2007 8:33 pm    Post subject: kick user not in list Reply with quote

hi guys
is there away to kick a user that is not in a text file
i.e use the command !add <nick>

bot adds nick to db.txt

user joins channel bot ignores user

user not added to db.txt ..... bot will kick from channel and keep kicking till the third join and then set channel ban

thanks guys
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Mar 25, 2007 8:21 pm    Post subject: Reply with quote

Why not create a handle, give it a specific flag, and then add the nicks to this handle. This way, instead of checking if the nick is in a text file, you just check if the user has that specific flag.
Code:
bind pub n|n !add add:nick
bind join - "#channel *" kick:et

proc add:nick {nick uhost hand chan arg} {
 if {![validuser allowed]} {
  adduser allowed
  chattr allowed +A
 }
 set n [string tolower [lindex [split $arg] 0]]!*@*
 if {[lsearch -exact [getuser allowed HOSTS] $n] == -1} {
  setuser allowed HOSTS $n
  puthelp "privmsg $chan :Added $n to allowed list."
 }
}

proc kick:et {nick uhost hand chan} {
 if {![matchattr $hand A|A $chan]} {
  putserv "kick $chan $nick :ETs not allowed."
 }
}

This way, only +A users will be allowed on #channel.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
outthere
Voice


Joined: 26 Nov 2005
Posts: 33

PostPosted: Thu Apr 03, 2008 8:04 pm    Post subject: this is what i have been looking for! Reply with quote

I have been searching for this exact script and finally found it. Could you please add 2 features?

1. kick and ban
2. voice the user if nick is allowed

Thanks in advance

Very Happy

now that i think of it.. maybe 1 one thing? put a notice to the user that lets them know they are added to the list? Wink
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Apr 04, 2008 7:10 am    Post subject: Reply with quote

Code:
bind pub n|n !add add:nick
bind join - "#channel *" kick:et

proc add:nick {nick uhost hand chan arg} {
 if {![validuser allowed]} {
  adduser allowed
  chattr allowed +A
 }
 set n [string tolower [lindex [split $arg] 0]]!*@*
 if {[lsearch -exact [getuser allowed HOSTS] $n] == -1} {
  setuser allowed HOSTS $n
  puthelp "privmsg $chan :Added $n to allowed list."
  puthelp "notice [lindex [split $arg] 0] :You've been added to the allowed list on $chan"
 }
}

proc kick:et {nick uhost hand chan} {
 if {![matchattr $hand A|A $chan]} {
  putserv "kick $chan $nick :ETs not allowed."
  pushmode $chan +b *!*@[lindex [split $uhost @] 1]
 } {
  pushmode $chan +v $nick
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
outthere
Voice


Joined: 26 Nov 2005
Posts: 33

PostPosted: Fri Apr 04, 2008 11:39 am    Post subject: Reply with quote

Awesome! Thanks for the fast reply!

Very Happy
Back to top
View user's profile Send private message
outthere
Voice


Joined: 26 Nov 2005
Posts: 33

PostPosted: Sat Apr 19, 2008 8:47 pm    Post subject: Reply with quote

How would you edit the script to make it a timed ban?

Thanks
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Apr 19, 2008 9:04 pm    Post subject: Reply with quote

Add a timer to remove the ban after x minutes. For example:
Code:
timer 10 [list pushmode $chan -b *!*@[lindex [split $uhost @] 1]]

This will remove the ban after 10 minutes from setting it.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
outthere
Voice


Joined: 26 Nov 2005
Posts: 33

PostPosted: Sat Apr 19, 2008 9:18 pm    Post subject: Reply with quote

That easy huh? I am picking up on this a little bit. I did some modification to the script and it worked! lol..

thanks again
Back to top
View user's profile Send private message
outthere
Voice


Joined: 26 Nov 2005
Posts: 33

PostPosted: Fri Aug 08, 2008 1:04 am    Post subject: !delete user Reply with quote

Ok how would I be able to !delete the user? I have tried adding a new process but it is not working correctly. I tried to use the !add as a guide.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Aug 09, 2008 11:29 am    Post subject: Reply with quote

Code:
bind pub n|n !del del:nick

proc del:nick {nick uhost hand chan arg} {
 set n [lindex [split $arg] 0]
 if {[validuser allowed] && [delhost allowed $n!*@*]} {
  puthelp "privmsg $chan :Removed $n from allowed list."
  puthelp "notice $n :You've been removed from the allowed list on $chan."
 } {
  puthelp "privmsg $chan :$n is not on the allowed list."
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
outthere
Voice


Joined: 26 Nov 2005
Posts: 33

PostPosted: Sat Aug 09, 2008 1:24 pm    Post subject: Reply with quote

Thank you!
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