Need Help with Scripts ! - page 2 - General Help and Assistance on using CHDK stable releases - CHDK Forum  

Need Help with Scripts !

  • 21 Replies
  • 9910 Views
Re: Need Help with Scripts !
« Reply #10 on: 15 / December / 2009, 22:19:31 »
Advertisements
Hello OldGit,
I was tied up the past day and a half and just got back onto the computer tonight.  I wanted to thank you for all your help.  I finally have it working properly now!
Best Regards,
Tom

Hey Tom

My situation paralleled yours, went thru all the same steps but script wouldn't start. What did you do to get it working?
I have the PS A540

Richard

*

Offline tkeeg

  • *
  • 11
Re: Need Help with Scripts !
« Reply #11 on: 15 / December / 2009, 23:58:01 »

Hey Tom
My situation paralleled yours, went thru all the same steps but script wouldn't start. What did you do to get it working?
I have the PS A540
Richard
[/quote]

Hello Richard,
Ii had initially copied & loaded the last script on this page: http://chdk.wikia.com/wiki/UBASIC/Scripts:_Ultra_Intervalometer , and could not get it to work. 
I deleted it along with the newly created config file on the SD card.  Next I copied the script about 1/3 of the way down the page (listed above) that is listed directly under this heading:  Script Code (save as "ult_intrvl.bas" to your /SCRIPTS/ folder),  into the CHDK/Script folder on the large partition of my SD card.
When I loaded this script it worked, but I had to go through these steps:  #1 - I had to make sure that when I turned the camera on I held the on button long enough for the lens to open.  #2 - Then I pushed the Print (ALT) button to get into ALT mode. #3 - Then I pressed the Function/Set button and loaded the script.  #4 - Then I pressed the menu button which took the script menus off of the screen leaving just the name of the loaded script visible at the bottom of the screen.  #5 - Then I pressed the shutter button and it worked perfectly.  #6 - Pressing the shutter button again stops the script.
Note that if the name of the script that you want to run is not visible at the bottom of the screen after completing steps # 1 through 4, before you press the shutter button to run it, it will not work.
I hope this helps.
Tom

Re: Need Help with Scripts !
« Reply #12 on: 16 / December / 2009, 17:17:15 »

Hey Tom
My situation paralleled yours, went thru all the same steps but script wouldn't start. What did you do to get it working?
I have the PS A540
Richard

Hello Richard,
Ii had initially copied & loaded the last script on this page: http://chdk.wikia.com/wiki/UBASIC/Scripts:_Ultra_Intervalometer , and could not get it to work. 
I deleted it along with the newly created config file on the SD card.  My config file read as created years ago, I moved it into another folder and upon first boot another was created with the same (years ago date)  Next I copied the script about 1/3 of the way down the page (listed above) that is listed directly under this heading:  Script Code (save as "ult_intrvl.bas" to your /SCRIPTS/ folder),  into the CHDK/Script folder on the large partition of my SD card. Got it
When I loaded this script it worked, but I had to go through these steps:  #1 - I had to make sure that when I turned the camera on I held the on button long enough for the lens to open.
Maybe you have auto boot? I have to start in play mode, load the firmware then go into record mode

  #2 - Then I pushed the Print (ALT) button to get into ALT mode. OK #3 -   Then I pressed the Function/Set button and loaded the script. OK #4 - Then I pressed the menu button which took the  script menus off of the screen leaving just the name of the loaded script visible at the bottom of the screen.  #5 - Then I pressed the shutter button and it worked perfectly. No #6 - Pressing the shutter button again stops the script.
Note that if the name of the script that you want to run is not visible at the bottom of the screen after completing steps # 1 through 4, before you press the shutter button to run it, it will not work.
I hope this helps.
Tom

[/quote]
The basic script included with CHDK works btw, I'll just have to keep playing. This is frustating of all the features this is the one I really wanted

Richard

*

Offline reyalp

  • ******
  • 14117
Re: Need Help with Scripts !
« Reply #13 on: 16 / December / 2009, 17:29:03 »
FWIW, the "years ago" date is just because CHDK doesn't update it when it modifies the file.

Scripts work regardless of whether you autoboot or load manually.

Note that the A540 does not support SDHC, so there is no reason to have a multipartition card. Even if you have a 4GB SD card, you can format it FAT16. Because of this, A540 does not have multipartition support, so if you are trying to use that, you could well end up with the scripts on the wrong partition.

