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

263: nil error. little bit of help maybe?

Started by DragonT4, 15 January 2013 - 10:32 PM
DragonT4 #1
Posted 15 January 2013 - 11:32 PM
due to the lack of [me noticing it was on the same website *edit* LOL] in the actual formun i got the program from i thought i ask on here. tho i'm still not sure if i should post the code on here, the guy is and i am having problems with his auto reactor text. it has to do with the save i know that. but i am not skilled enough to know what it is…
CoolisTheName007
ChunLing #2
Posted 16 January 2013 - 06:01 AM
It is usual to post any errors you're getting with a program in the thread where you found the program. If the thread is clearly dead (you can see that error reports are not being addressed), then posting here is perfectly acceptable. I believe that CoolisTheName is still active and probably will be maintaining any programs.
DragonT4 #3
Posted 16 January 2013 - 09:34 AM
yeah, i went and added a comment to the forum, if i don't have anything soon i'll post it here. ty :)/>
DragonT4 #4
Posted 16 January 2013 - 03:50 PM
i have not recieved any reply from Coolis so i will post it here.


    function saveReactors(reactors)
		    file=fs.open('disk/AR_reactors','w')
		    for i,reactor in  pairs(reactors) do
			    s='Entry{name=\''..reactor.name..'\', target=\''..reactor.target..'\', sensor=\''..reactor.sensor..'\', size=\''..reactor.size..'\', pos=\''..reactor.pos..'\', ice_slots_start=\''..compress(reactor.ice_slots_start)..'\'}'
			    file.writeLine(s)
		    end
		    file.close()
    end
	
    function getSavedReactors()
		    local reactors = {}
	    function Entry (B)/>/> reactors[#reactors+1] = b  end
	    dofile("disk/AR_reactors")
	    for i, r in pairs(reactors) do
		    r.size=tonumber(r.size)
	    end
	    return reactors
    end
	
	
    function saveParams(params)
		    file=fs.open('disk/AR_params','w')
		    for i,v in  pairs(params) do
				    s='Entry{\''..tostring(i)..'\',\''..tostring(v)..'\'}'
				    file.writeLine(s)
		    end
		    file.close()
    end
	
    function getSavedParams()
		    params = {}
		    if fs.exists('disk/AR_params') then
		    function Entry (B)/>/> params[b[1]]=tonumber(b[2])  end
		    dofile("disk/AR_params")
	    end
	    return params
    end
	
line 263 is

		  s='Entry{name=\''..reactor.name..'\', target=\''..reactor.target..'\', sensor=\''..reactor.sensor..'\', size=\''..reactor.size..'\', pos=\''..reactor.pos..'\', ice_slots_start=\''..compress(reactor.ice_slots_start)..'\'}'
DragonT4 #5
Posted 16 January 2013 - 10:28 PM
the only way i got it to work was to manually set up the save file myself. after that, i did a reboot and it worked. but i still don't know why it wouldn't work right of the bat…
remiX #6
Posted 17 January 2013 - 01:22 AM
Shouldn't reactor.names, reactor.targets etc be reactors.names etc
ChunLing #7
Posted 17 January 2013 - 07:51 AM
Umm…maybe? This code looks…very odd.
remiX #8
Posted 17 January 2013 - 08:05 AM
Umm…maybe? This code looks…very odd.

Yeah xD

Have you tried my suggestion, dragon?
DragonT4 #9
Posted 17 January 2013 - 08:10 PM
i'll post the full code, on second thought, its 300+lines. i'll give the link lol http://pastebin.com/tjvD0kF2 let me give it a try and see if it will work.
DragonT4 #10
Posted 17 January 2013 - 08:17 PM
Umm…maybe? This code looks…very odd.

Yeah xD

Have you tried my suggestion, dragon?

i did try to do reactorS.name etc etc, but ti didn't work, i did try it on my server, worked fine… single player.. yeah it gave me a bone >.<
it creates 2 extra files when it works, the AR_reactor and AR_prams file, but in sp it creates a empty AR_reactor that i have to delete to reboot the cp.
remiX #11
Posted 18 January 2013 - 02:14 AM
Did you try reactors.name or reactorS.name? Which one worked on your server?
DragonT4 #12
Posted 18 January 2013 - 07:46 PM
Did you try reactors.name or reactorS.name? Which one worked on your server?

i tried, "reactors.name" and "reactors.names" the stock coding worked fine on my server. its really odd. single player. it doesn't. i had to manually make the single player "AR_reactors" file and after that it worked :/ its really odd.
i had a idea it has to do with the location it has to save to. it may be that seeing how the server is on my desktop in a folder it can save no problem, but single player is in the app data so it requires a admins save basically. odd i know, but I've seen weird stuff like this lol.