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.

Idle Action Help

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
AdmiraL
Voice
Posts: 15
Joined: Sun Feb 21, 2021 4:55 pm
Location: Germany
Contact:

Idle Action Help

Post by AdmiraL »

Hello all..

i need a help, this code its perfect and i dont have problem with tcl.

if the bot sees example a nick hat idle x minute make -o or -v and when a nick its in the botlist example and when the bot detected he has idle bot must make nothing

* 17:21:01 * Guardian sets mode: -o Shoqeria
* 17:21:01 * Shoqeria sets mode: +o Shoqeria

I want to put this name Shoqeria in the list from Guardian.

My englisch its poor sorry :?

Code: Select all

# +-------------------------------------------------------------------------------------+
# |                                                                                     |
# |                         Idle Action v1.0.0                                          |
# |                                                                                     |
# +-------------------------------------------------------------------------------------+
# |                                                                                     |
# | *** Website             @  http://www.EggdropTCL.com                                |
# | *** GitHub              @  http://github.com/MadaliNTCL/eggdrop-tcl                 |
# |                                                                                     |
# +-------------------------------------------------------------------------------------+
# | *** IRC Support:                                                                    |
# |                    #EggdropTCL     @ QuakeNET                                       |
# |                    #EggdropTCL     @ UnderNET                                       |
# |                    #EggdropTCL     @ EfNET                                          |
# |                                                                                     |
# | *** Contact:                                                                        |
# |                    Yahoo Messenger/Mail: madalinmen28@yahoo.com                     |
# |                    Google Mail         : madalinmen28@gmail.com                     |
# |                    Skype Messenger     : madalinmen28                               |
# |                                                                                     |
# +-------------------------------------------------------------------------------------+
# + *** Commands ***                                                                    |
# |     +----------------+                                                              |
# |     [ ADMIN - PUBLIC ]                                                              |
# |     +----------------+                                                              |
# |                                                                                     |
# |     ++ !idleaction <deop on/off 10>                                                 |
# |     ++ !idleaction <devoice on/off 10>                                              |
# |     ++ !idleaction <deop on oa>                                                     |
# |     ++ !idleaction <devoice on gv>                                                  |
# |     ++ !idleaction status                                                           |
# |                                                                                     |
# | IMPORTANT                                                                           |
# | - Deop/devoice time is SET in minutes                                               |
# | - 'oa' and 'gv' represent LOCAL user flags you can add any valid flag               |
# |                                                                                     |
# +-------------------------------------------------------------------------------------+

bind PUBM - * idleaction:pubm

bind TIME - * idleaction:routine

setudef flag idledeop
setudef flag idledevoice

setudef int ideop
setudef int idevoice

setudef str idvprotect
setudef str idoprotect

