Jump to content


Xixili's Content

There have been 8 items by Xixili (Search limited from 10-February 22)


By content type

See this member's

Sort by                Order  

#231455 throw 3 switches and continue

Posted by Xixili on 30 August 2015 - 12:43 AM in Ask a Pro

Its hard to find the right topic title but I will explain it here in more detail.

I have 3 switches connected on bundled cables.

brown, green and red.

I want that the computer wait forthe levers before it continues.

The 3 levers needs to be switched before the computer continues.

But my problem is that the computer already continues at 1 lever.

this is the code:
os.pullEvent("redstone")
if rs.testBundledInput("left", colours.brown) then
term.setTextColor(colors.red)
term.setCursorPos(38, 5)
term.write("unlocked")
end
 
os.pullEvent("redstone")
if rs.testBundledInput("left", colours.green) then
term.setTextColor(colors.red)
term.setCursorPos(38, 6)
term.write("unlocked")
end
os.pullEvent("redstone")
if rs.testBundledInput("left", colours.red) then
term.setTextColor(colors.red)
term.setCursorPos(38, 7)
term.write("unlocked")
end
sleep(3)
rs.setBundledOutput("left", colours.black+colours.pink+colours.white)
sleep(5)


And the whole code can be found here:
http://pastebin.com/6MwycAaE



#231452 Monitor Countdown Timer

Posted by Xixili on 30 August 2015 - 12:02 AM in Ask a Pro

View PostHPWebcamAble, on 29 August 2015 - 10:29 PM, said:

View PostXixili, on 29 August 2015 - 09:17 PM, said:

Last question.
Is it possible if the computer recieves a redstone signal at the bottom before the 5 minute timer runs out that the countdown stops (os.reboot() for example)
And after 5 minutes that if he recieves a signal at the bottom then it wont reboot?

http://pastebin.com/7BKuLQx6
Should work.. I think, cant test at the moment

I checked it and it works fine.
Thank you very much



#231439 Monitor Countdown Timer

Posted by Xixili on 29 August 2015 - 09:17 PM in Ask a Pro

View PostHPWebcamAble, on 29 August 2015 - 08:30 PM, said:

Ok, I think it should work now

http://pastebin.com/r5Fyqcy6


I changed a few of the sides, you'll want to look through it and change them back to match your setup.
Another thing, for each timer, it runs the associated function a second AFTER the timer hits 0. Hope thats ok :)

Perfect it works!

Last question.
Is it possible if the computer recieves a redstone signal at the bottom before the 5 minute timer runs out that the countdown stops (os.reboot() for example)
And after 5 minutes that if he recieves a signal at the bottom then it wont reboot?



#231430 Monitor Countdown Timer

Posted by Xixili on 29 August 2015 - 07:33 PM in Ask a Pro

View PostHPWebcamAble, on 29 August 2015 - 04:49 PM, said:

View PostKingofGamesYami, on 29 August 2015 - 04:41 PM, said:

-- snip --
I think Xixili wanted more than 1 timer at a ... time ( :P )


I got pretty carried away when I was writting this...
Here's what I came up with:
http://pastebin.com/F3m9NV90

Don't have time to test it right now... just let me know if you run into any problems, I'll jump into a singleplayer world, and work out the kinks.
Thank you for making a timer but there are many problems with it.
I got it working but when 1 minute has passed it keeps counting like -9, -8, -7 and so on.

Also when the 5 minute timer has run out it needs to send a bundledcable orange signal

and when the 10 minute timer has run out it needs to send to a red cable.

sorry for so many questions.



#231429 Monitor Countdown Timer

Posted by Xixili on 29 August 2015 - 06:16 PM in Ask a Pro

View PostKingofGamesYami, on 29 August 2015 - 05:39 PM, said:

On line 12, you first try to access 'tTime', which works. Next, you try to index 'tTimer', which doesn't. Change 'tTimer' to tTime'.
Thank you it solved the problem but it doesnt count down as seconds but just a bunch of weird random numbers and then after 5 seconds it stops.



#231418 Monitor Countdown Timer

Posted by Xixili on 29 August 2015 - 05:22 PM in Ask a Pro

View PostKingofGamesYami, on 29 August 2015 - 05:07 PM, said:

Change line 5 from timers to timer, or change line 40 and 43 to timers.

Thank you but it didnt solve the problem
startup:12: attempt to index ? (a nil value)

http://pastebin.com/4XrSRm3S

Im trying to understand the code but sadly I cant find the problem.



#231410 Monitor Countdown Timer

Posted by Xixili on 29 August 2015 - 05:00 PM in Ask a Pro

View PostHPWebcamAble, on 29 August 2015 - 04:49 PM, said:

View PostKingofGamesYami, on 29 August 2015 - 04:41 PM, said:

-- snip --
I think Xixili wanted more than 1 timer at a ... time ( :P )


I got pretty carried away when I was writting this...
Here's what I came up with:
http://pastebin.com/F3m9NV90

Don't have time to test it right now... just let me know if you run into any problems, I'll jump into a singleplayer world, and work out the kinks.

Thank you for making some TIME to help me :P

Maybe i did it wrong but when activating the timer I get an error:
startup:40: attempt to index ? (a nil value)

this is how i added your code:
http://pastebin.com/4XrSRm3S



#231394 Monitor Countdown Timer

Posted by Xixili on 29 August 2015 - 04:02 PM in Ask a Pro

Dear Computercraft Pros,


Im making a purge system with a monitor that countdown timer
But my programming is quite rusty so I was wondering if someone can help me to make a countdowntimer on a monitor

this is the code:
http://pastebin.com/j0Aq8PyR

The plan is when the computer gets a redstonesignal then the timer should run (10 minutes and 20 seconds)
Both timers should run together.
But one starts at 10 minutes and the other one at 5.
The red numbers should count down in the code.
And when it reaches 0 it should send out a redstone signal.

Thank you