This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
SpiKe^^
Owner
Posts: 831 Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:
Post
by SpiKe^^ » Sun Feb 22, 2015 12:20 pm
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^^
Owner
Posts: 831 Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:
Post
by SpiKe^^ » Sun Feb 22, 2015 2:41 pm
This might be a more correct way to prove nicks before continuing.
Replace the existing proc doTimebomb with this...
Code: Select all
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.
langer_hans
Voice
Posts: 13 Joined: Thu Feb 19, 2015 2:18 pm
Post
by langer_hans » Mon Feb 23, 2015 1:28 am
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.
caesar
Mint Rubber
Posts: 3777 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Mon Feb 23, 2015 5:17 am
if {[string tolower $theNick] == [string tolower $botnick]} {
really? why don't you use built-in
isbotnick function?
Anyway.. how about:
Code: Select all
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.
SpiKe^^
Owner
Posts: 831 Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:
Post
by SpiKe^^ » Mon Feb 23, 2015 9:18 am
That part worked, I left it as it was:)