Collection of useful agent codes: Please add

Thought I start a collection of agent codes for beginners like myself so we could reference to and try out. Whlist the codes all documented elsewhere in the forum etc, it would very to have it all in one place. Please add to the list so we can all share…



I’ll start off with a few agent codes, all from the famous “inventor”

  1. Hello world

  2. Toggle (TickTock): previous life as vimp ticktoc
    tickTock <- 0;
    function TickTock() {
    // do a thing
    // your code here…

    // flip tick tock
    tickTock = 1 - tickTock;
    function.wakeup(1.0, TickTock);

  3. HTTP In - Controlling an LED with web requests.

  4. HTTP Out - Basic example demonstrating a POST request.

  5. Cosm (which is know Xively - Class for sending data to Xively.