| View previous topic :: View next topic |
| Author |
Message |
sdays Halfop
Joined: 21 Oct 2006 Posts: 98
|
Posted: Thu Aug 09, 2007 8:25 am Post subject: random kick |
|
|
How can i fix it so it won't kick owners or bots?
| Code: |
bind pub - !random text:attack
proc text:attack {nick uhost hand chan text} {
set nicks [chanlist $chan]
set randnick [lindex $nicks [rand [llength $nicks]]]
putserv "KICK $chan $randnick :Bitchowned by $nick!"
}
|
|
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Thu Aug 09, 2007 8:38 am Post subject: |
|
|
Something like this (not tested):
| Code: | proc text:attack {nick uhost hand chan text} {
# 1) generate list of nicks than can be kicked
set victims [list]
foreach possibleVictim [chanlist $chan] {
if {![isbotnick $possibleVictim]&&![matchattr [nick2hand $possibleVictim] bfmno|bfmno $chan]} {
lappend victims $possibleVictim
}
}
# 2) kick (unless the list is empty)
if {[llength $victims]} {
set victim [lindex $victims [rand [llength $victims]]]
putserv "KICK $chan $victim :Bitchowned by $nick!"
} else {
putserv "PRIVMSG $chan :No suitable victims at the moment."
}
} |
_________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
sdays Halfop
Joined: 21 Oct 2006 Posts: 98
|
Posted: Thu Aug 09, 2007 7:04 pm Post subject: |
|
|
| Okay people flooding my bot, how can i set it to ignore it for 30mins and if any one does !random with in that time they will get banned for 2 3 mins. |
|
| Back to top |
|
 |
YooHoo Owner

Joined: 13 Feb 2003 Posts: 939 Location: Redwood Coast
|
Posted: Thu Aug 09, 2007 8:05 pm Post subject: |
|
|
why don't you just bind the public command to a flag, such as +f. That way only your friends can use it. _________________
Johoho's TCL for beginners
 |
|
| Back to top |
|
 |
sdays Halfop
Joined: 21 Oct 2006 Posts: 98
|
Posted: Sun Aug 12, 2007 10:27 am Post subject: |
|
|
Nvm, i got it.  |
|
| Back to top |
|
 |
sdays Halfop
Joined: 21 Oct 2006 Posts: 98
|
Posted: Mon Aug 13, 2007 8:52 am Post subject: |
|
|
How can i add a counter for this, i want it o look like this when i type: !randtstats
<eggdrop> [Total] all [Lost] lost [Bitchowns] allowned [Success] % of winning
<eggdrop> [Last Own] Nick bitchowned Randnick.
| Code: |
set norand off
bind pub - !random random:kick
proc random:kick {nick uhost hand chan text} {
global norand
set banmask *!*@[lindex [split [getchanhost $nick $chan] @] 1]
set victims [list]
foreach possibleVictim [chanlist $chan] {
if {![isbotnick $possibleVictim]&&![matchattr [nick2hand $possibleVictim] bn|nb $chan]} {
lappend victims $possibleVictim
}
}
if {[llength $victims] && ($norand == off)} {
set victim [lindex $victims [rand [llength $victims]]]
putserv "KICK $chan $victim :Bitchowned by $nick!"
set norand on
timer 30 "set norand off"
} else {
putserv "MODE $chan +b :$banmask"
putserv "KICK $chan $nick :You lost!"
utimer 30 [list putserv "MODE $chan -b $banmask"]
}
}
|
|
|
| Back to top |
|
 |
|