Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

loop left mouse button in-game

Hi HF
let me first explain what i want to do: in the game there is a gun which is semi, so you have to click the left mouse button down and release it to make it shoot(Semi) so what im trying to make is a program which will do this very fast so it will be like (rapidfire?) ive tried to do many things but it just shoot 1 time then it stops. so i guess the problem is that it's not pressing down the mouse button and releasing it. it maybe just press it down? so how would i make this?
Sorry for my english. Thanks for any help
If you have a gaming mouse it usually comes with macro software. Or just download a macro recorder for this. Better than coding it yourself.
This is just from an old autoclicker i made from ages ago but it should work on your game.

Create a new project

Add a timer and 2 buttons
name one button start and the other stop

set timer to whatever interval you want. This controls the speed of clicking in milliseconds. It can be set in the properties or can be changed via code using this
Code
Timer1.interval = [Your preferred speed]

double click timer1 and enter this code:
Code
mouse_event(mouseclickup, 0, 0, 0, 0)
mouse_event(mouseclickdown, 0, 0, 0, 0)
This will simulate the click

Under public class form1 enter this code:
Code
Private Declare Sub mouse_event Lib "user32" (ByVal dwflags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cbuttons As Integer, ByVal dwextrainfo As Integer)

Private Const mouseclickup = 4

Private Const mouseclickdown = 2

Now double click the start button and enter this
Code
Timer1.enabled = True()
This starts the clicking

Now double click the stop button and enter this
Code
Timer1.Enabled = False()

This stops the clicking

You can assign start and stop to hotkeys if it makes it easier which i guess it would since you're in a fullscreen game.
(Apr 2, 2016 08:40 AM)PriorityNew Wrote:  This is just from an old autoclicker i made from ages ago but it should work on your game.

Create a new project

Add a timer and 2 buttons
name one button start and the other stop

set timer to whatever interval you want. This controls the speed of clicking in milliseconds. It can be set in the properties or can be changed via code using this
Code
Timer1.interval = [Your preferred speed]

double click timer1 and enter this code:
Code
mouse_event(mouseclickup, 0, 0, 0, 0)
mouse_event(mouseclickdown, 0, 0, 0, 0)
This will simulate the click

Under public class form1 enter this code:
Code
Private Declare Sub mouse_event Lib "user32" (ByVal dwflags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cbuttons As Integer, ByVal dwextrainfo As Integer)

Private Const mouseclickup = 4

Private Const mouseclickdown = 2

Now double click the start button and enter this
Code
Timer1.enabled = True()
This starts the clicking

Now double click the stop button and enter this
Code
Timer1.Enabled = False()

This stops the clicking

You can assign start and stop to hotkeys if it makes it easier which i guess it would since you're in a fullscreen game.
ive already tried all this and it don't work, the thing with this code is that i think it's only pressing the left mouse button down and don't release it. I installed a program which is called autohotkey(?) and that seemed to work, so it's possible to do. I just need a code that will work. anyways thanks for ur time

(Apr 2, 2016 07:54 AM)Ninja Wrote:  If you have a gaming mouse it usually comes with macro software. Or just download a macro recorder for this. Better than coding it yourself.
i know, i tried autohotkey and it worked like i should. But i want to code it
Code
mouse_event(mouseclickup, 0, 0, 0, 0)
mouse_event(mouseclickdown, 0, 0, 0, 0)

This mouse event should lift up
If the game you're trying to cheat in is a popular one, they've probably added some sort of detection for this.
(Apr 2, 2016 12:28 PM)Hawk HF Wrote:  If the game you're trying to cheat in is a popular one, they've probably added some sort of detection for this.
the game is not really that popular, it's an emulator for the game infestation survivor stories aka the warz. i tried with autohotkey and everything worked as it should but i want to code it myself
(Apr 2, 2016 08:40 AM)PriorityNew Wrote:  
Code
Timer1.enabled = True()

Code
Timer1.Enabled = False()

Since when was True and False a method? VB is silly for allowing that shit
(Apr 2, 2016 06:47 PM)Ainaj Wrote:  Since when was True and False a method? VB is silly for allowing that shit

It doesn't, no idea where he pulled that from.
Often you'll need a sleep between down&up at around 15ms for the game to catch it.
(Apr 3, 2016 02:59 PM)AnarchyCoder Wrote:  Often you'll need a sleep between down&up at around 15ms for the game to catch it.

That time depends on the games FPS, 60 is 16.6ms, so sleeping 20 would be more ideal.

If you use 15 and get unlucky, it'll go down and up during vsync so the game will never catch it
(Apr 3, 2016 04:16 PM)Ainaj Wrote:  That time depends on the games FPS, 60 is 16.6ms, so sleeping 20 would be more ideal.

If you use 15 and get unlucky, it'll go down and up during vsync so the game will never catch it

More ideal is to monitor the bool representing whether or not the game is ready to receive a new click. (If such exists in the game of course)
(Apr 3, 2016 06:37 PM)AnarchyCoder Wrote:  More ideal is to monitor the bool representing whether or not the game is ready to receive a new click. (If such exists in the game of course)

Doesn't exist to my knowledge. It'll depend game to game, engine to engine.
(Apr 4, 2016 09:41 AM)Ainaj Wrote:  Doesn't exist to my knowledge. It'll depend game to game, engine to engine.

Of course it's gonna depend on the game&engine. Currently I have 4 different projects on different games where such ability exists. Research how the game handles it>open handle to process>read memory>profit.
(Apr 4, 2016 05:51 PM)AnarchyCoder Wrote:  Of course it's gonna depend on the game&engine. Currently I have 4 different projects on different games where such ability exists. Research how the game handles it>open handle to process>read memory>profit.

Just thought of something. DirectX has begin scene and end scene. You can hook them to detect when the game is accepting input I guess. I don't have much experience with OpenGL, but I imagine they'll have the same.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by SurHommeOct 1, 2022 03:25 PM 9 289 Oct 1, 2022 03:25 PM
Last Post: MeyerWolfsheim
[Shell] by ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™May 11, 2020 12:50 PM 2 219 May 11, 2020 12:50 PM
Last Post: Exalted
[.NET] by LeonieHackPetaBytes2Jan 23, 2019 05:10 PM 1 225 Jan 23, 2019 05:10 PM
Last Post: 0xDEAD10CC