Solving a puzzle

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Solving a puzzle

Post by mightycpa » Mon Apr 05, 2021 7:27 pm

Any thoughts on how to automate moving the slider to the right spot?

Image

FYI, the puzzle piece does not always appear at the same vertical position. Sometimes it's higher, sometimes lower.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: Solving a puzzle

Post by mightycpa » Sat Apr 10, 2021 6:20 pm

bump
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

User avatar
Marcus Tettmar
Site Admin
Posts: 7376
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Solving a puzzle

Post by Marcus Tettmar » Mon Apr 12, 2021 12:28 pm

Image recognition to find the slider, mouse down, move, mouse up ... ?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: Solving a puzzle

Post by mightycpa » Mon Apr 12, 2021 3:00 pm

I can find the slider easily. I just don't know how far to move it to get the puzzle to work. I don't know how to recognize the borders of the missing puzzle piece. If I could do that, I think I'd be in business.

There are different backgrounds, and the missing puzzle piece appears at different coordinates.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1347
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Solving a puzzle

Post by Dorian (MJT support) » Mon Apr 12, 2021 3:21 pm

My initial thought was "I don't think Macro Scheduler is meant for solving puzzles".

This looks like it could be awfully complicated. Even if you manage to get it working for this one, making it adaptable for other puzzles could be a nightmare.

I'm interested to see what other suggestions or solutions may arise.
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Grovkillen
Automation Wizard
Posts: 998
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Solving a puzzle

Post by Grovkillen » Mon Apr 12, 2021 3:45 pm

Is the webpage drawing it using a canvas? Perhaps you could extract the data from there?
Let>ME=%Script%

Running: 15.0.24
version history

hagchr
Automation Wizard
Posts: 327
Joined: Mon Jul 05, 2010 7:53 am
Location: Stockholm, Sweden

Re: Solving a puzzle

Post by hagchr » Mon Apr 12, 2021 4:24 pm

Interesting problem...
Is it always along x-axis or could it also be y-axis or both?
Can you click anywhere on the slider to move it to that place, or do you need to click on the "handle" and then drag it to where you want it?
Is it in a public place somewhere (web site) that one can use to test?

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: Solving a puzzle

Post by mightycpa » Mon Apr 12, 2021 6:51 pm

There's a demo:

https://www.geetest.com/en/demo

choose the Slide Captcha, then in the demo login, click to verify. A puzzle will appear.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: Solving a puzzle

Post by mightycpa » Mon Apr 12, 2021 9:47 pm

Grovkillen, I know nothing about this canvas you speak of, but I think you nailed it. Impressive!

There are three images, as shown below:

1. the full background less the missing puzzle piece
2. the puzzle piece
3. the full background, hidden

Image

I'm not sure how to capture the hidden image. Any thoughts on that?

Once that's done, I can think of a couple of approaches, but at the end of the day, it's a race against time:

1. Slide the puzzle piece across, don't lift up the mouse button, take a picture and compare differences between what results and the hidden full background. Position the slider where you find the lowest difference.

2. Compare #1 and #3 to isolate the area where the two pictures diverge, maybe try to find that left "edge" of the missing piece. Slide the puzzle piece over that many pixels, plus or minus what is probably some constant.

3. Some combo of one and two to isolate the horizontal area where the solution will lie, so that you reduce the size of the image you're going to search.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

User avatar
Grovkillen
Automation Wizard
Posts: 998
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Solving a puzzle

Post by Grovkillen » Tue Apr 13, 2021 9:06 pm

Here's a proof of concept. It's using the latest "ChromeExecute" command, WHICH ROCK BY THE WAY. So you need to use 15.0.18 for it to work.

You may need to make your own needle.bmp for it to work and you can also tweak the tolerance settings and number of mismatches for a positive detection. As seen in the attached GIF it's working just fine to programmatically detect the position that the slider should match but the script only successfully passed the test once in my tests. Why I cannot figure out now.. that's up to you :)

I added the green lines to show where the JS code detected the position. It's spot on every time so there must be something with how the script is moving the slider that is messing up the final step in the verification (the part where I'm looping the mouse move/position).

Perhaps a loop is needed to change the "MOUSE_SLIDE_TWEAK_PIXELS" and test it again... since we have a handful of tries until the captcha will throw us out.

