This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

ident ban instead of hostban if irccloud user

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
s
simo
Revered One
Posts: 1069
Joined: Sun Mar 22, 2015 2:41 pm

ident ban instead of hostban if irccloud user

Post by simo »

i was wondering if this could be changed to check for irccloud users and
set bans on +b *!ident@* and for non irccloud to set a regular ban *!*@host

Code: Select all

bind pub o|o !kb2 pubm:kickban2
proc pubm:kickban2 {nick host hand chan text} {
	set text [split $text]
	set whom3 [lindex $text 0]
	set reason "Requested"
	if {[llength $text]>1} { set reason [join [lrange $text 1 end]] }

	if {[set chost [getchanhost $whom3 $chan]] ne ""} {
		set mask3 [maskhost "$whom3!$chost" 2]
		putquick "NOTICE $nick :Kick and Ban $whom3 ($mask3) ------- With Reason: $reason"
		putserv "MODE $chan +b $mask3"
		putserv "KICK $chan $whom3 :$reason"
	} else {
		putquick "NOTICE $nick :$whom3 is not on $chan"
	}
}

for example if someone with host
~sid95262@highgate.irccloud.com is on channel to get *!~sid95262@*

and if someone with host uid300068@id-300068.charlton.irccloud.com to get *!uid300068@* to use to set a ban on

and if someone with a regular host like Mibbit@c-71-231-192-20.hsd1.wa.comcast.net to get *!*@c-71-231-192-20.hsd1.wa.comcast.net
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Code: Select all

bind pub o|o !kb2 pubm:kickban2 

proc pubm:kickban2 {nick host hand chan text} { 
  set text [split $text] 
  set whom3 [lindex $text 0] 
  set reason "Requested" 
  if {[llength $text]>1} { set reason [join [lrange $text 1 end]] } 

  if {[set chost [getchanhost $whom3 $chan]] ne ""} { 

    if {[string match "*.irccloud.com" $chost]} {
      set mask3 *![lindex [split $chost @] 0]@*
    } else {  set mask3 [maskhost "$whom3!$chost" 2]  }

    putquick "NOTICE $nick :Kick and Ban $whom3 ($mask3) ------- With Reason: $reason" 
    putserv "MODE $chan +b $mask3" 
    putserv "KICK $chan $whom3 :$reason" 
  } else { 
    putquick "NOTICE $nick :$whom3 is not on $chan" 
  } 
}

SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
simo
Revered One
Posts: 1069
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

works excellent thnx again for your swift response and working code SpiKe^^ :)

much apreciated as always
S
Stefano1990
Voice
Posts: 25
Joined: Mon Jun 04, 2018 10:07 am
Contact:

Hello

Post by Stefano1990 »

Can u do it to make this script eggdrrop to ban only with command !b nick 5
to put the time of ban 5 10 30m 1h 2h

and how to make to give gline on ident of irccloud like u make it for kb and to quit user from server with command channel !g nick Out
Use your common sense and try not to make me look too much like I know what I'm doing.
S
Stefano1990
Voice
Posts: 25
Joined: Mon Jun 04, 2018 10:07 am
Contact:

Post by Stefano1990 »

And for ban with time command !b nick 5 on min
and for gline !g nick Out ....... user quit from server
can u write the code pls , thx in advance
Use your common sense and try not to make me look too much like I know what I'm doing.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Stefano1990 wrote:Can u do it to make this script eggdrrop to ban only with command !b nick 5
to put the time of ban 5 10 30m 1h 2h
Try this..

Code: Select all

################  Use the default kick reason:  Requested  ################
# !kb ted          :kick & ban ted  (this script doesn't remove this ban)
# !kb ted 20       :kick & ban ted  (remove ban in 20 minutes)
# !kb ted 20m      :kick & ban ted  (remove ban in 20 minutes)
# !kb ted 90s      :kick & ban ted  (remove ban in 90 seconds)
# !kb ted 4h       :kick & ban ted  (remove ban in 4 hours)
# !kb ted 1d       :kick & ban ted  (remove ban in 24 hours)

################  Use a custom kick reason  ################
# !kb ted Damn spammer   :kick & ban ted  (kick reason:  Damn spammer)
# !kb ted 20 stop that   :kick with reason: stop that (ban for 20 minutes)

################  Do just a kick, or just a ban  ################
# !k ted                :kick ted with default reason:  Requested
# !k ted Damn spammer   :kick ted with reason:  Damn spammer
# !b ted                :ban ted  (this script doesn't remove this ban)
# !b ted 1h             :ban ted  (remove this ban in 1 hour)



bind pub o|o !kb pubm:kickban
bind pub o|o !k pubm:kick
bind pub o|o !b pubm:ban

proc pubm:kick {nick host hand chan text} {
  pubm:kickban $nick $host $hand $chan $text k Kick
}
proc pubm:ban {nick host hand chan text} {
  pubm:kickban $nick $host $hand $chan $text b Ban
}


