View Single Post
09-09-22, 06:19 PM   #6
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
To explain "concatenation" in terms of code, the double period takes two strings (or numbers) and binds them together into one.

The fourth return of GetNetStats is your latency to the current instance server your character is at, which affects movement of players and NPCs around you as well as your interactions with them, such as vendors and combat. This return is a number.

This means that:
"Current Latency: "..select(4,GetNetStats()).."ms."
Will turn into (pretend your world latency is 100ms):
"Current Latency: "..100.."ms."
Then the first double period will bind the first two:
"Current Latency: 100.."ms."
Then the second double period:
"Current Latency: 100ms."
So the original command effectively does this, but automatically updates the number:
/run print("Current Latency: 100ms.")
/run is the same as /script, everything after the command is treated as Lua and is executed, print() dumps what it is given into ChatFrame1 in white text.
  Reply With Quote