onehandsolo Posted August 4, 2008 Share Posted August 4, 2008 Ok i read through the FAQ's and they didn't seem to be very helpfull as far as a listing of basic commands i could use I also looked through the examples and i cant find anything that relates to what i need Basically i want to hook a running process so that auto it will preform a keysend like this (open window) press up arrow , down arrow, left arrow , right arrow keys and i need it to randomly select one of them and at random miliseconds How could i write a program that randomly pushes a key basicly is what im asking and is there a way to get it to only perform the action for a certain process? Link to comment Share on other sites More sharing options...
bogQ Posted August 4, 2008 Share Posted August 4, 2008 Basically i want to hook a running process so that auto it will preform a keysend like this(open window)WinGetHandle() will hook windowWinGetTitle() (open window) WinSetState($handle or $title, "", @SW_MAXIMIZE)look at the Example in help file for all commandspress up arrow , down arrow, left arrow , right arrow keysSend(){UP} Up arrow {DOWN} Down arrow {LEFT} Left arrow {RIGHT} Right arrow and i need it to randomly select one of them and at random milisecondsHow could i write a program that randomly pushes a key basicly is what im asking and is there a way to get it to only perform the action for a certain process?Random() and with random you better look at If...ElseIf...Else...EndIfWhile...WEnd andSleep()command TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 4, 2008 Share Posted August 4, 2008 It would be even simpler to use ControlSend(), then you wouldn't need to bother about the window being active or not .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
onehandsolo Posted August 4, 2008 Author Share Posted August 4, 2008 (edited) Ok so here is what i've got so far , please help clean this up lol Sleep(1970.46384386842) Random( [Min 10.1 [Max2000.0000000000) Send("{UP DOWN}") Sleep(331.394632558049) Send("{UP UP}") Sleep(159.9250742762) Send("{DOWN DOWN}") Sleep(143.899294463402) Send("{DOWN UP}") Sleep(1543.57327537438) Send("{RIGHT DOWN}") Sleep(144.387065953913) Send("{RIGHT UP}") Sleep(1553.97683225103) Send("{LEFT DOWN}") Sleep(216.984002156699) The random thing i still dont understand how to apply this I basicly am needing everything under the random line to be random lol Edited August 4, 2008 by onehandsolo Link to comment Share on other sites More sharing options...
anixon Posted August 4, 2008 Share Posted August 4, 2008 Ok so here is what i've got so far , please help clean this up lolThe random thing i still dont understand how to apply thisI basicly am needing everything under the random line to be random lolYou need to create a variableGlobal $myrandomnumberFunc _randomnumber() $myrandomnumber = random(1,9000, 1) msgbox(0,"",$myrandomnumber)EndFunc;Example generates a whole number 1 to 9,000 inclusive. The Func routine will generate a new random number and assign it to the $myrandomnumber each time it is called. $myrandomnumber is used in your code where you need a random number. Hope that makes sense.... AntThen your codeDo something_randomnumber()Do Something_randomnumber()Do Something_randomnumber()ExitCheers Ant.. Link to comment Share on other sites More sharing options...
bogQ Posted August 5, 2008 Share Posted August 5, 2008 Ok so here is what i've got so far , please help clean this up lol this shud get you started expandcollapse popupGlobal $random_1 Global $random_2 Run("Notepad.exe", "", @SW_MAXIMIZE) ;~ WinActivate("[CLASS:Notepad]"); Or ;~ WinActivate("Untitled - Notepad") WinWaitActive("Untitled - Notepad") Send("jhjhjhjfghsdfsfd") Send("{ENTER}") Send("sdsdfsd") Send("{ENTER}") Send("sadfdsfff") Send("{ENTER}") While 1 _random_1();<== goto _random_1() func Sleep($random_1) _random_2();<== goto _random_2() func Select Case $random_2 = 1 Send("{UP}") Send("{DOWN}") Case $random_2 = 2 Send("{UP}") Send("{LEFT}") Case $random_2 = 3 Send("{UP}") Send("{RIGHT}") Case $random_2 = 4 Send("{UP}") Send("{DOWN}") Case $random_2 = 5 Send("{DOWN}") Send("{UP}") Case $random_2 = 6 Send("{DOWN}") Send("{LEFT}") Case $random_2 = 7 Send("{DOWN}") Send("{RIGHT}") Case $random_2 = 8 Send("{DOWN}") Send("{DOWN}") Case $random_2 = 9 Send("{LEFT}") Send("{UP}") Case $random_2 = 10 Send("{LEFT}") Send("{DOWN}") Case $random_2 = 11 Send("{LEFT}") Send("{RIGHT}") Case $random_2 = 12 Send("{LEFT}") Send("{LEFT}") Case $random_2 = 13 Send("{RIGHT}") Send("{UP}") Case $random_2 = 14 Send("{RIGHT}") Send("{DOWN}") Case $random_2 = 15 Send("{RIGHT}") Send("{LEFT}") Case $random_2 = 16 Send("{RIGHT}") Send("{RIGHT}") EndSelect WEnd Func _random_1() $random_1 = Random(1000, 2000,1);<== from 1 to 2 seconds EndFunc Func _random_2() $random_2 = Random(1,16,1);<== from 1 to 16 numbers EndFunc TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now