Page 1 of 1

Fuel Flow Script

Posted: Fri Jun 01, 2018 1:29 am
by rex-racer
o I'm working on implementing the ability to monitor fuel usage ala the article Brent posted by Gil Markum. So I go the fuel flow meter (not the same exact one but a similar one that's interchangeable with the floScan. I wired it up and car runs fine. I copied in the Lua script but am getting an error.

Here is the script as I have cut and pasted from my file:

https://files.mycloud.com/home.php?bran ... uaScript_2

I run the script and get the following error:

[lua] Startup script error: ([string "-- Fuel Total..."]:27.0: 'end' expected (to close 'function' at line 12.0) near '<eof>')

Now, I am a complete moron when it comes to programming and I have zero knowledge of how this stuff works. Always been something I've wanted to learn but for some reason just can't get my head around it.

Help would be greatly appreciated. Remember to explain it to me like I'm 8 years old, assume I know nothing about this stuff...which is a good assumpton.

Thanks
Jay[/url]

Posted: Fri Jun 01, 2018 11:47 am
by PS14
i'm no lua expert but I believe you are missing an "end" command at line 27, to close the function call at line 12. try adding the word end to line 27, just above the "function onTick() command. it either has to go there or just above the --Update last count value line.

I also find using an online lua syntax checker helps find most of these errors, as well as punctuation errors. hope this helps, Dave

Posted: Fri Jun 01, 2018 3:26 pm
by rex-racer
There is actually an "end" in both of those places.

Posted: Fri Jun 01, 2018 4:03 pm
by PS14
yea, I was going by the script error. when I put the entire script into tutorialspoint.com online checker it comes back with no errors. sorry, man. I tried.

Posted: Tue Jun 12, 2018 3:22 pm
by brentp
Following up, did you get your script to work yet?