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 

cloud ip remove ident ban

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
F|irT
Voice


Joined: 30 Apr 2015
Posts: 30
Location: Pakistan

PostPosted: Thu Dec 27, 2018 12:15 am    Post subject: cloud ip remove ident ban Reply with quote

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
}


this is what i am using got from this site ... i need some help on it .

when i ban cloud ip then bots remove the ban . but did not set the ident ban .

Exp:
[09:04] * F|irT sets mode: +b *!*@id-246043.stonehaven.irccloud.com
[09:04] * NoNSt0p sets mode: -b *!*@id-246043.stonehaven.irccloud.com
[09:09] * F|irT sets mode: +b *!*@id-338795.brockwell.irccloud.com
[09:09] * NoNSt0p sets mode: -b *!*@id-338795.brockwell.irccloud.com
[09:09] * F|irT sets mode: +b *!*@id-169916.brockwell.irccloud.com
[09:09] * NoNSt0p sets mode: -b *!*@id-169916.brockwell.irccloud.com

but in kick ban it works good
exp:
[09:11] * F|irT sets mode: +b *!*@id-246043.stonehaven.irccloud.com
[09:11] * Day-Night was kicked by F|irT (F|irT)
[09:11] * NoNSt0p sets mode: -b+b *!*@id-246043.stonehaven.irccloud.com *!uid246043@*

--------------------------------------------------------------
i want when any op ban the cloud ip it does not remove the ban .
of if it can be like remove ip and get ident like it's doing on kick ban .
not doing on simple ban.

hope u underatand.

My English is weak
F|irT
Back to top
View user's profile Send private message Yahoo Messenger
caesar
Mint Rubber


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

PostPosted: Mon Jan 07, 2019 3:02 am    Post subject: Reply with quote

I see that you took this code from the first page in irccloud banmask discussion but didn't read until last page to see the offered solution that seems to work for simo. Having trouble to understand what is needed to be changed? Here is the final code with all the changes in place:
Code:

## ircCloudBan v.0.4 ##

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*
   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
      if {[regexp {[su]id\d+} $u]} {
         pushmode $ch +b "*!$u@*"
      } elseif {[regexp {id-(\d+).(.*?).irccloud.com} $h - x]} {
         foreach n [chanlist $ch] {
            if {[isbotnick $n]} continue
            if {[isop $n $ch] || [isvoice $n $ch] || [validuser [nick2hand $n]]} continue
            scan [getchanhost $n $ch] {%[^@]@%s} user host
            if {[regexp {\d+} $user y]} {     
               if {[string equal $x $y]} {
                  pushmode $ch +b "*!$user@*"
               }
            }
         }
      }
      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
   if {[scan $chhost {%[^@]@%s} u h] != 2} return
   foreach host $ircSkip {
      if {![string match -nocase $host $h]} continue
      incr match
      break
   }
   if {$match} {
      if {[regexp {[su]id\d+} $u]} {
         pushmode $ch +b "*!$u@*"
      }
   }
   unset ::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
Stefano1990
Voice


Joined: 04 Jun 2018
Posts: 25

PostPosted: Wed Feb 13, 2019 2:14 pm    Post subject: Hello Reply with quote

ceasar hi, this is work only if i !kb nick same nick for the second time not at first time why ?

frist time

<@Stefano> !kb test-1
* test-1 was kicked by test (Requested (Stefano))
* test sets mode: +b *!*@test-67B691C.irccloud.com
* test sets mode: -b *!*@test-67B691C.irccloud.com

second time

<@Stefano> !kb test-1
* test-1 was kicked by test (Requested (Stefano))
* test sets mode: +b *!*@test-67B691C.irccloud.com
* test sets mode: -b+b *!*@test-67B691C.irccloud.com *!uid22341@*

Code:


## ircCloudBan v.0.4 ##

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*
   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
      if {[regexp {[su]id\d+} $u]} {
         pushmode $ch +b "*!$u@*"
      } elseif {[regexp {id-(\d+).(.*?).irccloud.com} $h - x]} {
         foreach n [chanlist $ch] {
            if {[isbotnick $n]} continue
            if {[isop $n $ch] || [isvoice $n $ch] || [validuser [nick2hand $n]]} continue
            scan [getchanhost $n $ch] {%[^@]@%s} user host
            if {[regexp {\d+} $user y]} {     
               if {[string equal $x $y]} {
                  pushmode $ch +b "*!$user@*"
               }
            }
         }
      }
      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
   if {[scan $chhost {%[^@]@%s} u h] != 2} return
   foreach host $ircSkip {
      if {![string match -nocase $host $h]} continue
      incr match
      break
   }
   if {$match} {
      if {[regexp {[su]id\d+} $u]} {
         pushmode $ch +b "*!$u@*"
      }
   }
   unset ::irccloudban
}


_________________
Use your common sense and try not to make me look too much like I know what I'm doing.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
caesar
Mint Rubber


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

PostPosted: Thu Feb 28, 2019 10:43 am    Post subject: Reply with quote

What's the exact user host of the test user? test-1!uid22341@test-67B691C.irccloud.com ?
_________________
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
mvp1
Voice


Joined: 27 Jan 2022
Posts: 22

PostPosted: Sun Oct 09, 2022 5:41 pm    Post subject: Reply with quote

Hi Caesar,

I'm testing this code, but there seems to be a problem. The code works fine in case of Kick+Ban. However;

