Posted 25 November 2013 - 07:41 PM
When I run this code:
At line 56, I'm getting a invalid pattern capture. This didn't happen the first time I tried this, about a week ago, am I doing something wrong?
Please help.
EDIT: Never mind, my random string generator had symbols that were used as pattern codes, so it was thinking about patterns. Removed those symbols, problem solved.
term.clear()
term.setCursorPos(1,1)
write("Minecraft Name: ")
nameread = read()
print("Insert Ticket")
while not disk.isPresent("right") do
local event, side = os.pullEvent("disk")
break
end
if not fs.exists("/disk/.ticketnumber") then
print("Non existant ticket! Tell Rail Manager error 102 (Blank ticket)")
sleep(3)
os.reboot()
elseif not fs.exists("/disk/.ticketnumber/.conf") then
print("No confirmation key. Flagging player")
if not fs.exists("/.flag") then
flag = fs.open("/.flag","w")
flag.close()
end
flag = fs.open("/.flag","w")
flag.writeLine(nameread)
flag.close()
os.reboot()
elseif not fs.exists("/disk/.ticketnumber/.tn") then
print("Non existant ticket! Tell Rail Manager error 102 (Blank ticket)")
sleep(3)
os.reboot()
end
local owner = disk.getLabel("right")
conf = fs.open("/disk/.ticketnumber/.conf","r")
conf1 = conf.readAll()
conf.close()
if conf1 == "Official Ticket" then
tn = fs.open("/disk/.ticketnumber/.tn","r")
ticketNum = tn.readAll()
tn.close()
if #ticketNum == 0 then
print("Ticket number blank! Tell Rail Manager error 108 (No ticket number)")
sleep(3)
os.reboot()
end
if not fs.exists("/.used") then
used = fs.open("/.used","w")
used.close()
end
check = fs.open("/.used","r")
test = check.readAll()
check.close()
if ticketNum:match(test) then --[[LINE 56 IS RIGHT HERE]]--
print("Used ticket. Flagging player")
if not fs.exists("/.flag") then
flag = fs.open("/.flag","w")
flag.close()
end
flag = fs.open("/.flag","w")
flag.writeLine(nameread)
flag.close()
sleep(1)
os.reboot()
end
check = fs.open("/.used","w")
check.writeLine(test)
check.close()
rs.setOutput("bottom",true)
sleep(5)
rs.setOutput("bottom",false)
os.reboot()
end
At line 56, I'm getting a invalid pattern capture. This didn't happen the first time I tried this, about a week ago, am I doing something wrong?
Please help.
EDIT: Never mind, my random string generator had symbols that were used as pattern codes, so it was thinking about patterns. Removed those symbols, problem solved.
Edited on 25 November 2013 - 07:18 PM