View difference between Paste ID: gL56mBdc and 0BpsbhA7
SHOW: | | - or go back to the newest paste.
1
-- ### DATOR 1
2
3
rednet.open("SIDA")
4
5
-- COMMAND LIST
6
print("Type 'wheat on/off' to enable/disable wheat farm")
7-
print("Type 'tree on/off' to enable/disable tree farm")
7+
print("Type 'blaze on/off' to enable/disable tree farm")
8
print("Type 'rubber on/off' to enable/disable rubber farm")
9
print("Type 'quarry on/off to enable/disable rubber farm")
10
11-
local state_tree 	= false
11+
12
local state_blaze 	= false
13
local state_rubber 	= false
14
local state_quarry      = false
15
-- ON
16
while ( true ) do
17
	local message = read()
18
	
19
	if message == "wheat on" then
20
		state_wheat = true
21-
	elseif message == "tree on" then
21+
22-
		state_tree = true
22+
	elseif message == "blaze on" then
23-
		rednet.send(ID, "ton")
23+
		state_blaze = true
24
		rednet.send(ID, "bon")
25
	elseif message == "quarry on" then
26
		state_quarry = true
27
		rednet.send(ID, "qon")
28
	elseif message == "rubber on" then
29
		state_rubber = true
30
		rednet.send(ID, "ron")
31
	end
32
33-
	elseif message == "tree off" then
33+
34-
		state_tree = false
34+
35-
		rednet.send(ID, "toff")
35+
36
		rednet.send(ID, "woff")
37
	elseif message == "blaze off" then
38
		state_blaze = false
39
		rednet.send(ID, "boff")
40
	elseif message == "quarry off" then
41
		state_quarry = false
42
		rednet.send(ID, "qoff")
43
	elseif message == "rubber off" then
44
		state_rubber = false
45
		rednet.send(ID, "roff")
46
	end
47
	
48
	term.clear()
49
	term.setCursorPos(1, 1)
50-
	if( state_tree ) then
50+
51-
		print("Tree farm [enabled]")
51+
52
		print("Wheat farm [enabled]")
53-
		print("Tree farm [disabled]")
53+
54
		print("Wheat farm [disabled]")
55
	end
56
		if( state_quarry ) then
57
		print("Quarry [enabled]")
58
	else
59
		print("Quarry [disabled]")
60
	end
61
62
	if( state_blaze ) then
63
		print("Blaze farm [enabled]")
64
	else
65
		print("Blaze farm [disabled]")
66
	end
67
	
68
	if( state_rubber ) then
69
		print("Rubber farm [enabled]")
70
	else
71
		print("Rubber farm [disabled]")
72
	end
73
	
74
	sleep( 0.1 )
75
end