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 

irccloud banmask
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
simo
Master


Joined: 22 Mar 2015
Posts: 243

PostPosted: Tue Apr 17, 2018 11:37 am    Post subject: irccloud banmask Reply with quote

Greetings,
i was wondering if banmask could be made for irccloud users

for example if someone sets a ban on an irccloud user to have eggdrop correct it

also if eggdrop sets a ban on an irccloud user to set on ident

like these examples:

Quote:
@Alvira Sets Mode on #Test to: +b *!id-293766@id-293766.tooting.irccloud.com
Amigo Kicked from #Test By @Alvira
@simo Sets Mode on #Test to: -b *!id-293766@id-293766.tooting.irccloud.com
@simo Sets Mode on #Test to: +b *!id-293766@*

@Alvira Sets Mode on #Test to: +b *!*@*.irccloud.com
@simo Sets Mode on #Test to: -b *!*@*.irccloud.com
@simo Sets Mode on #Test to: +b *!id-293766@*

@Alvira Sets Mode on #Test to: +b *!*@*.tooting.irccloud.com
@simo Sets Mode on #Test to: -b *!*@*.tooting.irccloud.com
@simo Sets Mode on #Test to: +b *!id-293766@*

@Alvira Sets Mode on #Test to: +b Amigo!id-293766@id-293766.tooting.irccloud.com
Amigo Kicked from #Test By @Alvira
@simo Sets Mode on #Test to: -b Amigo!id-293766@id-293766.tooting.irccloud.com
@simo Sets Mode on #Test to: +b *!id-293766@*

@Alvira Sets Mode on #Test to: +b *!id-293766@id-293766.tooting.irccloud.com
Amigo Kicked from #Test By @Alvira
@simo Sets Mode on #Test to: -b *!id-293766@id-293766.tooting.irccloud.com
@simo Sets Mode on #Test to: +b *!id-293766@*


Back to top
View user's profile Send private message
caesar
Ass Kicker


Joined: 14 Oct 2001
Posts: 3468
Location: Area 51

PostPosted: Wed Apr 18, 2018 1:43 am    Post subject: Reply with quote

Code:

bind mode - "#% +b" ircCloud

proc ircCloud {nick uhost hand chan mod ban} {
   if {![botisop $chan]} return
   if {![string match -nocase "*.irccloud.com" $ban]} return
   scan $ban {%[^!]!%[^@]@%s} n u h
   puthelp "MODE $chan -b+b $ban *!$u@*"
}

Haven't tested this so give it a try and reply back.
_________________
You may say anything about me, but at least don't misspell my name. xD


Last edited by caesar on Thu Apr 19, 2018 12:43 am; edited 1 time in total
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 243

PostPosted: Wed Apr 18, 2018 4:00 pm    Post subject: Reply with quote

tnx for the reply caesar

the botisisop seems off i corrected that and got this:
Quote:

simo Sets Mode on #Cappuccino to: +b *!*@id-180354.highgate.irccloud.com
@Cappuccino Sets Mode on #Cappuccino to: -b+b *!*@id-180354.highgate.irccloud.com *!*@*

in msl i use the kick event to get nick ident host of the kicked irccloud user

im not sure if eggdrop would need that as well to get full info nick!user@host
Back to top
View user's profile Send private message
caesar
Ass Kicker


Joined: 14 Oct 2001
Posts: 3468
Location: Area 51

PostPosted: Thu Apr 19, 2018 12:54 am    Post subject: Reply with quote

Ah, my bad. Give this a try:
Code:

proc ircCloud {nick uhost hand chan mod ban} {
   if {![botisop $chan]} return
   if {![string match -nocase "*.irccloud.com" $ban]} return
   set id [lindex [split [lindex [split $ban @] 1] .] 0]
   if {[string match "id-*" $id]} {
      pushmode $chan +b *!$id@*
   }
   pushmode $chan -b $ban
}

