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

Need a little help

Started by assassinx311, 23 July 2012 - 10:30 AM
assassinx311 #1
Posted 23 July 2012 - 12:30 PM
Guys, im really new to computercraft. I watched a couple of tutorials online, and i got all the basics.

I started creating a program which would allow me to enable a refinery for 5 minutes and then turn off.

This is what i got: (when i type "edit pump")

print("Loading…")
sleep(3)
print("25%")
sleep(2)
print("75%")
sleep(4)
print("100% Loaded! Welcome!")
sleep(1)
print("Launching refinery.exe")
sleep(1)
print("Refinery enabled for 5 minutes.")
redpulse left 1 1000


Everything was working untill i added redpulse left 1 1000 (approx. 5 mins(btw, im using a wireless redstone emitter))

The error i get when trying to start the program is: bios:206: [string "pump"]:12: '=' expected

I know the solution to this may be very simple, but as I said, I just started.

Thanks!
Mendax #2
Posted 23 July 2012 - 12:35 PM
:)/>/> ARE YOU KIDDING ME (Sorry, been going at this since MC1.0)!? redpulse is not a command. It's a program. You'd have to do shell.run("redpulse","1","1000")
assassinx311 #3
Posted 23 July 2012 - 12:41 PM
How to make it emitt the pulse to the left? When i launch it says
redpulse:13: Invalid side.

Sorry I'm a total idiot.
assassinx311 #4
Posted 23 July 2012 - 12:46 PM
:)/>/> ARE YOU KIDDING ME (Sorry, been going at this since MC1.0)!? redpulse is not a command. It's a program. You'd have to do shell.run("redpulse","1","1000")
Btw i didnt even know about shell.run :o/>/>
Kolpa #5
Posted 23 July 2012 - 01:02 PM
dont even do it the hard way :o/>/> better implemet this tool if its confusing for you ill take my time to explain :)/>/>

function redpulse(delay,iterations,side)
repeat
rs.setOutput(side,true)
sleep(delay)
rs.setOutput(side,false)
counter = counter + 1
until iterations == counter
end

to use this function u do the following thing

print("Loading...")
sleep(3)
print("25%")
sleep(2)
print("75%")
sleep(4)
print("100% Loaded! Welcome!")
sleep(1)
print("Launching refinery.exe")
sleep(1)
print("Refinery enabled for 5 minutes.")
redpulse(1,1000,"left")
remember the side is a string so u have to put "" around it :)/>/> even if u change it
also please use the CODE tag next time so that its easier for us to read your programs
Kolpa #6
Posted 23 July 2012 - 01:07 PM
:)/>/> ARE YOU KIDDING ME (Sorry, been going at this since MC1.0)!? redpulse is not a command. It's a program. You'd have to do shell.run("redpulse","1","1000")
u sir are a douche bag
assassinx311 #7
Posted 23 July 2012 - 01:33 PM
Thanks alot Kolpa, looking forward for your help in the future! :)/>/>
Kolpa #8
Posted 23 July 2012 - 03:38 PM
Thanks alot Kolpa, looking forward for your help in the future! :o/>/>
glad to help you just pm me if u need any help im online atleast 2 times a day :)/>/>