mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#260701 07/06/17 04:09 AM
Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
I don't know what I am doing wrong, but I can't get my bot to whisper a user when the enter the channel. I thought msg would work just fine? Can anyone tell me what is wrong?
Code:
 
on *:join:#:{
  if ($nick !isin $read(UserList.txt, 1)) {
    msg $chan $nick If a person you do not know slanders a streamer or his viewers, go to your settings -> security https://www.twitch.tv/settings/security and at the bottom of the page block messages, whispers, and invites from people you do not follow. Hit "Save Changes" after you finish.
    write UserList.txt $nick
    }

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
msg $chan is the same as typing into the channel window
msg $nick opens a query window, which is probably not what you mean by "whisper".

I'm guessing by whisper that you mean
notice $nick

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
When I try that command, it says "unknown command".

Also, I found out that 'write' does not detect duplicates. Any suggestions on an easy way to just compile a list of users that join the stream? And an easy way to compare that list to a user joining the stream?

The only other way I can think of is using writeini, and giving each user a value of "1". (I don't think you can use writeini without a value?)

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
Anyone have an idea on why I can't whisper with my bot? I can type .w darthclide message into the window and it works, but I can't get it to work in the code?

Last edited by darthclide; 08/06/17 12:40 AM.
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
NOTICE is a command, as you can see with:

/help /notice

So you shouldn't see that error unless you have a badly written alias to replace it, or you typed it badly. Type this in any window:

//notice $me test

This should send a message to yourself. If you still get "unknown command" check to see if you've somehow created an alias of the same name:

//echo -a $isalias(notice) $isalias(notice).fname

If it says $false then you haven't replaced /notice with an alias, but if it says $true, it also shows you which file contains that alias. It's possible for the right combination of lines following a missing/extra curly-bracket in aliases.ini to confuse mIRC into thinking you've created an alias for something.

---

If your list is short enough, an easy way to detect duplicates is a %variable that can have max length of around 4000 before getting an error, so probably around 300-400 users. It's simplest to have the tokens separated by the space character, ASCII 32.

set %userslist $addtok(%userslist,$nick,32)

if someone changes their nick while in channel and you want the list to contain the new nick:

set %userslist $reptok(%userslist,$nick,$newnick,1,32)

You can't writeini without writing something, regardless whether the 'item' already exists in the .ini, so you could either write 0 or $false to it. or use remini to delete a section or item.

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
whisper isn't an mirc command. If you want help with a human-created alias, you'll have to show the code.

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
All I want is to send a whisper from my bot, to a viewer. As I said before ".w username message" works just fine if I type it into the window.

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
If I try the notice command in the window it says
-> -darthclide- hello

in the chat window, but in the status window it says
NOTICE Unknown command

No message is sent. Not a private message (which I do not want) or a whisper (which I do want)

It says $false when I do your command, which I already knew the answer to. All of my aliases are unique, I make sure of that.




My list will grow indefinitely as I will be logging every person who comes into the stream. It looks like I will have to just set each username with a value of 1, and cycle through the list everytime a user enters the channel. To ensure that a person does not receive the whisper every time they join.

Joined: Jan 2017
Posts: 57
Babel fish
Offline
Babel fish
Joined: Jan 2017
Posts: 57
Have you tried sending a normal chat message prefaced with /w? I've had a lot of luck with the following:
Code:
msg $chan /w username message

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Your answer seems a contradiction. Your mIRC is recognizing and not-recognizing the /notice command at the same time.

If I did
//asdfg $me test

There would be nothing in the way of a "->" message on screen, so the fact that you're getting that arrow message tells me that your mirc knows that /notice is a communications command. But on the other hand, you're visually seeing the message in status window that NOTICE is an unknown command.

The only way I can see both being true is if you have something that intercepts the ON NOTICE command and mutes it so you can't see the notice being received by you. I suspect that if you have another person willing to test with you, that if you did /notice that-nick message, that they would see it.

For NOTICE to be at the same time an unknown command - one way this could happen is if you have an alias trying to send a notice, except it has an alt-160 touching the /notice, so it looks like NOTICE is an unknown command, but what's really unknown is NOTICE $+ $chr(160)

As for your trouble with /w or /whisper, these are not mirc commands, they have to be an alias you created, and without letting us know what it is, we can't help with it.

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
I have no aliases using the word "notice" anywhere in my script, but I will post it here for you to look through. For the record, the exemptions to usernames are for persistent trolls who stick around more than a few months after being banned.

I also know it is a mess, but until my stream gets bigger, I can't be bothered to optimize it.

https://pastebin.com/Mn5X2YGS

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
thanks. I see this is 'a' script. I see it doesn't mention 'notice'. However it also doesn't contain the /w alias either. It does mention it once, but is used improperly. When you do:

/msg $chan /w message

It's the same as someone chatting into channel: /w message or typing in channel window:

/say /w message

So it's showing everyone "/w" instead of doing the mysterious whisper - which must be a handmade alias because it's not part of mIRC. You've got some other script messing around with the notice command, but that's a separate item.

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
You can look at my code getUser setUser and I have no idea why
1. No file is created, or written to
2. Why the bot shows this in the window?
<@darth_bot> /w the_mighty_salad I am darthclide's bot, let me know if you received this whisper

But if I manually create a command that uses:
msg $chan /w username message

It does not show anything in my window (indicating it actually sent?)

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
There is only 1 script file. Everything you see there is all that exists.

So how do I modify /w in the aliases section to do what I want?

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
1. You're using the identifier format for getuser but the dollar is missing, so the code is setting %here_before to the literal string "getUser($chan,$nick)" without the channel and nick being evaluated.

Since that variable is never going to be the numeral 1, it always branches here, where it tries to execute the literal alias "setUser($chan,$nick,1)" which doesn't exist.

2. As for your manual command, without 2 forward-slashes it types into channel that literal text.

It also types the text beginning with /w into channel instead of executing the /w alias, which you've never shown us whether it's a /notice or what it does. If you precede with 2 forward slashes but type that in status window, $chan is $null, and it tries to send a message to a nick named /w.

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
so /w is in aliases tab of remotes window? show us what it looks like.

Reminder that in aliases tab everything is like

/aliasname {
stuff
}

instead of
alias aliasname {
stuff
}

Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
/w /whois $$1

That is how it appears in the aliases tab.

And all my aliases are fine as you can see. I have no idea why my writeini will not do anything? smirk

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
so now i finally see what you're calling a whisper.

a WHOIS is a message sent to the server to get the ip address and 'name' of a user. The person you do a /whois on - does not see the results of this, nor does not even know you're doing a /whois on them. The exception is that a small handful of server admins running the irc server are able to see when someone does a /whois on them.

Normally, the reply to "/whois nick" appears in status window, with the exception that if mirc-options/irc/show-in-active has a checkmark next to "whois", then the reply would show in your active channel.

As for your problem with notice being an invalid command, I noticed your answer showed you didn't paste my example, because my example used "test", but your answer used "hello" instead. Can you see if you still get the unknown command error if you use notice like this:

Code:
//notice $me TEST


Joined: Jun 2014
Posts: 52
D
Babel fish
OP Offline
Babel fish
D
Joined: Jun 2014
Posts: 52
I did exactly what you typed and it still says unknown command.

And still nobody has told me how to whisper someone with my bot? I have pasted my code. I have pointed to the relevant pieces of code: getUser setUser

This is very simple I thought?

Joined: Jan 2017
Posts: 57
Babel fish
Offline
Babel fish
Joined: Jan 2017
Posts: 57
Quote:
And still nobody has told me how to whisper someone with my bot?

If the goal is to send a Whisper over the Twitch Messaging Interface(TMI), then just send a normal chat message using the 'msg' command in mIRC.
Code:
msg #darthclide /w darthclide I whisper sweet nothings in your ear... er uh, beep boop, I'm a robot?

Page 1 of 2 1 2

Link Copied to Clipboard