mIRC Home    About    Download    Register    News    Help

Print Thread
ban user from using text command #183549 20/08/07 09:17 PM
Joined: Feb 2007
Posts: 91
S
spermis Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2007
Posts: 91
How to ban user from using ONTEXT command that is available for all users? I need that it saves banned users on .hsh ot .txt file.
So if i type !ban nick2 it will ban nick2 from using ontext command, and if the ontext command is !add and banned user uses it, it shows - You are banning from using this command, and if user is not banned it do what it should do. Hope you understand.

Re: ban user from using text command [Re: spermis] #183550 20/08/07 09:42 PM
Joined: Jan 2004
Posts: 509
L
LostShadow Offline
Fjord artisan
Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Originally Posted By: spermis
How to ban user from using ONTEXT command that is available for all users?


/help on text

Originally Posted By: spermis
I need that it saves banned users on .hsh ot .txt file.


/help /write

Originally Posted By: spermis
So if i type !ban nick2 it will ban nick2 from using ontext command, and if the ontext command is !add and banned user uses it, it shows - You are banning from using this command, and if user is not banned it do what it should do. Hope you understand.


/help on input

Re: ban user from using text command [Re: spermis] #183551 20/08/07 09:49 PM
Joined: Jan 2004
Posts: 509
L
LostShadow Offline
Fjord artisan
Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Originally Posted By: spermis
How to ban user from using ONTEXT command that is available for all users?


on @*:text:*badword*:#: /echo $chan zomg, $nick said *badword* | /ban $chan $nick 2

Originally Posted By: spermis
I need that it saves banned users on .hsh ot .txt file.


(continued)
| /write bannicks.txt $nick

Quote:
So if i type !ban nick2 it will ban nick2 from using ontext command,


No, use /ban or /b nick for an alias. ! is unnecessary.


Re: ban user from using text command [Re: LostShadow] #183559 20/08/07 11:36 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
My recommendation is to use User Levels and the ! suffix to restrict who can use the command.
Quote:
The ! suffix

You can prevent commands for a certain event level from being processed by using the ! suffix.

ctcp 5:PING:*:echo PING!

ctcp 5:*:*:!

The ! at the end of the line tells the remote to halt any further processing of level 5 commands.


Re: ban user from using text command [Re: LostShadow] #183666 21/08/07 05:35 PM
Joined: Feb 2007
Posts: 91
S
spermis Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2007
Posts: 91
Originally Posted By: LostShadow
Originally Posted By: spermis
How to ban user from using ONTEXT command that is available for all users?


on @*:text:*badword*:#: /echo $chan zomg, $nick said *badword* | /ban $chan $nick 2

Originally Posted By: spermis
I need that it saves banned users on .hsh ot .txt file.


(continued)
| /write bannicks.txt $nick

Quote:
So if i type !ban nick2 it will ban nick2 from using ontext command,


No, use /ban or /b nick for an alias. ! is unnecessary.


no no.. it is good command, you can use it when you want, but if i want that some user cant use that command i type !ban user and he cant use it.

Re: ban user from using text command [Re: spermis] #183675 21/08/07 07:09 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Set your event to 1 user level (e.g. on 1:TEXT:...) if you have them as *, then add a command such as this to limit them:

Code:
on 1:TEXT:!ban &:#: {
  if ($level($nick) != 0) {
    /auser 0 $nick
    /msg $chan $nick has been banned from using text commands.
  }
  else /msg $chan $nick already in ban list.
}
on 1:TEXT:!unban &:#: {
  if ($level($nick) == 0) {
    /ruser $nick
    /msg $chan $nick was removed from the ban list.
  }
  else /msg $chan $nick not in the ban list.
}


They are not stored in a txt or hsh, but in the userlist instead (those with a 0:* are banned). Usage: !ban KingTomato to ban me; likewise, !unban KingTomato to unban me.


-KingTomato
Re: ban user from using text command [Re: KingTomato] #183679 21/08/07 07:50 PM
Joined: Feb 2007
Posts: 91
S
spermis Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2007
Posts: 91
oh so 1 means just like *?

Re: ban user from using text command [Re: spermis] #183686 21/08/07 08:44 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
* means: all levels > every user.
1 is the default level (if you did not change this)

As the script will set level "0" for "banned" users, their level is below "1", thus they cannot use the command.
... /help access levels smile