You need to describe what actually happened between #4 and #5. "No" doesn't tell us anything.
Don't forget what the H stands for.


Re: Need Help with Scripts !
« Reply #14 on: 17 / December / 2009, 07:24:49 »
FWIW, the "years ago" date is just because CHDK doesn't update it when it modifies the file.

Scripts work regardless of whether you autoboot or load manually.

Note that the A540 does not support SDHC, so there is no reason to have a multipartition card. Even if you have a 4GB SD card, you can format it FAT16. Because of this, A540 does not have multipartition support, so if you are trying to use that, you could well end up with the scripts on the wrong partition.

You need to describe what actually happened between #4 and #5. "No" doesn't tell us anything.

I  have a PNY 2GB SC card (not SCHC), no partitions.

>>#4 - Then I pressed the menu button which took the  script menus off of the screen leaving just the name of the loaded script visible at the bottom of the screen.
I have this too, I can access the menus, change parameters, and exit the menu. After the menu disappears I have the blue bar in the lower left corner of the screen that has the name of the script, and in the upper left corner is a red bar that reads: "uBasic:1 Unk Stnt" these last two words, or abbreviations are hard to make out. 
I just ran the default script again and I don't have the red bar so that must be where the problem is, but I don't understand what the message ("uBasic:1 Unk Stnt") means. I would guess it reads unknown......?

>>#5 - Then I pressed the shutter button and it worked perfectly
I press the shutter and nothing happens. I have ran the default.bas script and it works, I have also tried running the script (ult intrvl.bas) in different modes, such as manual and Tv

Richard

*

Offline OldGit

  • ****
  • 303
Re: Need Help with Scripts !
« Reply #15 on: 17 / December / 2009, 09:19:17 »
.... I don't understand what the message ("uBasic:1 Unk Stnt") means. I would guess it reads unknown......?
Richard,
Welcome.
The search tab is your friend, a quick search gives details of "Unknown Statement" and what normally causes it at line 1.
Looks like you have blank lines or non standard file format.

Make sure the script file is plain text, and that any lines above the @title all start with "rem" like so

rem Some remarks
rem Some more remarks
@title My Title
@param a
@param b
@param c
some code etc.

Hope this helps,
OldGit
SX200 IS-100C

Re: Need Help with Scripts !
« Reply #16 on: 17 / December / 2009, 12:45:13 »
I should have thought to use the search, thanks for the heads up. I did look at the file and it seems to be okay per your example, perhaps I should copy and paste a new one.
Here is the file copied from the scripts folder, I know with html you need a closing symbol, I guess with this lanugage it is not required.(?)

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                   
rem first version                   
@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                   
  if c=1 then end                   
  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

*

Offline zeno

  • *****
  • 891
Re: Need Help with Scripts !
« Reply #17 on: 17 / December / 2009, 13:49:36 »
As OldGit says, the message means that there is an error in the first line of the script. The most likely error is that the line is not terminated properly with a newline character (or a carriage return line feed pair). When you 'copied' the script onto the card, how did you do this?
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit


Re: Need Help with Scripts !
« Reply #18 on: 17 / December / 2009, 17:11:28 »
As OldGit says, the message means that there is an error in the first line of the script. The most likely error is that the line is not terminated properly with a newline character (or a carriage return line feed pair). When you 'copied' the script onto the card, how did you do this?
I use the cursor to highlight the script, then use the keyboard commands to copy and paste into MS wordpad, then save with a .bas extension. Copy into scripts folder. The script seems to load okay, the blue title bar appears on the bottom left of screen.

Your saying the error should be in the first line? The first line is the title, I just tried another version of this script from  this page (at the bottom) http://chdk.wikia.com/wiki/UBASIC/Scripts:_Ultra_Intervalometer  and get the same error.

*

Offline fe50

  • ******
  • 3152
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: Need Help with Scripts !
« Reply #19 on: 17 / December / 2009, 17:15:37 »
@the jimmy
Also make sure there's NOT an empty line as first line in your script file; append one empty line at the end of the script.
Save the script as plain text file, with ANSI coding - unicode will NOT work.

*EDIT:
Don't use Wordpad, this will result in a binary file (MS Word 6 format) !
Use Notepad, use the settings from above...
« Last Edit: 17 / December / 2009, 17:18:08 by fe50 »

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal