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

Session Persist

Started by macss_, 19 March 2015 - 07:37 PM
macss_ #1
Posted 19 March 2015 - 08:37 PM
Anyone out there could give me tips on how do I do session persistence on my codes? For now is just for a simple one but who knows what I might have in mind.. Any help is welcome.
Lupus590 #2
Posted 19 March 2015 - 09:01 PM
There are a few APIs in the forums which keep track of variables.

Look into state machines and store the state in one of the persistent variable APIs

On program start, check the state from the API, and continue from there.
macss_ #3
Posted 20 March 2015 - 07:54 PM
Could you post any code as an example? ty
Dragon53535 #4
Posted 20 March 2015 - 08:10 PM
Load a variable from a file at the start, then whenever you change that variable in your code, change it in the file. (Simple explanation)

Fs api.