Posted 11 September 2016 - 06:17 PM
Hi there,
I am building a web app that my computercraft computers will use the HTTP api to connect to.
This web app will be brought up on a mobile device such as a phone or tablet next to the user whilst playing and will enable them to have buttons to control lights, unlock doors and turn on machinery.
I am able to have my computers poll ngrs.okonetwork.org.uk/action?id={computer_id} every second to obtain a list of what circuits need to be switched on or off, and actually switch them.
I would like to be able to have it so that a user can select a start station(second of railcraft track) and a destination station and have a train automatically switched and routed.
I have a php script that can take a start and destination station id and calculates what switches need switching, as it is possible to control railcraft switches with redstone i am able to have the computers switch the tracks but i do not know how to get sort sort of train id into my web app.
Is there any way to have Computercraft read the ticket of the railcraft locomotive as part of my script? If i could get the contents of the ticket i could give each locomotive a ticket with a unique id(something like 0001 0002 etc…) , have a computer near each switch read the id and switch tracks as appropriate and update my web app with the location of the train.
Thanks for advance for any help you can provide, it is greatly appreciated, i will be releasing all of my code and allowing people to access the web app free of charge when complete.
I am building a web app that my computercraft computers will use the HTTP api to connect to.
This web app will be brought up on a mobile device such as a phone or tablet next to the user whilst playing and will enable them to have buttons to control lights, unlock doors and turn on machinery.
I am able to have my computers poll ngrs.okonetwork.org.uk/action?id={computer_id} every second to obtain a list of what circuits need to be switched on or off, and actually switch them.
I would like to be able to have it so that a user can select a start station(second of railcraft track) and a destination station and have a train automatically switched and routed.
I have a php script that can take a start and destination station id and calculates what switches need switching, as it is possible to control railcraft switches with redstone i am able to have the computers switch the tracks but i do not know how to get sort sort of train id into my web app.
Is there any way to have Computercraft read the ticket of the railcraft locomotive as part of my script? If i could get the contents of the ticket i could give each locomotive a ticket with a unique id(something like 0001 0002 etc…) , have a computer near each switch read the id and switch tracks as appropriate and update my web app with the location of the train.
Thanks for advance for any help you can provide, it is greatly appreciated, i will be releasing all of my code and allowing people to access the web app free of charge when complete.
Edited on 11 September 2016 - 09:26 PM