quinn9009, on 11 September 2013 - 01:52 PM, said:
Sorry, I don't quite understand what you mean by that, can you explain again in a different way what you need explaining?
There have been 14 items by Rsstn (Search limited from 10-February 22)
Posted by
Rsstn
on 11 September 2013 - 12:34 PM
in
Ask a Pro
Posted by
Rsstn
on 21 February 2013 - 11:21 PM
in
APIs and Utilities
Posted by
Rsstn
on 21 February 2013 - 10:51 PM
in
Ask a Pro
function pulse(outputSide, nPulses) local i = 1 while i <= nPulses do i = i + 1 rs.setOutput(outputSide, true) sleep(1) rs.setOutput(outputSide, false) sleep(1) end
pulse("back", 5)
Posted by
Rsstn
on 21 February 2013 - 05:39 AM
in
Ask a Pro
Posted by
Rsstn
on 21 February 2013 - 05:09 AM
in
Ask a Pro
Posted by
Rsstn
on 21 February 2013 - 04:19 AM
in
Ask a Pro
Posted by
Rsstn
on 21 February 2013 - 03:44 AM
in
Ask a Pro
function clearS()
term.setCursorPos(1,1)
term.clear()
end
function writeToFile(data)
h = fs.open("EmailData/ModemData", "w")
h.write(data)
h.close()
end
if fs.isDir("EmailData") == false then --Make sure the directory exists. I want the file in a directory so that the files won't show up when the user displays the list of programs on the PC.
fs.makeDir("EmailData")
end
clearS()
h = fs.open("EmailData/ModemData", "r")
modemSide = h.readAll() -- Find out what the side is before changes. This is where the error is.
h.close()
while true do --Loop so that they are asked until they provide a valid answer.
if modemSide == "left" or modemSide == "right" or modemSide == "top" or modemSide == "bottom" or modemSide == "back" or modemSide == "front" then
print("The modem is currently set to be on the " .. modemSide .. " of the computer.")
print("Would you like to change this?")
print("'Y' or 'N'? ")
event, param1 = os.pullEvent("key")
if param1 == 109 then
clearS()
print("The modem side will not be changed.")
sleep(2)
clearS()
break
elseif param1 == 121 then
clearS()
while true do --Loop so that they are asked until they provide a valid answer.
print("What side should the monitor be changed to?")
print("Please select a number:")
print("[1] Left")
print("[2] Right")
print("[3] Top")
print("[4] Bottom")
print("[5] Front")
print("[6] Back")
print("[0] Cancel")
local event, param2 = os.pullEvent("key") --Get the user input...
if param2 == 49 then
s = "left"
break
elseif param2 == 50 then --And compare it to the ASCII codes for those keys.
s = "right"
break
elseif param2 == 51 then
s = "top"
break
elseif param2 == 52 then
s = "bottom"
break
elseif param2 == 53 then
s = "front"
break
elseif param2 == 54 then
s = "back"
clearS()
break
elseif param2 == 48 then
clearS()
print("Cancelling...")
sleep(1.5)
else
clearS()
print("That is not a valid selection...")
sleep(1.5)
end
end
clearS()
writeToFile(s) -- Set the side to what the user wants.
print("You have sucessfully changed the side of the modem to: " .. s)
sleep(2)
break
else
clearS()
print("That's not a valid answer...")
sleep(1.5)
clearS()
end
elseif modemSide == nil then
writeToFile("right") -- Set the default side.
end
end
Quote
Posted by
Rsstn
on 05 October 2012 - 08:47 PM
in
Ask a Pro
Posted by
Rsstn
on 17 September 2012 - 04:28 PM
in
Ask a Pro
nirokid, on 17 September 2012 - 04:24 PM, said:
Posted by
Rsstn
on 17 September 2012 - 04:24 PM
in
Ask a Pro
textutils.serialize(TABLE_NAME)
textutils.unserialize(STRING_NAME)
