Verified:

sigma Game profile

Member
406

Oct 26th 2011, 16:20:04

So I've been trying to get highlights to work for phrases in XChat to go off during war--and I thought I had it there. I tested it once and when --> mycountry (#xyz) occurred it opened VLC and played a 15 sec audio clip. Perfect, I thought.

Then a KR on me occurred, and for every hit made on me a new VLC opened up to the point of where there were 50 vlc open and the computer eventually just froze and forced it to shut down.

So here is the pastebin of the script:
http://pastebin.com/MJyueHE2

Essentially what needs to happen is that for 1 highlight splay calls the file, and the hits over 1 it ignores the rest for x amount of time (5 mins or so).

Could anyone help, or perhaps offer another script that they have working successfully?





General Earl Game profile

Member
896

Oct 26th 2011, 16:54:04

Hmm, I dont know enough about perl myself to offer up a fix, but you have the right idea.. look into reading/writing files with perl. it should be as easy as writing a timestamp when the event fires and specifying a time limit till it can fire again.

PS, if you are doing this on a *NIX system, use mplayer. I'm not sure if there is an equivalent for windows systems, but you should look into playing .mp3s from the windows CLI, as loading up vlc to play a file is a resource hog.

EDIT: Don't use the --quiet flag

Edited By: General Earl on Oct 26th 2011, 17:31:51
See Original Post
General Earl
----
Every time I read AT: http://i.imgur.com/jeryjn8.gif
︻╦╤─✮ ┄ ┄ RatttaTaatataatat!

iTz Klutch Game profile

Member
117

Oct 26th 2011, 16:57:44

{
inc $iif(!%flood,-eu9000) % $+ flood
if (%flood > 1) halt
--------command here ---------

}


what you need to add basically is something to check the amount of times it can perform that action. add something similar to this, a flood stopper that works in mIRC that should in your xchat if you modify it
[Carpe Cerevisi] in FFA

everything else is JUST A TOY

General Earl Game profile

Member
896

Oct 26th 2011, 17:01:49

He isn't using mIRC, he's writing it in perl. He can't use variables, since the file closes and the variables are destroyed in memory. He needs to write a file and then read from it.
General Earl
----
Every time I read AT: http://i.imgur.com/jeryjn8.gif
︻╦╤─✮ ┄ ┄ RatttaTaatataatat!

Dibs Ludicrous Game profile

Member
6702

Oct 26th 2011, 17:15:11

no option for static variables in perl?
There are no messages in your Inbox.
Elvis has left the building.

sigma Game profile

Member
406

Oct 26th 2011, 18:36:33

-have a global $last_highlight variable that stores the time of the last highlight (initialized to 0)
-when you would play a file, get the current time and compare to $last_highlight
-if the difference is less than 5 * 60, do nothing
-otherwise play the file and store the current time in $last_highlight


Now I have to read about how to implement this :)

General Earl Game profile

Member
896

Oct 26th 2011, 20:07:57

I'm pretty sure the script is executed when the trigger fires, then the script is halted. When this happens, ANY variable you had saved will be cleared, global or not. This is why writing to a file is recommended.

I have been playing with this and have gotten a file to write with a time stamp.. i'm running into some issues when checking $time - $timeout.. but I am on the right track.
General Earl
----
Every time I read AT: http://i.imgur.com/jeryjn8.gif
︻╦╤─✮ ┄ ┄ RatttaTaatataatat!

Dibs Ludicrous Game profile

Member
6702

Oct 26th 2011, 20:18:24

weird. it stops the call because it gets called again? does it release while the sound is being played? um, does it immediately move to the next step or wait for that step to finish?

Edited By: Dibs Ludicrous on Oct 26th 2011, 20:22:01
See Original Post
There are no messages in your Inbox.
Elvis has left the building.

General Earl Game profile

Member
896

Oct 26th 2011, 21:16:52

THIS DOES NOT WORK AS EXPECTED... (and I've changed stuff for me to test like the sound file and channels/triggers, so look it over carefully!)

http://pastebin.com/UaDquC8e

I am running into problems when trying to close the file during the while loop and overwriting it when the action is supposed to fire. (not shown in this file)

THE ONLY THING THIS DOES IS TELL YOU WHEN IT *SHOULD* OR SHOULDNT FIRE... PROOF OF CONCEPT ONLY. You need to delete the #channel.tmp file manually. Right now it will always make a sound. The main thing is that with some minor modifications, you should be able to have the event fire properly and not fire again until after the timeout. Writing more subs inside the sub should help workaround the issues i'm having.

Edited By: General Earl on Oct 26th 2011, 21:23:02
See Original Post
General Earl
----
Every time I read AT: http://i.imgur.com/jeryjn8.gif
︻╦╤─✮ ┄ ┄ RatttaTaatataatat!

sigma Game profile

Member
406

Oct 26th 2011, 21:58:49

Thanks,I'll play around with it later this evening. I really do appreciate it.