Jump to content

Qaptian

Members
  • Posts

    4
  • Joined

  • Last visited

Qaptian's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hi! I'm working on a project that's not as simple as I thought it would be. I've been asked to create a macro for a game similar to this. I've got the basics down, but in order to speed the macro up I don't want it clicking on an answer more than once. I need to get the macro to actively save the positions of the answers that it has found, and to not click them again. I wanted to do this by typing out the paths myself, but there's hundreds and hundreds of them. Here's the pseudo code of what I've got going on right now. While text of answer 1 <> blue click question click answer if text is blue, exit loop click another question click another answer if text is blue, exit loop while text of answer 2 <> blue repeat above To summarize: I want to create a macro that creates a path to finish this game by brute forcing it until it gets an answer. Once the game gets an answer, I need it to remember where it clicked and use that memory somehow to tell it not to click there again. Sorry if this doesn't make sense, I'm terribly tired right now. EDIT: post title is botched. I accidentally hit 'enter' and the damn thing submitted. Oh well.
  2. If you're trying to close something that can be seen in the task manager, find out the name of the process, and then insert the "ProcessClose" function. It should kill whatever you had running.
  3. So, if I understand correctly, the "ControlClick" function should be able to click inside a minimized window without having to open it? Also, Could I add a window handle in the PixelGetColor function to get pixel colors from a minimized window? I sincerely thank you for your speedy replies.
  4. Hello, I've been working with AutoIt for a little over 2 weeks now, and so far I've only created simple point and click automations. It's working out great for me, but, I'd like to know if I can run multiple instances of AutoIt without one taking mouse control over the other. I want to be able to have a bunch of automations running, each working on its own, and I would like to run them on miminized windows so that I still have control over the computer. Is this possible with AutoIt? Or must I run the automations on multiple computers? Thanks! EDIT: Also, if I'm running something minimized, how can I get the pixel colors at a certain coordinate inside the window? I don't think PixelGetColor will work, because that just grabs straight off the screen. Here's my code, I want to be able to have this running multiple times, in multiple minimized windows. CODEIf PixelGetColor ( 631 , 485 ) = 0xEDC21F Then MouseClick ( "left" , 358 , 495 , 1 ) Sleep ( 300 ) Send ( "8768400995" ) MouseClick ( "left" , 631 , 485 , 1 ) Sleep ( 1200 ) ElseIf PixelGetColor ( 631 , 485 ) <> 0xEDC21F Then Do PixelGetColor ( 631 , 485 ) Until PixelGetColor ( 631 , 485 ) = 0xEDC21F If PixelGetColor ( 631 , 485 ) = 0xEDC21F Then MouseClick ( "left" , 358 , 495 , 1 ) Sleep ( 300 ) Send ( "8768400995" ) MouseClick ( "left" , 631 , 485 , 1 ) Sleep ( 1200 ) EndIf EndIf If PixelGetColor ( 578 , 382 ) = 0xEBE9ED Then MouseClick ( "left" , 523 , 404 , 1 ) Sleep ( 300 ) MouseClick ( "left" , 358 , 495 , 1 ) Send ( "^a" ) Sleep ( 300 ) Send ( "8768400995" ) MouseClick ( "left" , 631 , 485 , 1 ) EndIf ;checks 2nd page If PixelGetColor ( 849 , 563 ) = 0xE7A80C Then MouseClick ( "left" , 849 , 563 , 1 ) ElseIf PixelGetColor ( 849 , 563 ) <> 0xE7A80C Then Do PixelGetColor ( 849 , 563 ) Until PixelGetColor ( 849 , 563 ) = 0xE7A80C If PixelGetColor ( 849 , 563 ) = 0xE7A80C Then MouseClick ( "left" , 849 , 563 , 1 ) EndIf EndIf ;checks 3rd page If PixelGetColor ( 568 , 624 ) = 0xE59C0A Then Sleep ( 1000 ) MouseClick ( "left" , 344 , 100 , 1 ) MouseClick ( "left" , 134 , 130 , 1 ) MouseClick ( "left" , 67 , 412 , 1 ) MouseClick ( "left" , 181 , 413 , 1 ) Sleep ( 300 ) Send ( "^a" ) Sleep ( 300 ) Send ( "^x" ) MouseClick ( "left" , 356 , 129, 1 ) Sleep ( 300 ) MouseClick ( "left" , 373 , 450, 1 ) Sleep ( 300 ) Send ( "^v" ) MouseClick ( "left" , 568 , 624 , 1 ) EndIf If PixelGetColor ( 568 , 624 ) <> 0xE59C0A Then Do PixelGetColor ( 568 , 624 ) Until PixelGetColor ( 568 , 624 ) = 0xE59C0A If PixelGetColor ( 568 , 624 ) = 0xE59C0A Then Sleep ( 1000 ) MouseClick ( "left" , 344 , 100 , 1 ) MouseClick ( "left" , 134 , 130 , 1 ) MouseClick ( "left" , 67 , 412 , 1 ) MouseClick ( "left" , 181 , 413 , 1 ) Sleep ( 300 ) Send ( "^a" ) Sleep ( 300 ) Send ( "^x" ) MouseClick ( "left" , 356 , 129, 1 ) Sleep ( 300 ) MouseClick ( "left" , 373 , 450, 1 ) Sleep ( 300 ) Send ( "^v" ) MouseClick ( "left" , 568 , 624 , 1 ) EndIf EndIf Sleep ( 1000 ) If PixelGetColor ( 413 , 399 ) = 0xEBE9ED Then MouseClick ( "left" , 525 , 401 , 1 ) Sleep ( 300 ) MouseClick ( "left" , 373 , 450, 1 ) Sleep ( 300 ) Send ( "^v" ) MouseClick ( "left" , 568 , 624 , 1 ) EndIf ;clicks page If PixelGetColor ( 350 , 421 ) = 0x6D523E Then MouseClick ( "left" , 350 , 421 , 1 ) ElseIf PixelGetColor ( 350 , 421 ) <> 0x6D523E Then Do PixelGetColor ( 350 , 421 ) Until PixelGetColor ( 350 , 421 ) = 0x6D523E If PixelGetColor ( 350 , 421 ) = 0x6D523E Then MouseClick ( "left" , 350 , 421 , 1 ) EndIf EndIf ;verifies page If PixelGetColor ( 152 , 459 ) <> 0xFFFFFF Then ElseIf PixelGetColor ( 152 , 459 ) = 0xFFFFFF Then Do PixelGetColor ( 152 , 459 ) Until PixelGetColor ( 152 , 459 ) <> 0xFFFFFF Endif If PixelGetColor ( 677 , 632 ) <> 0xEDC91D Or PixelGetColor ( 542 , 461 ) <> 0xEAD21C Then Do PixelGetColor ( 677 , 632 ) PixelGetColor ( 542 , 461 ) Until PixelGetColor ( 677 , 632 ) = 0xEDC91D Or PixelGetColor ( 542 , 461 ) = 0xEAD21C EndIf If PixelGetColor ( 677 , 632 ) = 0xEDC91D Then Sleep ( 20000 ) MouseClick ( "left" , 676 , 642 , 1 ) SoundPlay ( "success.wav" , 1 ) Sleep ( 2147483647 ) EndIf If PixelGetColor ( 542 , 461 ) = 0xEAD21C Then MouseClick ( "left" , 403 , 161 , 1 ) Sleep ( 500 ) Send ( "^a" ) Sleep ( 500 ) Send ( "{ENTER}" ) EndIf Until PixelGetColor ( 677 , 632 ) = 0xEDC91D (It's pretty simple and not well done, but it works.)
×
×
  • Create New...