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 

Questions about loops

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





PostPosted: Sun Aug 12, 2007 3:36 pm    Post subject: Questions about loops Reply with quote

hey is there any way to do For loops of while loops or anything other than just loop # {} ??
Back to top
Cerealbh
Guest





PostPosted: Sun Aug 12, 2007 3:58 pm    Post subject: Reply with quote

update: im trying to make a program thats going to click points on a grid need to do actions to each one of those x's and want to setup some loops to go through the gride so i dont' have to have so much messy code


X X X X X
X X X X X
X X X X X
X X X X X
X X X X X
Back to top
polyethene



Joined: 11 Aug 2004
Posts: 5248
Location: UK

PostPosted: Sun Aug 12, 2007 4:48 pm    Post subject: Reply with quote

Could you post the code you have so far?
_________________
GitHubScriptsIronAHK Contact by email not private message.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CerealBH
Guest





PostPosted: Sun Aug 12, 2007 5:03 pm    Post subject: Reply with quote

well, right now all i have for code, is where is clicks the first Row, i need the commands to allow me to do loops
ill write in C++ what i need and AHK what i already have
Code:

row = 0
while (row != 5)
{
Click %xaxis%,%yaxis%
xaxis = xaxis + 100
row = row + 1
}
Back to top
Cereal



Joined: 17 Mar 2007
Posts: 45
Location: San Antonio, TX

PostPosted: Sun Aug 12, 2007 5:40 pm    Post subject: Reply with quote

here wrote some code in ahk, but its not executing correctly, it goes through the loop once, then stops...
Code:

#s::
   IfWinExist ahk_class MozillaUIWindowClass
   {
    WinActivate
   }
   else
   {
    WinWait ahk_class MozillaUIWindowClass
    WinActivate
   }
   xaxis = 400
   yaxis = 380
   
   horizspace = 150
   
   ; TOP ROW
   Loop 5
   {
   IfWinExist ahk_class MozillaUIWindowClass
   {
    WinActivate
   }
   else
   {
    WinWait ahk_class MozillaUIWindowClass
    WinActivate
   }
   Click %yaxis%,%xaxis%
   xaxis = xaxis + horizspace
   sleep 2500
   ;Close
   Click 493, 132
   sleep 1000
   }
   MsgBox Done
   
   return
Back to top
View user's profile Send private message AIM Address
Cereal



Joined: 17 Mar 2007
Posts: 45
Location: San Antonio, TX

PostPosted: Sun Aug 12, 2007 5:47 pm    Post subject: Reply with quote

nvm i got it i needed the : infront of the = Smile
Back to top
View user's profile Send private message AIM Address
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