Posted 17 April 2013 - 05:19 PM
os i tried making this program unhackable or whatever and added os.pullEvent thing and tested the ctrl+T and sometimes it returns 75 sometimes it returns 74 sometimes it returns some java fuck up or something ive never seen sometimes it returns nothing and just nuls the program and other times it freezes the computer heres the code its fine if noone can help it would be nice to have it unhackable
function Coms()
KID = fs.exists(Gname)
if KID == true then
file = fs.open(Gname,"r")
Cstatus = file.readLine()
file.close()
term.setCursorPos(Px,Py)
term.setBackgroundColor(colors.lightGray)
write("+"..Cname)
if Cstatus == "ON" then
term.setBackgroundColor(colors.lime)
elseif Cstatus == "OFF" then
term.setBackgroundColor(colors.red)
end
write(" ")
Py = Py + 2
else
term.setCursorPos(Px,Py)
term.setBackgroundColor(colors.lightGray)
write("+"..Cname)
term.setBackgroundColor(colors.orange)
write(" ")
Py = Py + 2
end
end
function PutComsLeft()
Px = 1
Py = 3
Cname = "Computer 1"
Gname = "C1"
Coms()
Cname = "Computer 2"
Gname = "C2"
Coms()
Cname = "Computer 3"
Gname = "C3"
Coms()
Cname = "Computer 4"
Gname = "C4"
Coms()
Cname = "Computer 5"
Gname = "C5"
Coms()
Cname = "Computer 6"
Gname = "C6"
Coms()
Cname = "Computer 7"
Gname = "C7"
Coms()
Cname = "Computer 8"
Gname = "C8"
Coms()
Cname = "Computer 9"
Gname = "C9"
Coms()
Px = 13
Py = 3
Cname = "Computer 10"
Gname = "C10"
Coms()
end
function SyncCom()
term.setBackgroundColor(colors.black)
term.clear()
term.setCursorPos(1,1)
term.setTextColor(colors.lime)
print("Make sure the computer that your're syncing is already on and realy to sync")
write("Computer ID: ")
SyncID = read()
write("Syncing Computer")
textutils.slowPrint("...",1)
rednet.send(217,"PasswordPLZ")
id , PASS, dis = rednet.receive()
print(dis)
if PASS == "8932" then
end
end
function Background()
term.setBackgroundColor(colors.blue)
term.clear()
term.setCursorPos(1,1)
term.setBackgroundColor(colors.gray)
print("SteamPunk Servers v1.5 ")
term.setBackgroundColor(colors.blue)
print("GREEN = ON, RED = OFF ORANGE = CALL KIDGAMER")
end
function MainSelect()
event, button,X,Y = os.pullEvent("mouse_click")
if button == 1 then
if X == 1 and Y == 3 then
CN = "Computer 1"
CS = "C1"
ComSc()
elseif X == 1 and Y == 5 then
CN = "Computer 2"
CS = "C2"
ComsBack()
elseif X == 1 and Y == 7 then
CN = "Computer 3"
CS = "C3"
ComsBack()
elseif X == 1 and Y == 9 then
CN = "Computer 4"
CS = "C4"
ComsBack()
elseif X == 1 and Y == 11 then
CN = "Computer 5"
CS = "C5"
ComsBack()
elseif X == 1 and Y == 13 then
CN = "Computer 6"
CS = "C6"
ComsBack()
elseif X == 1 and Y == 15 then
CN = "Computer 7"
CS = "C7"
ComsBack()
elseif X == 1 and Y == 17 then
CN = "Computer 8"
CS = "C8"
ComsBack()
elseif X == 1 and Y == 19 then
CN = "Computer 9"
CS = "C9"
ComsBack()
elseif X == 13 and Y == 3 then
CN = "Computer 10"
CS = "C10"
ComsBack()
end
end
end
function updateComs()
rednet.open("top")
end
function ComsBack()
term.setBackgroundColor(colors.blue)
term.clear()
term.setBackgroundColor(colors.gray)
term.setCursorPos(1,1)
print("SteamPunk Servers v1.5 ")
end
function ComSc()
ComsBack()
term.setBackgroundColor(colors.blue)
write("Loading")
textutils.slowPrint("...",4)
term.clear()
ComsBack()
ADD = fs.exists(CS)
if ADD == true then
file = io.open(CS,"r")
Pstatus = file:read()
file:close()
term.setCursorPos(2,3)
term.setBackgroundColor(colors.blue)
write(CN.." Status = "..Pstatus)
print()
write(" +Back")
event,button,X,Y = os.pullEvent("mouse_click")
while true do
if button == 1 then
if X == 2 and Y == 4 then
main()
end
end
end
end
end
function main()
os.pullEvent = os.pullEventRaw
rednet.open("top")
Background()
PutComsLeft()
MainSelect()
sleep(1)
end
main()