Page 2 of 2

Re: Lua Scripting

Posted: Tue Jun 28, 2022 4:02 am
by mtmotorsport
Ahh, so just flip the X axis order?

Re: Lua Scripting

Posted: Tue Jun 28, 2022 4:13 am
by AndreyB
mtmotorsport wrote:
Tue Jun 28, 2022 4:02 am
Ahh, so just flip the X axis order?
exactly

Re: Lua Scripting

Posted: Mon Jul 04, 2022 9:30 am
by kjn260
So to do some bench hardware coding in Lua, RusEFI simulator now supports interaction to a physical hardware can device (via SocketCan) on Linux!
image.png
image.png (453.86 KiB) Viewed 25750 times
Which means, with just a standard can adapter (I am using a peak clone) I can attach simulator to a real can device and do Lua Development.

What a time to be alive.
image.png
image.png (1.65 MiB) Viewed 25750 times
So I am going to do some tidy up on the iDrive code and see what we can come up with.

@mck1117 is a deadset legend.

Re: Lua Scripting

Posted: Mon Jul 04, 2022 9:32 am
by mck1117
kjn260 wrote:
Mon Jul 04, 2022 9:30 am
Which means, with just a standard can adapter (I am using a peak clone) I can attach simulator to a real can device and do Lua Development.
It also means, curiously, your PC now responds to OBD2 PID requests.

Re: Lua Scripting

Posted: Mon Jul 04, 2022 12:27 pm
by AndreyB

Re: Lua Scripting

Posted: Wed Jul 06, 2022 9:12 am
by AndreyB
kjn260 wrote:
Mon Jul 04, 2022 9:30 am
So to do some bench hardware coding in Lua, RusEFI simulator now supports interaction to a physical hardware can device (via SocketCan) on Linux!
they wonder if we have reinvented a portion of https://forum.chibios.org/viewtopic.php?t=4861

Re: Lua Scripting

Posted: Thu Jul 14, 2022 5:10 pm
by AndreyB
New hooks to adjust closed loop boost target https://github.com/rusefi/rusefi/wiki/Lua-Scripting#setboostadd

Re: Lua Scripting

Posted: Fri Aug 12, 2022 12:57 am
by 007adr
AndreyB wrote:
Thu Jul 14, 2022 5:10 pm
New hooks to adjust closed loop boost target https://github.com/rusefi/rusefi/wiki/Lua-Scripting#setboostadd
im not a smart person, can you or some other smart person, have a step by step guide for dummies, i would like to increase boost with ethanol content and do a timing multiplier based on ethenol content and im sure lua can do it, i can understand the basics of the script, but im unable to implement them into tuner studio

Re: Lua Scripting

Posted: Fri Aug 12, 2022 4:36 pm
by AndreyB
As of today Lua scripting is only availbe in rusEFI console - tuner studio does not have provisions for multi-line text entry.

Re: Lua Scripting

Posted: Sat Aug 13, 2022 4:34 am
by 007adr
Yes but the tables are so I imagine you build the script
In the console with an “id” so you can assign table values in tuner studio


Sent from my iPhone using Tapatalk

Re: Lua Scripting

Posted: Sat Aug 13, 2022 2:37 pm
by AndreyB
007adr wrote:
Fri Aug 12, 2022 12:57 am
i would like to increase boost with ethanol content and do a timing multiplier based on ethenol content and im sure lua can do it, i can understand the basics of the script, but im unable to implement them into tuner studio
I can help once the vehicle is overall running under rusEFI. On the one hand do not worry you'll have it, on the other hand please understand that I have to set priorities based on actual vehicle needs.

Re: Lua Scripting

Posted: Sun Aug 14, 2022 9:55 am
by 007adr
AndreyB wrote:
007adr wrote:
Fri Aug 12, 2022 12:57 am
i would like to increase boost with ethanol content and do a timing multiplier based on ethenol content and im sure lua can do it, i can understand the basics of the script, but im unable to implement them into tuner studio
I can help once the vehicle is overall running under rusEFI. On the one hand do not worry you'll have it, on the other hand please understand that I have to set priorities based on actual vehicle needs.
Understand I’ll stop bugging,


Sent from my iPhone using Tapatalk

Re: Lua Scripting

Posted: Sun Sep 04, 2022 4:25 pm
by TBM
I wonder if it is possible to implement a simple ALS (anti lag) strategy using LUA script. I will ask for your opinion whether it is feasible at all.

Re: Lua Scripting

Posted: Sun Sep 04, 2022 4:28 pm
by AndreyB
Short answer is yes. A more specific question would be needed fpr more specifuc answer

Re: Lua Scripting

Posted: Sun Sep 04, 2022 4:43 pm
by TBM
AndreyB wrote:
Sun Sep 04, 2022 4:28 pm
Short answer is yes. A more specific question would be needed fpr more specifuc answer
Thanks for the quick reply Andrei. I don't quite know how to do it. If you have an idea or a ready script, I can test it (at my own risk) on my car. Otherwise, I will work on it slowly and share the script when it's ready.

Re: Lua Scripting

Posted: Tue Nov 21, 2023 10:42 pm
by AndreyB
Let's assume

Code: Select all

print (1 and "1 is true" or "1 is false")
print (0 and "0 is true" or "0 is false")
print (nil and "nil is true" or "nil is false")
Q1: what would you expect the output to be?

Q2: WHY IS IT SO WEIRD?!

Re: Lua Scripting

Posted: Tue Nov 21, 2023 10:43 pm
by AndreyB
PS: Q3 what shall we do about it?!
image.png
image.png (15.66 KiB) Viewed 22319 times

Re: Lua Scripting

Posted: Tue Nov 21, 2023 10:43 pm
by mck1117
lua has true and false and they work fine

Re: Lua Scripting

Posted: Tue Nov 21, 2023 10:45 pm
by AndreyB
image.png
image.png (21.92 KiB) Viewed 22319 times

Re: Lua Scripting

Posted: Tue Nov 21, 2023 10:49 pm
by mck1117