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 Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3775
Location: Mint Factory

PostPosted: Tue Jun 26, 2018 1:10 am    Post subject: Reply with quote

Give this untested code a try.
Code:

## ircCloudBan v.0.2 ##

set ircSkip {
   *.irccloud.com
   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.10
   2001:67c:2f08::/48
}

bind mode - "#% +b" ircCloudBan
bind kick - * ircCloudKick

proc ircCloudBan {nk uh hn ch md banmask} {
   if {![botisop $ch]} return
   global ircSkip
   set match 0
   foreach host $ircSkip {
      if {![string match -nocase $host $banmask]} continue
      incr match
      break
   }
   if {$match} {
      pushmode $ch -b $banmask
      set ::irccloudban $banmask
   }
}

proc ircCloudKick {nk uh hn ch target why} {
   if {![info exists ::irccloudban]} return
   if {![botisop $ch]} return
   set chhost [getchanhost $target $ch]
   global ircSkip
   set match 0
   foreach host $ircSkip {
      if {![string match -nocase $host $chhost]} continue
      incr match
      break
   }
   if {$match} {
      lassign [split $chhost "@"] user
      pushmode $ch +b "*!$user@*"
   }
   unset ::irccloudban
}

Honestly I have my doubts this will work with that IPv6 host as I honestly don't know how those look like, but with the others should.
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Thu Jun 28, 2018 9:58 am    Post subject: Reply with quote

perhaps we can use the ipv6 like this as well:

2001:67c:2f08*

i havent worked much with ipv6 but i would think using it like that would get all
irccloud ranges

since this part is what the ipv6 ones seem to have in common

2001:67c:2f08*
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Thu Jun 28, 2018 10:07 am    Post subject: Reply with quote

i tested the ipv4 ones dont seem to work only the *.irccloud.com seemed to work not if i set vhost as @irccloud.com tho

havent tested ipv6 one tho as i cant set vhost using ipv6 as i test with using forced vhost as ircop on a testnet i use to test with

didnt get any error either in PL

this is a list of users i gathered their info on dalnet with options of irccloud servers used

Quote:
sid192210@2001:67c:2f08:4::2:eed2
  sid303781@2001:67c:2f08:3::4:a2a5
  sid50703@2001:67c:2f08:5::c60f
  sid95262@highgate.irccloud.com
  uid122185@id-122185.hathersage.irccloud.com
  uid131084@id-131084.hathersage.irccloud.com
  uid135215@tooting.irccloud.com
  uid157056@id-157056.ealing.irccloud.com
  uid167562@id-167562.highgate.irccloud.com
  uid170024@id-170024.stonehaven.irccloud.com
  uid186764@id-186764.charlton.irccloud.com
  uid192191@id-192191.hathersage.irccloud.com
  uid192874@id-192874.stonehaven.irccloud.com
  uid199235@id-199235.tooting.irccloud.com
  uid209231@id-209231.ealing.irccloud.com
  uid233980@id-233980.stonehaven.irccloud.com
  uid245991@192.184.10.9
  uid254440@id-254440.stonehaven.irccloud.com
  uid257218@192.184.10.9
  uid304780@id-304780.charlton.irccloud.com
  uid306017@id-306017.charlton.irccloud.com
  uid306280@2001:67c:2f08:8::4:ac68
  uid306373@2001:67c:2f08:3::4:acc5
  uid306470@2001:67c:2f08:8::4:ad26
  uid59776@id-59776.charlton.irccloud.com
  uid63826@id-63826.tooting.irccloud.com
  ~sid154238@2001:67c:2f08:1::2:5a7e
  ~sid50703@2001:67c:2f08:5::c60f
  ~uid112933@hathersage.irccloud.com
  ~uid139993@id-139993.ealing.irccloud.com
  ~uid140561@id-140561.brockwell.irccloud.com
  ~uid16153@id-16153.ealing.irccloud.com
  ~uid167284@id-167284.charlton.irccloud.com
  ~uid204847@id-204847.ealing.irccloud.com
  ~uid215886@charlton.irccloud.com
  ~uid225090@id-225090.ealing.irccloud.com
