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

Computronics Ticket Machine

Started by nymox, 11 October 2016 - 09:48 PM
nymox #1
Posted 11 October 2016 - 11:48 PM
Hello,

And thank you for taking your time to help me. The situation is this. I am trying to have a touch screen list of buttons, with destinations that print out tickets from the Computronics ticket machine. I have tried my very best to use all of the information out there I can find but I just cannot get it to work. I should mention, that it is likely there is something simple in the code I am just no able to see, I don't have the best brain for this type of thing so please try to be kind lol. Currently there are only 2 possible destinations, I will be adding more in the future. Here is a pastebin link for the code. http://pastebin.com/Byh0xWtC

Once again thank you ever so much for taking the time out to even read my post, let alone attempt to help me solve it.


Nymox
Bomb Bloke #2
Posted 12 October 2016 - 05:20 AM
At a glance, I'm not seeing any obvious errors in the code - what does it do, as opposed to "working"?
hbomb79 #3
Posted 12 October 2016 - 10:12 AM
I recently created a web version of this kinda thing. When printing the tickets, I used strings instead of numbers. It should really throw an error if it doesn't like numbers, which I assume it isn't - but who knows. I say, give it a shot with strings instead of integers and see if it correctly prints the ticket.

Wait, hold on just a minute: I think I used a different mod, I just did some digging and realized the machine you are using is not the one I initially thought it was.
Edited on 12 October 2016 - 08:17 AM
Larry84 #4
Posted 12 October 2016 - 08:47 PM
Actually it seems that createTicket isn't a method. You should use printTicket instead. I've not found any wiki online, but using peripheral.getMethods() you can easily know which methods are aviable.
These:

setSelectedTicket()
setManualPrintingAllowed()
isManualPrintingAllowed()
getMaxEnergyStored()
printTicket()
isManualSelectionAllowed()
setDestination()
getSelectedTicket()
setManualSelectionAllowed()
getDestination()
getEnergyStored()

Hope you can make your program work ;)/>