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

Variable in code not working properly

Started by crackroach, 07 September 2014 - 08:09 PM
crackroach #1
Posted 07 September 2014 - 10:09 PM
So here's my problem

local function window()
--default of x, y value = 39, 12
local x, y = term.getSize()
local application  ={"Tunnel 1x2"; "Tunnel 2x2"; "Tunnel 3x3"; "Tunnel 2x2adv"; "Mettre a jour"; "Charger Dernier"; "Configuration"}

local title = "Turtle Miner v.3.0"
term.setCursosPos((x - #title) / 2, 1) -- problem here

end

When i run this code it says :"startup:7: attemp to call a nil. I've done this multiple time before and i just don't know why it does'nt work correctly this time.

Thanks for help
Dog #2
Posted 07 September 2014 - 10:11 PM
You have term.setCursosPos instead of term.setCursorPos (you have an 's' instead of an 'r' at the end of 'Cursor')
crackroach #3
Posted 07 September 2014 - 10:13 PM
You have term.setCursosPos instead of term.setCursorPos (you have an 's' instead of an 'r' at the end of 'Cursor')

thanks… I think it's time for me to go to bed :lol:/>