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

Help with these ideas

Started by Jonasidas, 16 June 2014 - 04:26 PM
Jonasidas #1
Posted 16 June 2014 - 06:26 PM
So I'm probably doing this all wrong i'm halfway out the noob stage i'll admit, but here goes…
I've got some ideas for some programs floating around in my head. But in order for any of it to work
I need to know some things…
Are the computers able to detect things? i.e. minecart or person or anything
The answer for this is probably going to incorporate openccsensors which leads me to…
how can i go about creating a gui that can basically be "touchscreen"? i've seen some of this
via youtube and would like to incorporate something of the nature to break away from the typing
just a little bit and to also save a little bit of time.

but my main and final question is how to incorporate time into lua code?
Bomb Bloke #2
Posted 17 June 2014 - 01:50 AM
Are the computers able to detect things? i.e. minecart or person or anything

Regular computers can't. Turtles can detect blocks, but not players / mobs / etc (short of trying to run them over, and failing - or attacking, and succeeding).

That's indeed where peripherals come into play.

how can i go about creating a gui that can basically be "touchscreen"? i've seen some of this
via youtube and would like to incorporate something of the nature to break away from the typing
just a little bit and to also save a little bit of time.

Advanced systems / monitors have this functionality. Clicks generate either mouse_click or monitor_touch events, which can be collected with os.pullEvent().

but my main and final question is how to incorporate time into lua code?

In ComputerCraft's implementation, you don't have access to the real-world time. If you just want to be able to measure time, that's not so much of a problem: use os.clock(). If you want the "real" time, there are a few code examples floating about the Programs section which go off to 3rd party online time servers to get it.