2.0 KiB
2.0 KiB
Manual
local syscalls = require("syscalls")
Events
syscalls.Event.<EventName>
RedrawButtonKeyDesktopMouseNetworkIPCDebug
Graphic
Text encoding
syscalls.Encoding.<value>
cp866cp866_8x16utf8utf16
Text sizes
syscalls.textSize.<value>
6x9(cp866 only)8x1612x18(cp866 only)16x3218x27(cp866 only)24x36(cp866 only)24x4830x45(cp866 only)32x6436x54(cp866 only)40x8042x63(cp866 only)48x72(cp866 only)48x9656x11264x128
DrawText(text, xPos, yPos, textColor, textScale, textLen, backgroundColor, encoding)
DrawTextFixSize(text, xPos, yPos, textColor, textSize, textLen, backgroundColor, encoding)
Draw text.
textSize, textLen, backgroundColor, encoding are optional.
DrawLine(x1, y1, x2, y2)
DrawRectangle(x, y, w, h color)
ReadPoint(x, y)
return color
Sockets
OpenSocket(domain, type, protocol)
local socket, err = syscalls.OpenSocket(
syscalls.SOCK.STREAM,
syscalls.AF.INET,
syscalls.IPPROTO.IP
)
if err then
print("Error", err)
else
print("Ok")
end
CloseSocket(socket)
PairSocket()
local first, second = PairSocket()
if first then
print("OK")
else
print("Error:", second)
end
Bind(socket, address)
Listen(socket, backlog)
Connect(socket, address)
Accept(socket, , flags)
Receive(socket, , flags)
SetSocketOption(socket, opt)
GetSocketOption(socket, opt)
Socket types
syscalls.SOCK.<Value>
STREAMRAWDGRAM
Address families
syscalls.AF.<Value>
UNSPECLOCALINETINET4INET6
IP options
syscalls.IP.<Value>
TTL
IP protocols
syscalls.IPPROTO.<Value>
IPICMPTCPUDPRAW
Socket options
syscalls.SO.<Value>
BINDTODEVICENONBLOCK