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.

except deop doesnt work

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
G
Gulio
Halfop
Posts: 74
Joined: Sun Nov 01, 2020 11:53 am

except deop doesnt work

Post by Gulio »

This script i take here in forum made by ceazar
If can added a simple command to add idle except names like .chanset #chan exceptIdle Name1 Name2 Name3
and to not deop or loop for the chanserv BOT and prefix channel ~ & owner sop
If someone help here to fix it thanks

Code: Select all


.chanset #test +idlemode
<Bot> Successfully set modes { +idlemode  } on #test

Code: Select all


 .chanset #test idletime 60
<Bot> Successfully set modes { idletime { 60 } } on #test.
<Bot> [01:59:12] #John# chanset #test idletime { 60 }

adding names for except deops is not work and is deop and channel Bot
TEST

Code: Select all


<John> .chanset #test "Tommy Clay" 
<Bot> Error trying to set "Tommy Clay" for #test, illegal channel option: "Tommy Clay"

Code: Select all


namespace eval idlemode {

	setudef flag idleMode
	setudef str idleExempt
	setudef int idleTime

	bind time {?0 *} [namespace current]::idleTime

	proc idleTime {args} {
		foreach chan [channels] {
			if {![channel get $chan idleMode]} continue
			timedCheck $chan
		}
	}

	proc timedCheck {chan} {
		variable idle
		switch -- [catch {botisop $chan} err] {
			"0" {
				if {!$err} {
					putlog "idleMode error: I'm not oped in $chan channel."
					return
				}
			}
			"1" {
				putlog "idleMode error: $chan channel is not valid."
				return
			}
		}
		set users [string tolower [lrange [chanlist $chan] 1 end]]
		set except [string tolower [channel get $chan idleExempt]]
		set time [channel get $chan idleTime]
		foreach user $users {
			if {[lsearch -exact $except $user] != -1} continue
			if {[isop $user $chan]} {
				lappend checkList $user:1
			}
			if {[isvoice $user $chan]} {
				if {[info exists checkList]} {
					set pos [lsearch -exact $checkList $user:1]
					if {$pos == -1} {
						lappend checkList $user:2
					} else {
						set checkList [lreplace $checkList $pos $pos $user:3]
					}
				} else {
					lappend checkList $user:2
				}
			}
		}
		if {[info exists checkList]} {
			foreach ele [split $checkList] {
				scan $ele {%[^:]:%s} user count
				checkIdle $count $user $chan $time
			}
		}
	}

	proc checkIdle {mode user chan time} {
		set idle [getchanidle $user $chan]
		if {$idle >= $time} {
			switch -- $mode {
				"1" {
					pushmode $chan -o $user
					putlog "idleMode: deoped $user in $chan cos was idle for $idle minutes"
				}
				"2" {
					pushmode $chan -v $user
					putlog "idleMode: devoiced $user in $chan cos was idle for $idle minutes"
				}
				"3" {
					puthelp "MODE $chan -ov $user $user"
					putlog "idleMode: deoped and devoiced $user in $chan cos was idle for $idle minutes"
				}
			}
		}
	}
}

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

Re: except deop doesnt work

Post by CrazyCat »

Gulio wrote:

Code: Select all

<John> .chanset #test "Tommy Clay" 
<Bot> Error trying to set "Tommy Clay" for #test, illegal channel option: "Tommy Clay"
Lol...

Code: Select all

.chanset #test idleExempt "Tommy Clay"
G
Gulio
Halfop
Posts: 74
Joined: Sun Nov 01, 2020 11:53 am

hi

Post by Gulio »

You will need to activate this on the channels you wish with .chanset #channel +idlemode, define the idle time with .chanset #channel idletime 60 (where 60 in my example means 60 minutes) and if you wish can add an exempt for each channel with .channel set #channel "user_1 user_2"

wrong command here for that sorry

CrazyCat thx for the help
G
Gulio
Halfop
Posts: 74
Joined: Sun Nov 01, 2020 11:53 am

