View difference between Paste ID: hwK6kbB2 and 2TmaSZvT
SHOW: | | - or go back to the newest paste.
1-
sle = 30
1+
term.setCursorPos(1,1)
2
term.clear()
3-
sen = sensor.wrap("right")
3+
sle = 60
4
os.loadAPI("ocs/apis/sensor")
5
sen = sensor.wrap("top")
6
state = false
7
8
file = fs.open("minute" , "r")              --read user
9
minu = file.readLine()
10
file.close()
11
minu = tonumber(minu)
12
13
hour = minu * 60
14
day = hour * 24
15
week = day * 7
16
month = day * 30
17
18
print(" ")
19
print(" ")
20
print("Your - Scrapbox - Calculator")
21-
   		if k.Name == "Scrap Box" then
21+
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
22
print(" ")
23
print("-- per minute:  "..minu)
24-
				print("Wert1: "..box1)
24+
print(" ")
25
print("-- per hour:    "..hour)
26
print(" ")
27-
				print("Wert2: "..box2)
27+
print("-- per day:     "..day)
28-
				box3 = box2 - box1
28+
print(" ")
29-
				box3 = box3 * 2
29+
print("-- per week:    "..week)
30-
				print("Boxen pro Minute:   "..box3)
30+
print(" ")
31-
				box3 = box3 * 60
31+
print("-- per month:   "..month)
32-
    box4 = box3 * 24
32+
33-
				print("Boxen pro Stunde:   "..box3)
33+
                    
34-
				print("Boxen in 24 Stunden "..box4)
34+
                    
35-
    print(" ")
35+
                    
36-
				shell.run("startup")
36+
37
	s = sen.getTargets()
38
	function getS()
39
		for v, k  in pairs(s) do
40
			if k.Name == "ME Wireless Access Point" then   
41
				target = v
42
			end
43
		end
44
		return target
45
	end
46
47
	f = getS()
48
	s1 = sen.getTargetDetails(target)
49
50
	for v, k in pairs(s1.Items) do
51
   		if k.Name == "Sulfuric Acid" then
52
        	if state == false then
53
            	box1 = k.Size
54
				--print("Wert1: "..box1)
55
        	else
56
           		box2 = k.Size
57
				--print("Wert2: "..box2)
58
				minu = box2 - box1
59
				file = fs.open("minute", "w")
60
				file.write(minu)
61
				file.close()
62
    			--print(" ")
63
				shell.run("1")
64
        	end
65
		end
66
	end
67
68
 	if state == true then
69
 		state = false
70
 	elseif state == false then
71
 		state = true
72
 	end
73
	sleep(sle)
74
75
end