Keep in mind that this will work on bans that have the id in the address, for example: *!*@id-180354.highgate.irccloud.com or Amigo!id-293766@id-293766.tooting.irccloud.com but won't work on *!*@*.tooting.irccloud.com or *!*@*.irccloud.com for instance, it will just lift the ban.

In case of wide ones like *!*@*.tooting.irccloud.com or *!*@*.irccloud.com would have to add extra code that would find what users match the ban and from there get their id.
_________________
You may say anything about me, but at least don't misspell my name. xD
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 243

PostPosted: Thu Apr 19, 2018 8:45 am    Post subject: Reply with quote

well since there are various irccloud servers we need them all else it wouldnt be as effective so we would need all available paterns ( and possibly IPs to check against as well )
Back to top
View user's profile Send private message
caesar
Ass Kicker


Joined: 14 Oct 2001
Posts: 3468
Location: Area 51

PostPosted: Thu Apr 19, 2018 12:10 pm    Post subject: Reply with quote

If you set a ban on *!*@*.irccloud.com how many users would be affected by this? You should set more restrictive bans and not wide ones like this one cos then if let's say you have 10 people with irccloud.com on their address then the bot would remove the *!*@*.irccloud.com ban and set 10 bans for each of the 10 id's it would find, basically filling the banlist.

Anyway, if you insist into adding this behavior then give try this and let me know if works or not:
Code:

proc ircCloud {nick uhost hand chan mod ban} {
   if {![botisop $chan]} return
   if {![string match -nocase "*.irccloud.com" $ban]} return
   set id [lindex [split [lindex [split $ban @] 1] .] 0]
   if {[string match "id-*" $id]} {
      pushmode $chan +b *!$id@*
   } else {
      foreach user [chanlist $chan] {
         if {[isbotnick $user]} continue
         if {[isop $user $chan] || [isvoice $user $chan] || [validuser [nick2hand $user]]} continue
         set host [getchanhost $user $chan]
         if {[matchaddr $ban $host]} {
            scan $host {%[^!]!%[^@]@%s} n u h
            lappend myList "*!$u@*"
         }
      }
      if {[info exists $myList]} {
         set len [llength $myList]
         set max 6
         while {$len > 0} {
            if {$len > $max} {
               set mode [string repeat "b" $max]
               set bans [join [lrange $myList 0 [expr {$max - 1}]]]
               set myList [lrange $myList $max end]
               incr len -$max
            } else {
               set mode [string repeat "b" $len]
               set bans [join $myList]
               set len 0
            }
            puthelp "MODE $chan -$mode $bans"
         }
      }
   }
   pushmode $chan -b $ban
}

It should remove bans set like *!id-293766@id-293766.tooting.irccloud.com or Amigo!id-293766@id-293766.tooting.irccloud.com and set them on id instead, and if you set a ban like *!*@*.irccloud.com will search for all members that match that ban and set a ban on their id instead. At least in theory. Smile
_________________
You may say anything about me, but at least don't misspell my name. xD
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 243

PostPosted: Thu Apr 19, 2018 3:31 pm    Post subject: Reply with quote

Quote:
It should remove bans set like *!id-293766@id-293766.tooting.irccloud.com or Amigo!id-293766@id-293766.tooting.irccloud.com and set them on id instead, and if you set a ban like *!*@*.irccloud.com will search for all members that match that ban and set a ban on their id instead. At least in theory. Smile


this is the reason i used kick event in msl to determine the ident of kickbanned irccloud user, im not sure how to use that in eggdrop

this seems to work in msl im not sure how to translate to tcl:

Code:
ON ^*:KICK:#: {
  haltdef
  if (%ircloudnick == on) {
    var %irccloudbanmazk = 1
    while ($chan(%irccloudbanmazk))  {
      var %ircloudChan $ifmatch
      if ($nick(%ircloudChan,$me,@&~%)) {  mode $chan +b $+(*!,$gettok($mid($address($knick,0),3),1,64),@*)    }
      inc %irccloudbanmazk
    }
    unset  %ircloudnick
  }
}


