-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLua_guide.txt
17 lines (17 loc) · 1004 Bytes
/
Lua_guide.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
error() -- is used to end the program. Most likely used when an error is thrown.
term.restore() -- Sets the current output to be at the terminal. Good for restoring after use of monitor.
term.redirect(peripheral.wrap([SIDE])) -- replace [SIDE] with desired side that the Computer should set output to. example Monitor.
-- Insert this function to receive ANY signal that is broadcasted and print it to the screen.
--------------------------------------
function receive()
while 1 do
centerText("receiving. please wait...")
id, msg = rednet.receive()
print("Computer ", id," said: ", msg)
end
end
---------------------------------------
os.computerID() -- Returns ID. Used for find out the computer ID of the computer it's executed on.
ID -- Used to get ID of computer from terminal
VAR = { ... } -- used to get Arguments. to call arg 1 call VAR[1] and 2 is like VAR[2]. You can rename VAR to whatever you wan't.
event, key = os.pullEvent() -- event is ??. key is the pressed key.