View difference between Paste ID: jqBZeKub and kvbshTHj
SHOW: | | - or go back to the newest paste.
1-
s = peripheral.wrap("bottom")
1+
2
    rs.setOutput("bottom", true)
3-
    s.setAttenuation(0)
3+
	sleep(0.5)
4-
    s.stop(0)
4+
	rs.setOutput("bottom", false)
5-
    s.start(0, 2438)
5+
6-
    sleep(0.2)
6+
7-
    s.start(1, 2532)
7+
8-
    sleep(0.2)
8+
9-
    s.setAttenuation(10)
9+
10-
    s.stop(0)
10+
11-
    s.start(2, 2614)
11+
12-
    sleep(0.4)
12+
13-
    s.stop(0)
13+
14-
    s.stop(1)
14+
15-
    s.stop(2)
15+
16
term.write("      DIMUS BQR-2 ACTIVE SONAR SYSTEM")
17
term.setCursorPos(25, 2)
18
term.write("-O-")
19
20
term.setCursorPos(50, 3)
21
term.write("0")
22
term.setCursorPos(50, 6)
23
term.write(".5")
24
term.setCursorPos(50, 9)
25
term.write("1k")
26
term.setCursorPos(50, 12)
27-
term.write("       Gidroakusticheskiy kompleks «Kerch'»")
27+
28
term.setCursorPos(50, 15)
29
term.write("4k")
30
term.setCursorPos(50, 18)
31
term.write("8k")
32
33
term.setCursorPos(1, 3)
34
term.write("0")
35
term.setCursorPos(1, 6)
36
term.write(".5")
37
term.setCursorPos(1, 9)
38
term.write("1k")
39
term.setCursorPos(1, 12)
40
term.write("2k")
41
term.setCursorPos(1, 15)
42
term.write("4k")
43
term.setCursorPos(1, 18)
44
term.write("8k")
45
end
46
47
local function drawLine(y, modifier)
48
    for i = 4, 48 do
49
        local ran = math.floor(math.random(1, 2))
50
        local m1 = math.floor(math.random(1, 3))
51
        local m2 = math.floor(math.random(1, 3))             
52
        local m3 = math.floor(math.random(1, 2))
53
        if i > 30+m2 then
54
            ran = ran
55
        elseif i > 20-m1 then
56
            ran = ran + 1 + modifier
57
--        elseif i < 20 then
58
--            ran = ran
59
        end
60
        ran = ran + modifier
61
        if (ran+1) > 8 then
62
            ran = 9 - (math.floor(math.random(1,2)))
63
        end
64
        local colorBase = sonColors[ran]
65
        paintutils.drawPixel(i, y, colorBase)
66
  
67
   end
68
end 
69
70
clearScreen()
71
72
73
74
term.setCursorPos(21, 10)
75
term.setBackgroundColor(colors.red)
76
term.setTextColor(colors.white)
77
term.write("START")
78
79
80
event = os.pullEvent("mouse_click")
81
82
clearScreen()
83
doSonarSweep()
84
85
while true do
86
    for i = 3, 21 do
87
        mod = 8 - i
88-
term.write("NACHINAT")
88+
89
          mod = 0
90
        end
91
        drawLine(i, mod)
92
        sleep(0.1)
93
    end
94
    doSonarSweep()
95
end