SyncStark Posted March 18, 2016 Share Posted March 18, 2016 Hi, I would like some help, I explain myself : I would like my bot detects a button that appears several times between two time requiring automated actions that the bot does not need to. But I do not know how to do, I tried to make a code with a "First time" (First time to the first button, Second Time for the second button etc.) And a system of HuntPixel, which is 0 to 3 if the bot can not find the button it adds 1 to HuntPixel, it reached 3 then it will abandon the search and press another button. I did all this in a function but when I call, it does not work! I give you all the code, I also wonder if it was possible to improve it or if I made mistakes that I can correct. Thank you very much ! expandcollapse popup;FT MEANS FIRST TIME, I WILL ADD ST AND TT HotKeySet("{F9}", "MyExit") ;-----VARIABLES----- Global $MouseLeft Global $HuntPixelFT = 0 Global $ColorSkipButton = 0x2C3A47 Global $LeftSkip = 613 Global $TopSkip = 28 Global $RightSkip = 677 Global $BottomSkip = 47 Global $ClickMouse = $MouseLeft Global $SearchResult ;-----FONCTIONS----- Func MyExit() Exit EndFunc Func AutoSkipFT() While 1 $SearchResult = PixelSearch($LeftSkip, $TopSkip, $RightSkip, $BottomSkip, $ColorSkipButton, 5) If @error Then ContinueLoop $HuntPixelFT = $HuntPixelFT +1 ElseIf $HuntPixelFT = 3 Then ExitLoop Sleep(2000) MouseClick("Left", 497, 349) EndIf Wend EndFunc ;-----CODE----- WinActivate("Mobizen") Sleep(1000) WinMove("Mobizen", "", 0, 0) sleep(500) MouseClick("left", 490, 339) sleep(4000) MouseClick("left", 581, 132) sleep(2000) MouseClick("left", 490, 339) Sleep(20000) AutoSkipFT() Link to comment Share on other sites More sharing options...
water Posted March 18, 2016 Share Posted March 18, 2016 Why can't you access the button by it's ID? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
SyncStark Posted March 19, 2016 Author Share Posted March 19, 2016 On 18/3/2016 at 5:06 PM, water said: Why can't you access the button by it's ID? It's ID ? Where can I find a ID's Button ? By the way it's not a button you can find on Internet Explorer, Google Chrome or any Form it's just a mirrorred button on an Android Screen from Mobizen Link to comment Share on other sites More sharing options...
water Posted March 19, 2016 Share Posted March 19, 2016 You didn't give enough information about your environment in the OP so I could only guess. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 20, 2016 Moderators Share Posted March 20, 2016 @SyncStark, can you please explain in detail what you are attempting to do? What is Mobizen, and how are you trying to manipulate the app? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Dgameman1 Posted March 20, 2016 Share Posted March 20, 2016 42 minutes ago, JLogan3o13 said: @SyncStark, can you please explain in detail what you are attempting to do? What is Mobizen, and how are you trying to manipulate the app? From my understanding, Mobizen allows you to control you Android Phone from a Desktop Chrome Browser Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 20, 2016 Moderators Share Posted March 20, 2016 @Dgameman1 yes, I can Google as well. I am attempting to get the OP to provide a more detailed explanation to help us help him "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Dgameman1 Posted March 20, 2016 Share Posted March 20, 2016 1 minute ago, JLogan3o13 said: @Dgameman1 yes, I can Google as well. I am attempting to get the OP to provide a more detailed explanation to help us help him I figured, I was just trying to help Link to comment Share on other sites More sharing options...
SyncStark Posted March 20, 2016 Author Share Posted March 20, 2016 11 hours ago, Dgameman1 said: From my understanding, Mobizen allows you to control you Android Phone from a Desktop Chrome Browser Yes, he's right, I'll explain more : What I want is to create a bot that would detect the color of a button in a perimeter given by X and Y rectangle. In my first attempt , I tried to repeat the same code multiple times for there to be several detections. The problem is that it takes too much time to the bot, it makes a lot of writing for nothing and I want it faster , for example, that repeats the code several times himself until that it detects the color and in result it stops wanting to find . I inquired with the functions Do , Until but I have no idea where and when to use them , I also tested While, Wend but the problem is that even after executed with a StopLoop he kept still ... Link to comment Share on other sites More sharing options...
Bert Posted March 21, 2016 Share Posted March 21, 2016 is there any reason why you can't use an app that works on the android platform to automate what you have in mind? I did a quick google search and found a few. https://www.google.com/search?num=100&q=android+automation+app&spell=1&sa=X&ved=0ahUKEwjA_IqN4NDLAhVIqx4KHUEpCPYQvwUIGigA&biw=1600&bih=654 The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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