mIRC Homepage
Posted By: giannis123 Action Script - 12/10/06 07:06 AM
Is there any script tha does the following:
on NICK action something
ME action something else
on NICK says something
ME says somethingelse

p.x.
NICK goes to bed
ME is comming with you smile
<NICK> Hello!
<ME> Hello!
grin
Posted By: Crash_N_Burn Re: Action Script - 12/10/06 07:48 AM
yes, basicly is this:

Code:
 

on *:TEXT:Hi:#:{
.msg $chan Hi you there!
}

 



Its works when someone say in the channel the "Hi" word, you or your bot will say on the channel Hi you there!.
You can remove or change the return message and the Hi by whatever you want. Basicly is this but for more information check on the mIRC Help File, the On Text section!

Thats all

*
Posted By: Riamus2 Re: Action Script - 12/10/06 02:43 PM
As for the action text, you need to use on ACTION instead of on TEXT.

/help on action

Example:
Code:
on *:action:*trout*:#: {
  me slaps $nick back with a trout.
}


Keep in mind that the example I gave above can cause you to be flooded off if both of you have similar slap back scripts loaded. So be careful how you use such response scripts.
Posted By: o0Chris0o Re: Action Script - 26/10/06 07:52 AM
hey guys..I am having problems getting this to work...it was working..then it wasn't can someone help me out ?

Code:
 on *:TEXT:night:#:{$me msg # 4G5ood09 4N5ight $nick :) }
on *:TEXT:goodnight:#:{$me msg # 4G5ood09 4N5ight $nick :) }
on *:TEXT:nite:#:{$me msg # 4G5ood09 4N5ight $nick :) }
on *:TEXT:nn:#:{$me msg # 4G5ood09 4N5ight $nick :) } 
Posted By: Sam_Hamwich Re: Action Script - 26/10/06 10:55 AM
Should that be "/me"?
Posted By: Riamus2 Re: Action Script - 26/10/06 03:34 PM
Remove $me from there. It's not necessary.

Code:
on *:TEXT:night:#:{ msg # 4G5ood09 4N5ight $nick :) }
on *:TEXT:goodnight:#:{ msg # 4G5ood09 4N5ight $nick :) }
on *:TEXT:nite:#:{ msg # 4G5ood09 4N5ight $nick :) }
on *:TEXT:nn:#:{ msg # 4G5ood09 4N5ight $nick :) } 


Also, keep in mind that you can merge these all into one on text event if you want to:

Code:
on *:TEXT:*:#:{
  if ($1- == night || $1- == goodnight || $1- == nite || $1- == nn) {
    msg $chan 4G5ood09 4N5ight $nick :)
  }
}
Posted By: Riamus2 Re: Action Script - 26/10/06 03:36 PM
Quote:
Should that be "/me"?


No. Even if he wanted to do an action, you use "describe" in a script instead of "me".

Example:
alias test { describe $active laughs. }

Use (in a channel or query):
/test
Posted By: o0Chris0o Re: Action Script - 26/10/06 10:19 PM
ahhh thanks Riamus adding it to one is much better thanks for the head up
Posted By: o0Chris0o Re: Action Script - 26/10/06 10:20 PM
what if I add good night with a space? can that be done?
Posted By: o0Chris0o Re: Action Script - 26/10/06 10:49 PM
also when someone says talk to you guys later nn or nn so in so....it doesn't work
Posted By: Riamus2 Re: Action Script - 27/10/06 02:49 AM
If you want it to trigger whenever a word or phrase is in the text, then use isin.

if (night isin $1-) { do this }

Keep in mind that someone could just be using the word and not meaning it for a goodnight, so it could be a problem. Also, "nn" can be part of a word. To prevent that, you could do something like:

if ($istok($1-,nn,32 ) || $istok($1-,nn!,32) || $istok($1-,nn.,32)) { do this }

That should give you enough to build on. If you have trouble, just paste what you've made and we'll help with that.
Posted By: o0Chris0o Re: Action Script - 27/10/06 06:21 AM
Code:
 if ($istok($1-,nn,32 ) || $istok($1-,nn!,32) || $istok($1-,nn.,32)) { do this }
 


alright how would I use that with all of the "goodnight, good night, night, nn" commands? keeping it in one simplfied code?
Posted By: Riamus2 Re: Action Script - 27/10/06 09:34 PM
The nn part is the only part that really needs the $istok. The rest should be fine with the isin example. Just checking for night is enough for "goodnight", "good night", and "night".

To put the 2 together:

Code:
if ($istok($1-,nn,32 ) || $istok($1-,nn!,32) || $istok($1-,nn.,32) || night isin $1-) { do this }


As I said, someone could still just mention night in what they are saying. There is no real way to prevent that from triggering the script if you are going to allow it to be anywhere in the line.

Example:
This night is very cold.

There isn't a good way for the script to know that it shouldn't trigger for that unless you limit where it accepts the word night/goodnight/good night. It's usually best to have it just accept it if that's the only thing on the line.

Also, be warned that some people love to flood bots that respond to commands. Once someone knows your bot responds to that trigger, they can just keep typing it until your bot is flooded off the server. Protections for that would be wise.
© mIRC Discussion Forums