Jump to content
JmXit

Click relative to bitmap

Recommended Posts

Greetings,

 

New to these forums, and to coding in general.

I'm wondering upon which parameters would

if findbitmap

then click

work

I'm attempting to have the bot click a chrome URL BAR, then drag all the way to the left in order to select anything that might have been there. The bitmap I have chosen is the "bookmarks" star, and I'd like to have it click an amount of pixels to the left of it

 

Code:

const

XLeft = 0;

YTop = 0;

XRight = 1439;

YBottom = 899;

 

var

URLBARBMP: TSCARBitmap;

X, Y: Integer;

begin

URLBARBMP := TSCARBitmap.Create('deNqtlGtvIWEUx/sx9sV+U+2yVWxdVrd0JaKbI' +

'mr2hRciTWyKhMZtynaDEFSQiLtlhlF16/5bW2aZ0aazfzI5zyW/55zznOe823m' +

'/Q9jtdsL++OUQwWP/HTgcDpIkh8Ph3d3dgwCNRqNYLJZMpUYjQRzo/v7+6uoKw' +

'AfBCgaDAuNaKBQMDXk48/kcOZRKpWdn5slk8gInFEKqOZdKpZJIJGq1Wnq9PpF' +

'IbueEQ2E+jsfjMRqNMHw+H0EQL3DCYYaHYzAYcAswGo0GotseWjgSHjIcnF6vt' +

'7u71263F0ON5nM6nd7KiTADBobb7VYqVXK54uBZNpttuS0aJQ8PlWq1Bn+F4hN' +

'WzWbLbDZbbog8cXCuWCwZj8evv2iJ5GOxWGQdFB0MmG63KxaLb25+vRKSy+X29' +

'j5UKhV2XIPBAEYmk1EoFATxne/6FkIsl5ceOAMH2PORZw4E4/zcrlarUTmcEIq' +

'iTCaTTqer1xtrS9FItN/vs2fi8bhMJp9Op5uc42Od0+nkTOMmB9VycCBj38UyI' +

'gSOzHC6ijDXOG73DxzKU+Fes9nMx6H7NPtQ1Em5XF68U7/fL5fLrVYrwzzWGE7' +

'c35c2m81NDloiTa842Wz26OgLCAwztFgsMpkMjwszWq22Wq1iA1x1uVwc/pBRm' +

'l7F5fX60CtQGBqN5vT0G+oKk0jsxcUFnhj6ZyqVOjn5yukPRVPLYafT0WqPlEp' +

'lIBCAV+ydhUIBDUSlUuFCX4zrzXrkUNR/4VCCOSja+M84Wo1ASCKZvL3NI7fXE' +

'Infv1ofrzbhQ5JPI/Iaac/n871et1ar0wJEUXS3+7teq1dr1T/SZzdE');

 

if (FindBitmap(X, Y, URLBARBMP, XLeft, YTop, XRight, YBottom))

then

MouseBtnDown(X-5, Y, mbLeft);

STAND

MoveMouseEx(0, Y, 5);

STAND

MouseBtnUp(X, Y,mbLeft);

URLBARBMP.Free;

 

Feel free to comment on anything you see here which I may have done unoptimally.

Cheers

Edited by JmXit
Link to comment
Share on other sites

Have you tried testing your bitmap finding skills on something more remedial like shapes in Microsoft-paint or something? This could actually get complicated unless you set your frame of reference to your entire screen (Which is different for most people)

 

I don't see anything inherently wrong with the code.. what exactly is the issue?

 

Please use

 [/ CODE] tags as well..
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...