proc idleaction:pubm {nick uhost hand chan arg} {

	if {[string index $arg 0] in {! . `}} {
		set temp(cmd) [string range $arg 1 end]
		set temp(cmd) [lindex [split $temp(cmd)] 0]
		set arg [join [lrange [split $arg] 1 end]]
	} elseif {[isbotnick [lindex [split $arg] 0]]} {
		set temp(cmd) [lindex [split $arg] 1]
		set arg [join [lrange [split $arg] 2 end]]
	} else { return 0 }

	if {[info commands $temp(cmd):icpubcmd] ne ""} { $temp(cmd):icpubcmd $nick $uhost $hand $chan $arg }
}

proc idleaction:icpubcmd {nick uhost hand chan arg} {

	switch -exact -- [lindex [split $arg] 0] {
		deop {
			switch -exact -- [lindex [split $arg] 1] {
				on {
					if {![matchattr $hand n]} { return }
					
					if {[lindex [split $arg] 2] eq ""} {
						channel set $chan +idledeop
						channel set $chan ideop "120"
						channel set $chan idoprotect "o"

						putquick "PRIVMSG $chan :\002$nick\002 - \00312Idle-deop\00302 sapo keni bere \00304ON\00302, Koha: \00304120 minuta\00302 mbrojtje \002\00304+[channel get $chan idoprotect]\002\00302"
					} else {
						channel set $chan +idledeop
						
						if {[isnumber [lindex [split $arg] 2]]} {
							channel set $chan ideop [lindex [split $arg] 2]
							
							putquick "PRIVMSG $chan :\002$nick\002 - \00312Idle-deop\00302 spo keni bere \00304ON\003, Koha: \00304[lindex [split $arg] 2] minuta"
						} else {
							channel set $chan idoprotect [lindex [split $arg] 2]

							putquick "PRIVMSG $chan :\002$nick\002 - \00312Idle-deop\00302 spo keni bere \00304ON\003, mbrojtje: \00304\002+[lindex [split $arg] 2]"							
						}
					}
				}
				off {
					if {![matchattr $hand n]} { return }
					
					channel set $chan -idledeop
					channel set $chan ideop ""

					putquick "PRIVMSG $chan :\002$nick\002 - \00312Idle-deop\00302 spo keni bere \00304OFF\003"
				}
			}
		}
		devoice {
			switch -exact -- [lindex [split $arg] 1] {
				on {
					if {![matchattr $hand n]} { return }
					
					if {[lindex [split $arg] 2] eq ""} {
						channel set $chan +idledevoice
						channel set $chan idevoice "120"
						channel set $chan idvprotect "v"

						putquick "PRIVMSG $chan :\002$nick\002 - \00312Idle-devoice\00302 spo keni bere \00304ON\00302, Koha: \00304120 minutes\00302 and protection for \002\00304+[channel get $chan idvprotect]\002\00302 local flags"
					} else {
						channel set $chan +idledevoice
						
						if {[isnumber [lindex [split $arg] 2]]} {
							channel set $chan idevoice [lindex [split $arg] 2]
							
							putquick "PRIVMSG $chan :\002$nick\002 - \00312Idle-devoice\00302 spo keni bere \00304ON\003, Koha: \00304[lindex [split $arg] 2] minutes"
						} else {
							channel set $chan idvprotect [lindex [split $arg] 2]

							putquick "PRIVMSG $chan :\002$nick\002 - \00312Idle-devoice\00302 spo keni bere \00304ON\003, Mbrojtja: \00304\002+[lindex [split $arg] 2]"							
						}
					}
				}
				off {
					if {![matchattr $hand n]} { return }
					
					channel set $chan -idledevoice
					channel set $chan idevoice ""

					putquick "PRIVMSG $chan :\002$nick\002 - \00312Idle-devoice\00302 spo keni bere \00304OFF\003"
				}
			}
		}
		status {
			if {[channel get $chan idledevoice]} { set idvstatus "\002\00312AKTIV\003\002" } else { set idvstatus "\00304DEAKTIV\003"  }
			if {[channel get $chan idledeop]} { set idostatus "\002\00312AKTIV\003\002" } else { set idostatus "\00304DEAKTIV\003"  }
			
			putquick "PRIVMSG $chan :\002$nick\002 - \00302Idle-deop\003: $idostatus (\00303[channel get $chan ideop]\00302 minuta -- Mbrojtja: \00304\002+[channel get $chan idoprotect]\002 usera\003) \037\002/\037\002 \00302Idle-devoice\003: $idvstatus (\00303[channel get $chan idevoice]\00302 minuta\00302 -- Mbrojtja: \00304\002+[channel get $chan idvprotect]\002 usera\003)"
		}
	}
}

proc idleaction:routine {min hour day month year} {

	## ++ Devoice
	foreach chan [channels] {
		if {[channel get $chan idledevoice]} {
			set idevoice [channel get $chan idevoice]
			if {[channel get $chan idvprotect] ne ""} { set dvprotect [channel get $chan idvprotect] } else { set dvprotect "v"}
			
			foreach nick [chanlist $chan] { 
				if {![isbotnick $nick] && [isvoice $nick $chan] && ![matchattr $nick |$dvprotect $chan]} { if {[getchanidle $nick $chan] >= $idevoice} { pushmode $chan -v $nick } } }
		}
	}
	flushmode $chan
	
	## ++ Deop
	foreach chan [channels] {
		if {[channel get $chan idledeop]} {
			set ideop [channel get $chan ideop]
			if {[channel get $chan idoprotect] ne ""} { set doprotect [channel get $chan idoprotect] } else { set doprotect "o" }

			foreach nick [chanlist $chan] { 
				if {![isbotnick $nick] && [isop $nick $chan] && ![matchattr $nick |$doprotect $chan]} { if {[getchanidle $nick $chan] >= $ideop} { pushmode $chan -o $nick } } }
		}
	}	
	flushmode $chan
}

putlog "++ \[ - \00304PUBLIC\003 - \00306loaded\003 * \00303Idle Action\003 \]"
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

AdmiraL

I'm not sure I understand the goal of this request, maybe you can explain better:)

Have you tried contacting the author, MadaliN?
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
AdmiraL
Voice
Posts: 15
Joined: Sun Feb 21, 2021 4:55 pm
Location: Germany
Contact:

Post by AdmiraL »

No i dont have conntact.

The bot Guardian make all @operators when idle its more then 20 min.

* 19:23:29 * @Guardian AdmiraL - Idle-deop: AKTIV (20 minuta -- Mbrojtja: + usera) / Idle-devoice: AKTIV (20 minuta -- Mbrojtja: + usera)

i want to put some @operators in the list and when this @ what is in the list and when he is idle and the bot must ignore this users and the bot must make nothing, because the bot must make deop and devoice just this user what he dont have in the list.

Maybe u have understant what i mean..
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

nope, sorry...

If you are looking to exempt some users from the script, looks to me like you should add them to the eggdrop user file with +ov maybe.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
AdmiraL
Voice
Posts: 15
Joined: Sun Feb 21, 2021 4:55 pm
Location: Germany
Contact:

Post by AdmiraL »

SpiKe^^ wrote:nope, sorry...

If you are looking to exempt some users from the script, looks to me like you should add them to the eggdrop user file with +ov maybe.
At the moment with this tcl, Eggdrop does everything all @ what they are over 20 minutes away makes automatic deop.

I want to do that, example I have 10 operators and of 10 operators are 2 eggdrop and I want this 2 eggdrop always to be on top with @ and the other when they are off example 20 minutes are away from chat I want to make this tcl bot automatic deop and this 2 eggdrop I always want to have with @.

maybe now you have understood me.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

After checking the code one more time, the script already has an exempt user system, but I see a couple small issues with that...

1) Search for this string in your code...

Code: Select all

![matchattr $nick |$dvprotect $chan]
and make it look more like this...

Code: Select all

![matchattr [nick2hand $nick $chan] $dvprotect|$dvprotect $chan]
2) Search for this string in your code...

Code: Select all

![matchattr $nick |$doprotect $chan]
and make it look more like this...

Code: Select all

![matchattr [nick2hand $nick $chan] $doprotect|$doprotect $chan]
Add the users you want exempted to the bots user file with valid hostmasks.
Give the exempted users you just added the +ov flags (either global and/or channel).

If that does not work for you, try contacting the script author, MadaliN (_MaDaLiN_ at undernet #EggdropTCL)
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
AdmiraL
Voice
Posts: 15
Joined: Sun Feb 21, 2021 4:55 pm
Location: Germany
Contact:

Post by AdmiraL »

Perfect now its perfect , i have made all what u have me recomanded..

Thanks Spike..
Post Reply