Sound File Events Trigger Problem
#164002
06/11/06 06:54 PM
|
Joined: Nov 2006
Posts: 35
noscriptskills
OP
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2006
Posts: 35 |
Hi All, I'm having a problem with a custom sounds dialog. Everything is working fine, with the exception of the actual events triggers. It appears as though the intended events aren't actually tiggering the sound files which are properly listed in the .ini file. Here's the current text that isn't working:
; ~~~ IRC Events ~~~
on *:OP:*: {
if ($readini(FTCSounds.ini,Enabled,OP) == 1) && ($readini(FTCSounds.ini,Sounds,OP) != $null) splay " $+ $readini(FTCSounds.ini,Sounds,OP) $+ "
}
on *:DeOP:*: {
if ($opnick == $me) && ($readini(FTCSounds.ini,Enabled,DeOP) == 1) && ($readini(FTCSounds.ini,Sounds,DeOP) != $null) splay " $+ $readini(FTCSounds.ini,Sounds,DeOP) $+ "
}
on *:HOP:*: {
if ($hnick == $me) && ($readini(FTCSounds.ini,Enabled,HOP) == 1) && ($readini(FTCSounds.ini,Sounds,HOP) != $null) splay " $+ $readini(FTCSounds.ini,Sounds,HOP) $+ "
}
on *:DeHOP:*: {
if ($Hnick == $me) && ($readini(FTCSounds.ini,Enabled,DeHOP) == 1) && ($readini(FTCSounds.ini,Sounds,DeHOP) != $null) splay " $+ $readini(FTCSounds.ini,Sounds,DeHOP) $+ "
}
on *:Voice:*: {
if ($Vnick == $me) && ($readini(FTCSounds.ini,Enabled,Voice) == 1) && ($readini(FTCSounds.ini,Sounds,Voice) != $null) splay " $+ $readini(FTCSounds.ini,Sounds,Voice) $+ "
}
on *:DeVoice:*: {
if ($Vnick == $me) && ($readini(FTCSounds.ini,Enabled,DeVoice) == 1) && ($readini(FTCSounds.ini,Sounds,DeVoice) != $null) play " $+ $readini(FTCSounds.ini,Sounds,DeVoice) $+ "
}
on *:kick:*: {
if ($knick == $me) && ($readini(FTCSounds.ini,Enabled,Kick) == 1) && ($readini(FTCSounds.ini,Sounds,Kick) != $null) splay " $+ $readini(FTCSounds.ini,Sounds,Kick) $+ "
}
on *:Ban:*: {
if ($bnick == $me) || ($address($me,2) isin $banmask) {
if ($readini(FTCSounds.ini,Enabled,Ban) == 1) && ($readini(FTCSounds.ini,Sounds,Ban) != $null) splay " $+ $readini(FTCSounds.ini,Sounds,Ban) $+ "
}
}
on *:Whisper:*: {
if ($bnick == $me) || ($address($me,2) isin $banmask) {
if ($readini(FTCSounds.ini,Enabled,Whisper) == 1) && ($readini(FTCSounds.ini,Sounds,Whisper) != $null) splay " $+ $readini(FTCSounds.ini,Sounds,Whisper) $+ "
}
}
on *:Connect: {
if ($readini(FTCSounds.ini,Enabled,Connect) == 1) && ($readini(FTCSounds.ini,Sounds,Connect) != $null) splay " $+ $readini(FTCSounds.ini,Sounds,Connect) $+ "
}
on *:Disconnect: {
if ($readini(FTCSounds.ini,Enabled,Disconnect) == 1) && ($readini(FTCSounds.ini,Sounds,Disconnect) != $null) splay " $+ $readini(FTCSounds.ini,Sounds,Disconnect) $+ "
}
on *:Join: {
if ($readini(FTCSounds.ini,Enabled,Join) == 1) && ($readini(FTCSounds.ini,Sounds,Join) != $null) splay " $+ $readini(FTCSounds.ini,Sounds,Join) $+ "
}
I know the sound files are otherwise recognized by the script because it has the ability to test each sound, and they work properly. However, when the triggering events occurs, the sounds don't play. If anyone can clue me in to why this code is not working, I'd sure appreciate it. Thanks very much!
|
|
|
Re: Sound File Events Trigger Problem
#164003
06/11/06 10:34 PM
|
Joined: Oct 2004
Posts: 8,327
Riamus2
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,327 |
I'd do a little debugging, if I were you, because it looks okay from here...
on *:OP:*: {
echo -a Enabled: $readini(FTCSounds.ini,Enabled,OP) -- Sound: $readini(FTCSounds.ini,Sounds,OP)
if ($readini(FTCSounds.ini,Enabled,OP) == 1) && ($readini(FTCSounds.ini,Sounds,OP) != $null) splay " $+ $readini(FTCSounds.ini,Sounds,OP) $+ "
}
See what values you have there and make sure that you have 1 and a valid sound. Just have someone be opped and see if what's displayed. Just a note... I'd really recommend {}'s... but it's up to you. Example:
if ($readini(FTCSounds.ini,Enabled,OP) == 1 && $readini(FTCSounds.ini,Sounds,OP) != $null) { splay " $+ $readini(FTCSounds.ini,Sounds,OP) $+ " }
Notice that I also adjusted the ()'s so there is one set around the entire IF and none around the individual $readini's. Your way isn't wrong, but it's better imho to write scripts following standard formatting rules. 
Invision Support #Invision on irc.irchighway.net
|
|
|
Re: Sound File Events Trigger Problem
#164004
06/11/06 10:45 PM
|
Joined: Jun 2006
Posts: 508
deegee
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
Plus save on a file read by reusing the second $readini()... if ($readini(FTCSounds.ini,Enabled,OP) == 1 && $readini(FTCSounds.ini,Sounds,OP)) { splay $+(",$v1,") }
|
|
|
Re: Sound File Events Trigger Problem
#164005
06/11/06 10:49 PM
|
Joined: Oct 2004
Posts: 8,327
Riamus2
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,327 |
Good point. Just to make a note about $v1... it is relatively new. If you want your script to be compatible with versions older than 6.14 (I think $v1 was added somewhere around then, though it may be a different version), then you wouldn't want to use $v1. It's up to you how compatible you'd like it to be. Most people use 6.14 or higher, so it shouldn't be an issue for the majority of users. I just thought I'd point it out so you don't wonder why it won't work for someone.
Invision Support #Invision on irc.irchighway.net
|
|
|
Re: Sound File Events Trigger Problem
#164006
06/11/06 10:54 PM
|
Joined: Jun 2006
Posts: 508
deegee
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
New? C'mon its over two years since $v1 was added.  I also ONLY use up to date version and script for the same, if a user has an old version they should say so! 
|
|
|
Re: Sound File Events Trigger Problem
#164007
06/11/06 11:53 PM
|
Joined: Oct 2004
Posts: 8,327
Riamus2
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,327 |
Yeah, I know. Some people do still use older versions because they really like a particular script that doesn't work on newer versions. Just wanted to throw it out there. I also use the latest version of mIRC. But I do tend to weigh in the compatibility issue when deciding whether to use $v1 or not. For a script that I *really* want to have available for everyone, I won't use it. For any that I don't care so much about, I will use it.  Besides, not using $v1 doesn't slow things down enough to matter unless you're doing it a LOT in a script.
Invision Support #Invision on irc.irchighway.net
|
|
|
Re: Sound File Events Trigger Problem
#164008
07/11/06 12:11 AM
|
Joined: Nov 2006
Posts: 35
noscriptskills
OP
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2006
Posts: 35 |
Thank you both for your help with this. I used the following code:
; ~~~ IRC Events ~~~
on *:OP:*: {
if ($readini(FTCSounds.ini,Enabled,OP) == 1 && $readini(FTCSounds.ini,Sounds,OP)) { splay $+(",$v1,") }
}
However, it still doesn't work. I know the sounds all work and the script plays the correct sound from the .ini when I click on the sound test button. It just doesn't seem to trigger from the event. In the past I have used the following code to trigger sounds: I was wondering if the on 1:op:#: part could be the problem. Thanks again!
|
|
|
Re: Sound File Events Trigger Problem
#164009
07/11/06 02:11 AM
|
Joined: Jun 2006
Posts: 508
deegee
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
No that shouldnt make any difference. type (copy/paste) this... //echo -a $readini(FTCSounds.ini,Enabled,OP) -- $readini(FTCSounds.ini,Sounds,OP) and see what the returned info is
You can also try these //echo -a $isfile($readini(FTCSounds.ini,Sounds,OP)) and //splay $qt($readini(FTCSounds.ini,Sounds,OP))
|
|
|
Re: Sound File Events Trigger Problem
#164010
07/11/06 02:59 AM
|
Joined: Oct 2004
Posts: 8,327
Riamus2
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,327 |
Just what I said to try as well (basically). 
Invision Support #Invision on irc.irchighway.net
|
|
|
Re: Sound File Events Trigger Problem
#164011
07/11/06 05:22 AM
|
Joined: Nov 2006
Posts: 35
noscriptskills
OP
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2006
Posts: 35 |
Hi Again, OK, I tried all three, and here are the results. The first one, which was:
//echo -a $readini(FTCSounds.ini,Enabled,OP) -- $readini(FTCSounds.ini,Sounds,OP)
Resulted in NO sound and the following on screen message: -- C:\Program Files\FTC Chat Commander v.6.2\sounds\op.wav The second, which was:
//echo -a $isfile($readini(FTCSounds.ini,Sounds,OP))
resulted in NO sound and the following on screen message: $true The third and final one, which was:
//splay $qt($readini(FTCSounds.ini,Sounds,OP))
resulted in the correct sound and NO onscreen message. Does any of this give you a clue as to what's not working properly? Thank you again for all your help!
|
|
|
Re: Sound File Events Trigger Problem
#164012
07/11/06 05:40 AM
|
Joined: Jun 2006
Posts: 508
deegee
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
Hi Again, OK, I tried all three, and here are the results. The first one, which was: //echo -a $readini(FTCSounds.ini,Enabled,OP) -- $readini(FTCSounds.ini,Sounds,OP) Resulted in NO sound and the following on screen message: -- C:\Program Files\FTC Chat Commander v.6.2\sounds\op.wav OK, that doesn't show anything for the first readini call - $readini(FTCSounds.ini,Enabled,OP) Check the ini file for that setting, either the section name or item name is wrong or its not set. Your script relies on it being set to "1" (without quotes)
|
|
|
Re: Sound File Events Trigger Problem
#164013
07/11/06 06:32 AM
|
Joined: Nov 2006
Posts: 35
noscriptskills
OP
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2006
Posts: 35 |
Hi Again, I checked the .ini and you're right it wasn't showing anything under enabled. So I reset each of the sounds and this is what the .ini says now:
[Sounds]
OP=C:\Program Files\FTC Chat Commander v.6.2\sounds\op.wav
DeOP=C:\Program Files\FTC Chat Commander v.6.2\sounds\deop.wav
HOP=C:\Program Files\FTC Chat Commander v.6.2\sounds\op.wav
DeHOP=C:\Program Files\FTC Chat Commander v.6.2\sounds\deop.wav
Voice=C:\Program Files\FTC Chat Commander v.6.2\sounds\whisper.wav
Kick=C:\Program Files\FTC Chat Commander v.6.2\sounds\kick.wav
Whisper=C:\Program Files\FTC Chat Commander v.6.2\sounds\ChatWhsp.wav
Connect=C:\Program Files\FTC Chat Commander v.6.2\sounds\connect.wav
Disconnect=C:\Program Files\FTC Chat Commander v.6.2\sounds\dis.WAV
Join=C:\Program Files\FTC Chat Commander v.6.2\sounds\Join.wav
[Enabled]
OP=1
DeOP=1
HOP=1
DeHOP=1
Voice=1
DeVoice=1
Kick=1
Ban=1
Whisper=1
Connect=1
Disconnect=1
Join=1
In addition, now the first one shows: 1 -- C:\Program Files\FTC Chat Commander v.6.2\sounds\op.wav However, even with the .ini saying "1" for each of the sounds, there is no sound. Thanks again for all your help 
|
|
|
Re: Sound File Events Trigger Problem
#164014
07/11/06 06:46 AM
|
Joined: Nov 2006
Posts: 35
noscriptskills
OP
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2006
Posts: 35 |
WOW! My error. I went ahead and changed back to the code:
if ($readini(FTCSounds.ini,Enabled,OP) == 1 && $readini(FTCSounds.ini,Sounds,OP)) { splay $+(",$v1,") }
and it worked! Thank you VERY much, very much!
|
|
|
Re: Sound File Events Trigger Problem
#164015
07/11/06 06:58 AM
|
Joined: Jun 2006
Posts: 508
deegee
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
Good to hear  One other error i see though is on *:Join: #: { ^^ is missing the #:
|
|
|
Re: Sound File Events Trigger Problem
#164016
07/11/06 06:59 AM
|
Joined: Nov 2006
Posts: 35
noscriptskills
OP
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2006
Posts: 35 |
Ooops, Op works, but the others still don't work. Is there something else I need to change on each of the sounds? Here's what I have now:
; ~~~ IRC Events ~~~
on *:OP:*: {
if ($readini(FTCSounds.ini,Enabled,OP) == 1 && $readini(FTCSounds.ini,Sounds,OP)) { splay $+(",$v1,") }
}
on *:DeOP:*: {
if ($readini(FTCSounds.ini,Enabled,DeOP) == 1 && $readini(FTCSounds.ini,Sounds,DeOP)) { splay $+(",$v1,") }
}
on *:HOP:*: {
if ($readini(FTCSounds.ini,Enabled,HOP) == 1 && $readini(FTCSounds.ini,Sounds,HOP)) { splay $+(",$v1,") }
}
on *:DeHOP:*: {
if ($readini(FTCSounds.ini,Enabled,DeHOP) == 1 && $readini(FTCSounds.ini,Sounds,DeHOP)) { splay $+(",$v1,") }
}
on *:Voice:*: {
if ($readini(FTCSounds.ini,Enabled,Voice) == 1 && $readini(FTCSounds.ini,Sounds,Voice)) { splay $+(",$v1,") }
}
on *:DeVoice:*: {
if ($readini(FTCSounds.ini,Enabled,DeVoice) == 1 && $readini(FTCSounds.ini,Sounds,DeVoice)) { splay $+(",$v1,") }
}
on *:kick:*: {
if ($readini(FTCSounds.ini,Enabled,kick) == 1 && $readini(FTCSounds.ini,Sounds,kick)) { splay $+(",$v1,") }
}
on *:Ban:*: {
if ($bnick == $me) || ($address($me,2) isin $banmask) {
if ($readini(FTCSounds.ini,Enabled,Ban) == 1 && $readini(FTCSounds.ini,Sounds,Ban)) { splay $+(",$v1,") }
}
on *:Whisper:*: {
if ($bnick == $me) || ($address($me,2) isin $banmask) {
if ($readini(FTCSounds.ini,Enabled,Whisper) == 1 && $readini(FTCSounds.ini,Sounds,Whisper)) { splay $+(",$v1,") }
}
}
on *:Connect: {
if ($readini(FTCSounds.ini,Enabled,Connect) == 1 && $readini(FTCSounds.ini,Sounds,Connect)) { splay $+(",$v1,") }
}
on *:Disconnect: {
if ($readini(FTCSounds.ini,Enabled,Discount) == 1 && $readini(FTCSounds.ini,Sounds,Discount)) { splay $+(",$v1,") }
}
on *:Join: {
if ($readini(FTCSounds.ini,Enabled,Join) == 1 && $readini(FTCSounds.ini,Sounds,Join)) { splay $+(",$v1,") }
}
Sorry about all this confusion, but I am really lost and appreciate all your help.  Thanks again
|
|
|
Re: Sound File Events Trigger Problem
#164017
07/11/06 07:06 AM
|
Joined: Jun 2006
Posts: 508
deegee
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
And a missing brace in the ban event on *:Ban:*: {
if ($bnick == $me) || ($address($me,2) isin $banmask) {
if ($readini(FTCSounds.ini,Enabled,Ban) == 1 && $readini(FTCSounds.ini,Sounds,Ban)) { splay $+(",$v1,") }
}
[color:red]}[/color]
on *:Whisper:*: {
if ($bnick == $me) || ($address($me,2) isin $banmask) {
if ($readini(FTCSounds.ini,Enabled,Whisper) == 1 && $readini(FTCSounds.ini,Sounds,Whisper)) { splay $+(",$v1,") }
}
}
on *:Connect: {
if ($readini(FTCSounds.ini,Enabled,Connect) == 1 && $readini(FTCSounds.ini,Sounds,Connect)) { splay $+(",$v1,") }
}
on *:Disconnect: {
if ($readini(FTCSounds.ini,Enabled,Discount) == 1 && $readini(FTCSounds.ini,Sounds,Discount)) { splay $+(",$v1,") }
}
on *:Join:[color:red]#:[/color] {
if ($readini(FTCSounds.ini,Enabled,Join) == 1 && $readini(FTCSounds.ini,Sounds,Join)) { splay $+(",$v1,") }
}
|
|
|
Re: Sound File Events Trigger Problem
#164018
07/11/06 07:09 AM
|
Joined: Jun 2006
Posts: 508
deegee
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
Hm, reading more, seeing more.. There is no "on whisper" event  on hop/on dehop should be 'on help' and 'on dehelp'
|
|
|
Re: Sound File Events Trigger Problem
#164019
07/11/06 07:55 AM
|
Joined: Nov 2006
Posts: 35
noscriptskills
OP
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2006
Posts: 35 |
Yep, it's all working well now.
Thank you VERY, VERY much. You're terrific!
|
|
|
|
|