mirror of https://github.com/LDDestroier/CC/
Update progdor2.lua
This commit is contained in:
parent
d12922cb0b
commit
b9b15bb5ae
19
progdor2.lua
19
progdor2.lua
|
@ -703,22 +703,20 @@ elseif trMode == "transmit" then
|
||||||
cPrint("good", colors.green)
|
cPrint("good", colors.green)
|
||||||
sWrite("Sent '")
|
sWrite("Sent '")
|
||||||
cWrite(fs.getName(inputPath), colors.yellow)
|
cWrite(fs.getName(inputPath), colors.yellow)
|
||||||
sWrite("' using Skynet.")
|
sPrint("' using Skynet.")
|
||||||
else
|
else
|
||||||
|
modem, grr = getModem()
|
||||||
if not modem then
|
if not modem then
|
||||||
modem, grr = getModem()
|
print(grr)
|
||||||
if not modem then
|
print("Abort.")
|
||||||
print(grr)
|
return false
|
||||||
print("Abort.")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
cWrite("Sending file...", colors.lightGray)
|
cWrite("Sending file...", colors.lightGray)
|
||||||
modem.transmit(progdor.channel, progdor.channel, output)
|
modem.transmit(progdor.channel, progdor.channel, output)
|
||||||
cPrint("good", colors.green)
|
cPrint("good", colors.green)
|
||||||
sWrite("Sent '")
|
sWrite("Sent '")
|
||||||
cWrite(fs.getName(inputPath), colors.yellow)
|
cWrite(fs.getName(inputPath), colors.yellow)
|
||||||
sWrite("' using modem.")
|
sPrint("' using modem.")
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif trMode == "receive" then
|
elseif trMode == "receive" then
|
||||||
|
@ -775,13 +773,12 @@ elseif trMode == "receive" then
|
||||||
else
|
else
|
||||||
modem, grr = getModem()
|
modem, grr = getModem()
|
||||||
if not modem then
|
if not modem then
|
||||||
error("is it open? " .. modem.isOpen(progdor.channel))
|
|
||||||
print(grr)
|
print(grr)
|
||||||
print("Abort.")
|
print("Abort.")
|
||||||
sleep(0.05)
|
sleep(0.05)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
--modem.open(progdor.channel)
|
modem.open(progdor.channel)
|
||||||
local evt
|
local evt
|
||||||
cWrite("Waiting for file...", colors.lightGray)
|
cWrite("Waiting for file...", colors.lightGray)
|
||||||
sleep(0.05)
|
sleep(0.05)
|
||||||
|
@ -884,7 +881,7 @@ elseif trMode == "receive" then
|
||||||
file.close()
|
file.close()
|
||||||
sWrite("Wrote to '")
|
sWrite("Wrote to '")
|
||||||
cWrite(writePath, colors.yellow)
|
cWrite(writePath, colors.yellow)
|
||||||
sWrite("'")
|
sPrint("'")
|
||||||
end
|
end
|
||||||
elseif not didAbort then
|
elseif not didAbort then
|
||||||
print("fail!")
|
print("fail!")
|
||||||
|
|
Loading…
Reference in New Issue