I did try to use JS to manipulate the slider but the JS code of the captcha is expecting an mouse move event to fire and that isn't (AFAIK) possible to do within the JS realm.

Image

Code: Select all

IfNotFileExists>%SCRIPT_DIR%\needle.bmp
  ExportData>BUTTON_IMAGE.BMP_DATA,%SCRIPT_DIR%\needle.bmp
Endif>
Let>WINDOW_TO_LOOK_IN=GeeTest CAPTCHA | Demo - Google Chrome
Let>URL_TO_DEMO=https://www.geetest.com/en/demo
Let>BUTTON_CAPTION=Slide CAPTCHA
Let>VERIFY_CLASS=geetest_radar_tip
Let>CANVAS_DIRTY_CLASS=geetest_canvas_bg
Let>CANVAS_CLEAN_CLASS=geetest_canvas_fullbg
Let>SLIDER_BUTTON_CLASS=geetest_slider_button
Let>MISMATCH_TOL=100
Let>MISMATCH_STREAK=30
Let>MOUSE_SLIDE_TWEAK_PIXELS=-2
Let>CHROMEDRIVER_EXE=%SCRIPT_DIR%\chromedriver.exe

ChromeStart>SessionID
ChromeNavigate>SessionID,url,%URL_TO_DEMO%
ChromeExecute>SessionID,[...document.getElementsByTagName("button")].map(button => { if (button.textContent === "%BUTTON_CAPTION%") { button.click() } })
//an element with id="wait" will get a style of "display: none;" when the captcha is loaded... could be used instead of wait
Wait>5
ChromeExecute>SessionID,document.querySelector(".%VERIFY_CLASS%").click()
Wait>3
LabelToVar>compare_canvas,JS_CODE,0,0,*/
ChromeExecute>SessionID,JS_CODE
ChromeFindElements>SessionID,id,get_pixels_to_travel,element
ChromeGetElementData>SessionID,element_1,text,PIXELS_TO_MOVE_MOUSE
IfNot>PIXELS_TO_MOVE_MOUSE>0
  Exit>
Endif>
FindImagePos>%SCRIPT_DIR%\needle.bmp,WINDOW:%WINDOW_TO_LOOK_IN%,0.7,1,MOUSE_X_START,MOUSE_Y_START,NumFound,CCOEFF
If>NumFound>0
  Let>SLIDE_TO_END_POSITION=PIXELS_TO_MOVE_MOUSE+MOUSE_SLIDE_TWEAK_PIXELS
  MouseMove>MOUSE_X_START_0,MOUSE_Y_START_0
  LDown
  Let>k=0
  Repeat>k
    Let>k=k+1
    Let>MOUSE_NEW_POSITION=MOUSE_X_START_0+k
    MouseMove>MOUSE_NEW_POSITION,MOUSE_Y_START_0
    If>k>SLIDE_TO_END_POSITION
      Let>k=SLIDE_TO_END_POSITION
    Endif>
  Until>k=SLIDE_TO_END_POSITION
  Lup
Endif

/*
compare_canvas:
let sliderButton = document.querySelector(".%SLIDER_BUTTON_CLASS%");
let canvasFrame = document.querySelector(".%CANVAS_DIRTY_CLASS%");
let dirtyCanvas = document.querySelector(".%CANVAS_DIRTY_CLASS%").getContext("2d");
let dirtyPixels = dirtyCanvas.getImageData(0, 0, canvasFrame.width, canvasFrame.height);
let dirtyPixel = dirtyPixels.data;
let cleanCanvas = document.querySelector(".%CANVAS_CLEAN_CLASS%").getContext("2d");
let cleanPixels = cleanCanvas.getImageData(0, 0, canvasFrame.width, canvasFrame.height);
let cleanPixel = cleanPixels.data;
let misMatchTolerance = %MISMATCH_TOL%;
let misMatchCountWanted = %MISMATCH_STREAK%;
let misMatchCount = 0;
sliderButton.scrollIntoView({
          behavior: 'auto',
          block: 'center',
          inline: 'center'
      });
for (let i = 0; i < dirtyPixel.length; i += 4) {
    let dirtyRGBA = dirtyPixel[i] + dirtyPixel[i+1] + dirtyPixel[i+2] + dirtyPixel[i+3];
    let cleanRGBA = cleanPixel[i] + cleanPixel[i+1] + cleanPixel[i+2] + cleanPixel[i+3];
    let diffCheck = Math.abs(dirtyRGBA - cleanRGBA);
    if (diffCheck > misMatchTolerance) {
        misMatchCount++;
    } else {
        misMatchCount = 0;
    }
    if (misMatchCount === misMatchCountWanted) {
        let pixelNumber = Math.floor(i / 4 - misMatchCountWanted);
        let offsetX = pixelNumber % canvasFrame.width;
        let offsetY = ( pixelNumber - offsetX ) / canvasFrame.width;
        dirtyCanvas.fillStyle = "rgb(56,255,3)";
        dirtyCanvas.fillRect( offsetX, 0, 3, canvasFrame.height );
        dirtyCanvas.fillRect( 0, offsetY, canvasFrame.width, 3 );
        let dumpElement = document.createElement("div");
        dumpElement.id = "get_pixels_to_travel";
        dumpElement.innerText = offsetX;
        document.body.appendChild(dumpElement);
        break;
    }
}
*/

