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.

Bombscript with revenge mode

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

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
.
l
langer_hans
Voice
Posts: 13
Joined: Thu Feb 19, 2015 2:18 pm

Post by langer_hans »

i have only one bot
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

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.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
l
langer_hans
Voice
Posts: 13
Joined: Thu Feb 19, 2015 2:18 pm

Post by langer_hans »

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.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

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
.
Post Reply