View previous topic :: View next topic |
Author |
Message |
Sting9x Expert Cheater Reputation: 0
Joined: 27 Jul 2016 Posts: 124
|
Posted: Sat Aug 19, 2017 7:59 pm Post subject: auto clicker |
|
|
Hello all member CE
I have the following problem hope to help.
My code is as follows
Code: | if mytimer2 == nil then
mytimer2 = createTimer(nil, false)
end
mytimer2.OnTimer = function(timer)
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP)
end
mytimer2.Interval = 500
if myhotkey then
myhotkey.Destroy()
end
myhotkey = createHotkey(function()
mytimer2.Enabled = not mytimer2.Enabled
end, VK_F1) |
Its function is auto clicker. I'm really annoyed when naughty children, they naughty my computer when I'm gone. Deflector pointer that I activate F1 before.
My question is there is a way to keep a fixed position when I press F1?
Tks ALL
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Sat Aug 19, 2017 8:28 pm Post subject: |
|
|
Presumably calling setMousePos(x,y) inside the OnTimer function would work.
Though if you're really worried about people messing with it then you'll probably need to worry about them pressing the power button to reset it once they realize they can't use the mouse, not sure how to handle that (especially holding down the power) but...also for older children they'll probably eventually figure out which key toggles it so you might want to use inputQuery to ask for a password and stringToMD5String to generate a hash from the input to compare to one saved in the script (that way they can't simply find the script and read the password, all they get is the hash).
Over time you may also need to worry about someone opening a command prompt or something that might let them cancel the script by killing CE, if you can open something on top of where the mouse is clicking then it'd keep the focus because the mouse is constantly clicking on it. Using the win api SetForegroundWindow may help with that, example usage
Code: | local hwnd = findWindow(nil, '... - VLC media player') -- I was watching a movie lol
if hwnd ~= 0 and getForegroundWindow() ~= hwnd then -- found window and not foreground
local success = executeCodeLocal('SetForegroundWindow',hwnd) ~= 0
end
|
Ultimately it depends on just how far you want to go, it's possible that other programs already exist that might help, though I haven't done any google searches to find out
|
|
Back to top |
|
|
Sting9x Expert Cheater Reputation: 0
Joined: 27 Jul 2016 Posts: 124
|
Posted: Sat Aug 19, 2017 8:46 pm Post subject: |
|
|
FreeER wrote: | Presumably calling setMousePos(x,y) inside the OnTimer function would work.
Though if you're really worried about people messing with it then you'll probably need to worry about them pressing the power button to reset it once they realize they can't use the mouse, not sure how to handle that (especially holding down the power) but...also for older children they'll probably eventually figure out which key toggles it so you might want to use inputQuery to ask for a password and stringToMD5String to generate a hash from the input to compare to one saved in the script (that way they can't simply find the script and read the password, all they get is the hash).
Over time you may also need to worry about someone opening a command prompt or something that might let them cancel the script by killing CE, if you can open something on top of where the mouse is clicking then it'd keep the focus because the mouse is constantly clicking on it. Using the win api SetForegroundWindow may help with that, example usage
Code: | local hwnd = findWindow(nil, '... - VLC media player') -- I was watching a movie lol
if hwnd ~= 0 and getForegroundWindow() ~= hwnd then -- found window and not foreground
local success = executeCodeLocal('SetForegroundWindow',hwnd) ~= 0
end
|
Ultimately it depends on just how far you want to go, it's possible that other programs already exist that might help, though I haven't done any google searches to find out |
My idea is when I activated the F1 key. The pointer will remain in a fixed position on the screen, although I pointed at the mouse, it was still in that position.
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sun Aug 20, 2017 4:59 pm Post subject: |
|
|
from your code
Code: | ..
mytimer2.OnTimer = function(timer)
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP)
setMousePos(1,1)
end
mytimer2.Interval = 500
.. |
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
Sting9x Expert Cheater Reputation: 0
Joined: 27 Jul 2016 Posts: 124
|
Posted: Sun Aug 20, 2017 7:49 pm Post subject: |
|
|
Corroder wrote: | from your code
Code: | ..
mytimer2.OnTimer = function(timer)
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP)
setMousePos(1,1)
end
mytimer2.Interval = 500
.. |
|
I've been tried, but the frame size is a lot, Is there a way to pointer in a certain position?
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Mon Aug 21, 2017 12:12 am Post subject: |
|
|
function setMousePos(x, y)
Sets the mouse cursor to the specified coordinates.
Parameter Type Description
x Integer The x coordinate to set the mouse cursor to
y Integer The y coordinate to set the mouse cursor to
Get it from another topic :
http://www.cheatengine.org/forum/viewtopic.php?t=602233&sid=38ce612f4e1002ff482acdc0dfc17d3a
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
Sting9x Expert Cheater Reputation: 0
Joined: 27 Jul 2016 Posts: 124
|
Posted: Mon Aug 21, 2017 7:26 am Post subject: |
|
|
Thank you for your enthusiastic support, I have a question.
Is there a way to exit CE means the game will turn off?
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Mon Aug 21, 2017 4:36 pm Post subject: |
|
|
maybe something like this to exit a process :
Code: |
shellExecute('cmd.exe', '/c taskkill /PID ' .. getOpenedProcessID(), nil, false);
|
or
Code: |
shellExecute('cmd.exe', '/c taskkill /PID ' .. getOpenedProcessID(), 'C:\\Windows\\System32\\', false);
|
put the command under checkbox or button click function
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
|