uid257218@192.184.10.9
  uid304780@id-304780.charlton.irccloud.com
  uid306017@id-306017.charlton.irccloud.com
  uid306280@2001:67c:2f08:8::4:ac68
  uid306373@2001:67c:2f08:3::4:acc5
  uid306470@2001:67c:2f08:8::4:ad26
  uid59776@id-59776.charlton.irccloud.com
  uid63826@id-63826.tooting.irccloud.com
  ~sid154238@2001:67c:2f08:1::2:5a7e
  ~sid50703@2001:67c:2f08:5::c60f
  ~uid112933@hathersage.irccloud.com
  ~uid139993@id-139993.ealing.irccloud.com
  ~uid140561@id-140561.brockwell.irccloud.com
  ~uid16153@id-16153.ealing.irccloud.com
  ~uid167284@id-167284.charlton.irccloud.com
  ~uid204847@id-204847.ealing.irccloud.com
  ~uid215886@charlton.irccloud.com
  ~uid225090@id-225090.ealing.irccloud.com
  ~uid236624@id-236624.stonehaven.irccloud.com
  ~uid270310@id-270310.ealing.irccloud.com
  ~uid275550@id-275550.charlton.irccloud.com
  ~uid286964@id-286964.hathersage.irccloud.com
  ~uid288785@id-288785.hathersage.irccloud.com
  ~uid294417@id-294417.hathersage.irccloud.com
  ~uid298989@2001:67c:2f08:3::4:8fed
  ~uid299144@2001:67c:2f08:8::4:9088
  ~uid301571@stonehaven.irccloud.com
  ~uid305805@2001:67c:2f08:8::4:aa8d
  ~uid305810@2001:67c:2f08:8::4:aa92
  ~uid305923@2001:67c:2f08:8::4:ab03
  ~uid305989@2001:67c:2f08:8::4:ab45
  ~uid306055@id-306055.stonehaven.irccloud.com
  ~uid306104@id-306104.charlton.irccloud.com
  ~uid306735@charlton.irccloud.com
  ~uid80616@id-80616.tooting.irccloud.com
  ~uid89398@id-89398.brockwell.irccloud.com



it seems they dont use @irccloud.com no more for their users but i believe we should use it in case
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3775
Location: Mint Factory

PostPosted: Fri Jun 29, 2018 1:31 am    Post subject: Reply with quote

Yeah, I'm an idiot cos should have foreseen this issue. Rolling Eyes

Anyway, there are two easy fixes for this problem:

1. make them in the nick!user@host format, for example:
Code:

set ircSkip {
   *!*@*.irccloud.com
   *!*@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.10
}

2. Leave $ircSkip as is and above:
Code:

