Weird error with script - General Discussion and Assistance - CHDK Forum

Weird error with script

  • 3 Replies
  • 2547 Views
Weird error with script
« on: 06 / August / 2010, 19:12:48 »
Advertisements
I wrote a script to make the LEDs go on, but for some reason it won't work. The error message I get is:

endsleep(1000)for i=
0,9 do set_led(i,0) end
:1: unexpected symbol nea
r '@'
PRESS SHUTTER TO CLOSE


The musical notes weren't originally there (just the weird block symbol) but I converted it to DOS line endings (CR/LF) to see if that would help, and it didn't. Here's the script's code:

Code: (lua) [Select]
@title LED Test

for i=0,9 do set_led(i,1) end
sleep(1000)
for i=0,9 do set_led(i,0) end

It looks fine in the text file reader, btw.
« Last Edit: 06 / August / 2010, 19:18:15 by flarn2006 »

*

Offline reyalp

  • ******
  • 14079
Re: Weird error with script
« Reply #1 on: 06 / August / 2010, 20:08:20 »
The @title needs to be in a comment in lua
e.g.
--[[
@title blah
]]
Don't forget what the H stands for.

Re: Weird error with script
« Reply #2 on: 06 / August / 2010, 20:16:08 »
That worked; thanks!
BTW, did you see my reply to that other thread? I finally got it compiled on the Mac!  :D
« Last Edit: 06 / August / 2010, 20:18:06 by flarn2006 »



 

Related Topics