Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Clears Screen & Opens Connection --
- term.clear()
- rednet.open("back")
- -- Engine Status Light Positions --
- local abx, aby = 5,3 -- bank1 light
- local acx, acy = 18,3 -- bank2 light
- local adx, ady = 5,5 -- bank3 light
- local aex, aey = 18,5 -- bank4 light
- -- Engine Button Positions --
- local aax, aay = 5,7 -- bank1 on button
- local bax, bay = 5,8 -- bank1 off button
- local cax, cay = 18,7 -- bank2 on button
- local dax, day = 18,8 -- bank2 off button
- local eax, eay = 5,11 -- bank3 on button
- local fax, fay = 5,12 -- bank3 off button
- local gax, gay = 18,11-- bank4 on button
- local hax, hay = 18,12-- bank4 off button
- -- Engine Button Text --
- local bnk1on = "[Bank 1 On]"
- local bnk1off = "[Bank 1 Off]"
- local bnk2on = "[Bank 2 On]"
- local bnk2off = "[Bank 2 Off]"
- local bnk3on = "[Bank 3 On]"
- local bnk3off = "[Bank 3 Off]"
- local bnk4on = "[Bank 4 On]"
- local bnk4off = "[Bank 4 Off]"
- -- Engine Status Light Text --
- local bnk1staton = "Bank 1 On "
- local bnk1statoff = "Bank 1 Off"
- local bnk2staton = "Bank 2 On "
- local bnk2statoff = "Bank 2 Off"
- local bnk3staton = "Bank 3 On "
- local bnk3statoff = "Bank 3 Off"
- local bnk4staton = "Bank 4 On "
- local bnk4statoff = "Bank 4 Off"
- -- Button Placing --
- term.clear()
- term.setCursorPos(aax, aay)
- write(bnk1on)
- term.setCursorPos(bax, bay)
- write(bnk1off)
- term.setCursorPos(cax,cay)
- write(bnk2on)
- term.setCursorPos (dax,day)
- write(bnk2off)
- term.setCursorPos(eax, eay)
- write(bnk3on)
- term.setCursorPos(fax, fay)
- write(bnk3off)
- term.setCursorPos(gax,gay)
- write(bnk4on)
- term.setCursorPos (hax,hay)
- write(bnk4off)
- -- Engine Button Code --
- while true do
- local e, but, cx,cy = os.pullEvent()
- if e =="mouse_click" then
- if cx >= aax and cx <= aax + bnk1on:len() and cy == aay then
- rednet.send(0,"on")
- term.setCursorPos(abx, aby)
- term.setTextColor(colors.green)
- write(bnk1staton)
- term.setTextColor(colors.white)
- end
- end
- if e =="mouse_click" then
- if cx >= bax and cx <= bax + bnk1off:len() and cy == bay then
- rednet.send(0,"off")
- term.setCursorPos(abx, aby)
- term.setTextColor(colors.red)
- write(bnk1statoff)
- term.setTextColor(colors.white)
- end
- end
- if e =="mouse_click" then
- if cx >= cax and cx <= cax + bnk2on:len() and cy == cay then
- rednet.send(1,"on")
- term.setCursorPos(acx, acy)
- term.setTextColor(colors.green)
- write(bnk2staton)
- term.setTextColor(colors.white)
- end
- end
- if e =="mouse_click" then
- if cx >= dax and cx <= dax + bnk2off:len() and cy == day then
- rednet.send(1,"off")
- term.setCursorPos(acx, acy)
- term.setTextColor(colors.red)
- write(bnk2statoff)
- term.setTextColor(colors.white)
- end
- end
- if e =="mouse_click" then
- if cx >= eax and cx <= eax + bnk3on:len() and cy == eay then
- rednet.send(3,"on")
- term.setCursorPos(adx, ady)
- term.setTextColor(colors.green)
- write(bnk3staton)
- term.setTextColor(colors.white)
- end
- end
- if e =="mouse_click" then
- if cx >= fax and cx <= fax + bnk3off:len() and cy == fay then
- rednet.send(3,"off")
- term.setCursorPos(adx, ady)
- term.setTextColor(colors.red)
- write(bnk3statoff)
- term.setTextColor(colors.white)
- end
- end
- if e =="mouse_click" then
- if cx >= gax and cx <= gax + bnk4on:len() and cy == gay then
- rednet.send(4,"on")
- term.setCursorPos(aex, aey)
- term.setTextColor(colors.green)
- write(bnk4staton)
- term.setTextColor(colors.white)
- end
- end
- if e =="mouse_click" then
- if cx >= hax and cx <= hax + bnk4off:len() and cy == hay then
- rednet.send(4,"off")
- term.setCursorPos(aex, aey)
- term.setTextColor(colors.red)
- write(bnk4statoff)
- term.setTextColor(colors.white)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement