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 

Simple editing required.

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


Joined: 05 Aug 2008
Posts: 71

PostPosted: Wed Oct 23, 2013 12:17 am    Post subject: Simple editing required. Reply with quote

Code:

namespace eval MassKick {

  # self explanatory
  set mass(limit) "1:5"
  set memo(mass) "MSG"
  set memo(bot) "MSG"

  # don't count or do anything to people with local/global friend flag or whatever you wish
  set mass(friends) "f|f"

  # don't edit below this line
  setudef flag massKick
  setudef str massKicker
  setudef str massCount

  # binds
  bind kick * * [namespace current]::kicked
  bind part - * [namespace current]::remove
  bind sign - * [namespace current]::remove
  bind nick - * [namespace current]::nickCh

  # AOP removal and memo
  proc takeAction {chan nick pos} {
    dropAOP $chan $nick "1"
    doThis "2" $chan $nick $pos
  }

  # bot kicked
  proc botKicked {chan nick} {
    dropAOP $chan $nick "2"
    resetChan $chan
  }

  # reset
  proc resetChan {chan} {
    channel set $chan massKicker {}
    channel set $chan massCount {}
  }

  # remove AOP, deop and send memo
  proc dropAOP {chan nick act} {
    variable memo
    switch -- $act {
      "1" {
        set message [string map -nocase [list "%chan" "$chan" "%nick" "$nick"] $memo(mass)]
      }
      "2" {
        set message [string map -nocase [list "%chan" "$chan" "%nick" "$nick"] $memo(bot)]
      }
    }
    putserv "Chanserv aop $chan del $nick"
    putserv "Chanserv deop $chan $nick"
    putserv "Memoserv sendsop $chan $message"
  }

  # triggers:
  # 1 - add, 2 - remove, 3 - replace nick, 4 - replace count
  proc doThis {act chan nick {pos ""} {count ""} {newNick ""}} {
    set massKicker [channel get $chan massKicker]
    set massCount [channel get $chan massCount]
    switch -- $act {
      "1" {
        lappend massKicker $nick
        lappend massCount 1
      }
      "2" {
        set massKicker [lreplace $massKicker $pos $pos]
        set massCount [lreplace $massCount $pos $pos]
      }
      "3" {
        set massKicker [lreplace $massKicker $pos $pos $newNick]
      }
      "4" {
        set massCount [lreplace $massCount $pos $pos $count]
      }
    }
    channel set $chan massKicker $massKicker
    channel set $chan massCount $massCount
  }

  # triggers:
  # 1 - part & sign, 2 - nick change
  proc eventThis {event chan nick {newNick ""}} {
    set massKicker [channel get $chan massKicker]
    if {$nick ni $massKicker} return
    set pos [lsearch $massKicker $nick]
    switch -- $event {
      "1" {
        doThis "2" $chan $nick $pos
      }
      "2" {
        doThis "3" $chan $nick $pos "0" $newNick   
      }
    }
  }

  # part & sign
  proc remove {nick uhost handle chan {text ""}} {
    if {![channel get $chan massKick]} return
    if {[isbotnick $nick]} {
      resetChan $chan
      } else {
      eventThis "1" $chan $nick
    }
  }

  # nick
  proc nickCh {nick uhost handle chan newnick} {
    if {![channel get $chan massKick]} return
    if {[isbotnick $nick]} return
    eventThis "2" $chan $nick $newNick
  }


  # kick
  proc kicked {nick uhost hand chan target reason} {
    if {![channel get $chan massKick]} return
    variable mass
    if {[matchattr $hand $mass(friends) $chan]} return
    if {[isbotnick $nick]} return
    if {$nick eq "Chanserv"} return
    if {[isbotnick $target]} {
      botKicked $chan $nick
      return
    }
    set massKicker [channel get $chan massKicker]
    if {$nick ni $massKicker} {
      doThis "1" $chan $nick
      return
    }
    set pos [lsearch $massKicker $nick]
    set massCount [channel get $chan massCount]
    set count [lindex [split $massCount] $pos]
    set info [split $mass(limit) :]
    if {$count >= [lindex $info 0]} {
      takeAction $chan $nick $pos
      return
      } else {
      incr count
    }
    utimer [lindex $info 1] [list [namespace current]::doThis "2" $chan $nick $pos]
    doThis "4" $chan $nick $pos $count
  }
}

This tcl is working fine. Its masskick pro tcl which meant to safeguard the channel for attempt of masskick. Problem here is if i uses a nick which isnt in access of the channel the tcl cant detect the access and cant del it.

below is example

nick in aop list : A
masskicker joins with nick B using A access, tcl unable to detect whose access is it using thus unable to delete the access. It still sends memo to channel but using B nick. It should del A access and send memo as A access been deleted for attempt of masskick.

So things to do will be able to distinguish access of any nick joining the channel and act accordingly should the need arise. thanks in advance Smile
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Wed Oct 23, 2013 1:30 pm    Post subject: Reply with quote

