Programs
Spoiler
My Login/Protection Program.
Let you control the Turtle by Wireless.
Turtle
Computer
My Login/Protection Program.
Spoiler
A Instant Messageros.pullEvent=os.pullEventRaw l1="Change" l2="Change" s1="change" s2="change" tries=5 id=os.getComputerID() function goodLogin() print("Correct Password!") sleep(2) term.clear() term.setCursorPos(1,1) print("You are logged in computer "..id..".") end function badLogin() print("No More Tries!") sleep(2) os.reboot() end function togo() term.clear() term.setCursorPos(1,1) print("Tries Left:", tries) print("Put Your Login.") write("Login:") lo=read() write("Password : ") pa=read("*") if lo == l1 and pa == s1 then goodLogin() elseif lo == l2 and pa == s2 then goodLogin() elseif tries==0 then badLogin() else tries=tries-1 term.clear() term.setCursorPos(1,1) togo() end end togo()
Spoiler
local name=" "
local y=3
local id=os.getComputerID()
local function draw()
print("Logged as:"..name)
print("------------------------------")
end
local function exit()
term.clear()
term.setCursorPos(7,7)
print("Disconnected")
ex=name.." Disconnected"
rednet.broadcast(ex)
sleep(3)
os.reboot()
end
local function clear()
term.clear()
term.setCursorPos(1,1)
end
local function check()
while true do
local e, p1, p2, p3= os.pullEvent()
if e=="rednet_message" then
y=y+1
print(p2)
elseif e=="key" and p1==28 then
term.setCursorPos(1,16)
print("Message:")
m=read()
if m=="/exit" then
exit()
elseif y>=15 then
y=3
term.clear()
term.setCursorPos(1,1)
draw()
print(mb)
sleep(1)
check()
else
local mb=name..":"..m
term.setCursorPos(1,16)
term.clearLine()
term.setCursorPos(1,17)
term.clearLine()
term.setCursorPos(1,y)
rednet.broadcast(mb)
term.clearLine()
print(name,":",m)
y=y+1
check()
end
end
end
end
local function init()
clear()
rednet.open("left")
rednet.open("right")
rednet.open("top")
rednet.open("bottom")
rednet.open("back")
print("Choose a Name.")
write("Name:")
name=read()
clear()
draw()
check()
end
init()
Turtle Wireless Movementlocal name=" "
local y=3
local id=os.getComputerID()
local function draw()
print("Logged as:"..name)
print("------------------------------")
end
local function exit()
term.clear()
term.setCursorPos(7,7)
print("Disconnected")
ex=name.." Disconnected"
rednet.broadcast(ex)
sleep(3)
os.reboot()
end
local function clear()
term.clear()
term.setCursorPos(1,1)
end
local function check()
while true do
local e, p1, p2, p3= os.pullEvent()
if e=="rednet_message" then
y=y+1
print(p2)
elseif e=="key" and p1==28 then
term.setCursorPos(1,16)
print("Message:")
m=read()
if m=="/exit" then
exit()
elseif y>=15 then
y=3
term.clear()
term.setCursorPos(1,1)
draw()
print(mb)
sleep(1)
check()
else
local mb=name..":"..m
term.setCursorPos(1,16)
term.clearLine()
term.setCursorPos(1,17)
term.clearLine()
term.setCursorPos(1,y)
rednet.broadcast(mb)
term.clearLine()
print(name,":",m)
y=y+1
check()
end
end
end
end
local function init()
clear()
rednet.open("left")
rednet.open("right")
rednet.open("top")
rednet.open("bottom")
rednet.open("back")
print("Choose a Name.")
write("Name:")
name=read()
clear()
draw()
check()
end
init()
Let you control the Turtle by Wireless.
Turtle
Spoiler
local v=0.1
local function clear()
term.clear()
term.setCursorPos(1,1)
end
local currentslot=1
local function receive()
if not turtle then
print("This is for turtle.")
return
end
turtle.select(1)
while true do
local e,p1,p2,p3=os.pullEvent()
if e=="rednet_message" and p2=="@W" then
turtle.forward()
print("Front")
elseif e=="rednet_message" and p2=="@S" then
turtle.back()
print("Back")
elseif e=="rednet_message" and p2=="@D" then
turtle.turnRight()
print("Right")
elseif e=="rednet_message" and p2=="@A" then
turtle.turnLeft()
print("Left")
elseif e=="rednet_message" and p2=="@U" then
turtle.up()
print("Up")
elseif e=="rednet_message" and p2=="@CTR" then
turtle.down()
print("Down")
elseif e=="rednet_message" and p2=="@DIG" then
turtle.dig()
print("Dig")
elseif e=="rednet_message" and p2=="@DIGD" then
turtle.digDown()
print("Dig Down")
elseif e=="rednet_message" and p2=="@DIGU" then
turtle.digUp()
print("Dig up")
elseif e=="rednet_message" and p2=="@P" then
turtle.place(currentslot)
print("Place")
elseif e=="rednet_message" and p2=="@1" then
turtle.select( 1 )
currentslot=1
elseif e=="rednet_message" and p2=="@2" then
turtle.select( 2 )
currentslot=2
elseif e=="rednet_message" and p2=="@3" then
turtle.select( 3 )
currentslot=3
elseif e=="rednet_message" and p2=="@4" then
turtle.select( 4 )
currentslot=4
elseif e=="rednet_message" and p2=="@5" then
turtle.select( 5 )
currentslot=5
elseif e=="rednet_message" and p2=="@6" then
turtle.select( 6 )
currentslot=6
elseif e=="rednet_message" and p2=="@7" then
turtle.select( 7 )
currentslot=7
elseif e=="rednet_message" and p2=="@8" then
turtle.select( 8 )
currentslot=8
elseif e=="rednet_message" and p2=="@9" then
turtle.select( 9 )
currentslot=9
end
end
end
rednet.open("right")
clear()
print("Current Ver:",v)
print("Receiving Commands.")
receive()
local v=0.1
local function clear()
term.clear()
term.setCursorPos(1,1)
end
local currentslot=1
local function receive()
if not turtle then
print("This is for turtle.")
return
end
turtle.select(1)
while true do
local e,p1,p2,p3=os.pullEvent()
if e=="rednet_message" and p2=="@W" then
turtle.forward()
print("Front")
elseif e=="rednet_message" and p2=="@S" then
turtle.back()
print("Back")
elseif e=="rednet_message" and p2=="@D" then
turtle.turnRight()
print("Right")
elseif e=="rednet_message" and p2=="@A" then
turtle.turnLeft()
print("Left")
elseif e=="rednet_message" and p2=="@U" then
turtle.up()
print("Up")
elseif e=="rednet_message" and p2=="@CTR" then
turtle.down()
print("Down")
elseif e=="rednet_message" and p2=="@DIG" then
turtle.dig()
print("Dig")
elseif e=="rednet_message" and p2=="@DIGD" then
turtle.digDown()
print("Dig Down")
elseif e=="rednet_message" and p2=="@DIGU" then
turtle.digUp()
print("Dig up")
elseif e=="rednet_message" and p2=="@P" then
turtle.place(currentslot)
print("Place")
elseif e=="rednet_message" and p2=="@1" then
turtle.select( 1 )
currentslot=1
elseif e=="rednet_message" and p2=="@2" then
turtle.select( 2 )
currentslot=2
elseif e=="rednet_message" and p2=="@3" then
turtle.select( 3 )
currentslot=3
elseif e=="rednet_message" and p2=="@4" then
turtle.select( 4 )
currentslot=4
elseif e=="rednet_message" and p2=="@5" then
turtle.select( 5 )
currentslot=5
elseif e=="rednet_message" and p2=="@6" then
turtle.select( 6 )
currentslot=6
elseif e=="rednet_message" and p2=="@7" then
turtle.select( 7 )
currentslot=7
elseif e=="rednet_message" and p2=="@8" then
turtle.select( 8 )
currentslot=8
elseif e=="rednet_message" and p2=="@9" then
turtle.select( 9 )
currentslot=9
end
end
end
rednet.open("right")
clear()
print("Current Ver:",v)
print("Receiving Commands.")
receive()
Computer
Spoiler
local v=0.1
local function clear()
term.clear()
term.setCursorPos(1,1)
end
local function initializate()
rednet.open("right")
rednet.open("top")
rednet.open("back")
rednet.open("bottom")
rednet.open("left")
clear()
while true do
clear()
print("W-front, S-back, D-right ,A-Left,P-Place,Enter-Dig,Down-Dig down, Up-Dig Up, 1 to 9 numbers, select item slot,Left Control-Down,Space- Up")
local e,p1,p2,p3=os.pullEvent()
if e=="key" and p1==17 then
rednet.broadcast("@W")
clear()
print("Front")
elseif e=="key" and p1==31 then
rednet.broadcast("@S")
clear()
print("Back")
elseif e=="key" and p1==32 then
rednet.broadcast("@D")
clear()
print("Right")
elseif e=="key" and p1==30 then
rednet.broadcast("@A")
clear()
print("Left")
elseif e=="key" and p1==57 then
rednet.broadcast("@U")
elseif e=="key" and p1==29 then
rednet.broadcast("@CTR")
elseif e=="key" and p1==28 then
rednet.broadcast("@DIG")
elseif e=="key" and p1==200 then
rednet.broadcast("@DIGU")
elseif e=="key" and p1==208 then
rednet.broadcast("@DIGD")
elseif e=="key" and p1==25 then
rednet.broadcast("@P")
elseif e=="key" and p1==2 then
rednet.broadcast("@1")
elseif e=="key" and p1==3 then
rednet.broadcast("@2")
elseif e=="key" and p1==4 then
rednet.broadcast("@3")
elseif e=="key" and p1==5 then
rednet.broadcast("@4")
elseif e=="key" and p1==6 then
rednet.broadcast("@5")
elseif e=="key" and p1==7 then
rednet.broadcast("@6")
elseif e=="key" and p1==8 then
rednet.broadcast("@7")
elseif e=="key" and p1==9 then
rednet.broadcast("@8")
elseif e=="key" and p1==10 then
rednet.broadcast("@9")
end
end
end
clear()
if turtle then
print("This is for Computer!")
return
end
print("Turtle Wirelles Movement Program!")
print("Ver:"..v)
sleep(4)
initializate()
local v=0.1
local function clear()
term.clear()
term.setCursorPos(1,1)
end
local function initializate()
rednet.open("right")
rednet.open("top")
rednet.open("back")
rednet.open("bottom")
rednet.open("left")
clear()
while true do
clear()
print("W-front, S-back, D-right ,A-Left,P-Place,Enter-Dig,Down-Dig down, Up-Dig Up, 1 to 9 numbers, select item slot,Left Control-Down,Space- Up")
local e,p1,p2,p3=os.pullEvent()
if e=="key" and p1==17 then
rednet.broadcast("@W")
clear()
print("Front")
elseif e=="key" and p1==31 then
rednet.broadcast("@S")
clear()
print("Back")
elseif e=="key" and p1==32 then
rednet.broadcast("@D")
clear()
print("Right")
elseif e=="key" and p1==30 then
rednet.broadcast("@A")
clear()
print("Left")
elseif e=="key" and p1==57 then
rednet.broadcast("@U")
elseif e=="key" and p1==29 then
rednet.broadcast("@CTR")
elseif e=="key" and p1==28 then
rednet.broadcast("@DIG")
elseif e=="key" and p1==200 then
rednet.broadcast("@DIGU")
elseif e=="key" and p1==208 then
rednet.broadcast("@DIGD")
elseif e=="key" and p1==25 then
rednet.broadcast("@P")
elseif e=="key" and p1==2 then
rednet.broadcast("@1")
elseif e=="key" and p1==3 then
rednet.broadcast("@2")
elseif e=="key" and p1==4 then
rednet.broadcast("@3")
elseif e=="key" and p1==5 then
rednet.broadcast("@4")
elseif e=="key" and p1==6 then
rednet.broadcast("@5")
elseif e=="key" and p1==7 then
rednet.broadcast("@6")
elseif e=="key" and p1==8 then
rednet.broadcast("@7")
elseif e=="key" and p1==9 then
rednet.broadcast("@8")
elseif e=="key" and p1==10 then
rednet.broadcast("@9")
end
end
end
clear()
if turtle then
print("This is for Computer!")
return
end
print("Turtle Wirelles Movement Program!")
print("Ver:"..v)
sleep(4)
initializate()
API
Spoiler
None.
None.
To do List:
Make another Program.
Make An API.
If has some errors please, tell me.
Credits:Virtualayu