I am trying to make a ordering script that will send the orders to my email which i have setup.
But i keep getting errors!
Please help me.
Script:
Spoiler
function start() rednet.open("back") term.clear() term.setCursorPos(1,1) write("What cart to order?: ") local input = read() if input == not "1" then fail() end elseif input == not "2" then fail() local function fail() term.clear() print("Failed!") sleep(1) start() end elseif input == "1" then term.clear() term.setCursorPos(1,1) print("Ordering") http.post( "http://computercraft.comli.com/email.php?message="..textutils.urlEncode(tostring(input)) ) sleep(1) if http_failure then print("Failed") else print("Success!") sleep(1) term.clear() orderid() end elseif input == "2" then term.clear() term.setCursorPos(1,1) print("Ordering") http.post( "http://computercraft.comli.com/email.php?message="..textutils.urlEncode(tostring(input)) ) sleep(1) if http_failure then print("Failed") end else print("Success!") sleep(1) term.clear() orderid() else start() end end end end end function orderid() orderid = math.random(1,99999999) term.clear() term.setCursorPos(1,1) print("Your order number is: "..orderid) rednet.send(ordercomp, orderid) sleep(15) term.clear() start() end start()