proc pubm:kickban {nick host hand chan text {do kb} {say "Kick and Ban"} } {
  set text [split [string trim $text]]
  if {![llength $text]} {
    puthelp "NOTICE $nick :Must provide a target nick to $say."
    return 0
  }
  set text [lassign $text whom]
  if {[isbotnick $whom] || ![botisop $chan] || [matchattr [nick2hand $whom $chan] mn]} {
    return 0
  }
  if {[set chost [getchanhost $whom $chan]] eq ""} { 
    puthelp "NOTICE $nick :$whom is not on $chan" 
    return 0
  }
  append say " $whom"

  if {[string match *b $do]} {
    if {[string match "*.irccloud.com" $chost]} {
      set mask *![lindex [split $chost @] 0]@*
    } else {  set mask [maskhost "$whom!$chost" 2]  }

    append say " ($mask"
    if {[llength $text]} {
      set rest [lassign $text exp]
      if {[regexp {^([1-9][0-9]{0,3})([smhd]?)$} $exp - num dur]} {
        if {$dur eq ""} {  set dur m  }

        set tcall [list timed:unban $mask $chan $nick $num $dur]
        if {$dur eq "d"} {  timer [expr {$dur * 1440}] $tcall
        } elseif {$dur eq "h"} {  timer [expr {$dur * 60}] $tcall
        } elseif {$dur eq "s"} {  utimer $num $tcall
        } else {  utimer [expr {$dur * 60}] $tcall  }

        append say " for $num$dur"
        set text $rest
      }
    }
    append say ")"
  }

  if {[string match k* $do]} {  set reason "Requested"
    if {[llength $text]} {  set reason [join $text]  }
    append say " --> With Reason: $reason"
  }

  putquick "NOTICE $nick :$say"

  if {[string match *b $do]} {  putserv "MODE $chan +b $mask"  }
  if {[string match k* $do]} {  putserv "KICK $chan $whom :$reason"  }
}


proc timed:unban {mask chan nick num dur} {
  if {[botisop $chan] && [ischanban $mask $chan]} {
    putserv "MODE $chan -b $mask"
  }
}

SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
S
Stefano1990
Voice
Posts: 25
Joined: Mon Jun 04, 2018 10:07 am
Contact:

Hello

Post by Stefano1990 »

can u write on this script and for the gline command !g nick 1h or 1d and gline goes to irccloud ident to quit user without infecting other user with same ip irccloud and other regular user with regular ip take gline on their real ip :
example: user with ircloud take a gline on *!ident@* and regular user on *@IP
ty in advance for ur help
Use your common sense and try not to make me look too much like I know what I'm doing.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Stefano1990

This is a kick/ban script.

Please check all of the included functions.
Last edited by SpiKe^^ on Thu Jun 07, 2018 9:31 am, edited 1 time in total.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
S
Stefano1990
Voice
Posts: 25
Joined: Mon Jun 04, 2018 10:07 am
Contact:

Post by Stefano1990 »

Yes i understand , but i need like kb ban u make it and for gline with command example !g ted 1h Adversiting can u do it pls thx again
Use your common sense and try not to make me look too much like I know what I'm doing.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Yes i understand , but the script needs to be tested as it stands now.

This forum thread is about a kick/ban script.
Please check all of the included functions.

Working with the ircd as an oper is a different script and forum thread.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
S
Stefano1990
Voice
Posts: 25
Joined: Mon Jun 04, 2018 10:07 am
Contact:

Hello

Post by Stefano1990 »

Spike^^ yes my friend is work great and thx again for ur help ur amazing
Use your common sense and try not to make me look too much like I know what I'm doing.
S
Stefano1990
Voice
Posts: 25
Joined: Mon Jun 04, 2018 10:07 am
Contact:

Hello

Post by Stefano1990 »

Spike^^^ the last script for eggdrop u make it !kb !k !b nick is not work anymore why ?

and the first with !kb2 is work perfectly can u see the last script why is not work like !kb2 nick

maybe need to be the $whom = $whom3 and the $mask = $mask3 ?
thx in advance
Use your common sense and try not to make me look too much like I know what I'm doing.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

You said the script worked fine then "is not work anymore why ?"

Please explain what it is doing that it should not be doing.
Also explain what it isn't doing that it should be doing.

Paste all errors that the script may have generated.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
S
Stefano1990
Voice
Posts: 25
Joined: Mon Jun 04, 2018 10:07 am
Contact:

Post by Stefano1990 »

i think it is working cozz we have the same command on bot channel when quit out the channel bot is not work
nothing from this command is now work dont get make no one action and is not show me any notice what and why is not work any of all commands on script
example i make
!kb Test2 out
!k test2 out
!b test2

no one of this work and egddrop dont react to the comand of the script
and dont show me notice what is not work or what is wrong :(

can eggdrrop give the command to the Channel Bot to give ban on irccloud ident and normal user without irccloud to hostmask like normaly on ip

here ur script is not recognise the command of eggdrop script u make only the channel bot

[18:53:07] <Alb> !k Test2
[18:53:11] <Alb> !kb Test2
[18:53:15] <Alb> !b Test2
[18:53:26] <~aL> !k test2 5
[18:53:27] * Test2 was kicked from #TEST by TEST (5)

[19:51:14] <~aL> !kb test2 20
[19:51:15] * Test2 was kicked from #TEST by TEST (20)
[19:51:15] * TEST sets mode: +b *!*@test-339B913C.irccloud.com

this is the first script with !kb2 is work

[18:54:08] <@aL> !kb2 Test2 Out
[18:54:09] * Rocky sets mode: +b *!uid290495@*
[18:54:09] >> BAN for nick Test2 <<
[18:54:10] * Test2 was kicked from #TEST by Rocky (Out)

Rocky is the eggdrop name
TEST channel name
Use your common sense and try not to make me look too much like I know what I'm doing.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Early testing shows this script working here. :)

I'll look more tomorrow.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Post Reply