Most scripts follow this structure:

  1. Sense environment (nearby entities, variables, timer)
  2. Make a decision
  3. Issue one or more commands
  4. Update variables or timers