This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Andrew2060's profile picture

[Terminal Glasses] [Help]

Started by Andrew2060, 04 January 2016 - 10:37 AM
Andrew2060 #1
Posted 04 January 2016 - 11:37 AM
Hi,

I was trying to make a circular radar with a proximity sensor, advanced computer and terminal glasses.
The program is supposed to display entities on a circular grid on the glasses.

Basically its supposed to make a circular radar grid rather than a rectangular one.


ox=20
oy=10
width=20
height=10
color=colors.green

--[Functions]--
function createGui(ox, oy, width, height, color)
 glasses.clear()
   for y=-height,height,1 do
    for x=-width,width,1 do
     if x*x*height*height+y*y*width*width <= height*height*width*width then
      glasses.addBox(ox+x, oy+y, color)
       end
     end
   end
 end

It first returned "Attempt to perform arithmetic on Nil"
After i messed around with it "Parameter height is missing"
Then i tried to fix it and got "Parameter X is missing"

Basically all i want to know is, how can i draw a circlular box with terminal glasses.

Would be really appreciated if one could explain and provide examples too!

Thanks!
LeDark Lua #2
Posted 04 January 2016 - 11:49 AM
If its a box you need to specify: width, height of the box.