| View previous topic :: View next topic |
| Author |
Message |
ups2000ups I post too much
Reputation: 0
Joined: 31 Jul 2006 Posts: 2471
|
Posted: Sun Jun 15, 2008 3:42 am Post subject: Help Making Bot almost done |
|
|
Hello im normaly in MS sector and i have made some bot/trainers and stuff for a while for maplestory and other games so i want to make 1 for runescape
so far i know if you check for GetPixel (canavas color) you will get an error if you do it to often
well it works anyway if you just check for the pixel sometimes
i made a little bot and it works 100% but the problem it is laggy .. and i wondering if some 1 else got any better idea
this is the timer who checks for the color's pos
| Quote: |
I use a second window that you set over the mining spot and in the area of that window it will checks each pixel (range 125,125) that makes 15625 combinations and thats why it lags/crash probably.
about make the window smaller dosent work since you cant only set min with on a form in delphi at 123
procedure TForm1.CheckPositionsTimer(Sender: TObject);
begin
While CheckColor = 'Checking' Do begin // If Check For Color Then
GetColor.caption := TColorToHex(DesktopColor(form2.Left + CheckPosX , form2.Top + CheckPosY)); // Check Position
if GetColor.caption = RightColor.caption then begin // If Found Then
CheckColor:='Found';
CheckPositions.Enabled:=false;
ClickTimer.Enabled:=true;
end else // If Found Start Next Thing Else Try Next Position
if CheckPosX > form2.Width - XPos then begin // if X nothing found
CheckPosX:=XPos; // Reset X
CheckPosY:=CheckPosY+1; // Try Next Y
end else
CheckPosX:=CheckPosX+1; // Next X Position
if CheckPosY > form2.Height - XPos then // If Y Is Done Then
CheckPosY:=YPos; // Reset Y
end;
end;
end;
|
the function who gets the color
| Quote: |
function DesktopColor(const X, Y: Integer): TColor;
var
c: TCanvas;
begin
c := TCanvas.Create;
try
c.Handle := GetWindowDC(GetDesktopWindow);
Result := GetPixel(c.Handle, X, Y);
finally
c.Free;
end;
end;
|
so my question is is the a way to check a selected range (example 100-200) and check all pixels in that range for a color (instead of check 1 by 1) and on the same way get the position where you got the Right Pixel color
notice
if i would just use a timer to check each position it would take to long time to check each position (even with interval 1 it would take atleast 16 sec and more because 1 interval dosent mean the whole procedur will take 1 interval
_________________
dont complain about my english...
1*1 = 2?
Last edited by ups2000ups on Sun Jun 15, 2008 8:08 am; edited 2 times in total |
|
| Back to top |
|
 |
Trucido Moderator
Reputation: 6
Joined: 08 Sep 2007 Posts: 2792
|
Posted: Sun Jun 15, 2008 5:26 am Post subject: |
|
|
There probly is, general programming might be able to help you better.
_________________
I'm out. |
|
| Back to top |
|
 |
ups2000ups I post too much
Reputation: 0
Joined: 31 Jul 2006 Posts: 2471
|
|
| Back to top |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Sun Jun 15, 2008 7:08 am Post subject: |
|
|
| What is the delay of your timers?, i would advice you to set them to at minimum 100 with those procedures, to avoid lagg
|
|
| Back to top |
|
 |
ups2000ups I post too much
Reputation: 0
Joined: 31 Jul 2006 Posts: 2471
|
Posted: Sun Jun 15, 2008 7:59 am Post subject: |
|
|
| Anden100 wrote: | | What is the delay of your timers?, i would advice you to set them to at minimum 100 with those procedures, to avoid lagg |
the timer interval does not have anything to do with it
since i use while it will be repeated until the position is found and then start the next timer
is there any real answear how to make it dosent lag so much or another way to find the position it should click
_________________
dont complain about my english...
1*1 = 2? |
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Tue Jun 17, 2008 4:10 am Post subject: |
|
|
the problem with looping is that it tries to do that code as fast as your computer possibly can, which aint good, my advice, slap a Sleep(20); in there, i doubt you could even react in 20 milliseconds so the delay wont be noticeable, but will stop it lagging
_________________
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Tue Jun 17, 2008 9:01 am Post subject: |
|
|
Also I would suggest making the variable that holds the window's DC public.
You only have to call GetWindowDC once, then save it's return value and use that in you're loop. You're script calls GetWindowDC every loop.
|
|
| Back to top |
|
 |
|