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.

AutoReop

Support & discussion of released scripts, and announcements of new releases.
Post Reply
User avatar
Arnold_X-P
Master
Posts: 243
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

AutoReop

Post by Arnold_X-P »

I have this TCL and when temporary operator access is removed, the TCL uses a recovery time of 4 minutes.

Code: Select all

 bind mode - "*-o*" prot_deop

proc prot_deop {nick uhost hand chan mc argv} { 
global botnick 
if {[isbotnick $argv] && ![matchattr $hand mn|mn $chan]} { 
 putnow "chanserv deop $chan $nick"
putserv "PRIVMSG $chan :$nick don't take my away @"
  timer 4 [list puthelp "cs op $chan $botnick"]
  }
} 
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
networks: DALnet #tcls ChatZona #tcl Libera.Chat #tcls
User avatar
Arnold_X-P
Master
Posts: 243
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Re: AutoReop

Post by Arnold_X-P »

The detail for me is this...

Code: Select all

 [22:18] * JulieTh sets mode: -o Kantuta
[22:18] * ChanServ sets mode: +o Kantuta
[22:18] * JulieTh sets mode: -o Kantuta
[22:18] -ChanServ:#beni2- Kantuta has deopped JulieTh
[22:18] * ChanServ sets mode: +o Kantuta
[22:18] * JulieTh sets mode: -o Kantuta
[22:18] -ChanServ:#beni2- Kantuta has deopped JulieTh
[22:18] * ChanServ sets mode: +o Kantuta
[22:18] * JulieTh sets mode: -o Kantuta
[22:18] * ChanServ sets mode: -o JulieTh
[22:18] * ChanServ sets mode: +o Kantuta
[22:18] -ChanServ:#beni2- Kantuta has deopped JulieTh
[22:19] <@Kantuta> JulieTh don't take my away @
[22:19] <@Kantuta> JulieTh don't take my away @
[22:19] <@Kantuta> JulieTh don't take my away @
[22:19] <@Kantuta> JulieTh don't take my away @ 

causing abuse in services...
The solution for me is to add a killtimer to kill the time sequence and prevent it from abusing auto reop in services.
Last edited by Arnold_X-P on Wed Apr 30, 2025 12:51 am, edited 2 times in total.
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
networks: DALnet #tcls ChatZona #tcl Libera.Chat #tcls
User avatar
Arnold_X-P
Master
Posts: 243
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Re: AutoReop

Post by Arnold_X-P »

I implemented a killtimer, but I don't know if it will work so that it only asks for auto-reop once and then not again.
This is to prevent auto-reop @ abuse in services. Can you please help me?

Code: Select all

 bind mode - "*-o*" prot_deop
set autoopchan 4

proc prot_deop {nick uhost hand chan mc argv} { 
global botnick  autoopchan
if {[isbotnick $argv] && ![matchattr $hand mn|mn $chan]} {killtimer [lindex [split $autoopchan] end] }
 putnow "chanserv deop $chan $nick"
puthelp "PRIVMSG $chan :$nick don't take my away @"
timer $autoopchan [list puthelp "cs op $chan $botnick"] 
  }
I'm not sure if it will work.
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
networks: DALnet #tcls ChatZona #tcl Libera.Chat #tcls
s
simo
Revered One
Posts: 1122
Joined: Sun Mar 22, 2015 2:41 pm

Re: AutoReop

Post by simo »

try this :

Code: Select all


bind mode - * Re-OP:Me
set autoopchan 4

proc Re-OP:Me {nick uhost hand chan mode target} {
    global botnick  autoopchan
     if {$mode eq "-o" && [isbotnick $target]} {

  	if {[string match -nocase "chanserv" $nick] || [matchattr $hand omn|omn $chan] || [string match -nocase "$botnick" $nick]} { return 0 }

   if {[info exists TimeDReop($chan)]} {
    after cancel $TimeDReop($chan)
    unset TimeDReop($chan)
  }
    set TimeDReop($chan) [list [after [expr {$autoopchan*1000*60}] [list AUTO:OP $botnick $chan]]]
  }

  if {$mode eq "+o" && [isbotnick $target]} {
  if {[info exists TimeDReop($chan)]} {
    after cancel $TimeDReop($chan)
    unset TimeDReop($chan)
  }
}
}

   
 proc AUTO:OP {nick chan} {
   if {[isbotnick $nick] && ![botisop $chan] && [onchan $nick $chan]} {  putserv "chanserv op $chan $nick"}
}



User avatar
Arnold_X-P
Master
Posts: 243
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Re: AutoReop

Post by Arnold_X-P »

thanks simo I will try the TCL

I tested it and the TCL doesn't work.
When I remove the OP, the timeout passes and the auto-op doesn't work.

Code: Select all

 bind mode - * Re-OP:Me
set autoopchan 4

