0

I'm trying to make a script that will automatically says "see you later" as soon as one specific handle in a channel says the words "going home". I tried to do it on my own but got lost. Could anyone help me out?

Kefka
  • 1,655
  • 2
  • 15
  • 25
  • mIRC's Help File has examples for almost every scripting event. I used it nearly exclusively when learning mIRC-Script. – drudge Nov 09 '10 at 23:30

2 Answers2

1
on *:TEXT:going home:#:{ msg $chan see you later }

Note that this would only pick up "going home", not "I'm going home". You would need to add more to it, like making it *going home* or something of the sort.

corsiKa
  • 81,495
  • 25
  • 153
  • 204
  • do I replace the * with the username? like bob:TEXT:going home:#:{ msg $chan see you later } – Kefka Nov 09 '10 at 23:25
  • 1
    you may want to change it to `*going home*` otherwise it will ONLY match if the person types "going home" without ANYTHING before or after. – drudge Nov 09 '10 at 23:25
  • the first asterisk (`on *:`) refers to the userLevel. if you only want it to trigger for a specific user, use: `#:{ if ($nick == Bob) msg $chan see you later $nick ! }` – drudge Nov 09 '10 at 23:26
  • this goes in remote.ini and doesn't have to be activated somehow, does it? I can't make it work – Kefka Nov 09 '10 at 23:32
  • Yes, this goes into the Remote tab of your Scripts editor. It won't trigger from your own input. – drudge Nov 09 '10 at 23:41
  • okay I think its almost working with on *:TEXT:*going home*:#:{ msg $chan later } , but how do I change this to only respond to a user named Sprig, for example? – Kefka Nov 09 '10 at 23:48
  • @Matt: My comment above covers that. – drudge Nov 10 '10 at 00:47
  • @jnpcl I agree - that's what I meant to do in my original answer. It came out italicized instead of having asterisks around it. :) – corsiKa Nov 10 '10 at 01:19
1

The script below should get you started with mIRC scripting. It works with private message as well as an channel message (going home).

on *:text:*going home*:#,?: {
  if ($chan) { !var %target = $chan }
  else { !var %target = $nick }  
  if ($nick == sprig) || ($nick == Bob) { !msg %target see you later }
}

You could also use !var %target = $iif(($chan),$chan,$nick) instead of having the first two lines. The #,? means the on text event is happening in a channel (#) or a private message (?). To send a private message use the /msg command. The command prefix ! makes the script run the client version of the command opposed to a scripted overwrite of the command alias msg echo -a You've overwritten /msg command for example will prevent you from being able to use the /msg command which you do not want. Incase it has been overwritten I prefix most command calls with ! to ensure some of my data is not intercepted by an overwrite. The || between the if calls means or as if nick is sprig or if nick is bob (|| = or).

bauderr
  • 47
  • 10