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 

SIMPLE kick/ban w/timer

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


Joined: 12 Mar 2008
Posts: 61

PostPosted: Mon Nov 10, 2008 4:16 pm    Post subject: SIMPLE kick/ban w/timer Reply with quote

Hello !

I tryed but no sucess =D

I just want a simple ban/script like

.noflame $nick
+ban $nick
+kick $nick ( NO FLAME !!! )
(after 1 hour)
-ban $nick


Thanks !

GaRfWeN
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Tue Nov 11, 2008 4:33 pm    Post subject: Reply with quote

Hopefully, you did not want it to just ban the nickname for the banmask :S
If you did, then let me know so i can change it. Here it is anyway,
Code:
set noflame_access "o|o"            ;# access flags for public command
                                     # "global-flag"|"channel-flag"
set noflame_message "NO FLAME !!!"  ;# kick/ban message
set noflame_time "100"              ;# time to remove ban after this many minets

proc noflame:pub {nick host handle channel text} {
global noflame_message noflame_time
 if {([llength $text] == 0)} {
  puthelp "NOTICE $nick :Syntax: .noflame <nickname>"
  return 0
 }
 set target [lindex [split $text] 0]
 if {(![onchan $target $channel])} {
  puthelp "NOTICE $nick :I dont see $target on this channel."
  return 0
 } else {
  if {([string match "*!~*@*" "$target![getchanhost $target $channel]"])} {set banmask [maskhost [regsub "~" "$target![getchanhost $target $channel]" "*"]]} else {set banmask [mashost "$target![getchanhost $target $channel]"]}
  if {([botisop $channel]) || ([botishalfop $channel])} {
   putserv "KICK $channel $target :$noflame_message"
   putserv "MODE $channel +b $banmask"
   timer $noflame_time [list pushmode $channel -b $banmask]
   return 1
  } else {
   puthelp "NOTICE $nick :unable to kick/ban $target (i'm not oped)"
   return 0
  }
 }
}

proc noflame:checksettings {} {
 global noflame_message noflame_time noflame_access
  if {($noflame_access == "")} {
   putlog "noflame.tcl: invalid access flags set, should be <globalflag>|<channelflag> (setting it to default o|o)"
   set noflame_access o|o
  } else {
   bind pub $noflame_access .noflame noflame:pub
  }
  if {($noflame_time < 0) || ($noflame_time == 999)} {
   putlog "noflame.tcl: invalid ban time, should be above 0 and below 999. (setting it to default 100)"
   set noflame_time 100
  }
  if {($noflame_message == "") || ([llength $noflame_message] > 200)} {
   putlog "noflame.tcl: invalid kick messag. (setting to default \"Please do not flame in this channel\")"
   set noflame_message "Please do not flame in this channel"
  }
   return
}

putlog "loaded noflame.tcl"
return [noflame:checksettings]
haven't had time to test it, sorry. Smile least you know where to find me, if it dosen't Very Happy
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
garfwen
Halfop


Joined: 12 Mar 2008
Posts: 61

PostPosted: Thu Nov 13, 2008 1:20 pm    Post subject: Ty. Reply with quote

Hello !
1st ty.

Theres something wrong on the code, because the eggdrop does not kick/ban.

The other commands are working fine.

Guess its something over here:

Code:
 
set target [lindex [split $text] 0]
 if {(![onchan $target $channel])} {
  puthelp "NOTICE $nick :I dont see $target on this channel."
  return 0
 } else {
  if {([string match "*!~*@*" "$target![getchanhost $target $channel]"])} {set banmask [maskhost [regsub "~" "$target![getchanhost $target $channel]" "*"]]} else {set banmask [mashost "$target![getchanhost $target $channel]"]}
  if {([botisop $channel]) || ([botishalfop $channel])} {
   putserv "KICK $channel $target :$noflame_message"
   putserv "MODE $channel +b $banmask"
   timer $noflame_time [list pushmode $channel -b $banmask]
   return 1
  } else {
   puthelp "NOTICE $nick :unable to kick/ban $target (i'm not oped)"
   return 0
  }
 }
}



Cumps,
GaRfWeN
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Thu Nov 13, 2008 2:54 pm    Post subject: Reply with quote

Could you give more details please? They only way from that, which the bot couldn't be kicking and banning someone was if they where not A Channel Operator or Channel HalfOp (if supported). Confused other than that, it would be becouse the nickname you supplyed wasn't on the bots channel where you used the command.
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
garfwen
Halfop


Joined: 12 Mar 2008
Posts: 61

PostPosted: Thu Nov 13, 2008 3:59 pm    Post subject: Reply with quote

Nop, the egg has op (im runnig it on qnet, #cs.gthr.pt)
When i type wrong nick he notices me, and also when i just dont put any nick.
It just doesnt works on the kick/ban acting: he does nothing.
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Fri Nov 14, 2008 1:43 am    Post subject: Reply with quote

Ok after testing the script my self, I've found no problems. The bot seems to be kicking and banning as it should given its a little fast to kick. but not really seeing any problem with that.
Quote:
[05:30:48] <@Me> .noflame Flamer
[05:30:49] * Flamer was kicked by bot (NO FLAME !!!)
[05:30:50] * bot sets mode: +b *!*noident@*.flame.org
The Bot Not oped on the channel seems to work
Quote:
[05:31:11] <@ME> .noflame Flamer
[05:31:11] -bot- unable to kick/ban Flamer (i'm not oped)
And when the nickname isn't on the channel it works fine.
Quote:
[05:31:04] <@Me> .noflame Flamer
[05:31:05] -bot- I dont see Flamer on this channel.
I got the same thing on Quakenet Smile so i doubt it was a problem the syntax. Arrow I'd check out if anything on your bot could be preventing it from kicking and banning Question or an other script Idea

Example: do you use some kind of "maskhost fixing script" that could be causing the problem? since the "maskhost" is used in this script.
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
garfwen
Halfop


Joined: 12 Mar 2008
Posts: 61

PostPosted: Sat Nov 15, 2008 5:51 pm    Post subject: Reply with quote

hey.

Nop have no idea.

I search a little and i found a script... with some edits:

Code:

bind PUB - .noflame pub:timeban

proc pub:timeban {nickname hostname handle channel arguments} {
  if {[llength [set arguments [split $arguments]]] < 1} {
    putquick "NOTICE $nickname :Usage: !timeban nickname"
  } elseif {![onchan [set nick [lindex $arguments 0]] $channel]} {
    putquick "NOTICE $nickname :I don't see $nick on $channel!"
  } else {
    if {[isop $nickname $channel]} {
    putquick "MODE $channel +b $nick"
    putquick "KICK $channel $nick :\026 Flame não é permitido, ban 60 minutos. Regras: http://gather.dotsi.pt \026"

    timer 60 [list putquick "MODE $channel -b $nick"]
    }
  }
}



This1 is working on my egg.

Ty TCL_no_TK.

GaRfWeN
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