What irc network?
Back to top
View user's profile Send private message
gamble27
Halfop


Joined: 05 Aug 2008
Posts: 71

PostPosted: Thu Oct 24, 2013 3:18 am    Post subject: dalnet Reply with quote

Oh pardon me. Its dalnet im talking about.
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Thu Oct 24, 2013 10:28 am    Post subject: Re: Simple editing required. Reply with quote

gamble27 wrote:

...
masskicker joins with nick B using A access,
...


I just had a look, on DALnet. It didn't do what I expected, based on your above.

I expected something like this to appear, in a line of a /whois report:
Quote:

UserB is logged in as UserA


Freenode does it that way.

It didn't appear that way, on DALnet. Only appeared if the current nick was identified, as in:
Quote:

UserA has identified for this nick


So ... I'm not exactly sure what you mean yet.
Please explain: "joins with nick B using A access" as it applies to DALnet.
Back to top
View user's profile Send private message
gamble27
Halfop


Joined: 05 Aug 2008
Posts: 71

PostPosted: Thu Oct 24, 2013 11:24 am    Post subject: Reply with quote

Alright, let me be clear. Above tcl is working fine. what it does is when there any aop kicks the eggdrop it will delete the access of the aop and sends channel memo. It does the same when an aop try to mass kick the channel ie: 4 kicks in 10 sec it deletes the aop, deops him and send channel memo too. Perfect. Now this are straight forward scenarios. Now problem comes when a user joins with a different nick from the access he has in the channel and kicks the eggdrop or does masskick. In this case eggdrop tries to delete the different nick in the access list (it doesnt exist) and sends a channel memo.Below is breakdown of what im saying :

My access in channel #egg : A

I joins in channel #egg using A access which is my access but using B nick.(im identified to A access but im using different nick)

now if i kick the eggdrop using B nick or does a masskick in channel using B nick eggdrop cannot stop me as tcl is trying to delete B nick in access list instead of A.

I hope it helps, thanks for your interest. ill be around in case you need more information Smile
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Thu Oct 24, 2013 11:35 am    Post subject: Reply with quote

gamble27 wrote:

...


Got all that.

Quote:

I joins in channel #egg using A access which is my access but using B nick.(im identified to A access but im using different nick)


What does /whois B return?

Quote:

ill be around in case you need more information Smile


Are you on DALnet right now?
What channel and/or what nick?
PM it to me here, if you wish.
Back to top
View user's profile Send private message
gamble27
Halfop


Joined: 05 Aug 2008
Posts: 71

PostPosted: Thu Oct 24, 2013 1:02 pm    Post subject: Reply with quote

nope im not on dalnet now. /whois will change depending on user. mayb what we can do is to do a why or check access on the nick should it triggers eggdrop ie :

each time when eggdrops get triggered either by getting kicked or mass kick it checks for access level of kicker and deletes the access of results returned.. just an idea.

Thanks willyw. useful commands for you would be

/cs why #channel nick

or

/cs access #channel nick
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Thu Oct 24, 2013 1:17 pm    Post subject: Reply with quote

gamble27 wrote:

...
/whois will change depending on user.


Of course it will.

Quote:

mayb what we can do is to do a why or check access on the nick should it triggers eggdrop ie :


Now you are catching on to the idea.
Smile

Quote:

Thanks willyw. useful commands for you would be

/cs why #channel nick

or

/cs access #channel nick




"why" is interesting. Not something that I am super familiar with though.
Perhaps it is a DALnet thing.
And THAT is probably why you are not getting a lot of responses... I suspect that this will be a totally custom thing, that works only on DALnet.

For me to work on it, I would have to register a channel, AOP list for it, etc. Probably the best bet is for us both to be online at the same time.... meet... and work on it.
Back to top
View user's profile Send private message
Get_A_Fix
Master


Joined: 07 May 2005
Posts: 206
Location: New Zealand

PostPosted: Thu Oct 24, 2013 10:48 pm    Post subject: Reply with quote

Quote:
And THAT is probably why you are not getting a lot of responses... I suspect that this will be a totally custom thing, that works only on DALnet.


DALnet originated this command but other networks have a module of this.

On DALnet, it outputs as such. - /chanserv why #IRCSpeed istok

Code:

-ChanServ- istok has FOUNDER access to #IRCSpeed.  Reason: Identification to the founder's nickname, istok. Channel Frozen: NO


On IRCSpeed, the output is similar, but more basic. - /chanserv why #IRCSpeed istok

Code:

-ChanServ- istok (istok) has FOUNDER access to channel #IRCSpeed.


The second why uses a displaynick, which is the name inside the ( and ) (Main nickname for groups, on anope).

For this script to work, it would need to why again, on nickchanges, along with a why on modechg (@) or join. One of the user's here, Arfer, has a script for this. He is away from IRC and the PC at this time but hopefully will return soon.
_________________
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
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