![]() |
|
[.NET] loop left mouse button in-game - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] loop left mouse button in-game (/showthread.php?tid=5223975) |
loop left mouse button in-game - SIM-2618262 - Apr 2, 2016 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 * - Ninja - Apr 2, 2016 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. * - PriorityNew - Apr 2, 2016 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)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)Now double click the start button and enter this Code Timer1.enabled = True()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. * - SIM-2618262 - Apr 2, 2016 (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.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 * - PriorityNew - Apr 2, 2016 Code mouse_event(mouseclickup, 0, 0, 0, 0)This mouse event should lift up * - Hawk HF - Apr 2, 2016 If the game you're trying to cheat in is a popular one, they've probably added some sort of detection for this. * - SIM-2618262 - Apr 2, 2016 (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 * - Ainaj - Apr 2, 2016 (Apr 2, 2016 08:40 AM)PriorityNew Wrote: Since when was True and False a method? VB is silly for allowing that shit * - Odus - Apr 3, 2016 (Apr 2, 2016 06:47 PM)cesarvb689 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. * - AnarchyCoder - Apr 3, 2016 Often you'll need a sleep between down&up at around 15ms for the game to catch it. * - Ainaj - Apr 3, 2016 (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 * - AnarchyCoder - Apr 3, 2016 (Apr 3, 2016 04:16 PM)cesarvb689 Wrote: That time depends on the games FPS, 60 is 16.6ms, so sleeping 20 would be more ideal. 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) * - Ainaj - Apr 4, 2016 (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. * - AnarchyCoder - Apr 4, 2016 (Apr 4, 2016 09:41 AM)cesarvb689 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. * - Ainaj - Apr 5, 2016 (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. |