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.

Redirect Ban with eggdrop (inspircd)

Help for those learning Tcl or writing their own scripts.
Post Reply
h
h1x0r1
Voice
Posts: 5
Joined: Wed Jan 22, 2020 5:45 am

Redirect Ban with eggdrop (inspircd)

Post by h1x0r1 »

Hello to all. I have to write some script to make ban with redirect chan. This option in inspircd server is possible with command mode +b banmask!*@*#channel
This is the code but it's not working:

Code: Select all

set redirectchan "#sex"
proc sex_ban { nick uhost hand chan text } {
global botnick redirectchan
set banmask [getchanhost $text $chan]
if {[onchan $text]} {
putquick "MODE $chan +b $banmask$redirectchan" #this raw not working  
putquick "KICK $chan $text Here is not a sex chan!"
  } else { putserv "PRIVMSG $chan :$text Is Not In The Channel" }
}
Please help me ;)
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Re: Redirect Ban with eggdrop (inspircd)

Post by willyw »

Code: Select all

       putquick "MODE $chan +b $banmask$redirectchan" #this raw not working  

Should there be a space between $banmask and $redirectchan ?
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
h
h1x0r1
Voice
Posts: 5
Joined: Wed Jan 22, 2020 5:45 am

Post by h1x0r1 »

No, the command is $banmask#chan like: *!*ddd@dasd.com#channel
I try with space and didn't work !
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

This is the manual page for The "banredirect" Module in InspIRCd v2
https://docs.inspircd.org/2/modules/banredirect/

The same seems to apply for InspIRCd v3

That explains what is required to make the banredirect command work.

Try changing your banmask line to like this:

Code: Select all

set banmask *![getchanhost $text $chan]
Maybe a kick is not required after setting this banredirect mode?
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
h
h1x0r1
Voice
Posts: 5
Joined: Wed Jan 22, 2020 5:45 am

Post by h1x0r1 »

Thanks for replay!

The change of banmask not working.
Bot didn't put any error in dcc.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

You also need to get rid of this text after the code on that line...

#this raw not working
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
h
h1x0r1
Voice
Posts: 5
Joined: Wed Jan 22, 2020 5:45 am

Post by h1x0r1 »

Code is :

Code: Select all

 
#sexBAN
set redirectchan "#sex"
proc sex_ban { nick uhost hand chan text } {
global botnick redirectchan
set banmask *![getchanhost $text $chan]
if {[onchan $text]} {
putquick "MODE $chan +b $banmask$redirectchan"
putquick "KICK $chan $text This is not a sex channel"
  } else { putserv "PRIVMSG $chan :$text Is Not In The Channel" }
}
and didn't work eggdrop is 1.6.21
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

I believe the redirect only affects users trying to join after the ban has been set and is active on the channel.

Your script is setting a ban on a user already in the channel.
The kick is removing the user from the channel, Not the redirectban:)
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
h
h1x0r1
Voice
Posts: 5
Joined: Wed Jan 22, 2020 5:45 am

Post by h1x0r1 »

I'm so sorry for disturbing you.
Code is working fine but i forgot the fact user who sets redirect ban need to be operator not only in first channel. Need to be operator in redirectchan also !

Thanks for the help again!
Post Reply