mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2014
Posts: 16
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Mar 2014
Posts: 16
I have checked through previous posts both here and on twitch but no success. None say what I need to know.

My client receives whispers but they only appear in the debug.log as something like:

Quote:
<- @badges=;color=#FF4500;display-name=IndieBob;emotes=;message-id=70;thread-id=52103932_102974315;turbo=0;user-id=52103932;user-type= :indiebob!indiebob@indiebob.tmi.twitch.tv WHISPER robonicorn :I am whispering you buddy!


Where indiebob is the sending user name and robonicorn the mirc client name.

I can't work how I intercept these messages with an mIRC script. Any suggestions?

Last edited by davethejackal; 22/06/16 10:49 PM.
Joined: Jan 2004
Posts: 1,352
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,352
These are available via $msgtags, I believe SReject has normalization for whispers:

https://github.com/SReject/mTwitch
https://github.com/SReject/mTwitch/search?utf8=%E2%9C%93&q=whisper

Joined: Mar 2014
Posts: 16
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Mar 2014
Posts: 16
I think that uses JSON to get the IP to connect to the twitch group servers which isn't how it works these days AFAIK. I just need to know how to handle the incoming message. Surely there's just some ON event message I'm not doing right?

EDIT: AH wait saw the second link. Will check it out laugh

Last edited by davethejackal; 23/06/16 12:18 AM.
Joined: Mar 2014
Posts: 16
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Mar 2014
Posts: 16
Sadly it doesn't work. frown

MSL points to the start of the word PARSELINE and says "Erroneous On Event Block. Misspelled even name?".

Last edited by davethejackal; 23/06/16 12:43 AM.
Joined: Jan 2004
Posts: 1,352
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,352
Are you using an old version?

Joined: Apr 2010
Posts: 966
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 966
For whispers, you'll only need mTwitch.Core.mrc

It *does* attempt to get a list of ips/servers but if that fails it falls back to testing against known twitch servers such as: tmi.chat.twitch.tv, irc.chat.twitch.tv, irc.twitch.tv, tmi.twitch.tv

Secondly, the requirements for those scripts is using mIRC v7.43 or later and having my JSON parser loaded.


--

If instead you JUST want the whisper support you can use the following code; again, you'll need mIRC v7.43 or later. (pulled straight from mTwitch.Core.mrc and slightly edited to use literal server matching)

Code:
;; Converts incoming twitch whispers to private queries
;; Use on TEXT(/help on TEXT) or on OPEN(/help on OPEN) events to handle the event
on $*:PARSELINE:in:/^((@\S+ )?)(\x3A[^!@ ]+![^@ ]+@\S+) WHISPER (\S+) (\x3A.*)/i:{
  var %Count  = $regml(0)
  var %Tags   = $regml($calc(%Count -3))
  var %User   = $regml($calc(%Count -2))
  var %Target = $regml($calc(%Count -1))
  var %Msg    = $regml(%Count)
  if ($regex($server, /^(tmi|irc)\.(chat\.)?twitch\.tv$/i) && $me == %target) {
    .parseline -it
    .parseline -itqp %Tags %User PRIVMSG $me %Msg
  }
}

;; Converts outbound private queries into twitch whispers
on $*:PARSELINE:out:/^PRIVMSG ([^#]\S*) \x3A(.+)$/i:{
  var %Target = $regml(1)
  var %Msg    = $regml(2)
  if ($regex($server, /^(tmi|irc)\.(chat\.)?twitch\.tv$/i)) {
    .parseline -otn PRIVMSG jtv :/w $lower(%Target) %Msg
  }
}

Last edited by FroggieDaFrog; 23/06/16 07:07 AM.

I am SReject
My Stuff
Joined: Mar 2014
Posts: 16
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Mar 2014
Posts: 16
mSL still reports it as an error.... but it now works so thanks a lot! laugh I have outgoing whispers working already!


Link Copied to Clipboard