View previous topic :: View next topic |
Author |
Message |
SEKTION Cheater
Reputation: 0
Joined: 05 Nov 2017 Posts: 39 Location: Behind the keyboard
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1521
|
Posted: Mon Nov 18, 2019 3:26 pm Post subject: |
|
|
doKeyPress(VK_LBUTTON) ?
doKeyPress(VK_L) --Isn't that the "L" button anyway?
_________________
|
|
Back to top |
|
 |
SEKTION Cheater
Reputation: 0
Joined: 05 Nov 2017 Posts: 39 Location: Behind the keyboard
|
Posted: Mon Nov 18, 2019 11:58 pm Post subject: |
|
|
VK_L sends letter 'L'
I also tried mouse_event(MOUSEEVENTF_LEFTDOWN)
But nothing works
Every keyboard button work but not the mouse
Is there anything else??
_________________
TH3 UND3N14BL3 |
|
Back to top |
|
 |
SEKTION Cheater
Reputation: 0
Joined: 05 Nov 2017 Posts: 39 Location: Behind the keyboard
|
Posted: Wed Nov 20, 2019 9:59 am Post subject: |
|
|
Okay I got it working with the following code
Code: |
local cross = '["iw4sp.exe"+0008E4E4]+28'
local crshair = readInteger(cross)
while crshair == 16 do
mouse_event(MOUSEEVENTF_LEFTDOWN)
sleep(100)
mouse_event(MOUSEEVENTF_LEFTUP)
crshair = readInteger(cross)
end
|
It does work but only once like upon activation it shoots once and then nothing...
so somehow the loop is not working as it should be???
_________________
TH3 UND3N14BL3 |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25794 Location: The netherlands
|
Posted: Wed Nov 20, 2019 10:48 am Post subject: |
|
|
perhaps crshair isn't 16 right after the mouse release and then exits the loop
_________________
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 |
|
 |
SEKTION Cheater
Reputation: 0
Joined: 05 Nov 2017 Posts: 39 Location: Behind the keyboard
|
Posted: Wed Nov 20, 2019 12:35 pm Post subject: |
|
|
It has only two values, 16 when pointing on enemy and 0 when not pointing.
so when I activate the script the value should be 0 to enter the loop and then 16 to autoshoot and after that it again becomes 0 because crosshair displaces
so shouldn't the loop continue??
sorry I forgot to add
Here's a slightly changed code but its also shooting only once
Code: |
local cross = '["iw4sp.exe"+0008E4E4]+28'
local crshair = readInteger(cross)
while crshair == 0 do
crshair = readInteger(cross)
if crshair == 16 then
mouse_event(MOUSEEVENTF_LEFTDOWN)
sleep(100)
mouse_event(MOUSEEVENTF_LEFTUP)
crshair = readInteger(cross)
end
end
|
_________________
TH3 UND3N14BL3 |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25794 Location: The netherlands
|
Posted: Wed Nov 20, 2019 1:12 pm Post subject: |
|
|
are you sure that the crosshair is back at 0 immediately as you release the mouse ?
Code: |
local cross = '["iw4sp.exe"+0008E4E4]+28'
local crshair = readInteger(cross)
while crshair == 0 do
crshair = readInteger(cross)
if crshair == 16 then
mouse_event(MOUSEEVENTF_LEFTDOWN)
sleep(100)
mouse_event(MOUSEEVENTF_LEFTUP)
crshair = readInteger(cross)
if (crshair~=0) then
print('Not 0!')
end
end
end
|
Also, if it is working, that code will freeze CE, unless you run it in it's own thread
_________________
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 |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Wed Nov 20, 2019 1:27 pm Post subject: |
|
|
Code: | {$Lua}
if syntaxcheck then return end
[ENABLE]
superLuaAutoClickForTriggerbot_thread = createNativeThread(function (thread)
thread.freeOnTerminate(false)
thread.Name = 'superLuaAutoClickForTriggerbot_thread'
local crshair
while not thread.Terminated do
local crshair = readInteger('["iw4sp.exe"+0008E4E4]+28')
if crshair == 16 then
mouse_event(MOUSEEVENTF_LEFTDOWN)
sleep(100)
mouse_event(MOUSEEVENTF_LEFTUP)
end
sleep(10)
end
end)
[DISABLE]
if superLuaAutoClickForTriggerbot_thread then -- kill thread
superLuaAutoClickForTriggerbot_thread.terminate()
superLuaAutoClickForTriggerbot_thread.waitfor()
superLuaAutoClickForTriggerbot_thread.destroy()
superLuaAutoClickForTriggerbot_thread=nil
end
|
_________________
|
|
Back to top |
|
 |
