View difference between Paste ID: MUDWgbA5 and 5rH04LP0
SHOW: | | - or go back to the newest paste.
1
--Settings
2
mon = peripheral.wrap("top") --Screen Side
3
mon.setTextScale(3)           --Text Size
4
mon.setBackgroundColor(2)
5
mon.setTextColor(32768)
6
local monitor, touch
7
local monitorLocation, myTime
8-
text = "Welcome to Reign Station!"    --Displayed Text
8+
anger = 0
9
maxanger = 0
10
11
strtpos = 20                  --Start position on screen
12
speed = 0.1                   --Scroll Speed (Seconds)
13
text = "Welcome to Reign Station"    --Displayed Text
14-
 mon.clear()
14+
15-
 mon.setCursorPos(pos, 1)
15+
16-
 mon.write(text)
16+
myTime = os.startTimer(speed)
17-
 sleep(speed)
17+
18-
 if pos == poslimit then
18+
function writeLog(text)
19-
  pos = strtpos
19+
  print(text)
20-
 else
20+
end
21-
  pos = pos - 1
21+
 
22-
 end
22+
23
  monitorLocation = "top"
24
  monitor = peripheral.wrap(monitorLocation)
25
 
26
 
27
function determineLength(myString)
28
  local theLength = 0
29
  if string.len(myString) > maxNameLength then
30
    theLength = maxNameLength + buttonPadding * 2
31
  else
32
    theLength = string.len(myString) + buttonPadding * 2
33
  end
34
 
35
  return theLength
36
end
37
38
39
pos = strtpos
40
poslimit = 0 - strtpos
41
42
mon.setBackgroundColor(2)
43
mon.setTextColor(32768)
44
45
while true do
46
     event, completed = os.pullEvent()
47
   if event == "monitor_touch" then
48
	anger = anger + 10
49
	maxanger = maxanger + 10
50
	--os.startTimer(4)
51
   elseif event == "timer" then
52
	if anger < 1 then
53
	maxanger = 0
54
	end
55
56
	  if anger > 0 then
57
	      anger = anger - 1
58
    mon.clear()
59
    mon.setCursorPos(1, 1)
60
    mon.setBackgroundColor(16384)
61
    if maxanger < 20 then
62
    mon.write("Stop Poking ME!")
63
    --anger = 0
64
    end
65
    if maxanger > 19 and maxanger < 30 then
66
    mon.write("Cut it out!")
67
    --anger = 0
68
    end
69
    if maxanger > 29 and maxanger < 50 then
70
    mon.setTextScale(1)   
71
    mon.write("You're really making me mad!")
72
    --anger = 0
73
    end
74
    if maxanger > 49 and maxanger < 100 then
75
   mon.setTextScale(1)   
76
    mon.write("I'm sorry Dave, I can\'t let you do that.")
77
    --anger = 0
78
    end
79
    if maxanger > 99 then
80
    mon.setTextScale(3)   
81
    mon.write("EXTERMINATE!!!") 
82
    --anger=0
83
    end
84
          elseif anger < 1 then
85
    maxanger = 0
86
    mon.setBackgroundColor(2)
87
   mon.setTextScale(3)   
88
    mon.clear()
89
    mon.setCursorPos(pos, 1)
90
    mon.write(text)
91
       if pos == poslimit then
92
           pos = strtpos
93
       else
94
           pos = pos - 1
95
       end
96
      end
97
    end
98
if completed == myTime then 
99
myTime = os.startTimer(speed)
100
end
101
end