diff --git a/Tutorial:-Sockets.textile b/Tutorial:-Sockets.textile
index 79833e4..5ed8ab7 100644
--- a/Tutorial:-Sockets.textile
+++ b/Tutorial:-Sockets.textile
@@ -6,7 +6,8 @@ After that you can use s.connect("addr", TPort(80))
to connect to a
Once you connect to a server, you can send and receive messages to/from the server by using s.send("Message")
to send, and s.recv()
to receive.
== Examples ==
=== IRC Bot ===
-
import sockets, strutils + + var msg = "Total memory: " & formatSize(int64(getTotalMem())) + s.send("PRIVMSG " & data.split()[2] & " :" & msg & "\c\L") ++import sockets, strutils when not defined(strutils.toStringSep): proc toStringSep(x: int64): string = @@ -53,18 +54,19 @@ while True: s.send("JOIN #nimrod\c\L") if data.split()[1] == "PRIVMSG": if data.split()[3] == ":!about": - var msg: string = "NimrodBot 0.1 compiled on " & CompileDate & " " & CompileTime - msg = msg & " running on " & hostOS + var msg = "NimrodBot 0.1 compiled on " & CompileDate & " " & CompileTime + msg.add(" running on " & hostOS) s.send("PRIVMSG " & data.split()[2] & " :" & msg & "\c\L") elif data.split()[3] == ":!mem": - var msg: string = "Occupied memory: " & formatSize(int64(getOccupiedMem())) + var msg = "Occupied memory: " & formatSize(int64(getOccupiedMem())) s.send("PRIVMSG " & data.split()[2] & " :" & msg & "\c\L") elif data.split()[3] == ":!freemem": - var msg: string = "Free memory: " & formatSize(int64(getFreeMem())) + var msg = "Free memory: " & formatSize(int64(getFreeMem())) s.send("PRIVMSG " & data.split()[2] & " :" & msg & "\c\L") elif data.split()[3] == ":!totalmem": - var msg: string = "Total memory: " & formatSize(int64(getTotalMem())) - s.send("PRIVMSG " & data.split()[2] & " :" & msg & "\c\L")