Global (Persistent) Variables?

Discussion in 'C-Bus Automation Controllers' started by PMF, Mar 29, 2019.

  1. PMF

    PMF

    Joined:
    Feb 6, 2019
    Messages:
    16
    Likes Received:
    2
    I'm writing a pseudo occupancy code.

    I think this needs to be a resident script that checks if it's dark and then triggers actions when a particular (randomised) time is reached.

    My question is if I run a script that generates a randomised trigger time once a day, will the variable I store that time in persist to be used in the resident script?

    e.g.

    If I run a daily script in the morning that executes:

    lightsonatminute = math.random (0,59)

    Can I then use lightsonatminute as an argument in a resident script to check of a particular time has been passed.

    Thanks
     
    PMF, Mar 29, 2019
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.