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 

kill on join. :O

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


Joined: 08 Jun 2020
Posts: 34

PostPosted: Tue Jan 03, 2023 5:25 pm    Post subject: kill on join. :O Reply with quote

Description:

Este código asigna una acción al evento "on join", que se activa cuando un usuario se une a un canal. Cuando se activa este evento, el código obtiene el nombre de usuario del usuario que se ha unido al canal y lo compara con la lista de usuarios a los que quieren dar un kill. Si el usuario está en la lista, el código incrementa la variable de kills afectados y da un kill al usuario con el comando "putserv".


This code assigns an action to the "on join" event, which is fired when a user joins a channel. When this event is fired, the code gets the username of the user who joined the channel and compares it to the list of users it wants to kill. If the user is on the list, the code increments the hit kills variable and kills the user with the "putserv" command.


###########

I found this TCL, but I think it's unfinished.

It is possible to assign a specific #channel, for example #Eggdrop and prevent the entry of guest*!*"

Sorry if this code is STUPID for some....

###########


Code:
# Crea una lista de usuarios a los que quieres dar un kill
# Create a list of users you want to kill

set kill_list { "guest*!*" "user*!*"" "chat*!*" }

# Crea una variable para llevar un registro de cuántos kills has afectado
# Create a variable to keep track of how many kills you have affected

set kills_affected 0

# Asigna una acción al evento "on join"
# Assign an action to the "on join" event

bind join -|- {

    # Obtiene el nombre de usuario del usuario que se ha unido al canal
    # Gets the username of the user who joined the channel

    set username [lindex $event 1]

    # Verifica si el usuario está en la lista de usuarios a los que quieres dar un kill
    # Check if the user is in the list of users you want to kill

    if {[lsearch -exact $kill_list $username] != -1} {

        # Incrementa la variable de kills afectados
        # Increases the affected kills variable

        incr kills_affected

        # Da un kill al usuario
        # Kill the user

        putserv "KILL $username :kill affected ($kills_affected)"
    }
}



##########
Sorry for my bad English
##########
Back to top
View user's profile Send private message AIM Address
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Tue Jan 03, 2023 11:04 pm    Post subject: Reply with quote

If u are going to kill them off the server why not use the ircd or services server for that? I use it myself as well on a network i support im not sure what kind of ircd and services you are running tho
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Wed Jan 04, 2023 2:07 am    Post subject: Reply with quote

If you want to manage per channel why not just kickban instead of killing them off the server?
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Wed Jan 04, 2023 5:41 am    Post subject: Reply with quote

Your script can't work because you use -exact in lsearch, you need -glob (or nothing, -glob is default)

You can try this:
Code:
namespace eval nkiller {

   variable kill_list {"guest*!*" "user*!*" "chat*!*"}
   
   variable kills_affected 0
   
   setudef flag killnick
   
   proc kjoin {nick uhost handle chan} {
      if {![channel get $chan killnick]} { return }
      set umask "$nick!$uhost"
      if {[lsearch -glob -nocase $::nkiller::kill_list $umask] >= 0} {
         incr ::nkiller::kills_affected
         putserv "KILL $nick :kill affected ($::nkiller::kills_affected)"
      }
   }
   
   bind join - * ::nkiller::kjoin
}


Note : you'll have to activate the script on each chan by doing .chanset #channel +killnick
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
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