mIRC Homepage

Help on making a new script

Posted By: thenewguy

Help on making a new script - 03/02/11 01:25 AM

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
Posted By: Riamus2

Re: Help on making a new script - 03/02/11 02:21 AM

/help on text

It even comes with examples.
Posted By: NufSaid

Re: Help on making a new script - 05/02/11 09:22 PM

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
Posted By: FroggieDaFrog

Re: Help on making a new script - 06/02/11 12:26 AM

*cough cough*
Code:
on *:TEXT:*:#YourChannel:{
  if ($regex($1-,/\bGood Morning\b/Si)) {
    msg # Good Morning :)
  }
}
Posted By: RusselB

Re: Help on making a new script - 06/02/11 02:50 AM

Code:
on $*:TEXT:/\bGood Morning\b/Si:#mIRC_Scripting:{
  msg # Good Morning :)
}
Posted By: Tomao

Re: Help on making a new script - 06/02/11 03:42 AM

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 :)
}
Posted By: RusselB

Re: Help on making a new script - 06/02/11 05:11 AM

Well, considering that's the first regex that I've written that worked the first time, it's a step in the right direction.
Posted By: NufSaid

Re: Help on making a new script - 06/02/11 02:03 PM

Nice work guys looks great for what he wants
Posted By: NufSaid

Re: Help on making a new script - 06/02/11 02:28 PM

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
}
}
Posted By: FroggieDaFrog

Re: Help on making a new script - 06/02/11 02:44 PM

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>
Posted By: Tomao

Re: Help on making a new script - 06/02/11 10:19 PM

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.
Posted By: thenewguy

Re: Help on making a new script - 15/02/11 06:51 PM

Wow people thank you very much
© 2022 mIRC Discussion Forums