proc Re-OP:Me {nick uhost hand chan mode target} {
  global botnick  autoopchan
     if {$mode eq "-o" && [isbotnick $target]} {

  if {[string match -nocase "chanserv" $nick] || [matchattr $hand omn|omn $chan] || [string match -nocase "$botnick" $nick]} { return 0 }

   if {[info exists TimeDReop($chan)]} {
    after cancel $TimeDReop($chan)
    unset TimeDReop($chan)
  }
    set TimeDReop($chan) [list [after [expr {$autoopchan*1000*60}] [list AUTO:OP $botnick $chan]]]
  }

  if {$mode eq "+o" && [isbotnick $target]} {
  if {[info exists TimeDReop($chan)]} {
    after cancel $TimeDReop($chan)
    unset TimeDReop($chan)
   }
 }
}
 proc AUTO:OP {nick chan} {
   if {[isbotnick $nick] && ![botisop $chan] && [onchan $nick $chan]} {  putserv "chanserv op $chan $nick"}
}
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
networks: DALnet #tcls ChatZona #tcl Libera.Chat #tcls
s
simo
Revered One
Posts: 1122
Joined: Sun Mar 22, 2015 2:41 pm

Re: AutoReop

Post by simo »

try this :

Code: Select all



# delay time (in minutes) to REOP Bot. 
set autoopchan 4



bind mode - "#% +[string tolower [string tolower [string toupper [string tolower o]]]]" Re-OP:Me
bind mode - "#% -[string tolower [string tolower [string toupper [string tolower o]]]]" Re-OP:Me 
 
proc Re-OP:Me {nick uhost hand chan mode target} {
    global botnick  autoopchan
     if {$mode eq "-o" && [isbotnick $target]} {

   if {[info exists TimeDReop($chan)]} {
    after cancel $TimeDReop($chan)
    unset TimeDReop($chan)
  }
    set TimeDReop($chan) [list [after [expr {$autoopchan*1000*60}] [list AUTO:OP $botnick $chan]]]
  }

  if {$mode eq "+o" && [isbotnick $target]} {
  if {[info exists TimeDReop($chan)]} {
    after cancel $TimeDReop($chan)
    unset TimeDReop($chan)
  }
}
}

   
 proc AUTO:OP {nick chan} {
   if {[isbotnick $nick] && ![botisop $chan] && [onchan $nick $chan]} {  putserv "chanserv op $chan $nick"}
}

  	

I tested it and it seems to work fine it sets OP after 4 minutes.
User avatar
CrazyCat
Revered One
Posts: 1347
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: AutoReop

Post by CrazyCat »

WTF ?
bind mode - "#% +[string tolower [string tolower [string toupper [string tolower o]]]]" Re-OP:Me
bind mode - "#% -[string tolower [string tolower [string toupper [string tolower o]]]]" Re-OP:Me
Are you sure you want to lower + upper + double-lower a hard coded char ?
s
simo
Revered One
Posts: 1122
Joined: Sun Mar 22, 2015 2:41 pm

Re: AutoReop

Post by simo »

i wasnt sure on what network he will use this and if it has cmode +O in use for users thats why i made sure its lowercase but perhaps its not really needed im not sure.

else he can use :

Code: Select all


bind mode - "#% +o" Re-OP:Me
bind mode - "#% -o" Re-OP:Me 


User avatar
CrazyCat
Revered One
Posts: 1347
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: AutoReop

Post by CrazyCat »

simo wrote: Thu May 01, 2025 12:52 pm i wasnt sure on what network he will use this and if it has cmode +O in use for users thats why i made sure its lowercase but perhaps its not really needed im not sure.
Whatever the network is or does, it wont change the bind which is internal to the eggdrop. If you bind the mode +o, eggdrop will react to mode +o. If the server uses +O, eggdrop won't react.

In party-lie, do:

Code: Select all

.tcl bind mode - "#% +[string tolower [string tolower [string toupper [string tolower o]]]]" Re-OP:Me
.binds mode
After, do:

Code: Select all

.tcl bind mode - "#% +o" Re-OP:Me
.binds mode
The results of the 2 .binds mode are the same, the collection of string tolower/toupper is interpreted when the bind is declared.
User avatar
Arnold_X-P
Master
Posts: 243
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Re: AutoReop

Post by Arnold_X-P »

It works very well for me this way.

Code: Select all

# delay time (in minutes) to REOP Bot. 
set autoopchan 4

 bind mode - "*+o*" Re-OP:Me
 bind mode - "*-o*" Re-OP:Me

proc Re-OP:Me {nick uhost hand chan mode target} {
global botnick  autoopchan 
 if {$mode eq "-o" && [isbotnick $target]} {
 puthelp "chanserv deop $chan $nick" -next
  puthelp "PRIVMSG $chan :$nick don't take away my access to -@-"
 if {[info exists TimeDReop($chan)]} {
after cancel $TimeDReop($chan)
  unset TimeDReop($chan)
 }
  set TimeDReop($chan) [list [after [expr {$autoopchan*1000*60}] [list AUTO:OP $botnick $chan]]]
}
if {$mode eq "+o" && [isbotnick $target]} {
  if {[info exists TimeDReop($chan)]} {
 after cancel $TimeDReop($chan)
  unset TimeDReop($chan)
  }
 }
}

proc AUTO:OP {nick chan} {
  if {[isbotnick $nick] && ![botisop $chan] && [onchan $nick $chan]} { putserv "chanserv op $chan $nick"}
}
Very good work simo thanks... Thank you very much CrazyCat for also helping with the corrections
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
networks: DALnet #tcls ChatZona #tcl Libera.Chat #tcls
Post Reply