please help (s3 is script error uBASIC: 1 Unk stmt) - General Help and Assistance on using CHDK stable releases - CHDK Forum

please help (s3 is script error uBASIC: 1 Unk stmt)

  • 7 Replies
  • 4869 Views
please help (s3 is script error uBASIC: 1 Unk stmt)
« on: 04 / February / 2008, 04:39:42 »
Advertisements
Hi, I'm new to all of this and having some difficulty running scripts on the s3 is.  I'm using CHDK version 148.  CHDK works fine on my camera, but when I add additional scripts they won't seem to work.  I have zero experience doing this type of thing so I think I'm probably doing somethign wrong.  I'm trying to use the OMNI intervalometer scritp, and I can load it and set the parameters, but when I press the shutter button in alt mode I get a red message in the top left corner of my screen that says "uBASIC: 1 Unk stmt"
I don't know, maybe I'm doing something wrong, but I save the script and paste it into the scripts folder and it's there on my camera and I can set the intervals and all that, just when I press the shutter button nothing happens, I just get that red error message...
Any suggestions or help would be greately appreciated, thanks

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: please help (s3 is script error uBASIC: 1 Unk stmt)
« Reply #1 on: 04 / February / 2008, 04:57:44 »
Attach the script file you're trying to use to your message so we will be able to look at it.
CHDK Developer.

Re: please help (s3 is script error uBASIC: 1 Unk stmt)
« Reply #2 on: 04 / February / 2008, 05:37:00 »
I have now tried several intervalometer scripts and seem to get the same problem with all of them...I'll list the ones i've tried here...I downloaded them all from this location: http://chdk.wikia.com/wiki/UBASIC/Scripts
I've tried a few others from the same location and get the same error with them all, but I'm probably making a really simple mistake because I'm new to this and don't really know anything about it
Thanks for the help, and here are some of the scripts I've tried:


1) OMNI intervalometer (omnintrvl.bas)

rem Author ~Keoeeit~
rem S-Series cameras ONLY
rem Use Endless mode with caution
rem See documentation for important info
@title OMNI Intervalometer
@param a Photo=0 Vid=1 P&V=2 Burst=3
@default a 0
@param b Delay 1st Shot (Mins)
@default b 0
@param c Delay 1st Shot (Secs)
@default c 0
@param d Number of Shots/Vids/Burst
@default d 5
@param e Interval (Minutes)
@default e 0
@param f Interval (Seconds)
@default f 0
@param g Interval (10th Seconds)
@default g 5
@param h Video/Burst Minutes
@default h 0
@param i Video/Burst Seconds
@default i 0
@param j Endless? No=0 Yes=1
@default j 0
p=b*600+c*10
t=e*600+f*10+g
v=h*600+i*10
if a<0 then a=0
if a>3 then a=3
if d<1 then d=5
if t<1 then t=1
if j<0 then j=0
if j>1 then j=1
if p<0 then p=0
if v<10 then v=10
if a=0 then v=0
u=t
get_tv k
if a=1 then k=-14
if a=2 then t=t+10*d
if a=3 then t=t+25*d
if k=-12 then t=t+330
if k=-11 then t=t+270
if k=-10 then t=t+210
if k=-9 then t=t+170
if k=-8 then t=t+130
if k=-7 then t=t+110
if k=-6 then t=t+90
if k=-5 then t=t+70
if k=-4 then t=t+60
if k=-3 then t=t+50
if k=-2 then t=t+40
if k=-1 then t=t+35
if k=0 then t=t+18
if k=1 then t=t+15
if k=2 then t=t+13
if k=3 then t=t+11
if k=4 then t=t+10
if k=5 then t=t+8
if k=6 then t=t+6
x=p+(v*d)+(t*(d-1))
print "1 Cycle Time:", x/600; "min", x%600/10; "sec"
goto "interval"
:interval
  if p>0 then gosub "pause"
  for n=1 to d
  print "Shot", n, "of", d
  if n>1 then sleep u*100
  if a=0 then shoot
  if a=1 then gosub "vid"
  if a=2 then gosub "vid"
  if a=3 then gosub "burst"
  next n
  if j=1 then goto "interval" else end
:pause
  r=(b*60)+c
  for m=1 to r
  q=r-m
  print "Intvl Begins:", q/60; "min", q%60; "sec"
  sleep 930
  next m
  return
:vid
  if a=2 then shoot
  if a=2 then sleep 1000
  click "video"
  sleep v*100
  click "video"
  return
:burst
  click "timer"
  press "shoot_half"
  sleep 500
  press "shoot_full"
  sleep v*100
  release "shoot_full"
  release "shoot_half"
  sleep 2000
  click "timer"
  click "timer"
  return

2) Ultra Intervalometer (ult_intrvl.bas)

rem Author - Keoeeit
rem Written for S-Series
rem Should be okay on others
rem Use Endless mode with caution
rem See documentation for important info
@title Ultra Intervalometer
@param a Delay 1st Shot (Mins)
@default a 0
@param b Delay 1st Shot (Secs)
@default b 0
@param c Number of Shots
@default c 5
@param d Interval (Minutes)
@default d 0
@param e Interval (Seconds)
@default e 0
@param f Interval (10th Seconds)
@default f 5
@param g Endless? No=0 Yes=1
@default g 0

p=a*60000+b*1000
t=d*60000+e*1000+f*100
if c<1 then let c=5
if t<100 then let t=100
if g<0 then let g=0
if g>1 then let g=1
if p<0 then let p=0
z=t*c
y=p+z

