mIRC Home    About    Download    Register    News    Help

Print Thread
Help on making a new script #229398 03/02/11 01:25 AM
Joined: Feb 2011
Posts: 2
T
thenewguy Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
T
Joined: Feb 2011
Posts: 2
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

Re: Help on making a new script [Re: thenewguy] #229400 03/02/11 02:21 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
/help on text

It even comes with examples.


Invision Support
#Invision on irc.irchighway.net
Re: Help on making a new script [Re: thenewguy] #229458 05/02/11 09:22 PM
Joined: Dec 2010
Posts: 23
N
NufSaid Offline
Ameglian cow
Offline
Ameglian cow
N
Joined: Dec 2010
Posts: 23
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.
Re: Help on making a new script [Re: thenewguy] #229459 06/02/11 12:26 AM
Joined: Apr 2010
Posts: 966
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 966
*cough cough*
Code:
on *:TEXT:*:#YourChannel:{
  if ($regex($1-,/\bGood Morning\b/Si)) {
    msg # Good Morning :)
  }
}


I am SReject
My Stuff
Re: Help on making a new script [Re: FroggieDaFrog] #229460 06/02/11 02:50 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on $*:TEXT:/\bGood Morning\b/Si:#mIRC_Scripting:{
  msg # Good Morning :)
}

Re: Help on making a new script [Re: RusselB] #229461 06/02/11 03:42 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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 :)
}

Re: Help on making a new script [Re: Tomao] #229464 06/02/11 05:11 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Well, considering that's the first regex that I've written that worked the first time, it's a step in the right direction.

Re: Help on making a new script [Re: RusselB] #229469 06/02/11 02:03 PM
Joined: Dec 2010
Posts: 23
N
NufSaid Offline
Ameglian cow
Offline
Ameglian cow
N
Joined: Dec 2010
Posts: 23
Nice work guys looks great for what he wants

Re: Help on making a new script [Re: NufSaid] #229470 06/02/11 02:28 PM
Joined: Dec 2010
Posts: 23
N
NufSaid Offline
Ameglian cow
Offline
Ameglian cow
N
Joined: Dec 2010
Posts: 23
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.
Re: Help on making a new script [Re: NufSaid] #229474 06/02/11 02:44 PM
Joined: Apr 2010
Posts: 966
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 966
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>


I am SReject
My Stuff
Re: Help on making a new script [Re: NufSaid] #229484 06/02/11 10:19 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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.

Re: Help on making a new script [Re: thenewguy] #229737 15/02/11 06:51 PM
Joined: Feb 2011
Posts: 2
T
thenewguy Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
T
Joined: Feb 2011
Posts: 2
Wow people thank you very much