Posted 05 February 2013 - 02:19 PM
I am trying to make a touchscreen shop and this error comes up for me and I do not what to do with it. This error really does not tell me which line the error is on or anything
bios:466: Expected string
Here is the code I have mode so far.
bios:466: Expected string
Here is the code I have mode so far.
local function printGUI()
monitor.setCursorPos(1,1)
monitor.write("_____________ ______________ ")
monitor.setCursorPos(1,2)
monitor.write(":Add Chicken: :Add Beef : ")
monitor.setCursorPos(1,3)
monitor.write("------------- -------------- ")
monitor.setCursorPos(1,4)
monitor.write("______________________________ ")
monitor.setCursorPos(1,5)
monitor.write("Chicken: "..cNum)
monitor.setCursorPos(1,6)
monitor.write("Beef: "..bNum)
monitor.setCursorPos(1,7)
monitor.write("Pork: "..pNum)
monitor.setCursorPos(1,9)
monitor.write("[DONE] Press DONE when finished.")
end
local function clearScreen()
monitor.clear()
printGUI()
end
local function printTitle()
monitor.clear()
monitor.setCursorPos(1,5)
monitor.write("Press Screen to continue....")
sleep(1)
end
monitor = peripheral.wrap(mside)
mside = "right"
sscreen = "false"
cNum = 0
bNum = 0
pNum = 0
while true do
printTitle()
local event, p1 = os.pullEvent()
if event == "monitor_touch" then
sscreen = "true"
while sscreen == "true" do
clearScreen()
local event, side, x, y = os.pullEvent("monitor_touch")
if x >= 1 and x <= 13 then
if y == 1 or y == 2 or y == 3 then
cNum = cNum + 1
end
elseif x >= 16 and x <= 29 then
if y == 1 or y == 2 or y == 3 then
bNum = bNum + 1
end
elseif x >= 31 and x <= 44 then
pNum = pNum + 1
end
end
end
end