-
Posts
12 -
Joined
-
Last visited
Everything posted by astranberg
-
Hello friends, Been working on a script for weeks. File had several functions in it and was quite lengthy. The script was running when my power went out. Now I've rebooted and the file says 'nulnulnulnul' about several thousand times. I've not made any manual backups. Any chance SCiTE keeps backups hidden somewhere? Thanks, Adam
-
Hello friends! I am using the wonderful findbmp script made by @junkew here: The findbmp script works perfectly and I am using the c16RGBPartialMatch option, which is the least restrictive. What does my script do? It searches the windows program (bluestacks) for specific images. e.g. the dragon in the attached images. In order to make image search faster, I don't search for the entire image (the whole dragon e.g. R652ERbig.bmp), but I search for a small 2x10px snippet of the dragon (e.g. R952ER.bmp). So if the script works then what's my problem? Well, the program I am automating (bluestacks android) does not have great resolution, and therefore what I assume is a perfect resolution original picture is downscaled to be displayed in the program. This means that each time the picture is displayed in the program, you get slightly different pixels!! For example, if you search R652ER.bmp within R652ERbig.bmp, you get a match! If you search z8YD3t within z8YD3tbig you get a match! However, if you search R652ER within z8YD3tbig you don't get a match However, if you search z8YD3t within R652ERbig you don't get a match Even though R652ERbig and z8YD3tbig are obviously the same dragon (when you look at it grossly, not as a PC does pixel by pixel). And I am stuck finding a solution for it. I cannot reliably find the dragon within Bluestacks because it appears slightly different each time. Does anybody have an idea? Thanks, ~bub R652ERbig.bmp z8YD3tbig.bmp z8YD3t.bmp R652ER.bmp
-
Troubleshooting How to Find an Image and Click It
astranberg replied to astranberg's topic in AutoIt General Help and Support
This issue between @Jos and I has been respectfully resolved via PM. Also, my OP question has been resolved, and this thread may be marked as 'solved.' Here is what I'm using: SendAdb("shell am start -n com.aceanuu.swss/.MainActivity") Func SendADB($command) ShellExecute("C:\Program Files (x86)\BlueStacks\HD-Adb.exe", "-s emulator-5554 "&$command) EndFunc Thanks -
Troubleshooting How to Find an Image and Click It
astranberg replied to astranberg's topic in AutoIt General Help and Support
I feel like PM would be a more appropriate place for this conversation. Since you will not accept those from me, and since I must have my voice heard, I am forced to reply here. Heres what has happened: I opened a thread about a general question. I later specified it would be to automate a game. You rightfully closed the thread. I PMed you, and we cleared things up. You allowed me to post a thread still on android emulation, but this time not a game. I then created another thread about solving the same issue, except by a different means (first thread via image search, new one via ADB and shell). You closed that thread, told me it was 'sad' (or something to that effect), and told me to not PM you this time. I made my concerns known on this thread, including that you gave no reason for closure of the latter thread. You replied here saying that you would not take another reply from me, and still not offering an explanation. Rules are rules, and if you point to a rule that says "usernames that start with an 'a' may not post new threads, then so be it. I am fine with rules. I love rules; they give structure. But another thing I love is open communication. I am quite serious that I would like this issue resolved. I would like for other mods/admins to get involved. I understand this moderator is your own, and other moderators/admins are likely to side with him based on his position. But please, take my concerns openly. I don't really care about my thread here any more since another forum solved it for me, but the moderation displayed here is bugging me, and I would like to have a conversation about it. I respect your position here @Jos, thank you for the work you put in here. However, I would like better communication. Thank you. Respectfully, astranberg -
Troubleshooting How to Find an Image and Click It
astranberg replied to astranberg's topic in AutoIt General Help and Support
I am having inconsistencies in the script actually finding the image of the 7 wonders scoring sheet application. Sometimes it does not find the image at all, when it is clearly there. Does anybody know how I can launch an application via Shell or ADB or something like that? Thanks, astranberg P.S. @Jos misunderstood my new post. He closed it down w/o explanation and refused to talk to me (he left my PM without replying). My new thread is about the exact same thing as this thread that he approved, except that it's asking to achieve the same goal in a different way. If you choose to close down this thread, please offer an explanation and a means for me to communicate with you or another moderator on the issue. Thank you. -
Hello, Continuing my project, I am now trying to figure out how to launch an application from within bluestacks. I'm sure there's a ShellExecute() function in there for that somewhere. Can someone who has experience with bluestacks help? ;--> Launch BlueStacks Global $AndroidPID = ShellExecute("C:\Program Files (x86)\BlueStacks\" & "HD-Frontend.exe", "Android") ;--> Wait for it to load Global $AndroidHWND While $AndroidHWND = False $AndroidHWND = WinGetHandle("BlueStacks Android Plugin") Sleep(1000) WEnd ;--> Resize WinActivate($AndroidHWND) WinMove($AndroidHWND, '', 0, 0, 500, 900) Sleep(1000) ;--> Launch 7Wonders Thanks, Adam
-
Troubleshooting How to Find an Image and Click It
astranberg replied to astranberg's topic in AutoIt General Help and Support
I didn't know there was an updated version, thanks!!....and your suggestions worked. Solved. -
Hello friends! I am trying to learn how to launch an application inside of Bluestacks, and android emulator. Here is the ultimate goal of my project: Launch the bluestacks program -- DONE Launch the 7 Wonders Scoring Sheet application from within bluestacks. This is my current problem, and I believe it will require an image search.. Click on various tabs 'Players, military, money, wonder, etc.' This will also require an image search. Read data from those tabs. Export data to excel or a .txt document. So, I need to find the image of the application within the bluestacks program; then to click that image. To do that I'm trying to use ImageSearch from here: The android application I am using is a 7 Wonders Scoring Card. My friends and I use it to keep track of our board games, who wins, what score, how their economy vs. military vs. etc... https://play.google.com/store/apps/details?id=com.aceanuu.swss&hl=en Here is my current code: #include <ScreenCapture.au3> #include <ImageSearch.au3> $AndroidPID = Run ("C:\ProgramData\BlueStacksGameManager\BlueStacks.exe") Sleep(250) $AndroidHWND = WinGetHandle("[ACTIVE]") $AndroidPos = WinGetPos($AndroidHWND) ;--> [0] = X pos, [1] = Y pos; [2] = Width; [3] = Height $x = 0 $y = 0 $found = _ImageSearchArea("FindMe.bmp", 1, $AndroidPos[0], $AndroidPos[1], $AndroidPos[2], $AndroidPos[3], $x, $y, 100) If $found = 1 Then MouseMove($x,$y, 10) EndIf MsgBox (0, '', $found) ;--> Returns 0 MsgBox(0, '', $AndroidPos[0] & @CRLF & $AndroidPos[1] & @CRLF & $AndroidPos[2] & @CRLF & $AndroidPos[3]) ;--> Returns 0, 0, 1602, 950 It seems not to find the image at all. I am very confused. Perhaps it's because I'm using two monitors? However, I don't believe that's really why. Thank you! Adam
-
Trouble Using ImageSearch
astranberg replied to astranberg's topic in AutoIt General Help and Support
Thanks @alien4u! Awesome! The ultimate project is to automate a game called Clash Royale. I am not going to do anything crazy like they have for Clash of Clans bots (I'm assuming you're familiar). Here is the grand scheme: Launch Clash Royale Click a couple buttons to launch a game against the 'trainer'. Playing the game will consist of recognizing resource level ("Elixir" can be anywhere between 0-10), clicking on cards to select them, and clicking on the battlefield. Right now I'm just trying to click the button to launch Clash Royale. -
Hello Everybody! I'm new here (as you can see; first post) and also new to AutoIt. I have done lots of search and browsing of the forum to learn what I'm doing wrong, but I just can't figure it out. Hopefully one of you can help me. I finally figured out how to launch and get the handle of the program I'm automating (Bluestacks, and android emulator). Now I would like to search within that window to find a button, then click that button. To do that I'm trying to use ImageSearch from here: #include <ScreenCapture.au3> #include <ImageSearch.au3> $AndroidPID = Run ("C:\ProgramData\BlueStacksGameManager\BlueStacks.exe") Sleep(250) $AndroidHWND = WinGetHandle("[ACTIVE]") $AndroidPos = WinGetPos($AndroidHWND) ;--> [0] = X pos, [1] = Y pos; [2] = Width; [3] = Height $x = 0 $y = 0 $found = _ImageSearchArea("FindMe.bmp", 1, $AndroidPos[0], $AndroidPos[1], $AndroidPos[2], $AndroidPos[3], $x, $y, 100) If $found = 1 Then MouseMove($x,$y, 10) EndIf MsgBox (0, '', $found) ;--> Returns 0 MsgBox(0, '', $AndroidPos[0] & @CRLF & $AndroidPos[1] &@CRLF & $AndroidPos[2] &@CRLF & $AndroidPos[3]) ;--> Returns 0, 0, 1602, 950 Thanks! Adam