8 posts
Posted 06 March 2018 - 10:02 PM
I have changed my code a bit recently, to add a few more menus and to also change a bit of how they work. I also added a small reactor monitor to start the process of having this computer run my base. Now it is throwing this error when I click anywhere on the screen, the program loads up just fine but crashes on click:
The code can be found here:
https://pastebin.com/SRva7cRvAny help would be awesome!
2427 posts
Location
UK
Posted 06 March 2018 - 10:13 PM
8 posts
Posted 07 March 2018 - 12:42 AM
Well, I got the program and used: "trace startup" and I got this:
I get the whole "got nil" thing, but nothing else makes sense, I dont know where the "nil" is being called.
25 posts
Posted 07 March 2018 - 05:09 AM
Just a shot in the dark, but I tried following a bit and I have some places you could possibly check. Nil might be coming from the click event function in line 225. There're a lot of menus you can check, so try running the program with some extra functions to write to a file (as your screen will probably erase print lines). You could also use a combination of print and pause functions to see debug info as you run the program.
I can imagine that the problem could come from lines 17 and 18. The values of those are used in line 227 to call the function drawscreen() in line 131. This is important because the bcol variable for running the clear() function (which runs in line 79) comes from drawscreen() which gets bcol from terminalclick() in line 227. The value first assigned to what becomes bcol to be used to set the background color in line 80 should be a string and comes all the way from the value of _bgcolor in line 17.
_bgcolor may be the problem. Try running the program but print the value of _bgcolor in line 18 and have the program pause for a bit. If it outputs nil instead of a color string then you'll need to find "config" within the files near DS_DATA/kernal. (Or at least where the kernal API collects its data with the kerneal.getLine() function.
This may be entirely wrong, but just give a try at testing the value of _bgcolor. If that's not the issue, then try looking a bit through the terminalClick() function in line 225 and see where the different menu functions lead. You may end up needing to use comments to temporarily disable code so you can have the bare minimum left of what may be causing your issues. Good luck!
7083 posts
Location
Tasmania (AU)
Posted 07 March 2018 - 10:18 AM
Given that the errors are being spawned from within CC's code, it'd be a bit easier to track what's triggering them if you provided the version number for your CC install. The code in concern has changed a bit over time.
8 posts
Posted 07 March 2018 - 02:23 PM
Well, in response to Bomb Bloke, the version number Im assuming is the 1.7 (if the start screen for the computers is any indicator) and its for minecraft 1.7.10, For SuperDyl, I will check and see what I can do in regards to all that and see if I cant locate the issue that way.
3057 posts
Location
United States of America
Posted 07 March 2018 - 03:45 PM
Your CC version is not the CraftOS version.
You've narrowed it down to 1.64, 1.65, 1.7, 1.71-3, 1.74, or 1.75.
8 posts
Posted 07 March 2018 - 04:16 PM
Sorry about that, I responded before my brain woke up (had just gotten up) the cc version is 1.75
749 posts
Location
BOO!!
Posted 07 March 2018 - 04:51 PM
This is caused by term.blit()
Are you using any special characters?
Did you check all of your colors validity?
I would pay special attention to these calls:
window.clearLine()
window.blit()
window.write()
window.setTextColor()
window.setBackgroundColor()
--After a redirect
print()
write()
You should also debug around the following calls:
window.reposition()
window.setVisible()
window.clear()
window.scroll()
window.redraw()
Basically, anything that uses color, text, or redraws the screen
Edited on 07 March 2018 - 04:01 PM
8 posts
Posted 07 March 2018 - 05:41 PM
Well, I managed to completly miss the error, near the very end of the file, I call my function "clear()" however the function requires a color, so adding colors.black to clear() will make it work, I found that out while I was rewritting my program from an earlier date. Thanks for the help, but it was just a slight oversight.