0

I've noticed a big lack in documentation from mIRC scripting abilities so I apologize if I've missed something but I've been searching everwhere.

Basically, I have an on event when someone says something, I need to get there entire message, how is this possible? I've managed to discover $1- however this only grabs the text from what the event triggered from to the end, I need the entire message, is this possible?

Tazmanian Tad
  • 193
  • 1
  • 2
  • 12
  • Please show your current code. Also, please given an example of a message, and what you want out of it. – Daedalus Oct 18 '12 at 00:49
  • I haven't written the code yet but basically what I need is this: john: Hello I need help with this <-- persons message $1- would return I need help with this, I need to get the entire message: Hello I need help with this – Tazmanian Tad Oct 18 '12 at 00:59

2 Answers2

2

This is actually pretty simple, although maybe you're on an earlier version of mirc, if the documentation is lacking:

on *:TEXT:*I need help with*:#channel: {
  msg $chan $1-
}

$1- will always contain the full message. $# are space-delimited identifiers, so if your message is john: I need help with etc, $1 will contain john:, and $2 will contain I, and so on and so-forth. Adding the dash means 'this and everything onwards'. Since your match text is 'everything before I need help with and everything after, this code will always contain the full text.

The code above, in case it is not obvious, will message the channel the event triggered on with the full message text. Whatever you do with the text is up to you; it's just an example.

Daedalus
  • 7,586
  • 5
  • 36
  • 61
0

/dbg

alias dbg {
  if !$debug {  debug -i d dbg  }
  if $regex($1-,/.+!.+@.+.PRIVMSG.#.+:.+/g) {
    echo 4 -s $* 
  }
}

$1- or $1

CoCoRiCo
  • 1
  • 2
  • 2
    While this code may answer the question, providing additional context regarding _why_ and/or _how_ this code answers the question would significantly improve its long-term value. Please [edit] your answer to add some explanation. – Toby Speight Mar 15 '16 at 13:28