mIRC Home    About    Download    Register    News    Help

Print Thread
#22046 03/05/03 06:29 AM
Joined: Apr 2003
Posts: 20
L
limp Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Apr 2003
Posts: 20
I don't get it, what's the point of signals? Why use them?

#22047 03/05/03 09:31 PM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
well i can think of a bunch of different uses for signals . ive seen a pretty indepth version changer that uses signals its done without any dll at all and works .... also there are several reasons that u may need to use signals to trigger a specific script event your your trying to run ...... its pretty uch like asking why have an onjoin event... each one has its purpose


D3m0nnet.com
#22048 03/05/03 11:41 PM
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
One advantage over aliases is that you can have multiple loaded scripts all listening for a specific signal, and when that signal is set, it triggers in all of these scripts. So it could be used as a way of co-ordinating multiple independent scripts.

In the end though, signals are just another tool, and it's hard to say where they might or might not be useful. It all depends on whether you come across a situation where signals might serve as a more elegant solution to a scripting problem, which could just as easily be solved in other ways!

#22049 12/05/03 03:33 AM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
One nice thing about Signals, is it's similar properties to Timers, only slightly better. You can call a signal with /signal -n and have it execute things in the middle of your proccess (much like calling an alias as you usually would), except that the signal you call can halt or cause an error, and the original script wont die from it.

I've seen some nifty error trapping scripts come of this.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#22050 12/05/03 04:09 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Sorry, I didn't get your point.

A script, generally speaking, shouldn't cause an error. It must have proper error checking, and never show an "invalid parameters" message.

Also, if you call an alias, it can use /return for halting self and continuing in the main process (unlike /halt that stops the main process as well).

#22051 12/05/03 09:15 PM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Well, in some advanced scripting where you're relying on user input and perform syntex checking on their input, error trapping could be of great use to inform the user of an error they made and requesting the information again. Under normal circumstances, the script would die and no script-specific user prompt would be provided.

Example. "Script caused a Divide-By-Zero, please enter different parameters."


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard