mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
There's a difference between the getUser($chan,$nick) you used and

$getUser($chan,$nick)

Without the dollar, mIRC thinks you're trying to execute an alias name getUser($chan,$nick) without passing any parameters to it.


Unless there's something that twitch servers handle differently than mIRC, I can't see why an IRC server doesn't recognize NOTICE as a 'real' command that lets irc clients send non-query communications to each other, or why asking the server to do a /whois on someone would be related to whispering something to them.

I've been explaining things as if twitch were just an interest-group happening to also be using mirc. But from looking at a website describing the twitch interface, it appears that any advice you need related to your mirc's interaction with a twitch server might need to come from another twitch user. However, the reason why getUser($chan,$nick) without the dollar is a syntax error is an internal mirc issue that has nothing to do with using a twitch server or a standard server.

If you go somewhere like irc.freenode.net you'll see that "//notice $me test" is a real command. Whether it's also real at a twitch server is something else.

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
I took it most people used mirc with twitch (which is why I bought it originally), but I guess you just wrote a lot that just means "I have no idea why the notice command is doing that".

Here is the relevant code that should be working, but viewers report receiving no whispers. What could possibly be going wrong?

Code:
on *:join:#:{
  if ($nick != ignorednick) {
    var %here_before = $getUser($chan,$nick)
    var %setone = 1
    if (%here_before != 1 || %here_before == $null) {
      .msg /w $nick I am darthclide's bot, let me know if you received this whisper
      var %receive_return = $setUser($chan,$nick,%setone)
    }
  }
}

alias -l getUser {
  var %chan = $$1
  var %user = $$2
  var %boolvalue = $readini(UserList.ini,n,%chan,%user)

  if (%boolvalue == 1) {
    return %boolvalue
  }
  else {
    return 0
  }
}
alias -l setUser {
  var %chan = $1
  var %user = $2
  var %settrue = $3
  var %checkvalue = $readini(UserList.ini,n,%chan,%user)

  if (%checkvalue != 1 || %checkvalue == $null) {
    writeini -n UserList.ini %chan %user %settrue
    return %settrue
  }
}

Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
I never bothered to learn how to script whispers with mIRC. SReject already did it and made his script available publicly. Simply install mTwitch.Core.mrc. You're done. You can now send and receive whispers using the standard IRC format of /msg. https://github.com/SReject/mTwitch

Joined: Jan 2017
Posts: 57
Babel fish
Offline
Babel fish
Joined: Jan 2017
Posts: 57
Quote:
What could possibly be going wrong?

I think the problem is the "on Join" bit.

I've never seen anyone else's name but that of my bot in the users list.
Try a small test code to at least make sure the whispers work, such as
Code:
on *:TEXT:!test:#: {
  msg $chan /w $nick This is an automated bounceback. Thanks for checking with me!
}

I think this is what you might be having trouble with, but as you can see, I'm not even one year old in mIRC. I'm just relaying the troubles I've had as a Twitch streamer.

Joined: Jan 2017
Posts: 57
Babel fish
Offline
Babel fish
Joined: Jan 2017
Posts: 57
I believe that what you are trying to do is somewhat similar to what I tried to do when I first started coding. When I realized that the "on Join" wasn't working for me, then I made this script to serve my purpose.
When I have something new I want to say, then I just type "!update 0.5 I added some stuff.", and the next time someone chats in my channel, it whispers them "Welcome to StreamBot v0.5! Changelog: I added some stuff."
Code:
on *:TEXT:!update*:#: {
  if ($nick == kuboskube) {
    set %Version $$2
    set %Changelog $$3-
  }
}

