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 

timed bans

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


Joined: 20 May 2005
Posts: 37
Location: Earth

PostPosted: Thu Aug 24, 2006 6:02 pm    Post subject: timed bans Reply with quote

I'm in need of a script that will for every user that joins set a timer that will ban the user 15 mins later unless user has already parted the channel.
Back to top
View user's profile Send private message Visit poster's website
X-Ception
Voice


Joined: 20 May 2005
Posts: 37
Location: Earth

PostPosted: Fri Aug 25, 2006 6:02 am    Post subject: additional Reply with quote

Will also need to exempt ops/halfops/voices from the banning, any one have any ideas or can point me in right direction ?
Back to top
View user's profile Send private message Visit poster's website
X-Ception
Voice


Joined: 20 May 2005
Posts: 37
Location: Earth

PostPosted: Fri Aug 25, 2006 1:36 pm    Post subject: . Reply with quote

Ok gave it a go but its still nto right, +v +o users are kicked well actually all users regardlss of time in there are kicked after 15 mins Sad
Code:

bind join - * timed_bans

proc timed_bans {nick uhost hand chan} {
global botnick
  set ipmask [lindex [split [maskhost $nick![getchanhost $nick $chan]] "@"] 1]
  set userm [lindex [split [getchanhost $nick $chan] "@"] 0]
  set userhost *!*$userm@$ipmask
if {[isop $nick $chan]} {
puthelp "NOTICE $nick : \[DW\]-> Hello $nick Happy Opping"
putlog "\[DW\]-> $nick is a channel operator for $chan"
} else {
if {[isvoice $nick $chan]} {
puthelp "NOTICE $nick : \[DW\]-> Hello $nick Happy Helping"
putlog "\[DW\]-> $nick is a helper for $chan"
} else {
if {$nick == "nick" || $nick == $botnick} {
putlog "\[DW\]-> Don\'t want to ban myself or Gridlock really :P"
} else {
timer 15 [list putquick "MODE $chan +b $userhost"]
timer 15 [list putquick "KICK $chan $nick *pop*."]
# Logging/Debugging
timer 15 [list putlog "\[RS\]-> $nick was kicked and banned after using 15 mins"]
}
}
}
}

Help ?
Back to top
View user's profile Send private message Visit poster's website
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Fri Aug 25, 2006 10:39 pm    Post subject: Reply with quote

That's because people don't have modes the moment they join, Try using a delayed check by means of a utimer.
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Aug 26, 2006 8:27 am    Post subject: Reply with quote

Actually, I guess you really wanna check permissions within the bot:

isop only checks wether the nickname has been opped on the channel or not, rather than look at the userlist and see wether they've got +o permission (same goes for isvoice)

Code:
proc timed_bans {nick uhost hand chan} {
 global botnick
 if {$nick == $botnick || [matchattr $hand "+bflomn|flomn" $chan]} {
  return 0
 } else {
  timer 15 [list do_kick $nick $uhost $chan]
 }
}

proc do_kick {nick host channel} {
 if {[isop $nick $channel] || [isvoice $nick $channel]} {
  return 0
 } else {
  pushmode $channel +b [maskhost "$nick!$host"]
  putkick $channel $nick "*pop*"
  putlog "\[RS\]-> $nick was kicked and banned after using 15 mins"
 }
}


The above script checks both isop/isvoice and flags +o/+v etc

edit: Keep in mind tho, that this code does not handle nick-changes. You'll need something abit more complex for that...
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
X-Ception
Voice


Joined: 20 May 2005
Posts: 37
Location: Earth

PostPosted: Sat Aug 26, 2006 9:15 am    Post subject: perfect Reply with quote

Perfect - thank you il give it a go, really it was only for channel permissions but bot permissions added also will work great.
Back to top
View user's profile Send private message Visit poster's website
X-Ception
Voice


Joined: 20 May 2005
Posts: 37
Location: Earth

PostPosted: Sat Aug 26, 2006 9:23 am    Post subject: one more question Reply with quote

sorry one more question:
if i used
Code:

   if {$chan == "#channel"} {

would that ensure the proc only apply's to #channel ? ( forgot to mention its to only run for one channel, not all the bots within[/code]
Back to top
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Aug 26, 2006 9:28 am    Post subject: Reply with quote

I'd rather solve that within the actual binding (otherwize you'd have to care for upper/lowercase in channel-name)
Code:
bind join - "#channel *" timed_bans


I'd suggest something like this otherwize:
Code:
if {[string tolower $chan] == "#channel"} {

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
X-Ception
Voice


Joined: 20 May 2005
Posts: 37
Location: Earth

PostPosted: Sat Aug 26, 2006 9:33 am    Post subject: Reply with quote

nml375 wrote:
I'd rather solve that within the actual binding (otherwize you'd have to care for upper/lowercase in channel-name)
Code:
bind join - "#channel *" timed_bans


I'd suggest something like this otherwize:
Code:
if {[string tolower $chan] == "#channel"} {


Thank you once more - appreciated.
Back to top
View user's profile Send private message Visit poster's website
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