| View previous topic :: View next topic |
| Author |
Message |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Sun Feb 22, 2015 12:20 pm Post subject: |
|
|
| Quote: | | is it possible to protect users from a bomb? i dont want: !bomb Bot |
The script already tries to do this, but is done badly/incorrectly.
The script confuses nick with handle, they are not always the same thing:)
Have you added all the other bots (with +b) to the bot running the timebomb script? _________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
langer_hans Voice
Joined: 19 Feb 2015 Posts: 13
|
Posted: Sun Feb 22, 2015 2:35 pm Post subject: |
|
|
| i have only one bot |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Sun Feb 22, 2015 2:41 pm Post subject: |
|
|
This might be a more correct way to prove nicks before continuing.
Replace the existing proc doTimebomb with this...
| Code: |
proc doTimebomb {nick uhost hand chan arg} {
global botnick
set theNick $nick
set arg [split [string trim $arg]]
if {[llength $arg] == 1} {
set theNick [lindex $arg 0]
}
if {[string tolower $theNick] == [string tolower $botnick]} {
IRCKick $nick $chan "I will not tollerate this!"
return
}
set hn [nick2hand $theNick $chan]
if {$hn == ""} {
IRCPrivMSG $chan "$theNick is not on $chan"
return
}
if {$hn != "*" && [matchattr $hn "b|b" $chan]} {
IRCKick $nick $chan "I will not tollerate that!"
return
}
StartTimeBomb $nick $theNick $chan
}
|
Test that out and verify you can not timebomb the bot. _________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
langer_hans Voice
Joined: 19 Feb 2015 Posts: 13
|
Posted: Mon Feb 23, 2015 1:28 am Post subject: |
|
|
very nice, works great.
[06:26:50] <@user1> !bomb Bot
[06:26:52] * You were kicked by Bot (I will not tollerate this!)
Last edited by langer_hans on Mon Feb 23, 2015 10:20 am; edited 1 time in total |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Feb 23, 2015 5:17 am Post subject: |
|
|
| Quote: |
if {[string tolower $theNick] == [string tolower $botnick]} {
|
really? why don't you use built-in isbotnick function?
Anyway.. how about:
| Code: |
proc doTimebomb {nick uhost hand chan text} {
if {[scan $text {%s} who] != 1} {
set theNick $nick
} else {
set theNick $who
}
if {![onchan $theNick]} {
IRCPrivMSG $chan "$theNick is not on $chan"
return
}
set hn [nick2hand $theNick $chan]
if {[isbotnick $theNick] || [matchattr $hn "b|b" $chan]} {
IRCKick $nick $chan "I will not tollerate that!"
return
}
StartTimeBomb $nick $theNick $chan
}
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Mon Feb 23, 2015 9:18 am Post subject: |
|
|
That part worked, I left it as it was:) _________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
|