Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[AutoIt] Search for color + click function

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
~tex
Newbie cheater
Reputation: 0

Joined: 28 Dec 2008
Posts: 13

PostPosted: Wed Jan 07, 2009 4:52 pm    Post subject: [AutoIt] Search for color + click function Reply with quote

I use a more complicated version in my Runescape bots but this is a simple base to a color finder + clicker. Put hex color in $treecolor. fill out secondtree and treeclicks as well.

Code:
;;;;;Search Color+Click;;;;;
Func choptree()
;;;Variables
global $secondtree = "seconds to wait in between tree clicks"
global $treeclicks = "How many times to click trees"
global $treecolor = "Color to click here (hex)"
;;;Random Variables
$rand2 = random(1000,1200)
$rand3 = random(1,10)
$rand4 = random(1,10)
$oftrips = 0
;;;;;;;;;;;;;;;
sleep($rand2)
do
Do
$treepixel = PixelSearch(0, 0, 1279, 1023, $treecolor); Search for color
   If @error Then
   Do
   $treepixel = PixelSearch(0, 0, 1279, 1023, $treecolor)
   Until not @error
   EndIf
Until Not @error
mouseclick("left",$treepixel[0] + $rand3, $treepixel[1] + $rand4) ;clicks color
sleep($secondtree * 1000)
$oftrips = $oftrips + 1
until $oftrips = $treeclicks
EndFunc
;;;;;;;;;;;;;;;;
Back to top
View user's profile Send private message
blackmorpheus
Expert Cheater
Reputation: 0

Joined: 05 Apr 2008
Posts: 159

PostPosted: Fri Jan 09, 2009 2:32 am    Post subject: Reply with quote

what language is this? Rolling Eyes
Back to top
View user's profile Send private message
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Fri Jan 09, 2009 3:02 am    Post subject: Reply with quote

This is the General programming forum, not the General scripting forum.
Back to top
View user's profile Send private message MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Jan 09, 2009 3:56 am    Post subject: Reply with quote

Zerith wrote:
This is the General programming forum, not the General scripting forum.


it's fine.
Back to top
View user's profile Send private message
~tex
Newbie cheater
Reputation: 0

Joined: 28 Dec 2008
Posts: 13

PostPosted: Fri Jan 09, 2009 2:47 pm    Post subject: Reply with quote

Zerith wrote:
This is the General programming forum, not the General scripting forum.


Quote:
A scripting language, script language or extension language, is a programming language that allows some control of a single or many software application(s).


Suck my scripting nuts Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites