mIRC Home    About    Download    Register    News    Help

Print Thread
Ban someone for an invalid text #151771 22/06/06 12:17 AM
Joined: Jun 2006
Posts: 58
S
sas22 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jun 2006
Posts: 58
Ok some my chan has triggers beginning with ! and these triggers are:
!triggers !rules !ddl !list !voiceme !site !peak
people misuse them and add !...(which is not one of our triggers)
How do I ban them for using ! if its not one of our triggers?

Re: Ban someone for an invalid text #151772 22/06/06 01:07 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on @*:text:!*:#:{
if !$istok(!triggers !rules !ddl !list !voiceme !site !peak,$1,32) {
.ban -k $chan $nick Invalid trigger
}
}
 


If there are more triggers than you specified in your post, just add them to the list in the $istok ensuring that each trigger is separated by a space. If you have a lot of triggers that haven't been mentioned, then you might run into difficulties with the line length.

Re: Ban someone for an invalid text #151773 22/06/06 01:17 AM
Joined: Jun 2006
Posts: 58
S
sas22 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jun 2006
Posts: 58
Quote:
Code:
on @*:text:!*:#:{
if !$istok(!triggers !rules !ddl !list !voiceme !site !peak,$1,32) {
.ban -k $chan $nick Invalid trigger
}
}
 


If there are more triggers than you specified in your post, just add them to the list in the $istok ensuring that each trigger is separated by a space. If you have a lot of triggers that haven't been mentioned, then you might run into difficulties with the line length.
It didnt work

Re: Ban someone for an invalid text #151774 22/06/06 02:45 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Ensure that the person/bot that has the script has full ops. The @ in the ON TEXT event means that the code won't work unless the person/bot that has the code has full ops. (/mode <channel> +o <nick>)

Re: Ban someone for an invalid text #151775 22/06/06 02:57 AM
Joined: Jun 2006
Posts: 58
S
sas22 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jun 2006
Posts: 58
Quote:
Ensure that the person/bot that has the script has full ops. The @ in the ON TEXT event means that the code won't work unless the person/bot that has the code has full ops. (/mode <channel> +o <nick>)
Lol I know that.

Re: Ban someone for an invalid text #151776 22/06/06 03:01 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
OK..then I need to know what, if any, error message(s) came up when you tried the code.

Re: Ban someone for an invalid text #151777 22/06/06 03:21 AM
Joined: Jun 2006
Posts: 58
S
sas22 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jun 2006
Posts: 58
Well I tested out the script..and nothing happend Like when msg the chan some false ! triggers that were not in the list nothing happend

Re: Ban someone for an invalid text #151778 22/06/06 03:56 AM
Joined: Oct 2005
Posts: 91
T
truguce Offline
Babel fish
Offline
Babel fish
T
Joined: Oct 2005
Posts: 91
I tested it just as RusselB wrote it and it works just fine.
Quote:
- you were banned from [#truguce] by [truguce]
[20:53] * You were kicked by truguce (Invalid trigger)

You might want to check and see if there is another script conflicting with this one.

Re: Ban someone for an invalid text #151779 22/06/06 04:13 AM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
If you are running the script from your instance of mIRC, you can't trigger it yourself. Someone else has to.

Re: Ban someone for an invalid text #151780 22/06/06 04:14 AM
Joined: Jun 2006
Posts: 58
S
sas22 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jun 2006
Posts: 58
Quote:
If you are running the script from your instance of mIRC, you can't trigger it yourself. Someone else has to.
Yes I have a clone doing the testing..

Re: Ban someone for an invalid text #151781 22/06/06 04:17 AM
Joined: Jun 2006
Posts: 58
S
sas22 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jun 2006
Posts: 58
Quote:
I tested it just as RusselB wrote it and it works just fine.
Quote:
- you were banned from [#truguce] by [truguce]
[20:53] * You were kicked by truguce (Invalid trigger)

You might want to check and see if there is another script conflicting with this one.
Yeah there was thanks everyone

Re: Ban someone for an invalid text #151782 22/06/06 04:48 AM
Joined: Jun 2006
Posts: 58
S
sas22 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jun 2006
Posts: 58
Quote:
OK..then I need to know what, if any, error message(s) came up when you tried the code.
Would it be possible to add a * wilcard in the Delimiter section..like

on *:text:!*:#:{
if !$istok(%cmd,*,32) {
.ban -k $chan $nick Invalid trigger
}
}

So that if anyone where to use it..

Re: Ban someone for an invalid text #151783 22/06/06 07:05 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Not as you're specifying it. The list of valid commands could be stored in a variable (as you show), however, you can't have a wildcard as the token match...While it doesn't have to be $1, in your case that is what I would suggest, since you're wanting to check the triggering command (which is located in $1)