on *:TEXT:*:#: {
  if (%Version. [ $+ [ $nick ] ] != $null && %Version. [ $+ [ $nick ] ] == %Version) {
    goto VersionChecked
  }
  set %Version. [ $+ [ $nick ] ] %Version
  msg $chan /w $nick Welcome to StreamBot v [ $+ [ %Version ] $+ [ ! ] ] Changelog: %ChangeLog
  :VersionChecked
}

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
So you guys know, the code is activating just fine now. My UserList is updating correctly. So thankfully it is not an "on join" issue (but depending on what twitch does I might have to change it to "on text")

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
However, the whispers are still not working. But about SReject's code: You say that I can use /msg to send whispers, but that is the command I use to send messages globally for everyone to see in chat? And looking at the mTwitch.Core.mrc code, I do not see any alias anywhere called /msg What exactly does that code do? And how do I send whispers with it?

Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
Originally Posted By: darthclide
However, the whispers are still not working. But about SReject's code: You say that I can use /msg to send whispers, but that is the command I use to send messages globally for everyone to see in chat? And looking at the mTwitch.Core.mrc code, I do not see any alias anywhere called /msg What exactly does that code do? And how do I send whispers with it?

You would just do:
Code:
/msg username message

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
So... Due to testing with KubosKube, we discovered we can only send whispers between our bots and ourselves. For example:
KubosKube <-> KubosKubot
darthclide <-> Darth_Bot

But whispers do not work for anyone else. Can you or anyone please tell me what hidden piece of mirc is causing this to happen?

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
As part of twitch's spam protection, by default, a user has to be following the user/bot for them to receive whispers that from that user/bot. That is: For UserA to receive whispers from UserB, UserA must be following UserB.

Users can toggle this in their setting: https://www.twitch.tv/settings/security

Last edited by FroggieDaFrog; 11/06/17 08:52 AM.

I am SReject
My Stuff
Joined: Jan 2017
Posts: 57
Babel fish
Offline
Babel fish
Joined: Jan 2017
Posts: 57
Hey Darthclide,
I signed my bot(KubosKubot) up for 2-Factor Auth, and some folks say that whispers can't be sent from a bot unless the bot is whispered first. Maybe that's our issue? Next time you're online, I'll whisper your bot and we'll see if that works. I only mention this because perhaps in our efforts to ensure our bots work(like a responsible coder should), perhaps we opened the figurative window on accident for our bots to send us whispers, and since we only need open the window once, we haven't noticed the "pattern".

I know this is a janky workaround, but any workaround is better than no workaround.

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
Hmmm, this is definitely not what I wanted. There has to be some mirc wizard who figured this out. If on twitch.tv I can send a whisper to a user I never wrote to before (as I proved true with Kubos), then there is absolutely no reason why a bot can't do the same.

If anyone wants to continue using my channel as a guinea pig, please do so. I want this experience to help others too.

Joined: Jan 2017
Posts: 57
Babel fish
Offline
Babel fish
Joined: Jan 2017
Posts: 57
The pattern other users devised was that Twitch does not allow IRC connections to open the figurative two-way door of whispers.

I feel as if the solution to our problem(making the bot speak first through a whisper), as much as we joked about it, may ironically be with sockets. sick

If a socket wizard could make a script to send a whisper in a more human way than IRC, then I'll bet Twitch would let it open a new whisper-chat as if by human.

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
It does indeed Kubos. If we can somehow fake twitch into thinking the bot is a human, then I think our problem is solved.

On a related note, I am sending 3 unique whispers one after another with my script. As long as I am not being raided, twitch won't ban me for sending 3 whispers at once will they? Or would it be a better idea to add a 1 second delay between each one?

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
So anybody out there who is a master with mirc want to help us out? I am sure somebody has the skills to help us get our whispers working properly.

Kubos is content with getting his bot to receive whispers, but I need my bot to send whispers. Both of us are curious about how to do this.

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
Still no takers for the challenge? I would be willing to pay a little money for someone who can figure this out.

Joined: Jul 2016
Posts: 28
Z
Ameglian cow
Offline
Ameglian cow
Z
Joined: Jul 2016
Posts: 28
Is this for Twitch? Because if it is for Twitch, please read the following https://discuss.dev.twitch.tv/t/have-a-chat-whisper-bot-let-us-know/10651

Last edited by zapdos26; 02/07/17 03:14 PM.
Page 2 of 2 1 2

Link Copied to Clipboard