![mashinsky signal tutorial mashinsky signal tutorial](https://media.springernature.com/original/springer-static/image/chp%3A10.1007%2F978-981-10-7087-7_45/MediaObjects/347140_1_En_45_Fig4_HTML.png)
And since both stations are occupied, train chooses one rail and stays at the signal, blocking the exit for all other trains. At the X crossing, the train can only go to the 2 station platforms, there's no other way for the train. Train wants to go to the station, the signal before the X was green, so train entered the crossing. Then, they add more trains and this happens: They interconnect two platforms of the station, and it works well for 2 trains. The most common issue players face is when adding a second station platform to a Terminus station. Now if you added one train, the train will be able to pass through the signals and circle around our rail.īy adding more signals, you can divide tracks into many BLOCKS. Now the game sees our rail as two BLOCKS, separated by our signals: To split our rail into two BLOCKS, we need at least one more signal: This means that if you add a train now, the signals will stay RED forever. If we add a signal, it will cut this block in half on that particular spot:īut since the left part and right part of the rail are connected by the other side, our rail is still connected as one BLOCK: This whole track is considered as a BLOCK. Their purpose is to prevent trains from one block entering into another block with a train in it. The signals divide your track into BLOCKS, that's why we call them block signals. This is a short guide explaining the basic signals in the game Mashinky.
#Mashinsky signal tutorial code#
The code is just there to give you an idea of the environment in which signals work.)Īll content is copyright by and cannot be used without permission. In other words, don't complain to me about why it's lame to use inc -u for flood protection etc. Questions, comments, flames can be sent to The code examples above are strictly conceptual and are in no way meant to be copied and pasted as working script. Hopefully this has shed some light on the concept of Signals and mIRC event handling. In closing, there isn't much to the syntax of Signal Event handling, but there is a wealth of potential for a creative scripter.Īs well as the above MTS example, possible uses for signals could include: The above example shows how one could handle a range of signals dynamicly. It returns the value of the calling signal. In this example we introduce both a wildcard signal definition, and the $signal identifier. Instead of having:Īnd then having to run script after the parse in another file, you can simply create a signal based engine and pass along the event handling without any conflicts: MTS takes over all visual event handling, and often causes conflicts within scripts. Let's move on to a more beneficial example: a theme engine. The less one event has to do, the faster it will do it. While this example might seem trivial, it illustrates an important concept. Using /signal you can set off multiple triggers at the same time, without slowing down the event: mIRC script is executed IN ORDER before following lines can be processed. The extra lines of code now slow down the rest of the event. Normally you would just add them to the event: Maybe some logging and counter functions. So now lets say that you want to add some features to your flood protection script. What good is a flood protection if it's slow? In a situation such as this, the speed of the script is essential to it's function. This example kicks the $nick from the channel when the variable reaches a certain value in a certain period of time. For example, let's say that you have a channel flood protection script: Standard mIRC event handling creates conflicts in a modular environment. In other words you can create custom events based on existing events/situations. Note: The script that called /signal is triggered first, and then all other scripts are triggered." The $1- identifier returns the parameters that were specified in the /signal command. The $signal identifier returns the signal name that caused the signal event to trigger. The on signal event triggers if a script has used the /signal command to send a signal to all scripts. You can however use -n to make the script trigger immediately. The signal command allows you to trigger signal events in all scripts that listen for signals.īy default the signal is triggered after all current scripts have finished executing. "Signals are simple way of triggering signal events in multiple scripts at the same time." So just what is /signal? Signals are simply another level of event handling to prevent conflicts between scripts. This tutorial assumes working knowledge of basic mIRC event scripting, aliases, and basic scripting concepts such as wildcards.