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

poll program

Started by hawkwand, 14 January 2017 - 02:48 PM
hawkwand #1
Posted 14 January 2017 - 03:48 PM
So I'm trying to make a poll program where player get on the computer it tells them the poll number and the question, then below that it will have answer and quit



Poll 01

Question: What do you think of Minecraft?


[answer] [quit]



if they hit answer it will take them to a writing area where they can type up their answer, then his print and it will be printed.
the only thing is I don't know how to get it to where they can click on answer or quit and once there done and hit quite how to get it to go back to the beginning.

I'm also doing this on a server that does allow you to download programs off Pastebin and it is on tekkit lite which is version 1.4.7 of Minecraft,





So this is what i have so far


startup
shell.run("poll")


poll
term.setCursorPos(1, 1)
print("Poll 01 ")

term.setCursorPos(1, 3)
print("Question: what do you think of minecraft?")

term.setCursorPos(15, 10)
print("[Answer]")
term.setCursorPos(30, 10)
print("[Quit]")


Answer
shell.run("edit pollA")

Quit
shell.run("delete pollA")
os.shutdown()
Edited on 16 January 2017 - 04:13 AM
Bomb Bloke #2
Posted 15 January 2017 - 02:30 AM
Difficult to comment on how you might add that to your code if we can't see your code. What have you got so far?
hawkwand #3
Posted 15 January 2017 - 04:33 AM
Someone on the server gave me this program but I don't know what to do with it.

while true do
event, param, x, y = os.pullEvent()
– x and y are mouse positions
– if mouse is pos
– get answer
– else if is in pos B
– break <– this is exit
end
end
end
Edited on 16 January 2017 - 04:16 AM
roger109z #4
Posted 16 January 2017 - 07:16 AM
Someone on the server gave me this program but I don't know what to do with it.

while true do
event, param, x, y = os.pullEvent()
– x and y are mouse positions
– if mouse is pos
– get answer
– else if is in pos B
– break <– this is exit
end
end
end
you may want to try something simpler then working your way up to guis or look up a tutorial the code that your friend gave you basically just explains how to pull mouse clicks but it won't do anything unless you edit it.