mIRC Home    About    Download    Register    News    Help

Page 2 of 2 < 1 2
Topic Options
#260734 - 09/06/17 07:20 AM Re: Whisper with mirc bot [Re: darthclide]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 966
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.

Top
#260736 - 09/06/17 09:30 AM Re: Whisper with mirc bot [Re: maroon]
darthclide Offline
Babel fish

Registered: 25/06/14
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
  }
}

Top
#260738 - 09/06/17 01:03 PM Re: Whisper with mirc bot [Re: darthclide]
Blas Offline
Vogon poet

Registered: 27/10/15
Posts: 103
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
_________________________
My Twitch mIRC Bot Games and Stuff

Top
#260739 - 09/06/17 01:49 PM Re: Whisper with mirc bot [Re: darthclide]
KubosKube Offline
Ameglian cow

Registered: 31/01/17
Posts: 42
Loc: Central US
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.

Top
#260740 - 09/06/17 02:21 PM Re: Whisper with mirc bot [Re: KubosKube]
KubosKube Offline
Ameglian cow

Registered: 31/01/17
Posts: 42
Loc: Central US
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
}

Top
#260745 - 10/06/17 12:27 AM Re: Whisper with mirc bot [Re: KubosKube]
darthclide Offline
Babel fish

Registered: 25/06/14
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")

Top
#260746 - 10/06/17 12:32 AM Re: Whisper with mirc bot [Re: Blas]
darthclide Offline
Babel fish

Registered: 25/06/14
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?

Top
#260755 - 11/06/17 01:53 AM Re: Whisper with mirc bot [Re: darthclide]
Blas Offline
Vogon poet

Registered: 27/10/15
Posts: 103
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
_________________________
My Twitch mIRC Bot Games and Stuff

Top
#260757 - 11/06/17 05:11 AM Re: Whisper with mirc bot [Re: Blas]
darthclide Offline
Babel fish

Registered: 25/06/14
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?

Top
#260758 - 11/06/17 09:41 AM Re: Whisper with mirc bot [Re: darthclide]
FroggieDaFrog Online
Hoopy frood

Registered: 16/04/10
Posts: 905
Loc: USA
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


Edited by FroggieDaFrog (11/06/17 09:52 AM)
_________________________
I am SReject
My Stuff

Top
#260759 - 11/06/17 03:34 PM Re: Whisper with mirc bot [Re: FroggieDaFrog]
KubosKube Offline
Ameglian cow

Registered: 31/01/17
Posts: 42
Loc: Central US
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.

Top
#260766 - 12/06/17 10:51 PM Re: Whisper with mirc bot [Re: KubosKube]
darthclide Offline
Babel fish

Registered: 25/06/14
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.

Top
#260767 - 12/06/17 11:02 PM Re: Whisper with mirc bot [Re: darthclide]
KubosKube Offline
Ameglian cow

Registered: 31/01/17
Posts: 42
Loc: Central US
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.

Top
#260768 - 12/06/17 11:13 PM Re: Whisper with mirc bot [Re: KubosKube]
darthclide Offline
Babel fish

Registered: 25/06/14
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?

Top
#260773 - 14/06/17 06:51 AM Re: Whisper with mirc bot [Re: darthclide]
darthclide Offline
Babel fish

Registered: 25/06/14
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.

Top
#260806 - 20/06/17 03:36 AM Re: Whisper with mirc bot [Re: darthclide]
darthclide Offline
Babel fish

Registered: 25/06/14
Posts: 52
Still no takers for the challenge? I would be willing to pay a little money for someone who can figure this out.

Top
#260900 - 02/07/17 04:12 PM Re: Whisper with mirc bot [Re: darthclide]
zapdos26 Offline
Ameglian cow

Registered: 05/07/16
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


Edited by zapdos26 (02/07/17 04:14 PM)
_________________________
Here is my multi channel bot smile https://github.com/zapdos26/mIRC-Twitchbot-Windows

Top
Page 2 of 2 < 1 2