1) In case of only ban (no kick), it unbans the irccloud ban but DOES NOT set the ident(irccloud id) ban. Where it should be setting an irccloud id / ident ban.

<mvp1> !kb Test1
9:49:07 AM •Bot banned *!*@id-387274.lymington.irccloud.com (+b)
9:49:08 AM •Bot un-banned *!*@id-387274.lymington.irccloud.com (-b)

2) In case of only kick (no ban), it sets the ban (cloud id) ban. Where it should not be setting any ban at all.

← •Test1 (uid283599@id-283599.uxbridge.irccloud.com) was kicked by •mpv1: Testing please
9:31:11 AM •Bot banned *!uid283599@* (+b)

Any chance you can help edit so the (ip unban + ident ban) only runs in case of ban and kick+ban, but not in case of only kick?

Many thanks
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Wed Oct 12, 2022 10:09 am    Post subject: Reply with quote

this is how i use it


Code:



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

proc ircCloudBan {nk uh hn ch md banmask} {
   if {![botisop $ch]} return
           if {[string match -nocase "*@*irccloud*" $banmask] } { 
                   set ::irccloudban $banmask
                   after [expr {1*1000*60}] [list unset ::irccloudban]
   }
 }

proc ircCloudKick {nk uh hn ch target why} {
 if {![info exists ::irccloudban]} return
     if {![botisop $ch]} return
         set chost [getchanhost $target $ch]
          if {[string match -nocase "*@*irccloud*" $chost] } { 
        regsub -all -- ~ $chost "" chost
        set ident  [lindex [split $chost @] 0]
        set xbmaskx [string map {sid id uid id} $ident]
        set bmask  *!*[string tolower $xbmaskx ]@*
        pushmode $ch +b $bmask
        pushmode $ch -b $::irccloudban
       unset ::irccloudban
  }
}






the only downside is if 2 or more irccloud users get banned at same time the var only stores 1 since its stored under 1 name

Code:
 set ::irccloudban $banmask



i tried using like :

Code:
 set ::irccloudban($chan:$banmask) $banmask


but i couldnt use that in the kick proc since kick proc doesnt use bans

other than that it should work fine
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Thu Oct 13, 2022 6:06 am    Post subject: Reply with quote

in addition :

Quote:

1) In case of only ban (no kick), it unbans the irccloud ban but DOES NOT set the ident(irccloud id) ban. Where it should be setting an irccloud id / ident ban.


this can only be done if unique id (UID) is in the set banmask but in many cases it isnt and in many cases irccloud users use the same server without uid in the server vhost like

Quote:
*!*@uxbridge.irccloud.com or *!*@ilkley.irccloud.com


and so on wich makes it impossible to determine wich ident ban to set thats why the kick proc is used to determine that on kick
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Thu Oct 13, 2022 10:28 am    Post subject: Reply with quote

this seems to do well for me on dalnet

Code:
 
## ircCloudBan v.1.0 ##

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

proc ircCloudBan {nk uh hn ch md banmask} {
  if {![botisop $ch]} return

  if {[string match -nocase "*@*irccloud*" $banmask] && ![regexp {[\`\^\-\_\\\|\}\{\[\]a-zA-Z0-9]{1,}!(\*)@.*irccloud\.com} $banmask] && ![regexp {[su]id\d+} $banmask] && ![regexp {id-(\d+).(.*?).irccloud.com} $banmask] && || ![regexp {(\*)!(\*)@.*[a-zA-Z0-9\-]+\.[a-zA-Z]+\.irccloud\.com} $banmask]} {

    set ::irccloudban $banmask
    after [expr {1*1000*60}] [list unset ::irccloudban]
  }

  if {[regexp {[\`\^\-\_\\\|\}\{\[\]a-zA-Z0-9]{1,}!(\*)@.*irccloud\.com} $banmask] || [regexp {[su]id\d+} $banmask] || [regexp {id-(\d+).(.*?).irccloud.com} $banmask] || [regexp {(\*)!(\*)@.*[a-zA-Z0-9\-]+\.[a-zA-Z]+\.irccloud\.com} $banmask]} {

    set userList [chanlist $ch]

    foreach n $userList {

      if {![matchaddr $banmask $n![getchanhost $n $ch]]} { continue }
      if {[isop $n $ch] || [ishalfop $n $ch] || [matchattr [nick2hand $n] "fnmo|fnmo" $ch]} { continue }

      set chost [getchanhost $n $ch]
      regsub -all -- ~ $chost "" chost
      set ident  [lindex [split $chost @] 0]
      set xbmaskx [string map {sid id uid id} $ident]
      set bmask  *!*[string tolower $xbmaskx ]@*
      pushmode $ch +b $bmask
      pushmode $ch -b $banmask
    }
  }
}

proc ircCloudKick {nk uh hn ch target why} {
  set chost [getchanhost $target $ch]

  if {[info exists ::irccloudban] && [matchaddr $::irccloudban $target!$chost]} {
    if {![botisop $ch]} return

    regsub -all -- ~ $chost "" chost
    set ident  [lindex [split $chost @] 0]
    set xbmaskx [string map {sid id uid id} $ident]
    set bmask  *!*[string tolower $xbmaskx ]@*
    pushmode $ch +b $bmask
    pushmode $ch -b  $::irccloudban
    after cancel unset ::irccloudban
    unset ::irccloudban
  }
}

putlog "irccloud.tcl Loaded."

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 -> Scripting Help 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