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 

Redirect Ban with eggdrop (inspircd)

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


Joined: 22 Jan 2020
Posts: 5

PostPosted: Wed Jan 22, 2020 5:59 am    Post subject: Redirect Ban with eggdrop (inspircd) Reply with quote

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:

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 Wink
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1057

PostPosted: Wed Jan 22, 2020 11:52 am    Post subject: Re: Redirect Ban with eggdrop (inspircd) Reply with quote

Code:

       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 !
Back to top
View user's profile Send private message
h1x0r1
Voice


Joined: 22 Jan 2020
Posts: 5

PostPosted: Wed Jan 22, 2020 3:35 pm    Post subject: Reply with quote

No, the command is $banmask#chan like: *!*ddd@dasd.com#channel
I try with space and didn't work !
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 614
Location: Tennessee, USA

PostPosted: Wed Jan 22, 2020 4:54 pm    Post subject: Reply with quote

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:
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
.
Back to top
View user's profile Send private message Visit poster's website
h1x0r1
Voice


Joined: 22 Jan 2020
Posts: 5

PostPosted: Thu Jan 23, 2020 1:56 am    Post subject: Reply with quote

Thanks for replay!

The change of banmask not working.
Bot didn't put any error in dcc.
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 614
Location: Tennessee, USA

PostPosted: Thu Jan 23, 2020 2:01 am    Post subject: Reply with quote

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
.
Back to top
View user's profile Send private message Visit poster's website
h1x0r1
Voice


Joined: 22 Jan 2020
Posts: 5

PostPosted: Thu Jan 23, 2020 3:52 am    Post subject: Reply with quote

Code is :
Code:
 
#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
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 614
Location: Tennessee, USA

PostPosted: Thu Jan 23, 2020 11:12 am    Post subject: Reply with quote

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
.
Back to top
View user's profile Send private message Visit poster's website
h1x0r1
Voice


Joined: 22 Jan 2020
Posts: 5

PostPosted: Fri Jan 24, 2020 9:37 am    Post subject: Reply with quote

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!
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