mIRC Home    About    Download    Register    News    Help

Print Thread
#229398 03/02/11 01:25 AM
T
thenewguy
thenewguy
T
What do I want to do?
A script where for example someone types something in the channnel window and then automatically, I type something back.

For example: Someone: Good Morning
Me (inmediately): Good Morning

I have been trying to read guides abouty remote script (which is the way to go on this script, and still no luck on getting my script working.

Thanks

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
/help on text

It even comes with examples.

N
NufSaid
NufSaid
N
on *:TEXT:*:#: {
if ( Good Morning isin $strip($1-)) {
/MSG # Good Morning $nick
}
}
really kinda simple just make a few changes for a new response

on *:TEXT:*:#: {
if ( Good Morning isin $strip($1-)) {
/describe # Good Morning $nick
}
}
to reply in purple
or even more complex for exact spelling responce use this one

on *:TEXT:*:#: {
if (* Good Morning * iswm X $strip($1-) X) {
/MSG # Good Morning $nick
}
}
this one has to be exact spelling
the ones above can get away with misspell
like good morningg
and the script will response

And add another line and you can get it to pm you who an on what channel said Good Morning

on *:TEXT:*:#: {
if (* Good Morning * iswm X $strip($1-) X) {
/MSG # Good Morning $nick
/msg $me 4 $nick at $timestamp $day $adate said $strip($1-) on $chan
}
}
you can add anothe line an have it send all the info to your logs it can go on forever lol have fun
Ferrellhodges@yahoo.com

Last edited by NufSaid; 05/02/11 09:51 PM.
Joined: Apr 2010
Posts: 964
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 964
*cough cough*
Code:
on *:TEXT:*:#YourChannel:{
  if ($regex($1-,/\bGood Morning\b/Si)) {
    msg # Good Morning :)
  }
}

Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
Code:
on $*:TEXT:/\bGood Morning\b/Si:#mIRC_Scripting:{
  msg # Good Morning :)
}

Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
Nice thinking, RusselB on making the regex as an on text match. Though you may want to improve it a bit:
Code:
on $*:text:/(( |^)(Good Morning)\b)/Si:#mIRC_Scripting:{
  .msg # $regml(1) $+ , $nick :)
}

Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
Well, considering that's the first regex that I've written that worked the first time, it's a step in the right direction.

N
NufSaid
NufSaid
N
Nice work guys looks great for what he wants

N
NufSaid
NufSaid
N
to add more do it like this. with help from the others.By the way RusselB i did like yours better smile here are some example to play with
enjoy add as many as u like on same script

on *:TEXT:*:#:{
if ($regex($1-,/\bGood Morning\b/Si)) {
msg # Good Morning $nick smile
msg $me 4 $nick at $timestamp $day $adate said $strip($1-) on $chan
}
if ($regex($1-,/\bHows Everyone\b/Si)) {
msg # Everyone is great here $nick smile
msg $me 4 $nick at $timestamp $day $adate said $strip($1-) on $chan
}
if ($regex($1-,/\bhello channel\b/Si)) {
msg # Hello an welcome $nick smile
msg $me 4 $nick at $timestamp $day $adate said $strip($1-) on $chan
}
if ($regex($1-,/\bhello everyone\b/Si)) {
msg # Hello $nick an welcome smile
msg $me 4 $nick at $timestamp $day $adate said $strip($1-) on $chan
}
}

Last edited by NufSaid; 06/02/11 04:42 PM.
Joined: Apr 2010
Posts: 964
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 964
ya know, if you surround your code with <code>codehere</code> where <>'s are actually []'s, it will preserve spacing and put it in a nice little block smile
<code>
Code:
  like so
</code>

Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
The way you do it, you're gonna look at a big remote with a massive amount of if statements over a period of time. Regex can match multiple words within its matching pattern. It does not limit itself to just one word.

T
thenewguy
thenewguy
T
Wow people thank you very much


Link Copied to Clipboard