Posted 05 January 2017 - 09:14 PM
http://pastebin.com/Bcs8xVA2 <– full code (sorry about readability)
to save you some time, i'll put here where i think the code is breaking:
Essentially, the idea is that the word 'function' is taken out of the string & put into a seperate drawing call to show up as blue, the problem is (line 232 in pastebin, example 2, line 16 in text post) is never called, meaning that (line 89-94 in pastebin, example 1, line 11-15 in text post) is not doing it's job, but IS called.
to save you some time, i'll put here where i think the code is breaking:
Example 1
function makeRenderObjects()
renderc=1
renderObjects={}
for k,v in pairs(lines) do
beginp, endp = string.find(lines[k], 'function')
if beginp ~= nil then
for i = beginp, endp do
lines[k]=string.gsub(lines[k],'function',' ')
end
renderObjects[renderc] = {}
renderObjects[renderc]['text']="function"
renderObjects[renderc]['x'] = beginp
renderObjects[renderc]['y'] = k
renderObjects[renderc]['color']=colors.blue
end
end
end
Example 2
function render()
--term.write(lines[k])
renderObjects={}
makeRenderObjects()
for k,v in pairs(lines) do
term.setBackgroundColor(colors.gray)
term.setCursorPos(1,k+uioff)
term.write(k)
--term.setBackgroundColor(colors.gray)
term.setCursorPos(4,k+uioff)
term.write(lines[k])
end
for k,v in pairs(renderObjects) do
os.setComputerLabel("yeak ok") -- THIS LINE IS NEVER CALLED
term.setCursorPos(renderObjects[k]['x']+3,renderObjects[k]['y']+uioff)
term.setTextColor(renderObjects[k]['color'])
term.write(renderObjects[k]['text'])
end
term.setTextColor(colors.white)
end
Essentially, the idea is that the word 'function' is taken out of the string & put into a seperate drawing call to show up as blue, the problem is (line 232 in pastebin, example 2, line 16 in text post) is never called, meaning that (line 89-94 in pastebin, example 1, line 11-15 in text post) is not doing it's job, but IS called.
Edited on 05 January 2017 - 11:18 PM