Project

General

Profile

Notify option is not working properly

Added by Q Steinberg over 2 years ago

So my notify option is not working properly all the time. Sometimes it gives me a notification with sound that a user came online / or went offline, and many times it doesn't.

I went to options, and checked enable notify, added nicknames.
I'm also using the script that you once gave to me, a year ago or something.

When someone comes online:
on *:NOTIFY:{
if ($nick Zedd) /splay -q C:\Users\Lenovo\Desktop\yabadabado.wav
else if ($nick David) /splay -q C:\Users\Lenovo\Desktop\attention.wav

When someone goes offline:
on *:UNOTIFY:{
if ($nick Zedd) /splay C:\Users\Lenovo\Desktop\234526__foolboymedia__announcement-end.wav
else if ($nick David) /splay C:\Users\Lenovo\Desktop\234526__foolboymedia__announcement-end.wav


Replies (36)

RE: Notify option is not working properly - Added by Paul Janson over 2 years ago

It's not safe to address your code, because what we see is almost certainly not what you posted. I don't see the equals in your if statement, and there might be other things. To make sure your code displays correctly, click on the PRE button for the symbols to surround your pasted code. Then before posting, click on PREVIEW to make sure your post looks right.

RE: Notify option is not working properly - Added by Q Steinberg over 2 years ago

When someone comes online:
on *:NOTIFY:{
if ($nick Zedd) /splay -q C:\Users\Lenovo\Desktop\yabadabado.wav
else if ($nick David) /splay -q C:\Users\Lenovo\Desktop\attention.wav
When someone goes offline:
on *:UNOTIFY:{
if ($nick Zedd) /splay C:\Users\Lenovo\Desktop\234526__foolboymedia__announcement-end.wav
else if ($nick David) /splay C:\Users\Lenovo\Desktop\234526__foolboymedia__announcement-end.wav

RE: Notify option is not working properly - Added by Q Steinberg over 2 years ago

So I noticed that it doesn't play a notify sound (when a user comes online, or goes offline ) ONLY when there is more than one user online

RE: Notify option is not working properly - Added by Paul Janson over 2 years ago

Ah, so the problem is not due to the forum hiding characters, they're actually missing from your code.
There's 2 main types of if statements, either boolean or comparison using an operator. What you're doing is not using an operator, which is having the effect of a boolean statement with is true except when the string is something like $null or 0 or $false. So it looks like your code is always true, because you have a non-zero string inside the if statement. What you really want is something like

if ($nick Zedd) command goes here

First thing you want to do when something "isn't working", is to investigate the problem. Try including an echo to the status window as the first command of the :EVENT: handler, to see whether the problem is that the event is or isn't being triggered, or whether there's a problem with your branching logic, or a problem with the command that's supposed to be performed. Have something like:

echo s debug: $scriptline $nopath($script) event $event nick $nick (1) ($1-)

Your usage of a debug message will differ in some situations, where you need to include contents of variables, etc.
If you want to verify which branch is taken at an if statement, you can include the message as part of the commmand.

instead of

if ($nick zedd) splay filename.wav

have it do:

if ($nick == zedd) { echo -s debug $scriptline $nopath($script) | splay filename.wav }

It's important to have something in the debug message that identifies where it's coming from, because otherwise you run the risk of getting spammed by debug messages several months down the line which you have no idea which script is putting them there

RE: Notify option is not working properly - Added by Q Steinberg over 2 years ago

Nothing seems to work.

Every time you give me a new line, a new code, and there's always an error or something wrong

RE: Notify option is not working properly - Added by Per Amundsen over 2 years ago

I was the one who gave you the original code at https://dev.adiirc.com/boards/1/topics/1769?r=1790#message-1790 if you compare to what you have posted here, it is missing various things.

Your code should look like this:

on *:NOTIFY:{
  if ($nick == Zedd) /splay -q C:\Users\Lenovo\Desktop\yabadabado.wav
  else if ($nick == David) /splay -q C:\Users\Lenovo\Desktop\attention.wav
}

on *:UNOTIFY:{
  if ($nick == Zedd) /splay -q C:\Users\Lenovo\Desktop\234526__foolboymedia__announcement-end.wav
  else if ($nick == David) /splay -q C:\Users\Lenovo\Desktop\234526__foolboymedia__announcement-end.wav
}

RE: Notify option is not working properly - Added by Q Steinberg over 2 years ago

That's exactly how it looks. And it's not working at all.

All it does is gives me a notify when I connect that all my contacts are offline, even if some of them are online

RE: Notify option is not working properly - Added by Per Amundsen over 2 years ago

I think you should look closer, you'll see there was -q missing in the UNOTIFY events etc, try copy/paste my code and replace yours, then try again.

RE: Notify option is not working properly - Added by Per Amundsen over 2 years ago

Also make sure you don't have sounds set for these nicks in the Notify options to avoid overlap.

RE: Notify option is not working properly - Added by Q Steinberg over 2 years ago

So I added 3 nicknames to my notify list, and I noticed the following:

I only get a notify message and sound for the second nickname who is online. But no message or sound when the first nickname in the script and the last nickname are online

RE: Notify option is not working properly - Added by Q Steinberg over 2 years ago

Which takes us back to my very first question. Why doesn't it work when there's more than one nickname online??

RE: Notify option is not working properly - Added by Per Amundsen over 2 years ago

Open your config.ini file then copy/paste the [Notify] section here, also on what network are these users so I can test?

RE: Notify option is not working properly - Added by Per Amundsen over 2 years ago

Also if possible, upload the sound files, I think they can be attached here.

RE: Notify option is not working properly - Added by Q Steinberg over 2 years ago

on *:NOTIFY:{
  if ($nick == Xavi) /splay -q C:\Users\Lenovo\Desktop\yabadabado.wav
  else if ($nick == Laila) /splay -q C:\Users\Lenovo\Desktop\attention.wav
  else if ($nick == Bam) /splay -q C:\Users\Lenovo\Desktop\peekaboo.wav
}

irc.librairc.net

RE: Notify option is not working properly - Added by Q Steinberg over 2 years ago

Now it notifies me for the second and third nicknames. But gives me nothing for the first nick

RE: Notify option is not working properly - Added by Per Amundsen over 2 years ago

I need the [Notify] section from your config.ini file and your sound files to recreate your setup.

RE: Notify option is not working properly - Added by Per Amundsen over 2 years ago

You can type in the Editbox: //run $adiircdir

The config.ini file should be there.

RE: Notify option is not working properly - Added by Q Steinberg over 2 years ago

What do I do exactly when I open options - editbox?

Because I get no results when I search for //run $adiircdir

RE: Notify option is not working properly - Added by Q Steinberg over 2 years ago

And as I mentioned, now it gives me a notification for the 2nd and 3rd nicknames. But no message or sound for the first nick Xavi

RE: Notify option is not working properly - Added by Q Steinberg over 2 years ago

[Notify]
n0=Xavi¦irc.librairc.net¦¦0¦C:\Users\Lenovo\Desktop\yabadabado.wav¦0¦C:\Users\Lenovo\Desktop\234526__foolboymedia__announcement-end.wav¦False¦False
n1=Laila¦irc.icqchat.net¦¦0¦C:\Users\Lenovo\Desktop\attention.wav¦0¦C:\Users\Lenovo\Desktop\234526__foolboymedia__announcement-end.wav¦False¦False
n2=Bam¦irc.icqchat.net¦¦0¦C:\Users\Lenovo\Desktop\peekaboo.wav¦0¦C:\Users\Lenovo\Desktop\234526__foolboymedia__announcement-end.wav¦False¦False

RE: Notify option is not working properly - Added by Per Amundsen over 2 years ago

You should remove the sounds from the Notify options as I mentioned earlier, this is one of the causes for the confusion.

I figured out the other issue, it wont trigger on NOTIFY/UNOTIFY if adiirc is the focused window, should be fixed in next beta.

RE: Notify option is not working properly - Added by Q Steinberg over 2 years ago

I set it to NO SOUND in the notify options. And by the way, if it was on, it wouldn't cause any problems. But it would play the notify sound twice.

Now there's another issue. If I add a 4th nickname, it wouldn't notify me through a message or a sound.

Next beta? Sure! If I'm still alive

RE: Notify option is not working properly - Added by Per Amundsen over 2 years ago

What exactly do you mean by "Next beta? Sure! If I'm still alive" ?

(1-25/36)