Jump to content
Sign in to follow this  
CookieCop

Autofire bot

Recommended Posts

CookieCop

Alright, I have this script that works fine:

While 1

$coord = PixelSearch( 0, 0, 400, 300, 0xc800ff, 50 )
If Not @error Then
    MouseClick("Left")
EndIf

WEnd

Problem is, it's a bit slow and it's using up my cpu like crazy. Any idea on how to improve it?

Share this post


Link to post
Share on other sites
FuryCell

It is often useful to add a sleep into loops.

While 1
Sleep(50)

$coord = PixelSearch( 0, 0, 400, 300, 0xc800ff, 50 )
If Not @error Then
    MouseClick("Left")
EndIf

WEnd
Edited by SolidSnake

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites
CookieCop

Being the rookie I am, I JUST noticed that it delays the response of the script.

Anyway to prevent this without lagging the CPU? Like maybe targeting just a small 30 x 30 pixel square aroudn the center of the screen(800 x 600)?

EDIT: Nevermind. ;P

Edited by CookieCop

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×