2 posts
Posted 14 June 2015 - 03:31 PM
hi im hoping for a kind soul inhere
im making a rollorcoster ride for fellow servermembers to tour my base and im a total noob at programming
what i need is simple… a text field that i can change and a "continue ride" button below
ofc need directions on how to enter program to edit text. guess i need some sort of redstone signal to activate the rail… under the middle white block under the screen maybe?
ty
here is a picture of the first stop on the ride
2679 posts
Location
You will never find me, muhahahahahaha
Posted 14 June 2015 - 07:46 PM
You have to detect "monitor_touch" events. Then check the coordinates and see if it is within the boundaries of the button. If yes, then toggle the redstone output on the computer for a second and then turn it off.
2 posts
Posted 14 June 2015 - 08:49 PM
well ehhh ok… did i mention i dont know how to program? giggle… prolly sound right but wouldent know how to do that
2679 posts
Location
You will never find me, muhahahahahaha
Posted 14 June 2015 - 10:17 PM
Here is some very short code:
mon = peripheral.wrap(side) --side can be right, left, top, bottom, back, fron or a network address such as "monitor_1"
term.redirect(mon) -- making mon the standart drawing target
paintutils.drawFilledBox(1,1,7,3,colors.red) -- drawing try it out and find out
while true do
event = {os.pullEvent("monitor_touch")} -- get the evnt
if 1 =< event[3] and event[3] =< 7 and 1 =< event[4] and event[4] =< 3 then --check if it is in the boundaries
rs.setOutput("bottom",true) --redstone, get on
sleep(0.5) --sleep
rs.setOutput("bottom",false) -- and now off
end
end
Edited on 14 June 2015 - 08:17 PM
227 posts
Location
Germany
Posted 17 June 2015 - 10:21 AM
That doesn't look like an advanced monitor though - so no touch events. Do you have a ComputerCraft version that already supports advanced computers/monitors?
If not, the only option would be to use redstone buttons and just display some text on the monitor.