Posted 14 August 2013 - 11:30 AM
Hi there, first of all, i just want to say that this is not my code.
But when trying to run it, I get an error saying multiple points.
What is this error? How do I fix it, what causes it?
Code:
But when trying to run it, I get an error saying multiple points.
What is this error? How do I fix it, what causes it?
Code:
Spoiler
print("0")--This code doesn't even run
local m = peripheral.wrap("top")
local w, h = m.getSize()
print("1")
term.redirect(m)
local function clear ()
term.setBackgroundColor(colors.white)
term.clear()
end
print("2")
local function topleft (color)
paintutils.drawPixel(1, 1, color)
paintutils.drawPixel(2, 1, color)
paintutils.drawPixel(2, 2, color)
paintutils.drawPixel(1, 2, color)
end
print("3")
local function topright (color)
paintutils.drawPixel(w, 1, color)
paintutils.drawPixel(w, 2, color)
paintutils.drawPixel(w - 1, 1, color)
paintutils.drawPixel(w - 1, 2, color)
end
print("4")
local function bottomleft (color)
paintutils.drawPixel(1, h, color)
paintutils.drawPixel(2, h, color)
paintutils.drawPixel(1, h - 1, color)
paintutils.drawPixel(2, h - 1, color)
end
print("5")
local function bottomright (color)
paintutils.drawPixel(w, h, color)
paintutils.drawPixel(w, h - 1, color)
paintutils.drawPixel(w - 1, h - 1, color)
paintutils.drawPixel(w - 1, h, color)
end
print("6")
local function bool(var)
return not var ---*Face palm for me* I forget alot about no
end
print("7")
local tl = false
local tr = false
local bl = false
local br = false
print("8")
while true do
local event, x, y, button = os.pullEvent("mouse_click")
w, h = m.getSize()
clear()
local xy = x .. "," .. y
if xy == "1,1" or xy == "1,2" or xy == "2,1" or xy == "2,2" then
tl = bool(tl)
elseif xy == w.. ",1" or xy == w.. ",2" or xy == w - 1.. ",1" or xy == w - 1.. ",2" then
tr = bool(tr)
elseif xy == "5,5" then
bl = bool(bl)
elseif xy == "6,6" then
br = bool(br)
end
if tl then
topleft(colors.red)
elseif tr then
topright(colors.red)
elseif bl then
bottomleft(colors.red)
elseif br then
bottomright(colors.red)
end
end
term.restore()