AutoHotkey Community

It is currently May 27th, 2012, 2:40 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: November 22nd, 2009, 6:16 pm 
Offline

Joined: March 11th, 2009, 12:00 am
Posts: 86
Location: Nsw/Syd/Kiama
Hello, im quite new to ahk so im sorry for anouther newbie posting stupid questions abaout variables, but i have given a shot at this and im just a bit blank on what iv done wrong.

basicly this script is a small gui based square centred in the mide of the screen. it has a pixel search in specific co-ordinats inside the square.

i think iv mest up with the whole variable thing, im quite new to programing so if someone could explain to me what iv die wrong aswel as corecting my mistake, id much appreciate it.

Code:
;-----------the gui hitbox---------------------------------------------------
bDim = 35 ; Change this to desired size.
xPos = % (A_ScreenWidth/2) - bDim
yPos = % (A_ScreenHeight/2) - bDim
Gui, +alwaysontop
Gui, -Caption Border AlwaysOnTop ToolWindow
Gui, Color, C0C0C0
Gui, Show, NA W%bDim% H%bDim% X%xPos% Y%yPos%, hitBox

WinWait, hitBox
WinSet, TransColor, C0C0C0 255, hitBox

;------------the continuos pixelsearch inside the box-----------------------
Loop
{
  pixelSearch  , %TL% , %BR% , 806 , 490 , 841 , 524 , 10 , fast
}

;----------left click grabs the position of the color then leftclicks it----
LButton::
MouseGetPos, %TL% , %BR%
sleep 100
MouseClick , left , %TL% , %BR% , 1 , 10
sleep 100
return


 
;----------------------------end statemnts------------------------------------
^z::ExitApp



^^^^^^^^^^^^^^^^

thanks alot.
~Cyber

ps this is the error i get
"this dynamic variable is blank, if you did not intend it to be blank please remove the %"
i get that on line 15 i think, "pixelsearch line"

_________________
---{+.-}---


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2009, 6:22 pm 
Offline

Joined: July 18th, 2006, 12:18 pm
Posts: 403
Those are output varibles. There is no need to wrap them in %%

Change: pixelSearch , %TL% , %BR% , 806 , 490 , 841 , 524 , 10 , fast

To

Code:
pixelSearch  , TL , BR , 806 , 490 , 841 , 524 , 10 , fast


Also read the manual on pixelsearch


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2009, 6:29 pm 
Offline

Joined: March 11th, 2009, 12:00 am
Posts: 86
Location: Nsw/Syd/Kiama
thanks for that =)

_________________
---{+.-}---


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Alpha Bravo, Bing [Bot], rbrtryn and 19 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group