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

Tekkit ComputerCraft Help with Redpulse and Errors

Started by Sourface772, 16 March 2016 - 12:19 AM
Sourface772 #1
Posted 16 March 2016 - 01:19 AM
So I've been playing Tekkit with some friends recently and am super into it. It is currently using ComputerCraft version 1.58 (Tekkit runs on Minecraft version 1.6.4) and I am absolutely stumped about why this program is not working. I've searched across the ComputerCraft Forums as well as other sites and tutorials but still nothing. I keep getting the error control:10: attempt to call nil. If anyone has any idea about
why this is not working any help would be greatly appreciated.

The code is as follows :

print ("Preparing to drill some stuff…")
sleep(2)
print ("Would you like to drill some stuff? (Yes or No) ")

drill = read()

if drill == "Yes" or "yes" then
print ("How far would you like to go?")
drilldist = tonumber(read())
redpulse "bottom" drilldist "2" <—- This is where the error is, Apparently
print ("Done")

else
print ("Shutting Down…")

end

In case anyone was wondering, this program is going to be used to provide pulsing redstone signals to a drill that we built using the Terrain Smashers from Thermal Expansion attached to a Carriage from Redstone in Motion. The signals will activate the Carriage Engine, moving it forward and smashing the blocks in front of it. We were originally using levers and timers (from Project Red) to move the drill, but were looking to upgrade to a ComputerCraft system to save space.

One more thing, does anyone know if redpulse would work using bundled wires from Project Red, and if they do how? Anyway to conserve space would be great.
KingofGamesYami #2
Posted 16 March 2016 - 03:23 AM
Lua thinks you are attempting to call redpulse with the string argument "bottom". Since redpulse is not defined, it errors telling you the function you are trying to call is nil.

In this case, I think (this is just an educated guess), you are trying to run another program (as you would from the command line). To do this, you should use the shell.run function, demonstrated below:


shell.run( "redpulse bottom" )

You will also want to do this with drilldist (assuming drilldist is another program as well).

I am doubtful that redpulse as a program would work using bundled cables, but bundled cables may still be usable. The redstone API contains all functions you might need to do this, the source code of the redpulse program could be useful as an example.