Hello Guest it is March 29, 2024, 11:57:57 AM

Author Topic: LUA Script - Please help me  (Read 3469 times)

0 Members and 1 Guest are viewing this topic.

LUA Script - Please help me
« on: August 03, 2014, 05:52:01 AM »
Hello there,

i have a little problem. I tried to create a script.
What want I do, well very easy. I like to create 2 buttons in the FRO-Section.
The first button should increase the current FRO value by pushing +10.
The second button should decrease the current FTO value by pushing -10.

I tried out a lot, but currently I am not able to make it work.
Is anyone here who could help me?
Best regards,
Gerhard

Re: LUA Script - Please help me
« Reply #1 on: August 03, 2014, 07:36:10 AM »
i tried out this:

local inst = mc.mcGetInstance();
local TempFRO = 0;
mc.mcCntlGetFRO(TempFRO, 0);
TempFRO = TempFRO - 10;
mc.mcCntlSetFRO(inst, TempFRO);


but it does not work.

Re: LUA Script - Please help me
« Reply #2 on: August 03, 2014, 07:56:06 AM »
Now it works:

Decreasing FRO by Button:


local inst = mc.mcGetInstance();
local TempFRO;
TempFRO = mc.mcCntlGetFRO(inst);
TempFRO = TempFRO - 10;
mc.mcCntlSetFRO(inst, TempFRO);

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: LUA Script - Please help me
« Reply #3 on: August 03, 2014, 07:56:28 AM »
I don't know Lua, but I think it should be something like this:

local inst = mc.mcGetInstance();
local TempFRO = 0;
mc.mcCntlGetFRO(inst);
TempFRO = TempFRO - 10;
mc.mcCntlSetFRO(inst, TempFRO);

Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: LUA Script - Please help me
« Reply #4 on: August 03, 2014, 09:57:16 AM »
I did this by manipulating the slider.

I did a GetProperty() on the slider, did the math to add/subtract 5%, and then did a SetProperty() to update it.

I will post the code when I get to my computer.


-Freeman

Sent from my SGH-I337 using Tapatalk
I'm not a complete idiot...
    there are some parts missing.