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.

script command to ban a wildcard ident and its host

Help for those learning Tcl or writing their own scripts.
Post Reply
B
BarGuy
Voice
Posts: 24
Joined: Tue Aug 20, 2019 3:27 pm

script command to ban a wildcard ident and its host

Post by BarGuy »

so Im using script to ban someone who is on a ramage for some reason... the script Im using was banning the nick, but I changed it to ban the host ---> putquick "MODE $chan +b $uhost" <--- however its also banning the ident as well.. (ie itsme@123.456.789) how can I change that ban type so its a ban like *@123.456.789
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Re: script command to ban a wildcard ident and its host

Post by willyw »

BarGuy wrote:... how can I change that ban type so its a ban like *@123.456.789

Visit :
https://docs.eggheads.org/mainDocs/tcl- ... t-masktype

and see if the command and info describing it found there is helpful to you.

Experiment with it some.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
B
BarGuy
Voice
Posts: 24
Joined: Tue Aug 20, 2019 3:27 pm

Post by BarGuy »

got it figured out...

added
set banmask [lindex [split $uhost "@"] 1]
and changed $umask to $banmask
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

BarGuy wrote:got it figured out...

added
set banmask [lindex [split $uhost "@"] 1]
and changed $umask to $banmask
It depends on what you need and/or are satisfied with. If you've got it to suit you, all well and good. :)
However, the code you've posted won't produce what you asked for.
... so its a ban like *@123.456.789 ...
It will produce just the part to the right of the @ .

If you want a banmask like :
*!*@something.something
then there are a couple ways to achieve it.

Play with this in some test channel of yours. It will make the difference real clear. Then decide what you want / need.

Code: Select all

#
# Jan. 17, 2020
#
# http://forum.egghelp.org/viewtopic.php?t=20704
#
#
#####

bind pub - "!foo" mask_host_experiment


proc mask_host_experiment {nick uhost handle chan text} {

        putserv "privmsg $chan : "

        putserv "privmsg $chan :nick is: $nick - - - uhost is: $uhost "

        putserv "privmsg $chan : "

        set banmask [lindex [split $uhost "@"] 1]
        putserv "privmsg $chan :banmask is: $banmask"

        putserv "privmsg $chan : "
  

        set another_banmask [maskhost $nick!$uhost 2]

        putserv "privmsg $chan :another_banmask is: $another_banmask "

}

I hope this helps.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
B
BarGuy
Voice
Posts: 24
Joined: Tue Aug 20, 2019 3:27 pm

Post by BarGuy »

However, the code you've posted won't produce what you asked for.

... so its a ban like *@123.456.789 ...


It will produce just the part to the right of the @ .

If you want a banmask like :
*!*@something.something
then there are a couple ways to achieve it.
Actually it did exactly what we were looking for (11:05:42] * BarBot sets mode: +b *!*@89.249.65.30)

But thanks for the additional help
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

BarGuy wrote: ...
Actually it did exactly what we were looking for (11:05:42] * BarBot sets mode: +b *!*@89.249.65.30)
Ok. I'm glad you're getting the ban you wanted then. Apparently the irc server does some interpreting of what is sent to it, and adds the leading *!*@ on it's own.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Post Reply