/*
BUTTON_IMAGE.BMP_DATA:
424DDA05000000000000360000002800000013000000130000000100200000000000A405000000000000000000000000000000000000F7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F
7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F8FFF7F8F8FFF7F7F8FFF7F7F8FFF7F8F8FFF7F7F7FFF8F8F7FFF7F7F8FFF7F7F7FFF7F7F7FFF7F7F7FFF7
F7F7FFF7F8F7FFF7F7F8FFF7F8F7FFF7F7F7FFF7F8F7FFF7F7F8FFF8F8F8FFF8F8F8FF7ECFA6FF10C368FF77E2ABFFF8F8F8FFF8F8F8FFF8F8F8FFF8F8F8FF7ECFA6FF10C368FF77E2ABFFF8F8F8FFF8F8F8FFF8F8F8FFF8F8F8FF7ECFA6FF10C368FF77E2ABFFF8F8F8FFF8F8F8FF12AB5CFF05C562FF06D369FFF8F8F8FFF
8F8F8FFF8F8F8FFF8F8F8FF12AB5CFF05C562FF06D369FFF8F8F8FFF8F8F8FFF8F8F8FFF8F8F8FF12AB5CFF05C562FF06D369FFF8F8F8FFF8F8F8FF0FAA5AFF05C562FF00D266FFF8F8F8FFF8F8F8FFF8F8F8FFF8F8F8FF0FAA5AFF05C562FF00D266FFF8F8F8FFF8F8F8FFF8F8F8FFF8F8F8FF0FAA5AFF05C562FF00D266FF
F8F8F8FFF8F8F8FF0FAA5AFF05C562FF00D266FFF8F8F8FFF8F8F8FFF9F8F8FFF8F8F8FF0FAA5AFF05C562FF00D266FFF8F8F8FFF9F8F8FFF8F8F8FFF8F8F8FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9F
FF9F9F9FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9
FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFFAFAF
9FFFAFAFAFF0FAA5AFF05C562FF00D266FFF9FAFAFFFAF9F9FFF9FAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFF9F9FAFFFAFAFAFFFAFAFAFFFAF9F9FF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFA
FAFFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFFFAF
AFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFBFBFBFFFBFAFAFF0FAA5AFF05C562FF00D266FFFAFBFBFFFBFBFBFFFBFAFAFFFBFBFBFF0FAA5AFF05C562FF00D266FFFAFBFAFFFBFBFBFFFAFAFBFFFAFAFBFF0FAA5AFF05C562FF00D266FFFBFBFBFFFB
FBFBFF0FA95AFF06C161FF01CE65FFFBFBFBFFFBFBFBFFFBFBFBFFFBFBFBFF0FA95AFF06C161FF01CE65FFFBFBFBFFFBFBFBFFFBFBFBFFFBFBFBFF0FA95AFF06C161FF01CE65FFFBFBFBFFFBFBFBFF14A45AFF0BB45DFF0EBF64FFFBFBFBFFFBFBFBFFFBFBFBFFFBFBFBFF14A45AFF0BB45DFF0EBF64FFFBFBFBFFFBFBFBFFF
BFBFBFFFBFBFBFF14A45AFF0BB45DFF0EBF64FFFBFBFBFFFBFBFBFF82CAA5FF1CA760FF80CFA7FFFBFBFBFFFBFBFBFFFBFBFBFFFBFBFBFF82CAA5FF1CA760FF80CFA7FFFBFBFBFFFBFBFBFFFBFBFBFFFBFBFBFF82CAA5FF1CA760FF80CFA7FF
*/
What I'm doing is to read the data of the two canvas' (one of the clean background and one which got the "missing piece"). I read each pixel (RGBA) and make sure that we have at least a mismatch of a combined value of 100, and to be sure we're in a "sharp corner" I will only consider a positive detection if we have at least 30 mismatched pixels in a row. I'm not going to get into detail of the JS code... let's just say I'm an end-to-end developer who is doing everything from low-level C++ to JavaScript and MacroScheaduler coding and I know my way around the inside the binary world :)