SEKTION Cheater
Reputation: 0
Joined: 05 Nov 2017 Posts: 39 Location: Behind the keyboard
|
Posted: Thu Nov 21, 2019 2:07 am Post subject: |
|
|
Dark Byte wrote: | are you sure that the crosshair is back at 0 immediately as you release the mouse ?
Also, if it is working, that code will freeze CE, unless you run it in it's own thread |
Crosshair is back to 0 immediately not after I release the mouse but when It points somewhere else other than on the enemy
This does freeze CE but until value turns to 16 and also I tried to run in its own thread but this crashes the game
_________________
TH3 UND3N14BL3 |
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1521
|
Posted: Thu Nov 21, 2019 4:43 am Post subject: |
|
|
Why the mouse movement "16"?
Can't you just code "16" to shoot at the enemy?
For example: "SPACE" = shoot (keyPress = Space (position> "16")
This happens instantaneously and does not trigger a crash.
_________________
|
|
Back to top |
|
 |
SEKTION Cheater
Reputation: 0
Joined: 05 Nov 2017 Posts: 39 Location: Behind the keyboard
|
Posted: Thu Nov 21, 2019 5:42 am Post subject: |
|
|
mgr.inz.Player wrote: | Code: | {$Lua}
if syntaxcheck then return end
[ENABLE]
superLuaAutoClickForTriggerbot_thread = createNativeThread(function (thread)
thread.freeOnTerminate(false)
thread.Name = 'superLuaAutoClickForTriggerbot_thread'
local crshair
while not thread.Terminated do
local crshair = readInteger('["iw4sp.exe"+0008E4E4]+28')
if crshair == 16 then
mouse_event(MOUSEEVENTF_LEFTDOWN)
sleep(100)
mouse_event(MOUSEEVENTF_LEFTUP)
end
sleep(10)
end
end)
[DISABLE]
if superLuaAutoClickForTriggerbot_thread then -- kill thread
superLuaAutoClickForTriggerbot_thread.terminate()
superLuaAutoClickForTriggerbot_thread.waitfor()
superLuaAutoClickForTriggerbot_thread.destroy()
superLuaAutoClickForTriggerbot_thread=nil
end
|
|
Sorry for late response, CEF won't let me post two replies back to back
I'm yet to try your code and then let you know
EDIT
This worksss!!!!! Thank You very much @mgr.inz.Player
So what you did is created a thread and until that thread is running, the loop will continue.Right??
And also I have a few questions just for my knowledge
1-What is 'if syntaxcheck then return end'?
2-And at last what is 'superLuaAutoClickForTriggerbot_thread=nil' for?
EDIT 2
I somewhat figured out the two questions but these two I still can't understand
If someone can explain them cuz I'm a beginner and it's the first time I came upon the lua createThread function
_________________
TH3 UND3N14BL3 |
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sat Nov 23, 2019 7:53 am Post subject: |
|
|
The statement (not thread.Terminated) is true until you deactivate.
Deactivation will:
- set thread.Terminated (the line superLuaAutoClickForTriggerbot_thread.terminate() ) from false to true. (so "not thread.Terminated" will become false)
- then CE waits a while (the line superLuaAutoClickForTriggerbot_thread.waitfor() )
- so it can safely destroy TThread object (superLuaAutoClickForTriggerbot_thread.destroy() )
1
Shortly, CE executes ENABLE section and then DISABLE section in "syntaxcheck mode". It happens when you add new or edit existing script.
And that means it will execute embedded Lua scripts too. That line is to prevent Lua code execution when CE does syntaxcheck.
2
It's a common practice to set variables to nil after destroying/freeing object they pointed to. Especially global variables (variables created without "local" statement)
Example:
memoryscanner = createMemScan()
...
...
...
memoryscanner.destroy()
memoryscanner = nil
_________________
|
|
Back to top |
|
 |
SEKTION Cheater
Reputation: 0
Joined: 05 Nov 2017 Posts: 39 Location: Behind the keyboard
|
Posted: Sun Nov 24, 2019 9:53 am Post subject: |
|
|
Very thanks to you for clarification!!!
_________________
TH3 UND3N14BL3 |
|
Back to top |
|
 |
|