Here you go. The main problem with your script was that you started recording video and then immediately stopped it. I've changed it to use the passed parameter to the takevid(t) function as the length of the video filming interval. I also inserted a few sleep() commands in a few other places. Basically you need to allow the camera time to perform the shoot() operations unless you add code to check to see if shooting is complete.
--[[
@title Test Program
]]--
capturemode=require("capmode")
function takevid(t)
print("starting a", t,"second video")
capturemode.set("VIDEO_STD")
press("shoot_full")
sleep(500)
release("shoot_full")
sleep(t*1000) -- pause while video runs
print("exiting video")
press("shoot_full")
sleep(500)
release("shoot_full")
sleep(500)
end
function takephoto(s)
capturemode.set ("P")
sleep(500)
for r=1,s,1 do
print ("shot", r)
shoot()
sleep(2000)
end
end
takevid(5) -- take a 5 second video
takephoto(2) -- take 2 pictures