Fuel Flow Script

Discussion on the Lua Scripting capabilities for RaceCapture/Pro. Also see the <a href="http://autosportlabs.net/RaceCapturePro_Lua_Scripting">Lua Scripting Guide</a>

Moderators: JeffC, stieg

Post Reply
rex-racer
Posts: 18
Joined: Mon Jun 12, 2017 9:35 pm

Fuel Flow Script

Post 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]
A Race Car exists in 2 states: Broken or in the process of becoming that way.

PS14
Posts: 97
Joined: Fri Feb 12, 2016 11:27 pm
Location: NY

Post 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

rex-racer
Posts: 18
Joined: Mon Jun 12, 2017 9:35 pm

Post by rex-racer »

There is actually an "end" in both of those places.
A Race Car exists in 2 states: Broken or in the process of becoming that way.

PS14
Posts: 97
Joined: Fri Feb 12, 2016 11:27 pm
Location: NY

Post 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.

brentp
Site Admin
Posts: 5986
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Following up, did you get your script to work yet?
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

Post Reply