Author Topic: Find the blue color in the box.  (Read 507 times)

Offline Erayo

  • Newbie
  • *
  • Posts: 12
  • Rep: 0
    • View Profile
Find the blue color in the box.
« on: July 20, 2010, 02:26:58 pm »
How to find the blue color randomly ONLY in the box?



I want the mouse to move to the box in a random location, but not outside of it.

[scar]
var
  W, H: Integer;
  x, y: Integer;
begin
  GetClientDimensions(W, H);
  FindColor(x, y, 255, 0, 0, W - 1, H - 1);
  MoveMouse(x, y);
end.[/scar]

Maybe this script may help.

Thanks.
« Last Edit: July 20, 2010, 02:34:28 pm by Erayo »

Freddy1990.com

Find the blue color in the box.
« on: July 20, 2010, 02:26:58 pm »

Offline CX gamer

  • Jr. Member
  • **
  • Posts: 85
  • Rep: 0
    • View Profile
Re: Find the blue color in the box.
« Reply #1 on: July 20, 2010, 03:23:42 pm »
- Is the location of the box constant?
- Are the dimentions of the white box constant?

Freddy1990.com

Re: Find the blue color in the box.
« Reply #1 on: July 20, 2010, 03:23:42 pm »

Offline Erayo

  • Newbie
  • *
  • Posts: 12
  • Rep: 0
    • View Profile
Re: Find the blue color in the box.
« Reply #2 on: July 21, 2010, 12:49:02 am »
Yes.
« Last Edit: July 21, 2010, 01:25:36 am by Erayo »

Offline CX gamer

  • Jr. Member
  • **
  • Posts: 85
  • Rep: 0
    • View Profile
Re: Find the blue color in the box.
« Reply #3 on: July 21, 2010, 03:57:10 am »
So if the dimentions and location of the white box is constant, you can just use
[scar]moveMouse(left + random(width), top + random(height));[/scar]

Offline Freddy

  • Owner
  • *****
  • Posts: 2614
  • Rep: 19
    • MSN Messenger - freddy1990@gmail.com
    • AOL Instant Messenger - Freddy199O
    • View Profile
    • Email
Re: Find the blue color in the box.
« Reply #4 on: July 21, 2010, 04:12:41 am »
You have to enter a search area for the box into FindColor

Freddy1990.com

Re: Find the blue color in the box.
« Reply #4 on: July 21, 2010, 04:12:41 am »

Offline CX gamer

  • Jr. Member
  • **
  • Posts: 85
  • Rep: 0
    • View Profile
Re: Find the blue color in the box.
« Reply #5 on: July 21, 2010, 07:44:48 am »
Doesn't that stop when it finds a valid color?
Erayo needs it to be random.

Offline Erayo

  • Newbie
  • *
  • Posts: 12
  • Rep: 0
    • View Profile
Re: Find the blue color in the box.
« Reply #6 on: July 30, 2010, 02:07:07 pm »
I want to click the yellow/black button randomly to undock my ship, not always in the same location. Just to make it more random, so that anti cheat won’t find me. Same with minimizing and clicking other stuff that look the same.


Posted on: July 21, 2010, 07:51:12 AM
After playing with

[scar]moveMouse(left + random(width), top + random(height));[/scar]

I know how it works! Thank you CX gamer!


Posted on: July 21, 2010, 09:34:14 AM
Can anyone please explain why this is not working?

[scar]const
     random_double_click = (735 + random(217), 408 + random(217));[/scar]

[scar]Failed when compiling
Line 7: [Error] (7:30): Unknown identifier '' in script C:\Users\Andrew\Desktop\EVE Online Mining.scar[/scar]

Thank you!

Freddy1990.com

Re: Find the blue color in the box.
« Reply #6 on: July 30, 2010, 02:07:07 pm »

Offline Freddy

  • Owner
  • *****
  • Posts: 2614
  • Rep: 19
    • MSN Messenger - freddy1990@gmail.com
    • AOL Instant Messenger - Freddy199O
    • View Profile
    • Email
Re: Find the blue color in the box.
« Reply #7 on: August 01, 2010, 05:42:06 am »
you can't define a constant that isn't constant...

Offline Erayo

  • Newbie
  • *
  • Posts: 12
  • Rep: 0
    • View Profile
Re: Find the blue color in the box.
« Reply #8 on: August 01, 2010, 07:00:19 am »
Thanks Freddy!

There is one more questions I have and I think the last ;)
How to move a mouse at a random location and later click and release at THAT random location?

Let's say
[scar]         
MoveMouseSmooth(735 + random(217), 408 + random(217));
Wait(100+random(200));
HoldMouse(x, y, true);    // the location where the MoveMouseSmooth is
Wait(20+random(50));
ReleaseMouse(x, y, true);    // the location where the MoveMouseSmooth is[/scar]

Thank you.

Offline Freddy

  • Owner
  • *****
  • Posts: 2614
  • Rep: 19
    • MSN Messenger - freddy1990@gmail.com
    • AOL Instant Messenger - Freddy199O
    • View Profile
    • Email
Re: Find the blue color in the box.
« Reply #9 on: August 02, 2010, 09:52:35 am »
Use GetMousePos to get the location of the cursor.

Offline Erayo

  • Newbie
  • *
  • Posts: 12
  • Rep: 0
    • View Profile
Re: Find the blue color in the box.
« Reply #10 on: August 02, 2010, 11:25:24 am »
[scar]begin

MoveMouseSmooth(735 + random(217), 408 + random(217));
Wait(100+random(200));
HoldMouse(GetMousePos, true);
Wait(20+random(50));
ReleaseMouse(GetMousePos, true);

end.[/scar]

Not working :|

Offline Freddy

  • Owner
  • *****
  • Posts: 2614
  • Rep: 19
    • MSN Messenger - freddy1990@gmail.com
    • AOL Instant Messenger - Freddy199O
    • View Profile
    • Email
Re: Find the blue color in the box.
« Reply #11 on: August 02, 2010, 11:37:07 am »
You can't just replace 2 parameters by 1 thing... Also GetMousePos doesn't have a return value...
[scar]var
  x, y: Integer;
begin
 
MoveMouseSmooth(735 + random(217), 408 + random(217));
Wait(100+random(200));
GetMousePos(x, y);
HoldMouse(x, y, true);
Wait(20+random(50));
ReleaseMouse(x, y, true);
 
end.[/scar]

Freddy1990.com

Re: Find the blue color in the box.
« Reply #11 on: August 02, 2010, 11:37:07 am »

 

deductible-aliform