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.

Secure this deop on op script?

Help for those learning Tcl or writing their own scripts.
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Secure this deop on op script?

Post by cache »

Someone found a way around this script.. its suppose to deop those who were oped by someone..

Heres what they did.. they deoped and reoped, then oped user REAL FAST have to be fast for it to work..
[11:44pm] * TheOp sets mode: -o TheOp
[11:44pm] * TheOp sets mode: +o TheOp
[11:44pm] * TheOp sets mode: +o User

And bot didn't deop user :(

Anyway to secure this?

Code: Select all

bind mode - * check_deop 
proc check_deop {nick host hand chan mode target} { 
 if {$mode == "+o" && ![isbotnick $nick] && ![isbotnick $target]} { 
  pushmode $chan "-o" $target 
 } 
} 
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

I think lag was your enemy on this occasion.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

well can pushmode be changed to something slower? I don't have any lag, server is pretty fast on 6GB ram.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Question: If you put a "putcmdlog" string into that proc, does it in fact get triggered?

I'm wondering if it has to do with the "set double-mode" option in the eggdrop config, but I can't find much in the way of documentation for it, can't find much about it in the src either..
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

cache wrote:well can pushmode be changed to something slower? I don't have any lag, server is pretty fast on 6GB ram.
Make a timer to delay execution?
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Is there also a reason you can't enable "bitch" mode in the bot, to keep non-users from getting ops at all?
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

I'm still not good with timers, can you help me?
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

I tried +bitch but it still lets me op a user real fast and does nothing unless i op them slow.

* TheOp sets mode: -o TheOp
* TheOp sets mode: +o TheOp
* TheOp sets mode: +o User

Seems to deop user when bot enters room but not when op deops and reops then ops user real fast.
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

Just tried superbitch.tcl by slennox still does same when they flood it fast bot don't deop them.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Odd that bitch mode is so easily defeated too.. Put something like this into the proc before the "if" :

putcmdlog "proc check_deop running"

just to see if the proc is even being executed as it should be. If its not executing, I think you found a bona fide bug, which would likely be beyond this forum's ability to fix and should be reported to egghead's developers.
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

Hi rosc..

I did as you asked..

Then I copy pasted this in to room real fast:
/mode #chan -o Me
/mode #chan +o Me
/mode #chan +o UsersNick

Then putty shows:

[12:48] #chan: mode change '-o Me' by Me!Me@Me
[12:48] proc check_deop running
[12:48] #chan: mode change '+o Me' by Me!Me@Me
[12:48] proc check_deop running
[12:48] #chan: mode change '+o UsersNick' by Me!Me@Me
[12:48] proc check_deop running

-------------------

If I do it slow:

[12:51pm] * Me sets mode: +o UsersNick
[12:52pm] * BOT sets mode: -o UsersNick

Putty:
[12:51] #chan: mode change '+o UsersNick' by Me!Me@Me
[12:51] proc check_deop running
[12:52] #chan: mode change '-o UsersNick' by Bot!Bot@Bot
[12:52] proc check_deop running
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

The proc is running then.. What do you have in your eggdrop.conf for

set double-mode

Try setting that to 1. If that does not help, then you'll need to add a timer and a proc to execute the timer's commands.

That would be like:

Code: Select all

bind mode - * check_deop
proc check_deop {nick host hand chan mode target} {
     utimer 2 [list timerproc $mode $chan $nick $target]
} 

proc timerproc {mode chan nick target} {
    if {$mode == "+o" && ![isbotnick $nick] && ![isbotnick $target]} {
         pushmode $chan "-o" $target
    } 
}
That should do the trick
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

Yeah I had double-mode set to 1 the whole time..

The time script works when I set it to 5 secs, thanks :)
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

anyway I can have timer try at 2, 5, 10, 15, and 20 secs? Just want to be on safe side.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Yep, just make duplicate timers with different times:

utimer 2 [list timerproc $mode $chan $nick $target]
utimer 5 [list timerproc $mode $chan $nick $target]
utimer 10 [list timerproc $mode $chan $nick $target]
etc.
Post Reply