Jump to content




poll program

api computer

3 replies to this topic

#1 hawkwand

  • New Members
  • 2 posts
  • LocationUSA

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 by hawkwand, 16 January 2017 - 05:13 AM.


#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

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?

#3 hawkwand

  • New Members
  • 2 posts
  • LocationUSA

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 by hawkwand, 16 January 2017 - 05:16 AM.


#4 roger109z

  • Members
  • 53 posts
  • LocationCali beetch

Posted 16 January 2017 - 07:16 AM

View Posthawkwand, on 15 January 2017 - 04:33 AM, said:

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users