Sepz Posted November 26, 2008 Share Posted November 26, 2008 k, im trying to make a bot that presses 1 button over and over.the catch is, i need it to keep the window that its pressing the buttons in minimized. so i can press the button, and surf the web at the same time XD. its for a game called silkroad. heres what i have so far.$sTitle = "Gaia (New) - TIGGOBITTIES"WinWait($sTitle)$hWin = WinGetHandle($sTitle)$buff1 = ControlSend($hWin, "", "", 1)While 1=1if $buff1 then ControlSend($hWin, "", "", 1) endifSend ( "1" )ControlSend($buff1, "", "", 1)sleep(2000)Wendlike i said im VERY new at this, infact i dont really know what im doing at all XD. i got the idea from this post http://sawboo.com/macrome/?p=18 , and just deleted/modified code to make it work (kinda LOL)i thought "hey, if this guy can make something like that, i can too... i was wrong, but maybe u guys can help me .like i said, it switches to the window, and starts pressing the button. but i need it to be minimized the whole time, thanks guys Link to comment Share on other sites More sharing options...
Sepz Posted November 26, 2008 Author Share Posted November 26, 2008 cmon i know one of u knows... its almost all here, i just cant figure out why it wont do it while minimized >.< btw i know im not supposed to bump for 24 hours, but i made this thread in the middle of the night lol Link to comment Share on other sites More sharing options...
Madza91 Posted November 26, 2008 Share Posted November 26, 2008 (edited) First of all, welcome to AutoIt forums 2nd, Send() Function use like this: Send ("{1}"), not Send ( "1" )... 3rd, here is a little demo script, maybe can help you, I don't understand very well what do you want exactly (I'm bad in English ) #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $pressed = 0 $Form1 = GUICreate("Gaia (New) - TIGGOBITTIES", 242, 90, -1, -1) $Button1 = GUICtrlCreateButton("Buff", 17, 16, 207, 57, 0) GUISetState(@SW_SHOW) While 1 ControlClick($sTitle, "", "Button1") $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $pressed += 1 TrayTip("Test", "Button pressed "& $pressed & " times...", 5 ,1) Sleep(1000) EndSwitch WEnd Edited November 26, 2008 by n3nE [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
Madza91 Posted November 26, 2008 Share Posted November 26, 2008 I forgot, for minimizing, with this you can minimize that window: Local $hWnd = WinGetHandle("[CLASS:Notepad]");from help scripts... Local $sHWND = String($hWnd) ; Convert to a string WinSetState(HWnd($sHWND), "", @SW_MINIMIZE) Just use AutoIt help... [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
Sepz Posted November 26, 2008 Author Share Posted November 26, 2008 i dont need it to automatically minimize, i just need it to send the commands to that window while its minimized. so it doesnt come back up while its pressing the button... i compiled what u gave me, and it still requires the window to be selected for it to press the button, i cant think of anything else, it should work the way i have it, but it doesnt... any ideas? thanks Link to comment Share on other sites More sharing options...
Sepz Posted November 27, 2008 Author Share Posted November 27, 2008 anyone? lol i really need this working asap Link to comment Share on other sites More sharing options...
dbzfanatic Posted November 27, 2008 Share Posted November 27, 2008 Look at ControlSend() and ControlClick(), they might be what you need. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
Sepz Posted November 29, 2008 Author Share Posted November 29, 2008 sooo, i been trying on and off for about a week now to get this to work, just for fun, i tried to get it to press 1 in notepad while the window was minimized, no luck LOL im horrible. any other ideas? Link to comment Share on other sites More sharing options...
Sepz Posted December 1, 2008 Author Share Posted December 1, 2008 i still have a problem getting commands/keys to go to a minimized window, any ideas? Link to comment Share on other sites More sharing options...
walle Posted December 1, 2008 Share Posted December 1, 2008 (edited) ControlSend("Untitled", "", "Edit1", "This is a line of text in the notepad window") title The title of the window to access. text The text of the window to access. controlID The control to interact with. See Controls. string String of characters to send to the control. flag [optional] Changes how "keys" is processed: flag = 0 (default), Text contains special characters like + to indicate SHIFT and {LEFT} to indicate left arrow. flag = 1, keys are sent raw. Edited December 1, 2008 by walle Link to comment Share on other sites More sharing options...
Trait Posted December 1, 2008 Share Posted December 1, 2008 k, im trying to make a bot that presses 1 button over and over.the catch is, i need it to keep the window that its pressing the buttons in minimized. so i can press the button, and surf the web at the same time XD. its for a game called silkroad. heres what i have so far.$sTitle = "Gaia (New) - TIGGOBITTIES"WinWait($sTitle)$hWin = WinGetHandle($sTitle)$buff1 = ControlSend($hWin, "", "", 1)While 1=1if $buff1 then ControlSend($hWin, "", "", 1) endifSend ( "1" )ControlSend($buff1, "", "", 1)sleep(2000)Wendlike i said im VERY new at this, infact i dont really know what im doing at all XD. i got the idea from this post http://sawboo.com/macrome/?p=18 , and just deleted/modified code to make it work (kinda LOL)i thought "hey, if this guy can make something like that, i can too... i was wrong, but maybe u guys can help me .like i said, it switches to the window, and starts pressing the button. but i need it to be minimized the whole time, thanks guysIf you want to send a "1" keypress to Gaia you can do it with a controlsend()Something like this " ControlSend("Gaia (New)","","","1") - This is off the TOP OF MY HEAD. It's been a year or so since I did a minimized bot...Because you've copied code, you're over complicating your script... making it harder for you to understand.Break it down like this :Step 1: Set a hotkey to run your scripthotkeyset("{INSERT}","BotFunc")Step 2: Create a loop so that your script will stay running when you start it.While 1 Sleep(100)WEndStep 3: Create a function that will do your work. What I laid out is very basic. It sends a keypress, sleeps for 1 second and then starts over again.((You'll find out that games keep track of keypresses and there are some things needed to make this script undetectable... message me sometime if you're interested.))Func BotFunc()While 1;This loops untill the script is ended. ControlSend("Gaia (New)","","","1"); This sends a "1" to gaia window. Sleep(1000) ; This sleeps for 1 secondWEnd; This closes the loopEndFunc; This closes the func Link to comment Share on other sites More sharing options...
Sepz Posted December 2, 2008 Author Share Posted December 2, 2008 ok, i had it working last night. it would use meds by itself, but when i log 2 accounts in. it wants to snap to a screen. so whenever i start the script and it presses a button, it always focuses on that screen so it isnt even minimized anymore. my script reads this While 1=1 ControlSend("Gaia", "", "Edit1", "1") Sleep(1000) Wend this script works until i bring up a second client. the full client names are. Gaia (New) - Septum and Gaia (New) - TIGGOBITTIES ive tried changing it to this. ControlSend("Gaia (New) - TIGGOBITTIES", "", "Edit1", "1") and ControlSend("TIGGOBITTIES", "", "Edit1", "1") no luck if anyone can help me figure this out, it would be a great help, thanks all Link to comment Share on other sites More sharing options...
Sepz Posted December 3, 2008 Author Share Posted December 3, 2008 nvm, its all sorted. thanks guys 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