View difference between Paste ID: KmKubkGA and pF6ZcUNm
SHOW: | | - or go back to the newest paste.
1
mouseWidth = 0
2
mouseHeight = 0
3
4
monitor = peripheral.wrap("monitor_1")
5
6
monitor.clear()
7
8
monitor.setCursorPos(1,1)
9
10
w,h=monitor.getSize()
11
12
print(w)
13
print(h)
14
15
monitor.setBackgroundColour((colours.blue))
16
17
Bitems()
18
19
monitor.setBackgroundColour((colours.lime))
20
21
22
23
function Bitems()
24
25
monitor.setBackgroundColour((colours.lime))
26
monitor.clear()
27
monitor.setCursorPos(20,5)
28
29
monitor.write(" Player online =   ")
30
monitor.setCursorPos(20,8)
31
monitor.write(" Player online =  ")
32
monitor.setCursorPos(20,11)
33
monitor.write(" Player online =  ")
34
monitor.setCursorPos(20,14)
35
monitor.write(" Player online =  ")
36
sleep(1)
37
-- monitor.setCursorPos(20,17)
38
-- monitor.write(" Go back  in 9")
39
end
40
41
42
43
44
function checkClickPosition()
45
  if mouseWidth > 15 and mouseWidth < 25 and mouseHeight == 5 then
46
47
    rules()
48
49
  elseif mouseWidth > 15 and mouseWidth < 25 and mouseHeight == 10 then
50
51
    staff()
52
    
53
    elseif mouseWidth > 15 and mouseWidth < 25 and mouseHeight == 15 then
54
    
55
    Bitems()
56
57
  end 
58
end 
59
60
61
repeat 
62
63
64
  event,p1,p2,p3 = os.pullEvent()
65
66
  
67
   if event=="monitor_touch" then
68
69
   
70
     mouseWidth = p2 -- sets mouseWidth 
71
     mouseHeight = p3 -- and mouseHeight 
72
     checkClickPosition() -- this runs our function
73
     
74
   end
75
   
76
until event=="char" and p1==("x")