On *:BAN:#:{
  if ($nick(#,$me,@%&~)) {
    if ($regex($banmask,/(irccloud)/i)) {  mode  $chan -b $banmask  | set  %ircloudnick on }
  }
}
Back to top
View user's profile Send private message
caesar
Ass Kicker


Joined: 14 Oct 2001
Posts: 3468
Location: Area 51

PostPosted: Fri Apr 20, 2018 12:45 am    Post subject: Reply with quote

Give a try to the code I posted above. In theory should do what you say in msl.
_________________
You may say anything about me, but at least don't misspell my name. xD
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 243

PostPosted: Fri Apr 20, 2018 10:03 am    Post subject: Reply with quote

i tested it and it doesnt seem to trigger on +b *!*@*.irccloud.com

also i get this weird result where it sets ban and takes part of host and uses as ident ban

Quote:
16:52:14 simo Sets Mode on #testing to: +b *!uid19739@id-19739.tooting.irccloud.com
16:52:14 (1 User) is Banned (1) Blackwood
16:52:14 Blackwood Kicked from #testing By simo ( banned!!! )
16:52:15 @Cappuccino Sets Mode on #testing to: -b+b *!uid19739@id-19739.tooting.irccloud.com *!id-19739@*
Back to top
View user's profile Send private message
caesar
Ass Kicker


Joined: 14 Oct 2001
Posts: 3468
Location: Area 51

PostPosted: Fri Apr 20, 2018 1:46 pm    Post subject: Reply with quote

Not triggering on *!*@*.irccloud.com is something will have to properly test. As for the weird behavior, it's actually normal. For some reason I was under the impression the id in hostname is what you wanted to ban in the first place. Will correct this as well tomorrow.
_________________
You may say anything about me, but at least don't misspell my name. xD
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 243

PostPosted: Fri Apr 20, 2018 3:01 pm    Post subject: Reply with quote

tnx caesar
Back to top
View user's profile Send private message
SpiKe^^
Owner


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

PostPosted: Fri Apr 20, 2018 5:57 pm    Post subject: ircCloudBan v.0.1 Reply with quote

Hey simo,

I tried a direct translation of your msl, line for line, as best as I can understand the msl code.

This script tries to preserve the sequence-of-events and work-flow of the original msl code.

I did not address any of the possible issues I saw in the msl scripts theory.


Code:

## ircCloudBan v.0.1 ##

bind mode - "#% +b" ircCloudBan

proc ircCloudBan {nk uh hn ch md banmask} {
  if {![botisop $ch]} return
  if {![string match -nocase "*.irccloud.com" $banmask]} return

  pushmode $ch -b $banmask  ;  set ::irccloudban $banmask
}


bind kick - * ircCloudKick

proc ircCloudKick {nk uh hn ch target why} {
  if {![info exists ::irccloudban]} return

  if {[botisop $ch]} {
    set chhost [getchanhost $target $ch]
    if {[string match -nocase "*.irccloud.com" $chhost]} {
      lassign [split $chhost "@"] user
      pushmode $ch +b "*!$user@*"
    }
  }

  unset ::irccloudban
}


_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
Back to top
View user's profile Send private message Visit poster's website
simo
Master


Joined: 22 Mar 2015
Posts: 243

PostPosted: Fri Apr 20, 2018 9:22 pm    Post subject: Reply with quote

hey there SpiKe^^

i tried it and and tested it looks to work smooth so far tried various paterns and all seems working as desired excellent thx ones again.
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 243

PostPosted: Sat Apr 21, 2018 11:22 am    Post subject: Reply with quote

i would like to thank caesar as well much apreciated as always caesar ... cheers
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 243

PostPosted: Mon Jun 25, 2018 9:50 pm    Post subject: Reply with quote

i noticed on dalnet irccloud users connect with ip as well if for some reason ip doesnt resolve to dns

i wonder if these ips could be integrated as well


Quote:

ipv4:
192.184.9.108
192.184.9.110
192.184.9.112
192.184.10.118
192.184.10.9
192.184.8.73
192.184.8.103

ipv6:
2001:67c:2f08::/48
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
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