AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Variable error? Not quite sure what iv done wrong.

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Cyber



Joined: 10 Mar 2009
Posts: 86
Location: Nsw/Syd/Kiama

PostPosted: Sun Nov 22, 2009 5:16 pm    Post subject: Variable error? Not quite sure what iv done wrong. Reply with quote

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"
_________________
---{+.-}---
Back to top
View user's profile Send private message MSN Messenger
i3egohan



Joined: 18 Jul 2006
Posts: 403

PostPosted: Sun Nov 22, 2009 5:22 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Cyber



Joined: 10 Mar 2009
Posts: 86
Location: Nsw/Syd/Kiama

PostPosted: Sun Nov 22, 2009 5:29 pm    Post subject: Reply with quote

thanks for that =)
_________________
---{+.-}---
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group