View previous topic :: View next topic |
Author |
Message |
balckice How do I cheat?
Reputation: 0
Joined: 25 Jan 2017 Posts: 3
|
Posted: Wed Jan 25, 2017 10:42 am Post subject: Lua no recoil script |
|
|
Hello everybody,
i'm totally new to lua, but i wrote a little no recoil script to be executed with L-Bia (so you can run it on every pc or usb drive). I encountered a little problem when i want to run the script:
Error message:
l-bia: l-bia.lua:9: syntax error near 'mb1_pressed'
I don't find any syntax errors, so maybe you guys could help me.
My script:
EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 6 then --set flag for mb1
mb1_pressed = true
elseif event == "MOUSE_BUTTON_RELEASED" and arg == 6 then --set flag for mb1=false
mb1_pressed = false
end
If mb1_pressed then
if event == "MOUSE_BUTTON_PRESSED" and arg == 1 and then
repeat
MoveMouseRelative(3,0)
Sleep(1)
MoveMouseRelative(0,10)
Sleep(1)
MoveMouseRelative(-3,-10)
Sleep(1)
MoveMouseRelative(-3,0)
Sleep(1)
MoveMouseRelative(3,10)
Sleep(1)
MoveMouseRelative(0,-10)
Sleep(1)
until not IsMouseButtonPressed(1)
end
end
thank you in advance for your help
|
|
Back to top |
|
 |
panraven Grandmaster Cheater
Reputation: 62
Joined: 01 Oct 2008 Posts: 958
|
Posted: Wed Jan 25, 2017 11:09 am Post subject: |
|
|
It seem there are --[[extra: and]] and --[[missing, to close scope of 'function']]
bye~
Code: |
EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 6 then --set flag for mb1
mb1_pressed = true
elseif event == "MOUSE_BUTTON_RELEASED" and arg == 6 then --set flag for mb1=false
mb1_pressed = false
end
if mb1_pressed then
if event == "MOUSE_BUTTON_PRESSED" and arg == 1 --[[extra: and]] then
repeat
MoveMouseRelative(3,0)
Sleep(1)
MoveMouseRelative(0,10)
Sleep(1)
MoveMouseRelative(-3,-10)
Sleep(1)
MoveMouseRelative(-3,0)
Sleep(1)
MoveMouseRelative(3,10)
Sleep(1)
MoveMouseRelative(0,-10)
Sleep(1)
until not IsMouseButtonPressed(1)
end
end
end--[[missing, to close scope of 'function']]
|
_________________
- Retarded. |
|
Back to top |
|
 |
balckice How do I cheat?
Reputation: 0
Joined: 25 Jan 2017 Posts: 3
|
Posted: Wed Jan 25, 2017 12:55 pm Post subject: |
|
|
hey thank you for your quick help, seems like this was part of the problem,i updated the script, but now i get another error:
l-bia: l-bia.lua:1:attempt to call global 'EnablePrimaryMouseButtonEvents' (a nil value)
|
|
Back to top |
|
 |
panraven Grandmaster Cheater
Reputation: 62
Joined: 01 Oct 2008 Posts: 958
|
Posted: Wed Jan 25, 2017 4:27 pm Post subject: |
|
|
It means EnablePrimaryMouseButtonEvents is not ever defined.
It look like your script not like standard Lua builtin nor CE provided extension (if it is used in CE), and from google,
it seems related to lXXitech device?
They should has some external dependency (modules) that you have to load into your script first.
Usually it need a 'require' statement, like
Code: |
require ( "norecoilmod" )
|
given that your external modules are properly installed, and compatible with CE environment.
eg.
1.if it has an extension *.dll that its bit-ness 64-bit/32-bit match CE's,
2.if its lua version match CE's, 5.1 for ce 6.4, and 5.3 for ce 6.5+
etc.
bye~
_________________
- Retarded. |
|
Back to top |
|
 |
Corroder Grandmaster Cheater Supreme
Reputation: 75
Joined: 10 Apr 2015 Posts: 1668
|
Posted: Wed Jan 25, 2017 5:42 pm Post subject: |
|
|
Seem like use Logitech Gaming Mouse lua script.
But not sure which one use for your script, because LGM have many type, example : #G300s, #G19, etc.
- Check which LGM module use for your script
- Need Logitech Script Manager to activating your script (something same as "require" and "dofile" in pure lua)
- or Googling for Logitech lua scripting
Regards
|
|
Back to top |
|
 |
balckice How do I cheat?
Reputation: 0
Joined: 25 Jan 2017 Posts: 3
|
Posted: Thu Jan 26, 2017 1:41 am Post subject: |
|
|
i own a g500, but i want this to work with every mouse, compile it to a standalone exe
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25784 Location: The netherlands
|
Posted: Thu Jan 26, 2017 3:35 am Post subject: |
|
|
use isKeyPressed or a hotkey and mouse_event/setMousePos instead
and multiply tbe sleeps by 1000
and/or a timer/thread since this will freeze the ce gui for 10 seconds
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
|