| View previous topic :: View next topic |
| Author |
Message |
albatuni Voice
Joined: 09 Sep 2012 Posts: 2
|
Posted: Sun Sep 09, 2012 9:06 am Post subject: timebomb with dont kick ops |
|
|
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.. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sun Sep 09, 2012 11:37 am Post subject: |
|
|
Find:
| Code: |
proc doTimebomb {nick uhost hand chan arg} {
|
It is near the end.
Compare it to the following:
| Code: |
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/1.6.21/tcl-commands.html
and scroll down to:
isop <nickname> [channel]
I hope this helps. |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Sun Sep 09, 2012 12:15 pm Post subject: |
|
|
the secret to add such options in that script is in this somewhat flawed process...
| Code: |
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: |
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
. |
|
| Back to top |
|
 |
|