mIRC Home    About    Download    Register    News    Help

Print Thread
#243436 20/11/13 12:38 PM
Joined: Nov 2013
Posts: 3
V
Self-satisified door
OP Offline
Self-satisified door
V
Joined: Nov 2013
Posts: 3
I've tried every which thing in the world to get this to work and am not sure why it won't.

I'm trying to create a script that will play a sound file on a certain text that a bot says.

on *:text:*:#:
{
if ($chan == #removed)
{
if ($nick == removed)
{
if (connection isin $1 && broken isin $2)
{
/sound connectionlost.wav
}
}
}
}

I've tried to do a basic command that should play a sound when ANY line of text is sent and that doesn't even work.

on *:text:*:#:
{
/splay -w C:/Users/Vixstrix/AppData/Roaming/mIRC/sounds/connectionlost.wav
}

As you can see, I've tried two different methods of playing a sound too with /sound and /splay. If I type the command out myself, the sound plays just fine, but it will not respond to the bot for some reason. Is it possible that server side I can't play sound files? Not sure how, but that's the only thing i can think of that would block me from playing a sound.

Thanks for your help.

Joined: Jan 2004
Posts: 1,360
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,360
K&R style braces are not supported, the opening brace must be on the same line as the beginning of the block.

Joined: Nov 2013
Posts: 3
V
Self-satisified door
OP Offline
Self-satisified door
V
Joined: Nov 2013
Posts: 3
Not sure what you mean cause all my other programs work just fine. The spacing on some stuff didn't copy over correctly. Braces are spaced with each block, but that part didn't copy over. Braces should be fine.

Joined: Dec 2002
Posts: 5,490
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,490
What Loki12583 means is that the braces in your script appear to be separate from the event definition:

Code:
on *:text:*:#:
{
  splay -w C:/Users/Vixstrix/AppData/Roaming/mIRC/sounds/connectionlost.wav
}

The above script will not work. It would need to look like this:

Code:
on *:text:*:#:{
  splay -w C:/Users/Vixstrix/AppData/Roaming/mIRC/sounds/connectionlost.wav
}

If your script looks like the above, it should work. You can try adding an echo command (echo EVENT: $event $target $nick $1-) above the splay for debugging purposes. Other than that, you can also try placing the event at the top of the script, in case another event is interfering with it.

Joined: Nov 2013
Posts: 3
V
Self-satisified door
OP Offline
Self-satisified door
V
Joined: Nov 2013
Posts: 3
I moved it to the top and it worked just fine, but then my other sets stopped working. How do I make it so that multiple section's will run at the same time?

I've had this all working before, not sure why I can't run multiples now. It cause of a newer version perhaps?

Joined: Feb 2014
Posts: 1
T
Mostly harmless
Offline
Mostly harmless
T
Joined: Feb 2014
Posts: 1
Did you ever figure out your problem? Maybe I can help.


Link Copied to Clipboard