Reputation: 11
Even though my Lua scripts for my gaming mouse Logitech G502 Hero work fine in Windows desktop, or every application or game I tries, they dont work on Battlefield and the Origin app. Custom macros work, but the scripting doesnt.
Any ideas? or anyone else having the same problem?
Thanks! Emmanouil Filippou
Here is an example of a simple Lua script that I have tried and doesnt work.
EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
if IsMouseButtonPressed(3)then
repeat
if IsMouseButtonPressed(1) then
repeat
MoveMouseRelative(0,5)
Sleep(33)
until not IsMouseButtonPressed(1)
end
until not IsMouseButtonPressed(3)
end
end
Upvotes: 0
Views: 2381
Reputation: 23767
You have forgotten to insert Sleep
EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
Sleep(20)
if IsMouseButtonPressed(3)then
repeat
if IsMouseButtonPressed(1) then
repeat
MoveMouseRelative(0,5)
Sleep(33)
until not IsMouseButtonPressed(1)
end
until not IsMouseButtonPressed(3)
end
end
Upvotes: 0