print "1 Cycle Time:", y/60000; "min", y%60000/1000; "sec"

goto "interval"

:interval
  if p>0 then gosub "pause"
  print "Shot 1 of", c
  shoot
  for n=2 to c
  sleep t
  print "Shot", n, "of", c
  shoot
  next n
  if g=1 then goto "interval" else end

:pause
  n=(a*60)+b
  for m=1 to n
  q=n-m
  print "Intvl Begins:", q/60; "min", q%60; "sec"
  sleep 930
  next m
  return


3) A Simple Intervalometer (smpl_intv.bas)

rem  author Divalent, based on ONMI intervalometer of Keoeeit
rem  camera: S3, CHDK v148, Operating in P mode
rem
rem  Save this file as "smpl_intv.bas" in the SCRIPTS directory
rem
rem  This version calculates the "sleep time" for spacing the shots based on:
rem   - a user-specified desired interval,
rem   - the default 0.1 sec "script shoot delay" (a global script parameter)
rem   - an offset based on the user-estimated exposure time, and
rem   - an empirically determined "lag" time.
rem  (This lag time is, in theory, is supposed to represent the time it takes
rem  to shoot repetitive images when no delay is specified.)
rem
rem  If used on other cameras or CHDK versions, or other than "P" mode, test the
rem  timing and adjust the variable "l" below. (In practice, I've found that you
rem  should best modify this by changing it only by 1/2 of what you think you need,
rem  and then repeat the test (and I don't know why that is so)).
rem
rem  Also note: use the default value of 100 msec (i.e. 1 unit of 0.1 sec) for the
rem  global script variable "script shoot delay". The timing assumes this is the case.
rem
rem  Note: if using exposure times where the camera will do a dark-image
rem  subtraction, then double the estimated exposure time.
rem
rem  Note: this intervalometer only shoots in photo mode (not video or burst)
rem
@title Simple Intervalometer
@param d Number of Shots
@default d 99
@param e Interval (Mins)
@default e 0
@param f Interval (Secs)
@default f 0
@param g Interval (0.1 Secs)
@default g 0
@param h est exposure time (sec)
@default h 0
@param i est exposure time (0.1 s)
@default i 0
rem
rem  You may have to adjust this "lag" variable 'l' if used on non-S3 cameras
rem  or for CHDK versions other than 148, or non-P mode.  1 unit = 1 msec
rem  set the minimum interval time (lag)  (in msec!)
l=1371
rem
rem calculate the total user-specified interval time
rem t = user specified interval time (in 0.1s units)
t=e*600+f*10+g
rem
rem s = user estimated exposure time in 0.1 s units
s= h*10+i
rem now adjust t for estimated exposure time
t=t-s
rem now adjust t to sleep routine units (needs to be in msecs)
t=t*100
rem now adjust T for known lag
t=t-l
rem now adjust for a 100 msec "script shoot delay"
t=t-100
rem ensure T not < 1 (if so, interval will be greater than specified)
if t<1 then t=1
rem ensure # of shots more than 2
if d<3 then d=3
rem Initial delay at start: set at a fixed 0.5 sec
p=500
rem
rem set initial value of n
n=1
print "delay value ", t
print "Shot", n, "of", d
rem start with intial pause
  sleep p
  shoot
rem now we've done the first shot
:do_loop
  for n=2 to d
  print "Shot", n, "of", d
  sleep t
  shoot
  next n
end


4)

Re: please help (s3 is script error uBASIC: 1 Unk stmt)
« Reply #3 on: 04 / February / 2008, 12:06:32 »
Deleted
« Last Edit: 22 / April / 2008, 10:45:15 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye


Re: please help (s3 is script error uBASIC: 1 Unk stmt)
« Reply #4 on: 04 / February / 2008, 15:52:33 »
Thanks, I'll try that tomorrow (it's the wee hours in China now where I am) and see if that does the trick.
Cheers

Re: please help (s3 is script error uBASIC: 1 Unk stmt)
« Reply #5 on: 04 / February / 2008, 16:14:22 »
Actually I just tried it with the omni intervalometer script and it worked perfectly
Thanks a million!  :D

Re: please help (s3 is script error uBASIC: 1 Unk stmt)
« Reply #6 on: 18 / August / 2008, 01:53:55 »
Deleted

Hey Barney Fife!!

your reply only says "deleated" and it looks like the rest of the post is missing. Can you repost what you deleated to make the OMNI version work because I am having the same problem with the uBASIC warning.

Thanks!!
P

*

Offline fe50

  • ******
  • 3119
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: please help (s3 is script error uBASIC: 1 Unk stmt)
« Reply #7 on: 18 / August / 2008, 03:33:35 »
Hello & welcome pinkfloyd,

Barney is no longer active here in the board, you'll get no response...

I don't know what he answered, but "1 Unk stmt" ("Unknown statement in line 1" means that either the script interpreter has a problem with the first line of the script, often caused by an empty line at the beginning, or there's a problem with the character set, should be plain text ANSI, not UTF or something other...

-> remove the first (empty) line of the scripts, they should start with a rem@title line !
Code: (sdlbasic) [Select]
rem Author ~Keoeeit~
rem S-Series cameras ONLY
rem Use Endless mode with caution
rem See documentation for important info
@title OMNI Intervalometer
@param a Photo=0 Vid=1 P&V=2 Burst=3
...


 

Related Topics