hi

Post by Gulio »

Is possible to add a code to ignore and not check for prefix channel as ~ &
like ~BoB &Alicia if they change nick need everytime to add nicks exempt
to check and deop only for prefix @ aop like @Tommy
User avatar
CrazyCat
Revered One
Posts: 1236
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

No, it's not possible, the eggdrop doesn't see the opchar, or (to be more precise) doesn't distinguish if @, & or ~ are different levels.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

What did you set in your eggdrop.conf file at net-type? I think the eggdrop has some built-in functionality to recognize some special modes, but not 100% sure if would work with what you got so you have to test some stuff on your own and reply back with results.

If you got the .tcl command enabled from DCC Chat/Telnet on your bot (if not just lookup unbind dcc n tcl *dcc:tcl or was it #bind dcc n tcl *dcc:tcl?.. anyway, it should be bind dcc n tcl *dcc:tcl and restart the bot afterwards) then try giving yourself only the ~ flag and try in DCC Chat/Telnet with the bot:

Code: Select all

.tcl isop <your nick>
.tcl ishalfop <your nick>
next give yourself the & flag and try the two commands again. Note down the results and reply back with what you found.

From what i know the bot can recognize the '&' sign as halfop on some networks, not sure about others.

Edit: From what I could find UnrealIRCd has the prefix '~' as the 'owner of the current channel' and the prefix '&' as 'admin (SOP) on the current channel' and both are equivalent of @ on other networks, so should see something with isop.
Once the game is over, the king and the pawn go back in the same box.
G
Gulio
Halfop
Posts: 74
Joined: Sun Nov 01, 2020 11:53 am

Post by Gulio »

Sorry for my late report this is what is show
is better to add del list prefix channel we want to check idle for deop

Code: Select all


[12:39:04] <Teddy> .tcl isop Teddy
[12:39:04] <Bot> Tcl: 1
[12:39:22] <Teddy> .tcl ishalfop Teddy
[12:39:22] <Bot> Tcl: 0
[12:40:08] <Teddy> .tcl isop Teddy
[12:40:08] <Bot> Tcl: 1
[12:40:27] <Teddy> .tcl isop Teddy
[12:40:27] <Bot> Tcl: 1
[12:40:39] <Teddy> .tcl isowner Teddy
[12:40:39] <Bot> Tcl error: wrong # args: should be "isowner nick chan"
[12:40:52] <Teddy> .tcl isowner Teddy #test
[12:40:53] <Bot> Tcl: 1

Last edited by Gulio on Thu Nov 05, 2020 6:48 am, edited 1 time in total.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

What flags did Teddy have when you did each of the commands?
Once the game is over, the king and the pawn go back in the same box.
G
Gulio
Halfop
Posts: 74
Joined: Sun Nov 01, 2020 11:53 am

Post by Gulio »

this are the flags +iwrxzt

if u ask for prefix channel access are this
Owner ~Teddy
sop &Teddy
aop @Teddy
halfop %Teddy

if u mean flags on Bot dont have nothing
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

No, i meant flags on the channel.

Ah, as suspected.

Well, given that isop recognizes the special flags as a regular @ there's no way to add them to a special exception list without breaking the purpose of the script itself, meaning removing the @ and v from those that are idle.

At this point the only option I could think of would be creating a 'special' user and add their hosts to this user and except everyone matching this particular user.
Last edited by caesar on Thu Nov 05, 2020 7:05 am, edited 1 time in total.
Once the game is over, the king and the pawn go back in the same box.
G
Gulio
Halfop
Posts: 74
Joined: Sun Nov 01, 2020 11:53 am

Post by Gulio »

Idle can be and owner and sop ~ & and with to set mode -oo Owner Sop
If they change nick need to add every nick they have in group of nicks


yes and this can be for owner sop to exep them from *!*@host or *!*@*.domain.com
Post Reply