mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2006
Posts: 2
M
matrael Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
M
Joined: Oct 2006
Posts: 2
Hello

I tried doing a search on this topic but wasn't able to find a result within this forum. I'm really new to mIRC scripting and I've tried looking throughout the Help file that comes with the program as well as trying to locate it on the internet. I probably am searching for it incorrectly. Anyways, on to the pont:

I'm trying to write a script that will scan the text in a certain channel to see if a specific user says something in specific and then provide a response to that.

For instance (pseudo-code):

Code:
If Newbie says "help?" in channel #help, then respond in channel with "I've told you already, read the FAQ"


Does that make sense? I appreciate any help you guys can provide. I've been messing with putting an if clause within an ON 1:TEXT: event to try and detect the correct nick and then respond with a /msg $chan "text", but can't get the logic correct. Thanks in advance for any suggestions you have smile

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Example code only:
Code:
 on *:text:*:#:{
if $read(instructions.txt,n,$1) {
.msg $chan $read(instructions.txt,nw,$1)
}
}
 

In the text file instructions.txt you might have entries like

help I've told you already, read the FAQ
opme If you were entitled to ops here, you would have them

Joined: Oct 2006
Posts: 2
M
matrael Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
M
Joined: Oct 2006
Posts: 2
Thank you for the help. I'll give it a try using that method. Thanks again smile

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
try this untested script the first check sees if help isin word 1 through 4 and %nick is not found to msg that channel to say to nick to read FAQ, then if they do it again "I thought i told you to read etc..." and in the third check its goodbye for 5mins if ur op

on *:TEXT:*:#:{
if (help isin $1-4) && (!$+(%,%nick)) {
$+(%,%nick) = 1 | msg $chan $nick $+ , please read our FAQ
}
elseif (help isin $1-4) && ($+(%,$nick) == 1) {
msg $chan $nick $+ , I thought I told you to read our FAQ. | $+(%,$nick) = 2
}
elseif (help isin $1-4) && ($+(%,$nick) == 2) && ($me isop $chan) {
ban -ku300 $nick
}
}

On *:part:#:{ if ($+(%,$nick)) { unset $+(%,$nick) } }
On *:quit:{ if ($+(%,$nick)) { unset $+(%,$nick) } }


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }

Link Copied to Clipboard