User Tools

Site Tools


4rpl:commands:registerformsg

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
4rpl:commands:registerformsg [2020/05/14 13:27] – external edit 127.0.0.14rpl:commands:registerformsg [2025/02/14 14:57] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ~~NOTOC~~ ~~NOTOC~~
 +<=[[4rpl:start| Index]] \\
 +<= [[4rpl:start#Messaging]] 
  
-====== REGISTERFORMSG ====== +====== RegisterForMSG ====== 
-RegisterforMsg(<-channel <-callbackFunction)+RegisterForMSG(<-channel <-callbackFunction)
  
 ===== Description ===== ===== Description =====
-Registers a script to receive callbacks whenever somethings sends a message to 'channel'. The channel is just a string.\\ +Registers a script to receive callbacks whenever somethings sends a message to 'channel' 
-Callbacks are made at the time sending happens. Note that some callbacks can be made from system objects, like the InfoCache.\\+The channel is just a string. 
 + 
 +Callbacks are made at the time sending happens. Note that some callbacks can be made from system objects, like the InfoCache.
 The callback is made to the function specified by 'callbackFunction'. It is not case sensitive. A var named "_DATA" will be set before the function The callback is made to the function specified by 'callbackFunction'. It is not case sensitive. A var named "_DATA" will be set before the function
 is invoked on the script. That var can have any type, it depends what type the sender sent.\\ is invoked on the script. That var can have any type, it depends what type the sender sent.\\
-Messages are registered by channel. So if you call RegisterForMsg more than once with the same channel, but different callbackFunctions, only one registration is performance. + 
-Subsequent calls to register on the same channel will replace any previous registrations.\\+Messages are registered by channel. So if you call RegisterForMSG more than once with the same channel, but different callbackFunctions, only one registration is performed Subsequent calls to register on the same channel will replace any previous registrations. Multiple scripts can register to a single channel, but a single script can only have one registration for a particular channel at one time.     
 RegisterForMSG is persistent, so you only need to call it once. RegisterForMSG is persistent, so you only need to call it once.
  
Line 22: Line 27:
  
 </code> </code>
 +
 +=== See also ===
 + 
 +  * [[SendMSG]]
 +  * [[4rpl:commands:DeregisterForMSG]]
 +
 +<=[[4rpl:start| Index]]
  
4rpl/commands/registerformsg.1589462870.txt.gz · Last modified: 2025/02/14 14:56 (external edit)