Hi, I have a few scripts that I'd like to have running as much as possible in my IRC channel. The problem is currently that they're only running when my computer and mIRC is on. I'd like to increase the time they're running by letting other regular users have them too, although then they might interfere. When the script reacts to a certain type of message and there are x users with that script online, there would be x reactions to that message when there should only be one.

To get to the point, I want to make sure only one of the users' script is actually running at each moment. I don't know if it's possible to create some sort of 'public' variable in a channel that every user (eventually from a certain level) can consult and change, so when someone starts running the script it changes to '1' and when nobody's running the script it changes to '0'. The condition for a user who logs on to start running the script would be that the variable equals 0.

Simply checking if any of the other users who have the script is online isn't a solution, cause some of them have a 'ghost' on our channel which makes them appear online 24/7, even though they're not really there (and thus their script wouldn't be activated).

I also thought of letting the script send a PM to those other users when it's activated, and based on whether there's a response (an automatic response would be in the other users' scripts) or not, the script would start running. This would also allow one user to know if anyone else's script is already running or not. However, this doesn't seem like a very elegant solution cause all the names of the users with the script would need to be in everyone's script and there would be a lot of PM spam which isn't very nice if the actual human users want to PM eachother.

Thanks for reading, I'd greatly appreciate it if anyone knows any solutions for this problem.