foreach host $ircSkip {

add:
Code:

scan $banmask {%[^!]!%[^@]@%s} n u h

and then replace:
Code:

if {![string match -nocase $host $banmask]} continue

with this:
Code:

if {![string match -nocase $host $h]} continue

As for IPv6 I think it needs some testing with matchcidr if you plan to use something like 2001:67c:2f08::/48. It should also be in a different list and have it's own loop.
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Fri Jun 29, 2018 2:20 pm    Post subject: Reply with quote

changed it and tested again with ipv4 didnt trigger and no errors

this is what i got so far:

Code:
## ircCloudBan v.0.2 ##

set ircSkip {
   *!*@*.irccloud.com
   *!*@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.10
   *!*@2001:67c:2f08*




bind mode - "#% +b" ircCloudBan
bind kick - * ircCloudKick

proc ircCloudBan {nk uh hn ch md banmask} {
   if {![botisop $ch]} return
   global ircSkip
   set match 0
  scan $banmask {%[^!]!%[^@]@%s} n u h
   foreach host $ircSkip {
    if {![string match -nocase $host $h]} continue
      incr match
      break
   }
   if {$match} {
      pushmode $ch -b $banmask
      set ::irccloudban $banmask
   }
}

proc ircCloudKick {nk uh hn ch target why} {
   if {![info exists ::irccloudban]} return
   if {![botisop $ch]} return
   set chhost [getchanhost $target $ch]
   global ircSkip
   set match 0
   foreach host $ircSkip {
      if {![string match -nocase $host $chhost]} continue
      incr match
      break
   }
   if {$match} {
      lassign [split $chhost "@"] user
      pushmode $ch +b "*!$user@*"
   }
   unset ::irccloudban
}
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3775
Location: Mint Factory

PostPosted: Sat Jun 30, 2018 2:02 am    Post subject: Reply with quote

I gave you two methods and you combined the two instead of picking just one. Guess I haven't been very clear. Sorry. Anyway, set ircSkip back to how it was:
Code:

set ircSkip {
   *.irccloud.com
   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.10
}

and this should work.

Oh, and you should make the same changes to ircCloudKick as well in order to work like it dose for bans (ircCloudBan)
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Sat Jun 30, 2018 6:30 am    Post subject: Reply with quote

so using scan $banmask {%[^!]!%[^@]@%s} n u h
as well for the kick part ?

but kick proc doesnt have banmask right ?
im a bit lost here

i tried this but didnt seem to do it:

Code:
## ircCloudBan v.0.2 ##

set ircSkip {
   *.irccloud.com
   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.10
   2001:67c:2f08*




bind mode - "#% +b" ircCloudBan
bind kick - * ircCloudKick

proc ircCloudBan {nk uh hn ch md banmask} {
   if {![botisop $ch]} return
   global ircSkip
   set match 0
  scan $banmask {%[^!]!%[^@]@%s} n u h
   foreach host $ircSkip {
    if {![string match -nocase $host $h]} continue
      incr match
      break
   }
   if {$match} {
      pushmode $ch -b $banmask
      set ::irccloudban $banmask
   }
}

proc ircCloudKick {nk uh hn ch target why} {
   if {![info exists ::irccloudban]} return
   if {![botisop $ch]} return
   set chhost [getchanhost $target $ch]
   global ircSkip
   set match 0
   scan $chhost {%[^!]!%[^@]@%s} n u h
   foreach host $ircSkip {
      if {![string match -nocase $host $h]} continue
      incr match
      break
   }
   if {$match} {
      lassign [split $chhost "@"] user
      pushmode $ch +b "*!$user@*"
   }
   unset ::irccloudban
}



it removes ban but doesnt set ident ban
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Sat Jun 30, 2018 6:54 am    Post subject: Reply with quote

i tried again with this and it only removes ban it doesnt set ident ban either
Code:
## ircCloudBan v.0.2 ##

set ircSkip {
   *.irccloud.com
   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.10
   2001:67c:2f08*
}

bind mode - "#% +b" ircCloudBan
bind kick - * ircCloudKick

proc ircCloudBan {nk uh hn ch md banmask} {
   if {![botisop $ch]} return
   global ircSkip
   set match 0
  scan $banmask {%[^!]!%[^@]@%s} n u h
   foreach host $ircSkip {
    if {![string match -nocase $host $h]} continue
      incr match
      break
   }
   if {$match} {
      pushmode $ch -b $banmask
      set ::irccloudban $banmask
   }
}

proc ircCloudKick {nk uh hn ch target why} {
   if {![info exists ::irccloudban]} return
   if {![botisop $ch]} return
   set chhost [getchanhost $target $ch]
   global ircSkip
   set match 0
   scan $chhost {%[^!]!%[^@]@%s} nk uh ch
   foreach host $ircSkip {
      if {![string match -nocase $host $chhost]} continue
      incr match
      break
   }
   if {$match} {
      lassign [split $chhost "@"] user
      pushmode $ch +b "*!$user@*"
   }
   unset ::irccloudban
}
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3775
Location: Mint Factory

PostPosted: Sat Jun 30, 2018 9:05 am    Post subject: Reply with quote

Inside ircCloudKick correct your lines:
Code:

scan $chhost {%[^!]!%[^@]@%s} n u h

and:
Code:

if {![string match -nocase $host $h]} continue

And you can change this:
Code:

lassign [split $chhost "@"] user
pushmode $ch +b "*!$user@*"

to:
Code:

pushmode $ch +b "*!$u@*"

I left those n, u and h as variables for a reason.
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Sat Jun 30, 2018 9:11 am    Post subject: Reply with quote

at first i kept em like that and it didnt trigger at all and kept complaining about cant read h
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Sun Jul 01, 2018 9:33 am    Post subject: Reply with quote

this is what i got so far:

and it returns this error:

Tcl error [ircCloudKick]: can't read "h": no such variable


Code:
## ircCloudBan v.0.2 ##

set ircSkip {
   *.irccloud.com
   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.10
   2001:67c:2f08*




bind mode - "#% +b" ircCloudBan
bind kick - * ircCloudKick

proc ircCloudBan {nk uh hn ch md banmask} {
   if {![botisop $ch]} return
   global ircSkip
   set match 0
  scan $banmask {%[^!]!%[^@]@%s} n u h
   foreach host $ircSkip {
    if {![string match -nocase $host $h]} continue
      incr match
      break
   }
   if {$match} {
      pushmode $ch -b $banmask
      set ::irccloudban $banmask
   }
}

proc ircCloudKick {nk uh hn ch target why} {
   if {![info exists ::irccloudban]} return
   if {![botisop $ch]} return
   set chhost [getchanhost $target $ch]
   global ircSkip
   set match 0
   scan $chhost {%[^!]!%[^@]@%s} n u h
   foreach host $ircSkip {
    if {![string match -nocase $host $h]} continue
      incr match
      break
   }
   if {$match} {
     pushmode $ch +b "*!$u@*"
   }
   unset ::irccloudban
}
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3775
Location: Mint Factory

PostPosted: Sun Jul 01, 2018 2:02 pm    Post subject: Reply with quote

*facepalm* That's because getchanhost doesn't return a nick. I forgot. Just replace:
Code:

scan $chhost {%[^!]!%[^@]@%s} n u h

with:
Code:

scan $chhost {%[^@]@%s} u h

and should work fine.

Or even better replace it with:
Code:

if {[scan $chhost {%[^@]@%s} u h] != 2} return

cos if the nickname is not on the channel then "" is returned and will throw another error. Better safe than sorry, no? Smile
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Mon Jul 02, 2018 9:35 am    Post subject: Reply with quote

that seems to do it , excellent

did various tests seems to work fine

thanx caesar much apreciated
Back to top
View user's profile Send private message
gamble27
Halfop


Joined: 05 Aug 2008
Posts: 71

PostPosted: Tue Jul 17, 2018 4:39 am    Post subject: Reply with quote

currently on this code or spike code, when a user bans the ip the eggdrop unbans it but doesnt set ban on the ident, it only bans the ident when a kick is excuted, can we make it ban the ident the moment someone places a ban on ircloud? refer below for some example.

bot1 sets mode: +b *!*@id-2136d76.hathersage.irccloud.com
bot2 sets mode: -b *!*@id-2136d76.hathersage.irccloud.com

do note bot2 has this tcl loaded, it bans unbans the ban but doesnt sets the ident ban. only places ident ban when a kick is excuted.

can we fix tis tks
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3775
Location: Mint Factory

PostPosted: Wed Jul 18, 2018 12:48 am    Post subject: Reply with quote

Sure, above:
Code:

set ::irccloudban $banmask

just add:
Code:

pushmode $ch +b "*!$u@*"

It's simple as that. Wink

And the -b and +b should be set in one line, if it doesn't then you can replace the two pushmode lines with a single one:
Code:

puthelp "MODE $ch -b+b $banmask *!$u@*"

_________________
Once the game is over, the king and the pawn go back in the same box.
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 Previous  1, 2, 3, 4  Next
Page 2 of 4

 
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