Jump to content


makerimages's Content

There have been 81 items by makerimages (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#162178 Inbuilt Encryption

Posted by makerimages on 27 January 2014 - 11:00 AM in Suggestions

It would be great to have an inbuilt way of encrypting data, with most of the widespread forms: sha1, md5 and some of the sha-2 ones.

Would be great if we could encrypt no matter what, so we could to this:

local table={}
table[0]="Encrypt me!"
local encryped=textutils.encrypt(table,"sha-512") --Returns a table

Would also go very well with the new improved serialization coming in 1.6.



#161364 Bitbucket Repo download

Posted by makerimages on 21 January 2014 - 07:39 AM in Ask a Pro

indeed, it is not easy to understand....



#161298 Bitbucket Repo download

Posted by makerimages on 20 January 2014 - 03:41 PM in Ask a Pro

Hey there,

I began wondering- how could I easily download the latest bitbucket repository to the computer, with it automatically making all the directories for me?



#155122 ComputerCraft App Store - Input Wanted

Posted by makerimages on 04 December 2013 - 10:37 AM in General

View Postoeed, on 21 August 2013 - 06:03 PM, said:

View PostFreack100, on 21 August 2013 - 05:42 PM, said:

Could I test too? :)

Yes, you will, you've posted. During the beta test everyone will be a moderator, however, this will only be temporary.


Me too, please!



#153769 Why Wont The Background Refresh?

Posted by makerimages on 23 November 2013 - 09:45 AM in Ask a Pro

excact error unvisible fully, seems to reboot to startup, that calss selectID which also crashes, will look further soon.



#153697 Why Wont The Background Refresh?

Posted by makerimages on 22 November 2013 - 01:44 PM in Ask a Pro

Well, did this:
local fileColorConfig=nil
local backGround=nil

local fileData = {}


function getDesign()

fileColorConfig=fs.open("OsOne/Prefrences/Design.prefrence","r");
local line = fileColorConfig.readLine()
repeat
table.insert(fileData,line)
line = fileColorConfig.readLine()
until line == nil
fileColorConfig.close()


if fileData[#fileData]=="0" then backGround=paintutils.loadImage("SystemResources/GraphicsResources/backgrounds/whiteBack.nfp") end
if fileData[#fileData]=="1" then backGround=paintutils.loadImage("SystemResources/GraphicsResources/backgrounds/orangeBack.nfp") end
if fileData[#fileData]=="2" then backGround=paintutils.loadImage("SystemResources/GraphicsResources/backgrounds/darkPinkBack.nfp") end
if fileData[#fileData]=="3" then backGround=paintutils.loadImage("SystemResources/GraphicsResources/backgrounds/lightBlueBack.nfp") end
if fileData[#fileData]=="4" then backGround=paintutils.loadImage("SystemResources/GraphicsResources/backgrounds/goldenBack.nfp") end
if fileData[#fileData]=="5" then backGround=paintutils.loadImage("SystemResources/GraphicsResources/backgrounds/limeBack.nfp") end
if fileData[#fileData]=="6" then backGround=paintutils.loadImage("SystemResources/GraphicsResources/backgrounds/pinkBack.nfp") end
if fileData[#fileData]=="9" then backGround=paintutils.loadImage("SystemResources/GraphicsResources/backgrounds/cyanBack.nfp") end --because 8 is topbar color and 7 is button BG
if fileData[#fileData]=="a" then backGround=paintutils.loadImage("SystemResources/GraphicsResources/backgrounds/purpleBack.nfp") end
if fileData[#fileData]=="b" then backGround=paintutils.loadImage("SystemResources/GraphicsResources/backgrounds/blueBack.nfp") end
if fileData[#fileData]=="c" then backGround=paintutils.loadImage("SystemResources/GraphicsResources/backgrounds/brownBack.nfp") end
if fileData[#fileData]=="d" then backGround=paintutils.loadImage("SystemResources/GraphicsResources/backgrounds/greenBack.nfp") end
if fileData[#fileData]=="e" then backGround=paintutils.loadImage("SystemResources/GraphicsResources/backgrounds/redBack.nfp") end


fileColorConfig.close()
return backGround;
end
function setDesign(design)
fileColorConfig=fs.open("OsOne/Prefrences/Design.prefrence","w");
fileColorConfig.write(design.."")
fileColorConfig.close()
end
function getColor()
fileColorConfig=fs.open("OsOne/Prefrences/Design.prefrence","r");
local fileDataI={}
local line = fileColorConfig.readLine()
repeat
table.insert(fileDataI,line)
line = fileColorConfig.readLine()
until line == nil
fileColorConfig.close()
if fileDataI[#fileData]=="0" then return colors.white end
if fileDataI[#fileData]=="1" then return colors.orange end
if fileDataI[#fileData]=="2" then return colors.magenta end
if fileDataI[#fileData]=="3" then return colors.lightBlue end
if fileDataI[#fileData]=="4" then return colors.yellow end
if fileDataI[#fileData]=="5" then return colors.lime end
if fileDataI[#fileData]=="6" then return colors.pink end
if fileDataI[#fileData]=="9" then return colors.cyan end --because 8 is topbar color and 7 is button BG
if fileDataI[#fileData]=="a" then return colors.purple end
if fileDataI[#fileData]=="b" then return colors.blue end
if fileDataI[#fileData]=="c" then return colors.brown end
if fileDataI[#fileData]=="d" then return colors.green end
if fileDataI[#fileData]=="e" then return colors.red end
end

changes color, then crashes at what I belive to be line 56 of the app in the op (term.setBackgroundColor(DesignUtils.getColor()) what is the fix? (error says expected nr



#153601 Why Wont The Background Refresh?

Posted by makerimages on 21 November 2013 - 11:30 AM in Ask a Pro

Even with it uncommented, the issue remains there.



#153510 Why Wont The Background Refresh?

Posted by makerimages on 20 November 2013 - 08:20 AM in Ask a Pro

Hey, got this code

Spoiler


and this is the DesignUtil Api
Spoiler

When I click in the program, the click is identified, and getSelection is called, but the bg wont change. what could be thae cause and the fix?



#153134 Printing A Text From A Table, Makes One Row Below Text Be With Bacground Colo...

Posted by makerimages on 16 November 2013 - 02:13 PM in Ask a Pro

worked, ty



#153131 Printing A Text From A Table, Makes One Row Below Text Be With Bacground Colo...

Posted by makerimages on 16 November 2013 - 02:08 PM in Ask a Pro

I have this

os.loadAPI("OSOne/Apis/DesignUtil");
term.setTextColor(colors.lightGray)
local background=DesignUtil.getDesign();
term.clear();
local width,height=term.getSize();
local unlockButton={
text="Unlock";
x=math.ceil(width/2);
y=math.ceil(height);
W=6;
H=1;
}
while true do
paintutils.drawImage(background,1,1);
term.setCursorPos(unlockButton.x,unlockButton.y);
term.setBackgroundColor(colors.gray);
print(unlockButton.text);
term.setCursorPos(1,1)
term.setBackgroundColor(DesignUtil.getColor())
print(width.." "..height)
sleep(1)
end

It is supposed to print unlockButton.text at the screen height. it does so one row above the screen height and makes the bottom row be dark gray..

like so
Attached Image: 2013-11-16_21.14.45.png



#153128 [1.3+][OS] WolfOS 1.3.3

Posted by makerimages on 16 November 2013 - 01:02 PM in Operating Systems

Update?



#151513 Draw A Line For Each Column

Posted by makerimages on 01 November 2013 - 08:05 AM in Ask a Pro

works, ty!



#151414 Draw A Line For Each Column

Posted by makerimages on 31 October 2013 - 09:20 AM in Ask a Pro

Hi, I have thi pieceof API code

windowSystem

a window Is created
local window=windowSystem.createWindow("About this Device",21,3,20,14,true,"Version:"..afData[1].."\n \n \n \n System:"..afData[2])
and the for k=0 block in drawWindow draws a white column at the specified position(windowp.x+1, windowp.y+k), I would like to have the entire inside of a window(from windowp.x to windowp.W-2) to be with a white bg, how can I achieve that?



#147932 Mouse Click Flicker-How To Remove?

Posted by makerimages on 05 October 2013 - 08:18 AM in Ask a Pro

Anything folks?



#147745 Mouse Click Flicker-How To Remove?

Posted by makerimages on 04 October 2013 - 12:13 AM in Ask a Pro

I tried
function removeCoroutine(functionD)
    for k, v in ipairs(programCache) do
	    if v == functionD then
		    table.remove(programCache, k)
		    table.remove(routineCache, k)

	    end
    end
end
wont work aswell



#147635 Mouse Click Flicker-How To Remove?

Posted by makerimages on 03 October 2013 - 07:05 AM in Ask a Pro

Indeed it did! but.. i need to click once more after i click the button in desktop, to have the routine appear. and also, removeCoroutine wont remove the program from running... how to add those?

ACTUALLY, if I also run the updateManager app, it will allow to close routines... but not just when one is running, AND NOT in any order I want and after that, the screen sometimes flickers again on mouse cli nevermind, updatemanager not set up yet :)



#147158 Screen Is Flickering

Posted by makerimages on 29 September 2013 - 07:32 AM in Ask a Pro

try shoving a sleep(x) into the GUI function(the very end of it) aswell



#146712 Index Expected, Got Nil

Posted by makerimages on 26 September 2013 - 01:44 PM in Ask a Pro

Why would yo need the
[n]
behind the list? if it is there, N is used as an index, remove
 [n]
from all list`s and try then

also
#list
returns the lengtht of the list



#146692 Mouse Click Flicker-How To Remove?

Posted by makerimages on 26 September 2013 - 07:18 AM in Ask a Pro

the aboutW.app now looks like this
Spoiler
  • it still flickers
  • and occasionally showes too long without yielding
  • It still shows java.lang.ThreadDeath in the console

EDIT: issue seems to be the addCoroutine method... It keeps adding multiple routines of the same thing, is there any way to stop that from happening?



#146511 Mouse Click Flicker-How To Remove?

Posted by makerimages on 25 September 2013 - 08:23 AM in Ask a Pro

Most of the things are now working.. some are not

updated windowSystem
local window=nil;
function createWindow(title,x,y,w,h,closeable,text)
window=
{
  titlew=title;
  x=x;
  y=y;
  W=w;
  H=h;
  ca=closeable;
  text=text;
}
return window
end
function drawWindow(windowp)
term.setCursorPos(window.x,window.y)
term.setBackgroundColor(colors.lightGray)
for i=0, windowp.W do
  term.setCursorPos(windowp.x+i,windowp.y)
  print(" ")
  term.setCursorPos(windowp.x+i,windowp.y+windowp.H)
  print(" ")

end
for j=0, windowp.H do
  term.setCursorPos(windowp.x,windowp.y+j)
  print(" ")
  term.setCursorPos(windowp.x+windowp.W,windowp.y+j)
  print(" ")

end
  term.setCursorPos(windowp.x+windowp.W/2-string.len(windowp.titlew)/2,windowp.y)
  term.setTextColor(colors.gray)
  print(windowp.titlew)
  if(windowp.ca) then
  
  term.setBackgroundColor(colors.red)
term.setCursorPos(windowp.x+windowp.W+1,windowp.y)
print("X")
term.setBackgroundColor(colors.white)
end
term.setCursorPos(windowp.x+2,windowp.y+2)

for i in string.gmatch(windowp.text,"[^\n]+") do
	print(i)
	x,y=term.getCursorPos()
	if i== " " then
	 term.setCursorPos(windowp.x+1,y)
	  end
end
end

the kernel part that manages routnes(this might be what is wrong)
programCache={}
routineCache={}
local evt={}
--table.insert(programCache,function() shell.run("OSCore/desktop")end)
local routine=nil;
os.queueEvent("abc", 6, "meow")
function startCoroutines()
for i=1, #programCache,1 do
  routine=coroutine.create(programCache[i])
  table.insert(routineCache,routine)
  ok, err=coroutine.resume(routine,unpack(evt))
end
end
function updateCoroutines()
for i=1, #routineCache,1 do
  if coroutine.status(routineCache[i])=="suspended" then
  ok, err=coroutine.resume(routineCache[i],unpack(evt))
  end
end
end
function addCoroutine(functionD)
table.insert(programCache,functionD)
startCoroutines()
updateCoroutines()
end
function removeCoroutine(functionD)
for k,v in ipairs(programCache) do
  if v==functionD then
   table.remove(programCache,k)
  end
end
end
if loggedStatus then
addCoroutine(function() shell.run("OSCore/desktop")end)
end
while true do
evt={os.pullEvent()}
updateCoroutines()

end

desktop coroutine
os.loadAPI("Apis/DesignUtil")
os.loadAPI("Apis/AccountSytem")
os.loadAPI("Apis/windowSystem")
DesignUtil.setDesign("whiteLightGray")
local background,topBar =DesignUtil.getDesign()
local showOS1Menu = false;

term.setTextColor(colors.gray)
local OS1MenuB={
text="O1|";
x=1;
y=1;
W=3;
H=1;
}
local OS1MenuSelections=
{
s1Text="About this device";
s1X=1;
s1Y=2;
s1W=17;
s1H=1;
s2Text="Software update  ";
s2X=1;
s2Y=3;
s2W=17;
s2H=1;
s3Text="Restart device   ";
s3X=1;
s3Y=4;
s3W=17;
s3H=1;
s4Text="Shut down		";
s4X=1;
s4Y=5;
s4W=17;
s4H=1;
}
function registerClickEvent(x,y)
if x >=OS1MenuB.x and x <=OS1MenuB.x+OS1MenuB.W-1 and y >=OS1MenuB.y and y <=OS1MenuB.y+OS1MenuB.H-1 then
  if showOS1Menu then
   showOS1Menu=false
   else
	showOS1Menu=true
   end
end
if x >=OS1MenuSelections.s1X and x <=OS1MenuSelections.s1X+OS1MenuSelections.s1W-1 and y >=OS1MenuSelections.s1Y and y <=OS1MenuSelections.s1Y+OS1MenuSelections.s1H-1 then
  addCoroutine(function() shell.run("OSCore/aboutW.app")end)
  print("added routine")

end
end
function printOS1Menu()
if showOS1Menu then
  term.setBackgroundColor(colors.lightGray)
  term.setCursorPos(OS1MenuSelections.s1X,OS1MenuSelections.s1Y)
  print(OS1MenuSelections.s1Text)
  term.setCursorPos(OS1MenuSelections.s2X,OS1MenuSelections.s2Y)
  print(OS1MenuSelections.s2Text)
  term.setCursorPos(OS1MenuSelections.s3X,OS1MenuSelections.s3Y)
  print(OS1MenuSelections.s3Text)
  term.setCursorPos(OS1MenuSelections.s3X,OS1MenuSelections.s3Y)
  print(OS1MenuSelections.s3Text)
  term.setCursorPos(OS1MenuSelections.s4X,OS1MenuSelections.s4Y)
  print(OS1MenuSelections.s4Text)


end
end
while true do
local e = {os.pullEvent()}
paintutils.drawImage(background,1,1)
paintutils.drawImage(topBar,1,1)


term.setCursorPos(OS1MenuB.x,OS1MenuB.y)
term.setBackgroundColor(colors.lightGray)
print(OS1MenuB.text)

if e[1]=="mouse_click" then
  registerClickEvent(e[3],e[4])
   printOS1Menu()
end
end

and aboutW.app coroutine
os.loadAPI("Apis/windowSystem")
local afData = {}
local x,y=0;
function exit()


end
local SysU=
{
text="Software update";
x=22;
y=7;
W=15;
H=1;
}

function loadAbout()
local abF=fs.open("data/osInfo","r")
local line = abF.readLine()
repeat
  table.insert(afData,line) -- Puts the value of the current line into the table we have.
  line = abF.readLine() -- read the next line
until line == nil -- readLine() returns nil when the end of the file is reached.
abF.close() -- Close up the file ready for use again.
end
loadAbout()
function registerClick(xPos,yPos)
shell.run("OSCore/loginUtil")
if xPos==window.x+window.W+1 and yPos==window.y then
   exit()
  end
if xPos >= SysU.x and xPos <= SysU.x + SysU.W - 1 and yPos >= SysU.y and yPos <=  SysU.y + SysU.H then
   shell.run("OSCore/updateManager.app")
  end
end
local window=windowSystem.createWindow("About this Device",21,3,18,13,true,"Version:"..afData[1].." \n \n \n System: "..afData[2])
while true do
	local e = {os.pullEvent()}
windowSystem.drawWindow(window)
term.setBackgroundColor(colors.white)

   if e[1]=="mouse_click" then
		registerClick(e[3],e[4])
	end


end

heres what Id still need to make working
  • The menu in desktop wont close if I click outside of it
  • When I add the aboutW.app coroutine, the said routine starts to flicker onscreen, displays errors: No such program and AboutW:37 attemp to index ? (a nil value) (but I pass in the x and y, dont I?)
  • After a short while: TOO LONG WITHOUT YIELDING can be briefly seen, comsole spills out java.lang.ThreadDeath
How can a I make those problems dissapear aswell?? Should I load the apis inside the handler aswell, not separately in each coroutine???



#146376 Mouse Click Flicker-How To Remove?

Posted by makerimages on 24 September 2013 - 08:00 AM in Ask a Pro

Allright, what am I missing here?

the coroutine manager

programCache={}
routineCache={}
local xPos=0
local yPos=0
table.insert(programCache,function() shell.run("OSCore/desktop",xPos,yPos)end)
local routine=nil;
function startCoroutines()
for i=1, #programCache,1 do
  routine=coroutine.create(programCache[i])
  table.insert(routineCache,routine)
  ok, err=coroutine.resume(routine)
end
end
function updateCoroutines()
for i=1, #routineCache,1 do
  if coroutine.status(routineCache[i])=="suspended" then
  ok, err=coroutine.resume(routineCache[i],xPos,yPos)
  end
end
end
startCoroutines()
while true do
event, button, xPos, yPos = os.pullEvent("mouse_click")
updateCoroutines()
end

current coroutine
local tArgs = {...}
os.loadAPI("Apis/DesignUtil")
os.loadAPI("Apis/AccountSytem")
os.loadAPI("Apis/windowSystem")
DesignUtil.setDesign("whiteLightGray")
local background,topBar =DesignUtil.getDesign()
local showOS1Menu = false;
term.setTextColor(colors.gray)
if #tArgs<1 then
error("Desktop: expected mouse_click coordinates X and Y, but they were not given!")
end
function registerClickEvent(x,y)
if x >=0 and x <=1+3-1 and y >=0 and y <=1+1-1 then
  showOS1Menu= not showOS1Menu
end
end
function printOS1Menu()
if showOS1Menu then
  term.setBackgroundColor(colors.lightGray)
  term.setCursorPos(1,2)
  print("About this device")
  term.setCursorPos(1,3)
  print("Software update  ")
  term.setCursorPos(1,4)
  print("Restart device   ")
  term.setCursorPos(1,5)
  print("Shut down		")
end
end
while true do

paintutils.drawImage(background,1,1)
paintutils.drawImage(topBar,1,1)

printOS1Menu()
term.setCursorPos(1,1)
term.setBackgroundColor(colors.lightGray)
print("O1|")


registerClickEvent(tonumber(tArgs[1]),tonumber(tArgs[2]))
sleep(1)
end

the coroutine still is not responding to clicks, what am I doing wrong still?

EDIT: besides having a sleep in there(any workarounds to not need that there?)



#146297 Mouse Click Flicker-How To Remove?

Posted by makerimages on 23 September 2013 - 12:34 PM in Ask a Pro

brilliant, will try that out asap.

edit:you should put that doc in the tutorials section, it lacks on coroutines, if I get this working, I might write one aswell.



#146286 Mouse Click Flicker-How To Remove?

Posted by makerimages on 23 September 2013 - 11:15 AM in Ask a Pro

Form what I saw quickly having an initial read on the doc, i could create a separate program, to handle running of coroutines and have that do click checks and pass the x and y to the routine, in coroutine.resume and have actual position check in the routine, could I?



#146270 How to easily create, modify and use configs (properly)

Posted by makerimages on 23 September 2013 - 09:11 AM in Ask a Pro

Provide the code to the forum!



#146269 Mouse Click Flicker-How To Remove?

Posted by makerimages on 23 September 2013 - 09:07 AM in Ask a Pro

Hi, I have a program
os.loadAPI("Apis/DesignUtil")
os.loadAPI("Apis/AccountSytem")
os.loadAPI("Apis/windowSystem")
DesignUtil.setDesign("whiteLightGray")
local background,topBar =DesignUtil.getDesign()
local showOS1Menu = false;
local routine=nil;
programCache={}
table.insert(programCache,function() shell.run("OSCore/aboutW.app") end)
function updateCache()
for i=1, #programCache,1 do
  routine=coroutine.create(programCache[i])
  ok, err=coroutine.resume(routine)
end
end

term.setTextColor(colors.gray)
function registerClickEvent(x,y)
if x >=0 and x <=1+3-1 and y >=0 and y <=1+1-1 then
  showOS1Menu= not showOS1Menu
end
end
function printOS1Menu()
if showOS1Menu then
  term.setBackgroundColor(colors.lightGray)
  term.setCursorPos(1,2)
  print("About this device")
  term.setCursorPos(1,3)
  print("Software update  ")
  term.setCursorPos(1,4)
  print("Restart device   ")
  term.setCursorPos(1,5)
  print("Shut down	    ")
end
end
while true do

paintutils.drawImage(background,1,1)
paintutils.drawImage(topBar,1,1)
updateCache()
printOS1Menu()
term.setCursorPos(1,1)
term.setBackgroundColor(colors.lightGray)
print("O1|")
event, button, xPos, yPos = os.pullEvent("mouse_click")
registerClickEvent(xPos,yPos)
sleep(0.15)
end

which runs this program as a coroutine
os.loadAPI("Apis/windowSystem")
local afData = {}
local x,y=0;
function exit()
print(programCache[1])

end
local SysU=
{
text="Software update";
x=22;
y=7;
W=15;
H=1;
}

function loadAbout()
local abF=fs.open("data/osInfo","r")
local line = abF.readLine()
repeat
  table.insert(afData,line) -- Puts the value of the current line into the table we have.
  line = abF.readLine() -- read the next line
until line == nil -- readLine() returns nil when the end of the file is reached.
abF.close() -- Close up the file ready for use again.
end
loadAbout()
function registerClick(xPos,yPos)
shell.run("OSCore/loginUtil")
if xPos==window.x+window.W+1 and yPos==window.y then
   exit()
  end
if xPos >= SysU.x and xPos <= SysU.x + SysU.W - 1 and yPos >= SysU.y and yPos <=  SysU.y + SysU.H then
   shell.run("OSCore/updateManager.app")
  end
end
local window=windowSystem.createWindow("About this Device",21,3,18,13,true,"Version:"..afData[1].." \n \n \n System: "..afData[2])
while true do
windowSystem.drawWindow(window)
term.setBackgroundColor(colors.white)
 
local event, button, XPos, YPos=os.pullEvent("mouse_click")
	    registerClick(XPos,YPos)
  sleep(0.15)
end

It uses apis:

windowSystem:
local window=nil;
function createWindow(title,x,y,w,h,closeable,text)
window=
{
  titlew=title;
  x=x;
  y=y;
  W=w;
  H=h;
  ca=closeable;
  text=text;
}
return window
end
function drawWindow(windowp)
term.setCursorPos(window.x,window.y)
term.setBackgroundColor(colors.lightGray)
for i=0, windowp.W do
  term.setCursorPos(windowp.x+i,windowp.y)
  print(" ")
  term.setCursorPos(windowp.x+i,windowp.y+windowp.H)
  print(" ")

end
for j=0, windowp.H do
  term.setCursorPos(windowp.x,windowp.y+j)
  print(" ")
  term.setCursorPos(windowp.x+windowp.W,windowp.y+j)
  print(" ")
 
end
  term.setCursorPos(windowp.x+windowp.W/2-string.len(windowp.titlew)/2,windowp.y)
  term.setTextColor(colors.gray)
  print(windowp.titlew)
  if(windowp.ca) then
  
  term.setBackgroundColor(colors.red)
term.setCursorPos(windowp.x+windowp.W+1,windowp.y)
print("X")
term.setBackgroundColor(colors.white)
end
term.setCursorPos(windowp.x+2,windowp.y+2)

for i in string.gmatch(windowp.text,"[^\n]+") do
    print(i)
    x,y=term.getCursorPos()
    if i== " " then
	 term.setCursorPos(windowp.x+1,y)
	  end
end
sleep(0.1)
end

and DesignUtil

local fileColorConfig=nil
local topBar=nil
local backGround=nil

local fileData = {}

function getDesign()

fileColorConfig=fs.open("data/colorCombos/current","r");
local line = fileColorConfig.readLine()
repeat
table.insert(fileData,line)
line = fileColorConfig.readLine()
until line == nil
fileColorConfig.close()
local fileColorSetting=fs.open("data/colorCombos/"..fileData[1],"r");

local fileDataSetting = {}
local lineSetting = fileColorSetting.readLine()
repeat
table.insert(fileDataSetting,lineSetting)
lineSetting = fileColorSetting.readLine()
until lineSetting == nil
fileColorSetting.close()
if fileDataSetting[1]=="0" then backGround=paintutils.loadImage("graphics/backgrounds/whiteBack.nfp") end
if fileDataSetting[1]=="1" then backGround=paintutils.loadImage("graphics/backgrounds/orangeBack.nfp") end
if fileDataSetting[1]=="2" then backGround=paintutils.loadImage("graphics/backgrounds/darkPinkBack.nfp") end
if fileDataSetting[1]=="3" then backGround=paintutils.loadImage("graphics/backgrounds/lightBlueBack.nfp") end
if fileDataSetting[1]=="4" then backGround=paintutils.loadImage("graphics/backgrounds/goldenBack.nfp") end
if fileDataSetting[1]=="5" then backGround=paintutils.loadImage("graphics/backgrounds/limeBack.nfp") end
if fileDataSetting[1]=="6" then backGround=paintutils.loadImage("graphics/backgrounds/pinkBack.nfp") end
if fileDataSetting[1]=="7" then backGround=paintutils.loadImage("graphics/backgrounds/grayBack.nfp") end
if fileDataSetting[1]=="9" then backGround=paintutils.loadImage("graphics/backgrounds/cyanBack.nfp") end --because 8 is topbar color
if fileDataSetting[1]=="a" then backGround=paintutils.loadImage("graphics/backgrounds/purpleBack.nfp") end
if fileDataSetting[1]=="b" then backGround=paintutils.loadImage("graphics/backgrounds/blueBack.nfp") end
if fileDataSetting[1]=="c" then backGround=paintutils.loadImage("graphics/backgrounds/brownBack.nfp") end
if fileDataSetting[1]=="d" then backGround=paintutils.loadImage("graphics/backgrounds/greenBack.nfp") end
if fileDataSetting[1]=="e" then backGround=paintutils.loadImage("graphics/backgrounds/redBack.nfp") end


if fileDataSetting[2]=="8"then topBar=paintutils.loadImage("graphics/topBars/topBarLightGray.nfp") end
fileColorConfig.close()
return backGround, topBar;
end
function setDesign(design)
fileColorConfig=fs.open("data/colorCombos/current","w");
fileColorConfig.write(design)
fileColorConfig.close()
end

What I would really like is for the coroutine program to be able to register the click and run exit(), not return control back to the program that called it, how could I do this?