mIRC Home    About    Download    Register    News    Help

Print Thread
#171220 21/02/07 09:30 AM
Joined: Feb 2007
Posts: 3
O
Self-satisified door
OP Offline
Self-satisified door
O
Joined: Feb 2007
Posts: 3
I have this code:

Php Code:
on @*:TEXT:*shit*:#: { 
  IF (($nick !isop $chan) && ($nick !isvo $chan)) { 
	ban $chan $nick 3 
	kick $chan $nick Do Not Say That Word 
	notice $nick Please refrain from swearing in $chan again. 
	msg $chan $nick has been warned about swearing in $chan again. 
  } 
} 


This only works if a non-op says it. I want it to work ONLY if a op says it. How can i do that? (Okay, i'm changing the script, i'm not going to ban myself)

OnTheFly #171223 21/02/07 09:48 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
on @*:TEXT:*shit*:#: { 
  if ($nick isop $chan) { 
    ban $chan $nick 3 kick $chan $nick Do Not Say That Word 
    notice $nick Please refrain from swearing in $chan again. 
    msg $chan $nick has been warned about swearing in $chan again. 
  } 
} 


Matching *shit* is the worst possible way of detecting a swearword.

<user> pushit over the edge.

hixxy #171232 21/02/07 02:10 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You combined 2 lines there:

Code:
on @*:TEXT:*shit*:#: { 
  if ($nick isop $chan) { 
    ban $chan $nick 3
    kick $chan $nick Do Not Say That Word 
    notice $nick Please refrain from swearing in $chan again. 
    msg $chan $nick has been warned about swearing in $chan again. 
  } 
} 


Of course, he could just use the -k option to kick with the ban line. And using the -u option to automatically unban the user after a period of time is a good idea as well.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #171238 21/02/07 06:08 PM
Joined: Feb 2007
Posts: 3
O
Self-satisified door
OP Offline
Self-satisified door
O
Joined: Feb 2007
Posts: 3
I'm totally new to mirc scripting. And i wonders how to change this:

Php Code:
on @*:TEXT:*shit*:#: { 


So it works only for Ops.

OnTheFly #171239 21/02/07 06:18 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The @ symbol in that line means that the code will only be processed if the client running the code has ops in the channel.

Riamus posted the full code that you're looking for. There is no need to change that line, but a second check to see if the nick that used the word is an op (or not) is required (again, per Riamus' code).

RusselB #171240 21/02/07 06:34 PM
Joined: Feb 2007
Posts: 3
O
Self-satisified door
OP Offline
Self-satisified door
O
Joined: Feb 2007
Posts: 3
Sorry if i explained bad, but i'm just learning mirc scripting, and i wanted to do something like a very simple bot. And i wonders if i can use this code to make me (the op) send a word (!bot) and it do something.

OnTheFly #171242 21/02/07 07:33 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
And, as per my example, you can do that:

Code:
on @*:TEXT:*trigger*:#: { 
  if ($nick isop $chan) { 
    do whatever here
  }
}


Replace *trigger* with the trigger you want to use, such as !bot, and put what you want it to do where I showed you.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #171248 21/02/07 08:18 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
So I did. It's because the PHP tags on this board don't preserve linebreaks when you copy/paste from them, like the code tags used to behave.


Link Copied to Clipboard