egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

timebomb with dont kick ops

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
albatuni
Voice


Joined: 09 Sep 2012
Posts: 2

PostPosted: Sun Sep 09, 2012 9:06 am    Post subject: timebomb with dont kick ops Reply with quote

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
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sun Sep 09, 2012 11:37 am    Post subject: Reply with quote

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
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sun Sep 09, 2012 12:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber