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

[whats wrong] <<explains

Started by LuaEclipser, 11 March 2013 - 01:32 PM
LuaEclipser #1
Posted 11 March 2013 - 02:32 PM
i am making (yes, ANOTHER) an os and i am COMPLETELY stuck on the desktop.

i painted a pic in paint. named it .desktop

then did this.


desk = paintutils.loadImage(".desktop")
paintutils.drawImage(desk,1,1)
i get error;

paintutils:92:attempt to get length of nil

i uninstalled and reinstalled cc

halp?
Sammich Lord #2
Posted 11 March 2013 - 02:33 PM
Did you check that .desktop is in the same directory that the script you are running is? You should also use exact paths.
LuaEclipser #3
Posted 11 March 2013 - 02:35 PM
it is;


whats an exact path?
Sammich Lord #4
Posted 11 March 2013 - 02:37 PM
For instance: "/.desktop" instead of ".desktop". This insures it accesses the file from that directory instead of the directory it was ran from.
LuaEclipser #5
Posted 11 March 2013 - 02:38 PM
still same error
Sammich Lord #6
Posted 11 March 2013 - 02:44 PM
Just looked at the API. It is trying to get the length of a table that does not exist meaning that it could not save the image to the file.
Mind giving the contents of ".desktop"?
LuaEclipser #7
Posted 11 March 2013 - 02:45 PM
ok
LuaEclipser #8
Posted 11 March 2013 - 02:47 PM
http://pastebin.com/rtYSpVym
LuaEclipser #9
Posted 11 March 2013 - 02:49 PM
i tried it in a diff. program,

no cigar
LuaEclipser #10
Posted 11 March 2013 - 02:57 PM
abandonment :(/>
remiX #11
Posted 11 March 2013 - 05:45 PM
Where EXACTLY did you put the .desktop file?
Dlcruz129 #12
Posted 11 March 2013 - 06:09 PM
You definitely have the two files in different directories.
LuaEclipser #13
Posted 12 March 2013 - 11:24 AM
its in cd/disk
and the drawing file is in cd/disk
LuaEclipser #14
Posted 12 March 2013 - 11:32 AM
i really need this :(/>
LuaEclipser #15
Posted 12 March 2013 - 11:41 AM
i got it

i used npaintpro instead of paint
LuaEclipser #16
Posted 12 March 2013 - 11:56 AM
and cant use cd disk
SuicidalSTDz #17
Posted 12 March 2013 - 02:07 PM
its in cd/disk
and the drawing file is in cd/disk
i really need this :(/>
i got it

i used npaintpro instead of paint
and cant use cd disk
Instead of creating a new post every 5 minutes, why don't you use that handy 'Edit' button near the bottom of your post. <_</>
remiX #18
Posted 12 March 2013 - 05:39 PM
If it's in DISK then you need
desk = paintutils.loadImage(".desktop")
to be
desk = paintutils.loadImage("disk/.desktop")