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 

Idle Action Help

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


Joined: 21 Feb 2021
Posts: 15
Location: Germany

PostPosted: Wed Dec 29, 2021 12:27 pm    Post subject: Idle Action Help Reply with quote

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 Confused

Code:
# +-------------------------------------------------------------------------------------+
# |                                                                                     |
# |                         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 \]"
Back to top
View user's profile Send private message Visit poster's website
SpiKe^^
Owner


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

PostPosted: Wed Dec 29, 2021 2:12 pm    Post subject: Reply with quote

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
.
Back to top
View user's profile Send private message Visit poster's website
AdmiraL
Voice


Joined: 21 Feb 2021
Posts: 15
Location: Germany

PostPosted: Wed Dec 29, 2021 2:34 pm    Post subject: Reply with quote

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..
Back to top
View user's profile Send private message Visit poster's website
SpiKe^^
Owner


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

PostPosted: Wed Dec 29, 2021 3:18 pm    Post subject: Reply with quote

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
.
Back to top
View user's profile Send private message Visit poster's website
AdmiraL
Voice


Joined: 21 Feb 2021
Posts: 15
Location: Germany

PostPosted: Wed Dec 29, 2021 6:53 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
SpiKe^^
Owner


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

PostPosted: Wed Dec 29, 2021 8:48 pm    Post subject: Reply with quote

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:
![matchattr $nick |$dvprotect $chan]
and make it look more like this...
Code:
![matchattr [nick2hand $nick $chan] $dvprotect|$dvprotect $chan]


2) Search for this string in your code...
Code:
![matchattr $nick |$doprotect $chan]
and make it look more like this...
Code:
![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
.
Back to top
View user's profile Send private message Visit poster's website
AdmiraL
Voice


Joined: 21 Feb 2021
Posts: 15
Location: Germany

PostPosted: Thu Dec 30, 2021 9:04 am    Post subject: Reply with quote

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

Thanks Spike..
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