mIRC Home    About    Download    Register    News    Help

Print Thread
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.

Joined: Jan 2004
Posts: 509
L
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

Joined: Jan 2004
Posts: 509
L
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.


Joined: Aug 2004
Posts: 7,252
R
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.


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.

Joined: Jan 2003
Posts: 3,012
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
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 *?

Joined: Nov 2006
Posts: 1,559
H
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


Link Copied to Clipboard