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.

public ban command

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

public ban command

Post by simo »

greetingz , i was searching for public ban command script couldnt really find any most only ban nick and not host , i was wondering if someone would have one already made
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Re: public ban command

Post by juanamores »

simo wrote:greetingz , i was searching for public ban command script couldnt really find any most only ban nick and not host , i was wondering if someone would have one already made
This code is created to add ignores to hosts (masks ) of nicks (NOT BAN).
If you replace the newignore comnand by BAN command , it can be useful.

Code: Select all

#Sintax: !ignore [nick | mask] <time in min> <reason>
proc pub:cmdignore {nick uhost handle chan text} {
 if {$text == ""} {return 0}
  if {[regexp -nocase -- {^[-_./\\]+?([a-z0-9]+)[-_./\\]+$} [lindex [split $text] 0] a b]} {
 set target *$b*!*@*
  } else {
  set target [join [lindex [split $text] 0]]
   }
  set b $target
set largo [string length $text]
  set time [join [lindex [split $text] 1]]
  set reason [join [lrange [split $text] 2 [expr { "$largo" - 1}]]]
  if {![string match "*\[0-9\]*" $time]} {set it 15} else { set it "$time"} 
 set host [lindex [split [getchanhost $target $chan] @] 1]
 set idents [lindex [split [getchanhost $target $chan] @] 0]
  if {$reason == ""} {set ir "Solicitado por $nick en [join [ctime [unixtime]]]."} else { set ir "$reason Puesto por $nick en [join [ctime [unixtime]]]."}
  if {![string match *!*@* $target] && ![onchan $target]} {
		putserv "PRIVMSG $chan :$target NO se encuentra en el canal!."
		return 0
  }
  if {[onchan $target]} {set im "*!*@[join [lrange [split $host .] 0 end] .]"} else {set im "$target"}
  if {[onchan $target]} {set ident1 "*![join $idents]@*" } 
  if {"$idents" == "ircap"} {set ident1 "*![join $idents]@[join $host]"}
  	newignore $im $handle "$ir" $it
	newignore $ident1 $handle "$ir" $it
  if {("$it" == 0) && ($reason != "")} { putmsg $chan "$nick, se ha puesto en ignore a $im $b $ident1 por siempre, $reason."; return 1 }  
	if {("$it" == 0) && ($reason == "")} { putmsg $chan "$nick, se ha puesto en ignore a $im $b $ident1 por siempre."; return 1 }
	if {("$it" == 1) && ($reason != "")} { putmsg $chan "$nick, se ha puesto en ignore a $im $b $ident1 por $it minuto, $reason."; return 1}
	if {("$it" == 1) && ($reason == "")} { putmsg $chan "$nick, se ha puesto en ignore a $im $b $ident1 por $it minuto."; return 1}
	if {("$it" != 0) && ($reason == "")} { putmsg $chan "$nick, se ha puesto en ignore a $im $b $ident1 por $it minutos, $reason."; return 1
	} else { putmsg $chan "$nick, se ha puesto en ignore a $im $b $ident1 por $it minutos; $reason."
	return 1
	}
} 
Example with this nick and host: God!genius@I.am.a.god
nick: God
ident: genius
host:I.am.a.god

<God>Hello I came to bother jejeje!
<@operator> !ignore God por molestar
<@MyBoT> operator, se ha puesto en ignore a *!*@I.am.a.god *!genius@I.am.a.god por 15 minutos; molestar.
"por molestar" ( to bother) is a reason to ignore
or just put the nick without reason:
<@operator> !ignore God


Ignoring is put these two forms simultaneously.
*!*@host
*!ident@host

I think if you change:
newignore $im $handle "$ir" $it
newignore $ident1 $handle "$ir" $it
like this:

Code: Select all

putserv "mode #chan +b $im $handle $ir $it"
putserv "mode #chan +b $ident1 $handle $ir $it"
The messages are in Spanish , I had not time to translate to English.
With the help of google translator you can see or ask me if you do not understand.
I excepted the idents "ircap" because they are used by many users in my IRC network.
if {"$idents" == "ircap"} {set ident1 "*![join $idents]@[join $host]"}
The default time is 15 minutes
if {![string match "*\[0-9\]*" $time]} {set it 15} else { set it "$time"}

I have not tested
, but I think you can serve, at least you have an idea of ​​how to take the host or mask for the bans .
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks :)
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

If you need to, you can check out some of my releases. There is a public ban script, an ignore script and many other's.
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.
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

thnx get_a_fix
b
bero93
Voice
Posts: 8
Joined: Tue Dec 09, 2014 11:29 am

Post by bero93 »

Get_A_Fix wrote:If you need to, you can check out some of my releases. There is a public ban script, an ignore script and many other's.
there is a error on line 45 of your ban script
see github
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

bero93 wrote:
Get_A_Fix wrote:If you need to, you can check out some of my releases. There is a public ban script, an ignore script and many other's.
there is a error on line 45 of your ban script
see github
wow.. Thanks, bero93. I hadn't even noticed, everything I added to github has been edited for github, the code I use all binds back to the same trigger so I appreciate you letting me know so I can fix the code. Github needs a bug push notification or something.
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.
Post Reply