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.

timebomb with dont kick ops

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
a
albatuni
Voice
Posts: 2
Joined: Sun Sep 09, 2012 9:01 am

timebomb with dont kick ops

Post by albatuni »

hi, i want to ask help how to modified timebomb scripts so it can't kick ops/owner and say something in room like "sorry, no bomb for op/owner"

This link to Timebomb script

Thanks..
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

Find:

Code: Select all

proc doTimebomb {nick uhost hand chan arg} {
It is near the end.

Compare it to the following:

Code: Select all

proc doTimebomb {nick uhost hand chan arg} {
  global botnick
  set theNick $nick
  if { [llength $arg] == 1 } {
    set theNick [lindex [split $arg] 0]
  }
  if { [string tolower $theNick] == [string tolower $botnick] } {
    set theNick $nick
    IRCKick $theNick $chan "I will not tollerate this!"
    return
  }
  if { [validuser $theNick] == 1 } {
    if { [matchattr $theNick "+b"] == 1 } {
      set theNick $nick
      IRCKick $theNick $chan "I will not tollerate that!"
      return
    }
  }





  if {[isop $theNick $chan]} {
      putserv "privmsg $chan :Sorry, no bomb for op"
      return
    }




  StartTimeBomb $nick $theNick $chan
}




Add the changes to your script, rehash, and test. I have not loaded the script just to test this.

Here is the reference material you needed:
http://www.eggheads.org/support/egghtml ... mands.html
and scroll down to:
isop <nickname> [channel]


I hope this helps.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

the secret to add such options in that script is in this somewhat flawed process...

Code: Select all

proc doTimebomb {nick uhost hand chan arg} {
  global botnick
  set theNick $nick
  if { [llength $arg] == 1 } {
    set theNick [lindex [split $arg] 0]
  }
  if { [string tolower $theNick] == [string tolower $botnick] } {
    set theNick $nick
    IRCKick $theNick $chan "I will not tollerate this!"
    return
  }
  if { [validuser $theNick] == 1 } {
    if { [matchattr $theNick "+b"] == 1 } {
      set theNick $nick
      IRCKick $theNick $chan "I will not tollerate that!"
      return
    }
  }
  StartTimeBomb $nick $theNick $chan
}
Original process uses [validuser $theNick] & [matchattr $theNick "+b"]
Both need to be run on a handle, not a nick!
Try replacing all the above code with this.

Code: Select all

proc doTimebomb {nick uhost hand chan arg} {
  global botnick

  set arg [split $arg]

  set theNick $nick
  set self 1

  if {[llength $arg] == "1"} {
    set theNick [lindex $arg 0]
    set self 0
  }

  if { [string tolower $theNick] == [string tolower $botnick] } {
    set theNick $nick
    IRCKick $theNick $chan "I will not tollerate this!"
    return
  }

  if {$self=="0"} {

    if {![onchan $theNick $chan]} {  return  }

    if {[isop $theNick $chan]} 
      IRCPrivMSG $chan "You can't timebomb an op!"
      StartTimeBomb $nick $nick $chan
      return
    }

    set theHand [nick2hand $theNick $chan]

    if {$theHand ne "" && $theHand ne "*"} {

      if {[matchattr $theHand b|b $chan]} {
        IRCKick $nick $chan "I will not tollerate that!"
        return
      }

      if {[matchattr $theHand no|no $chan]} {
        IRCPrivMSG $chan "You can't timebomb an op/owner!"
        return
      }
    }
  }

  StartTimeBomb $nick $theNick $chan
}
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Post Reply