If you want to download the canvases as images I can post a simple script for that as well.
Last edited by Grovkillen on Wed Apr 14, 2021 3:39 am, edited 2 times in total.
Let>ME=%Script%

Running: 15.0.24
version history

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: Solving a puzzle

Post by mightycpa » Tue Apr 13, 2021 11:04 pm

Hi, I'll check that code out.

I too had a problem with the slider, cured it by adding a Wait>2 after the mouse move. Then I pressed the button. I'll try that with your code.

This looks great, I'll post back when I'm done.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: Solving a puzzle

Post by mightycpa » Wed Apr 14, 2021 1:13 am

Not great success.

First, I got this:
(1:1) Unquoted string in JSON data only valid for dictionary names.

So I followed the chromedriver.exe instructions.

Image
Image
Image


that got me farther along, but it didn't seem to do much of anything. I stepped my way down to line 31

Image

which had the effect of exiting on line 32. Hmmmm
So you need to use 15.0.18 for it to work.
Image :(

then tried to get the newer version, ended up here. Magic Link not so magic.
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>MalformedSignature</Code>
<Message>Could not unencode Signature</Message>
</Error>
Will try again tomorrow.
Last edited by mightycpa on Wed Apr 14, 2021 8:01 pm, edited 1 time in total.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

User avatar
Grovkillen
Automation Wizard
Posts: 998
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Solving a puzzle

Post by Grovkillen » Wed Apr 14, 2021 8:10 am

Image

I added some waits to the code and it's now fairly accurate. If you need to make a custom needle.bmp you most likely need to change the MOUSE_SLIDE_TWEAK_PIXELS value. See source comments for hints on how to tweak:

Code: Select all

//CAUSES OF ERROR:
//If you get a network failure it's probably due to the wait on line 46 being too small.
//If you get slider overshooting it's probably due to the find image pos tolerance on line 41 being not strict enough.

IfNotFileExists>%SCRIPT_DIR%\needle.bmp
  ExportData>BUTTON_IMAGE.BMP_DATA,%SCRIPT_DIR%\needle.bmp
Endif>
Let>WINDOW_TO_LOOK_IN=GeeTest CAPTCHA | Demo - Google Chrome
Let>URL_TO_DEMO=https://www.geetest.com/en/demo
Let>BUTTON_CAPTION=Slide CAPTCHA
Let>VERIFY_CLASS=geetest_radar_tip
Let>CANVAS_DIRTY_CLASS=geetest_canvas_bg
Let>CANVAS_CLEAN_CLASS=geetest_canvas_fullbg
Let>SLIDER_TRACK_CLASS=geetest_slider_track
Let>SLIDER_BUTTON_CLASS=geetest_slider_button
Let>MISMATCH_TOL=50
Let>MISMATCH_STREAK=35
Let>MOUSE_SLIDE_TWEAK_PIXELS=-2
Let>CHROMEDRIVER_EXE=%SCRIPT_DIR%\chromedriver.exe

Let>LOOP_max=5
Let>LOOP_k=0
Repeat>LOOP_k
  Let>LOOP_k=LOOP_k+1
  GoSub>THE_CAPTCHA_ROUTINE
Until>LOOP_k=LOOP_max

SRT>THE_CAPTCHA_ROUTINE
  ChromeStart>SessionID
  ChromeNavigate>SessionID,url,%URL_TO_DEMO%
  ChromeExecute>SessionID,[...document.getElementsByTagName("button")].map(button => { if (button.textContent === "%BUTTON_CAPTION%") { button.click() } })
  //an element with id="wait" will get a style of "display: none;" when the captcha is loaded... could be used instead of wait
  Wait>5
  ChromeExecute>SessionID,document.querySelector(".%VERIFY_CLASS%").click()
  Wait>3
  LabelToVar>compare_canvas,JS_CODE,1,0,*/
  ChromeExecute>SessionID,JS_CODE
  ChromeFindElements>SessionID,id,get_pixels_to_travel,element
  ChromeGetElementData>SessionID,element_1,text,PIXELS_TO_MOVE_MOUSE
  If>PIXELS_TO_MOVE_MOUSE>0
    FindImagePos>%SCRIPT_DIR%\needle.bmp,WINDOW:%WINDOW_TO_LOOK_IN%,0.7,1,MOUSE_X_START,MOUSE_Y_START,NumFound,CCOEFF
    If>NumFound>0
      Let>SLIDE_TO_END_POSITION=PIXELS_TO_MOVE_MOUSE+MOUSE_SLIDE_TWEAK_PIXELS
      MouseMove>MOUSE_X_START_0,MOUSE_Y_START_0
      LDown
      Wait>0.5
      Let>k=0
      Repeat>k
        Let>k=k+1
        Let>MOUSE_NEW_POSITION=MOUSE_X_START_0+k
        MouseMove>MOUSE_NEW_POSITION,MOUSE_Y_START_0
        If>k>SLIDE_TO_END_POSITION
          Let>k=SLIDE_TO_END_POSITION
        Endif>
      Until>k=SLIDE_TO_END_POSITION
      Wait>0.5
      Lup
    Endif
    Wait>3
  Endif>
  ChromeQuit>SessionID
END>THE_CAPTCHA_ROUTINE

/*
compare_canvas:
let sliderButton = document.querySelector(".%SLIDER_BUTTON_CLASS%");
let canvasFrame = document.querySelector(".%CANVAS_DIRTY_CLASS%");
let dirtyCanvas = document.querySelector(".%CANVAS_DIRTY_CLASS%").getContext("2d");
let dirtyPixels = dirtyCanvas.getImageData(0, 0, canvasFrame.width, canvasFrame.height);
let dirtyPixel = dirtyPixels.data;
let cleanCanvas = document.querySelector(".%CANVAS_CLEAN_CLASS%").getContext("2d");
let cleanPixels = cleanCanvas.getImageData(0, 0, canvasFrame.width, canvasFrame.height);
let cleanPixel = cleanPixels.data;
let misMatchTolerance = %MISMATCH_TOL%;
let misMatchCountWanted = %MISMATCH_STREAK%;
let misMatchCount = 0;
sliderButton.scrollIntoView({
          behavior: 'auto',
          block: 'center',
          inline: 'center'
      });
for (let i = 0; i < dirtyPixel.length; i += 4) {
    let dirtyRGBA = dirtyPixel[i] + dirtyPixel[i+1] + dirtyPixel[i+2] + dirtyPixel[i+3];
    let cleanRGBA = cleanPixel[i] + cleanPixel[i+1] + cleanPixel[i+2] + cleanPixel[i+3];
    let diffCheck = Math.abs(dirtyRGBA - cleanRGBA);
    if (diffCheck > misMatchTolerance) {
        misMatchCount++;
    } else {
        misMatchCount = 0;
    }
    if (misMatchCount === misMatchCountWanted) {
        let pixelNumber = Math.floor(i / 4 - misMatchCountWanted);
        let offsetX = pixelNumber % canvasFrame.width;
        let offsetY = ( pixelNumber - offsetX ) / canvasFrame.width;
        dirtyCanvas.fillStyle = "rgb(56,255,3)";
        dirtyCanvas.fillRect( offsetX, 0, 3, canvasFrame.height );
        dirtyCanvas.fillRect( 0, offsetY, canvasFrame.width, 3 );
        let dumpElement = document.createElement("div");
        dumpElement.id = "get_pixels_to_travel";
        dumpElement.innerText = offsetX;
        document.body.appendChild(dumpElement);
        break;
    }
}
*/

/*
BUTTON_IMAGE.BMP_DATA:
424DDA05000000000000360000002800000013000000130000000100200000000000A405000000000000000000000000000000000000F7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F
7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F7FFF7F7F8FFF7F8F8FFF7F7F8FFF7F7F8FFF7F8F8FFF7F7F7FFF8F8F7FFF7F7F8FFF7F7F7FFF7F7F7FFF7F7F7FFF7
F7F7FFF7F8F7FFF7F7F8FFF7F8F7FFF7F7F7FFF7F8F7FFF7F7F8FFF8F8F8FFF8F8F8FF7ECFA6FF10C368FF77E2ABFFF8F8F8FFF8F8F8FFF8F8F8FFF8F8F8FF7ECFA6FF10C368FF77E2ABFFF8F8F8FFF8F8F8FFF8F8F8FFF8F8F8FF7ECFA6FF10C368FF77E2ABFFF8F8F8FFF8F8F8FF12AB5CFF05C562FF06D369FFF8F8F8FFF
8F8F8FFF8F8F8FFF8F8F8FF12AB5CFF05C562FF06D369FFF8F8F8FFF8F8F8FFF8F8F8FFF8F8F8FF12AB5CFF05C562FF06D369FFF8F8F8FFF8F8F8FF0FAA5AFF05C562FF00D266FFF8F8F8FFF8F8F8FFF8F8F8FFF8F8F8FF0FAA5AFF05C562FF00D266FFF8F8F8FFF8F8F8FFF8F8F8FFF8F8F8FF0FAA5AFF05C562FF00D266FF
F8F8F8FFF8F8F8FF0FAA5AFF05C562FF00D266FFF8F8F8FFF8F8F8FFF9F8F8FFF8F8F8FF0FAA5AFF05C562FF00D266FFF8F8F8FFF9F8F8FFF8F8F8FFF8F8F8FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9F
FF9F9F9FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9
FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFF9F9F9FFF9F9F9FFF9F9F9FFF9F9F9FF0FAA5AFF05C562FF00D266FFFAFAF
9FFFAFAFAFF0FAA5AFF05C562FF00D266FFF9FAFAFFFAF9F9FFF9FAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFF9F9FAFFFAFAFAFFFAFAFAFFFAF9F9FF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFA
FAFFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFFFAF
AFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFF0FAA5AFF05C562FF00D266FFFBFBFBFFFBFAFAFF0FAA5AFF05C562FF00D266FFFAFBFBFFFBFBFBFFFBFAFAFFFBFBFBFF0FAA5AFF05C562FF00D266FFFAFBFAFFFBFBFBFFFAFAFBFFFAFAFBFF0FAA5AFF05C562FF00D266FFFBFBFBFFFB
FBFBFF0FA95AFF06C161FF01CE65FFFBFBFBFFFBFBFBFFFBFBFBFFFBFBFBFF0FA95AFF06C161FF01CE65FFFBFBFBFFFBFBFBFFFBFBFBFFFBFBFBFF0FA95AFF06C161FF01CE65FFFBFBFBFFFBFBFBFF14A45AFF0BB45DFF0EBF64FFFBFBFBFFFBFBFBFFFBFBFBFFFBFBFBFF14A45AFF0BB45DFF0EBF64FFFBFBFBFFFBFBFBFFF
BFBFBFFFBFBFBFF14A45AFF0BB45DFF0EBF64FFFBFBFBFFFBFBFBFF82CAA5FF1CA760FF80CFA7FFFBFBFBFFFBFBFBFFFBFBFBFFFBFBFBFF82CAA5FF1CA760FF80CFA7FFFBFBFBFFFBFBFBFFFBFBFBFFFBFBFBFF82CAA5FF1CA760FF80CFA7FF
*/
You don't need to start any chromedriver.exe manually. Just make sure that the file is in the SCRIPT_DIR as I point the script to it. Also, if you are iterating this you may want to consider either deleting the created get_pixels_to_travel div element or reuse it. You don't want multiple elements with the same id.
Let>ME=%Script%

Running: 15.0.24
version history

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: Solving a puzzle

Post by mightycpa » Wed Apr 14, 2021 4:19 pm

Still can't get it to run. Chromedriver problems, it would appear... the suggested remedy seems to have no effect.

https://app.vidjack.com/share/3133
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

User avatar
Grovkillen
Automation Wizard
Posts: 998
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Solving a puzzle

Post by Grovkillen » Wed Apr 14, 2021 6:02 pm

You're using latest MS version?

This is my chromedriver.exe

The Chrome driver can take some time... Leave it running for longer.
Let>ME=%Script%

Running: 15.0.24
version history

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts