Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
tintin:gmcp_setup [2023/04/19 23:56] ipeixtintin:gmcp_setup [2023/04/20 08:15] (current) – Added latency example script ipeix
Line 98: Line 98:
  
 There are a lot more and as always you can enable even more by tweaking the package names in ''core.supports.set'' (keep in mind that they need to be enabled/implemented on the server also) There are a lot more and as always you can enable even more by tweaking the package names in ''core.supports.set'' (keep in mind that they need to be enabled/implemented on the server also)
 +
 +===== Examples =====
 +=== Latency checker ===
 +A rough Round Trip Time measurement for network latency in milliseconds based on Core.Ping GMCP command
 +<code>
 +#ALIAS {latency} {
 +    #FORMAT {LATENCY_TIME_SENT} {%U};
 +    gmcp Core.Ping;
 +}
 +
 +#EVENT {IAC SB GMCP Core.Ping IAC SE} {
 +    #FORMAT {LATENCY_TIME_EVENT} {%U};
 +    #MATH {LATENCY_TIME_TRIP} {($LATENCY_TIME_EVENT-$LATENCY_TIME_SENT)/1000};
 +    #SHOWME {Latency: ${LATENCY_TIME_TRIP}ms}
 +}
 +</code>
 +
 +| Usage | Output |
 +| ''latency'' | ''Latency: 263ms'' |
  
 Happy Scripting! Happy Scripting!