Posted 19 September 2015 - 12:52 PM
I'm currently making a turtle miner program from scratch. Although there is already a program in the turtle itself that does what I want it to do, I wanted to challenge myself. This program, beyond the program in the turtle itself, will contain a GUI program inside a computer (which will send various commands via rednet), where you will be able to set different variables, dynamically stop the mining process, etc. I'm currently working on the computer part, but I quickly found a problem on the buttons.
You see, I want my GUI to have cycling buttons, aka, a selector with two buttons, one of which will increment the value of the selector and another button which will decrement the value. This type of button will be used to set both colors (background color, text color…) and numbers (specifically for the mining area).
The problem that I'm having is that, whenever I run the code, the computer registers the buttons, but crashes when drawing them. It says something along the lines of 'window 57: Expected number' and shuts itself off. I've tried to work around the function that draws the buttons, but nothing seems to work, since the program keeps crashing all the time. Here's the code: http://pastebin.com/3BXYnbiC
You see, I want my GUI to have cycling buttons, aka, a selector with two buttons, one of which will increment the value of the selector and another button which will decrement the value. This type of button will be used to set both colors (background color, text color…) and numbers (specifically for the mining area).
The problem that I'm having is that, whenever I run the code, the computer registers the buttons, but crashes when drawing them. It says something along the lines of 'window 57: Expected number' and shuts itself off. I've tried to work around the function that draws the buttons, but nothing seems to work, since the program keeps crashing all the time. Here's the code: http://pastebin.com/3BXYnbiC