It would be easier to post what code you are using.
DazTheGas
Posts: 7
Re: mcX360 Plugin for Lua
« Reply #77 on: September 20, 2018, 04:31:35 AM »
as I motion that the Register Diagnostics /mcX360_LUA give me a value when I press any bottom
I follow your video step by step and this is the code
------- Declaer local---------------
local mInst = mc.mcGetInstance()
local Xenable= 0
-------------- Ps3 Init Panel------------
Ps3_Penal = wx.wxPanel( wx.NULL , wx.wxID_ANY , wx.wxDefaultPosition , wx.wxDefaultSize)
Ps3_Timer = wx.wxTimer (Ps3_Penal)
Ps3_Timer : Start(100)
----------- Function----------------
function GetXin(Xinput)
local hreg = mc.mcRegGetHandle(mInst , string.format("mcX360_LUA/%s") , Xinput)
return mc.mcRegGetHandle(hreg)
end
------------Event Timers-------------
Ps3_Penal : Connect (wx.wxEVT_TIMER , function(event)
if GetXin("LTR_Val") > 150 and Xenable == 0 then
Xenable = 1
mc.mcCntlSetLastError(mInst , "Ps3 Running")
elseif GetXin ("LTR_Val") < 50 and Xenable == 1 then
Xenable =0
mc.mcCntlSetLastError(mInst , "Ps3 Stopped")
end
end )