3 posts
Posted 25 November 2015 - 11:18 PM
I wrote a program for a turtle to craft different tools based on a touchscreen input from a monitor. I ran it after editing a few lines of code, and nothing happened. I then tried to edit it, but I received an error: "Error: 132: attempt to call string". I don't know why it's doing this. I checked my saves file and the program is still in there. What's going on?
7083 posts
Location
Tasmania (AU)
Posted 26 November 2015 - 12:00 AM
More likely than not, you defined a string with the same title as one of ComputerCraft's in-built functions. You likely also made it a
global variable, meaning that it's remaining loaded in memory even when your script completes - it'll stay there until you reboot the computer, interfering with any other scripts that relied on the original function pointer.
If you can't figure it out, post your code.
3 posts
Posted 26 November 2015 - 12:29 AM
I rebooted the computer and now I can edit the code. I also noticed that I named a variable 'type'. Could this be the problem?
7083 posts
Location
Tasmania (AU)
Posted 26 November 2015 - 12:35 AM
Certainly could be.
3 posts
Posted 26 November 2015 - 01:20 AM
I renamed the variable and defined it as local. It fixed the problem. Thanks a billion!