Index: trunk/CHDK/SCRIPTS/shoot.bas
===================================================================
--- trunk/CHDK/SCRIPTS/shoot.bas	(revision 1485)
+++ trunk/CHDK/SCRIPTS/shoot.bas	(revision 1485)
@@ -0,0 +1,22 @@
+@title Delayed Single Shot
+@param a time delay (sec)
+@default a 2
+
+sleep a*1000 
+
+press "shoot_half"
+
+do 
+  sleep 50
+until get_shooting = 1
+
+press "shoot_full"
+sleep 500
+release "shoot_full"
+
+do
+   sleep 50
+until get_shooting = 1	
+
+release "shoot_half"
+
Index: trunk/CHDK/SCRIPTS/hdr.bas
===================================================================
--- trunk/CHDK/SCRIPTS/hdr.bas	(revision 1485)
+++ trunk/CHDK/SCRIPTS/hdr.bas	(revision 1485)
@@ -0,0 +1,24 @@
+@title High Dynamic Range
+
+print "1) normal"
+shoot
+
+set_aflock 1
+get_av96 p
+get_sv96 s
+get_tv96 t
+
+print "2) bright"
+set_tv96_direct t-192
+set_sv96 s
+set_av96 p
+shoot 
+
+print "3) dark"
+set_tv96_direct t+192
+set_sv96 s
+set_av96 p
+shoot
+		
+set_aflock 0
+print "...done"
Index: trunk/CHDK/SCRIPTS/interval.lua
===================================================================
--- trunk/CHDK/SCRIPTS/interval.lua	(revision 1485)
+++ trunk/CHDK/SCRIPTS/interval.lua	(revision 1485)
@@ -0,0 +1,12 @@
+--[[
+@title Intervalometer
+@param a = interval (sec)
+@default a 15
+--]]
+repeat
+    start = get_tick_count()
+	shoot()
+    sleep(a*1000 - (get_tick_count() - start))
+until ( false )
+
+
Index: trunk/CHDK/SCRIPTS/motion.lua
===================================================================
--- trunk/CHDK/SCRIPTS/motion.lua	(revision 1485)
+++ trunk/CHDK/SCRIPTS/motion.lua	(revision 1485)
@@ -0,0 +1,27 @@
+--[[
+@title Motion Detect
+]]
+
+a=6         -- columns to split picture into 
+b=6         -- rows to split picture into 
+c=1         -- measure mode (Y,U,V R,G,B)  U=0, Y=1, V=2, R=3, G=4, B=5
+d=300000    -- timeout (mSec) 
+e=200       -- comparison interval (msec) - less than 100 will slow down other CHDK functions
+f=5         -- threshold (difference in cell to trigger detection)
+g=1         -- draw grid (0=no, 1=yes)   
+h=0         -- not used in LUA - in uBasic is the variable that gets loaded with the number of cells with motion detected
+i=0         -- region masking mode: 0=no regions, 1=include, 2=exclude
+j=0         --      first column
+k=0         --      first row
+l=0         --      last column
+m=0         --      last row
+n=0         -- optional parameters  (1=shoot immediate)
+o=2         -- pixel step
+p=0         -- triggering delay (msec) 
+
+zones = md_detect_motion( a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
+
+if( zones > 0 ) then 
+	shoot() 
+end
+
Index: trunk/CHDK/SCRIPTS/interval.bas
===================================================================
--- trunk/CHDK/SCRIPTS/interval.bas	(revision 1485)
+++ trunk/CHDK/SCRIPTS/interval.bas	(revision 1485)
@@ -0,0 +1,11 @@
+@title Intervalometer
+@param a = interval (sec)
+@default a 15
+ 
+do
+    s = get_tick_count
+	shoot
+    sleep a*1000 - (get_tick_count - s)
+until ( 0 )
+
+
Index: trunk/CHDK/SCRIPTS/motion.bas
===================================================================
--- trunk/CHDK/SCRIPTS/motion.bas	(revision 1485)
+++ trunk/CHDK/SCRIPTS/motion.bas	(revision 1485)
@@ -0,0 +1,25 @@
+@title Motion Detect
+
+a=6 
+b=6 
+c=1 
+d=300000 
+e=200 
+f=5 
+g=1
+h=0
+i=0  
+j=0 
+k=0 
+l=0
+m=0
+n=0 
+o=2
+p=0
+
+md_detect_motion a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p
+
+if( h > 0 ) then 
+	shoot 
+endif
+
Index: trunk/CHDK/SCRIPTS/readme.txt
===================================================================
--- trunk/CHDK/SCRIPTS/readme.txt	(revision 1485)
+++ trunk/CHDK/SCRIPTS/readme.txt	(revision 1485)
@@ -0,0 +1,25 @@
+4Pack of Simple CHDK Scripts
+============================
+
+Presented here are four simple scripts for Canon cameras using CHDK.  
+Each script is available in both the Lua and uBasic programming language. 
+Make sure you have your camera in "shooting mode" prior to activating these scripts.
+
+They are :
+
+1) shoot.bas & shoot.lua
+       - a very simple script that simply takes a picture after a configurable time delay
+
+2) interval.bas & interval.lua
+       - a script to continuously take pictures at a configurable time interval
+	   
+3) motion.bas & motion.lua
+       - a motion detection script - takes one picture when motion is detected 
+	   
+4) hdr.bas & hdr.lua
+       - a script for taking images used in high dynamic range pictures 
+	   - also called exposure bracketing
+	   - takes three picture - one correctly exposed, one overexposed and one underexposed
+	   
+Obviously these are very simple program and you are encouraged to modify and expand them to suit your needs.
+	   
Index: trunk/CHDK/SCRIPTS/shoot.lua
===================================================================
--- trunk/CHDK/SCRIPTS/shoot.lua	(revision 1485)
+++ trunk/CHDK/SCRIPTS/shoot.lua	(revision 1485)
@@ -0,0 +1,19 @@
+--[[
+@title Delayed Single Shot
+
+@param a time delay (sec)
+@default a 2
+--]]
+
+sleep(a*1000)
+
+press("shoot_half")
+repeat sleep(50) until get_shooting() == true
+
+press("shoot_full")
+sleep(500)
+release("shoot_full")
+
+repeat sleep(50) until get_shooting() == false	
+release("shoot_half")
+
Index: trunk/CHDK/SCRIPTS/hdr.lua
===================================================================
--- trunk/CHDK/SCRIPTS/hdr.lua	(revision 1485)
+++ trunk/CHDK/SCRIPTS/hdr.lua	(revision 1485)
@@ -0,0 +1,26 @@
+--[[
+@title High Dynamic Range
+--]]
+
+print("1) normal")
+  shoot()
+
+  set_aflock(1)
+  p=get_av96()
+  s=get_sv96()
+  t=get_tv96()
+
+print("2) bright")
+  set_tv96_direct(t-192)
+  set_sv96(s)
+  set_av96(p)
+  shoot()	
+
+print("3) dark")
+  set_tv96_direct(t+192)
+  set_sv96(s)
+  set_av96(p)
+  shoot()
+		
+set_aflock(0)
+print("...done")
