AutoHotkey Community

It is currently May 27th, 2012, 10:22 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: October 20th, 2009, 1:05 pm 
Offline

Joined: June 9th, 2008, 2:32 am
Posts: 936
Location: Canada
Y not throw in some Anti ban for those who want long term macros.

Code:
Click, % (100 + rnd(-10,10)), % (100 + rnd(-10,10))
Sleep, % rnd(1000,2000)

rnd(x,y)
{
Random, z, x, y
Return, z
}



_________________
Image
I know i have 6 legs. It's cuz I'm special.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 20th, 2009, 8:43 am 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
Gaming Tutorials


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 1st, 2009, 4:45 am 
Offline

Joined: December 1st, 2009, 4:42 am
Posts: 2
dwinar wrote:
That's a shame... I didn't notice that :/ Anyway if you're right, the old system of loop breaking was simple and awesome... And now I have problem with it and no one wants (or can) to help.


I know this is a semi-old thread, but why not use subroutines/functions with an if statement(s) to check whether a variable is true or false?
Code:
loopStart:
breakLoop := 0
loop
{
   if (breakLoop=1)
      Break
   Send a
}

loopBreak:
breakLoop := 1

F1::GoSub, loopStart   ; pressing F1 will start the loop
F2::GoSub, loopBreak   ; pressing F2 will stop the loop


Simple solution. ;)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2010, 4:17 am 
Quote:
That's a shame... I didn't notice that :/ Anyway if you're right, the old system of loop breaking was simple and awesome... And now I have problem with it and no one wants (or can) to help.



The only way I found to escape in a loop with a keypress is get the key state and parse it with an if like:


Code:
loop
   {
IfWinExist Untitled - Notepad
   WinActivate
   random, sendnum, 0, 1500
   send {backspace 4}
   Send %sendnum%
   sleep 10
   GetKeyState, state, F2, T   ; get the F2 state and put it in the var
   if state = D ; check if it's Down
   break ; if so break no else needed, it loops
   }



I'm all new to this program, so it's crappy written no doubt. But I hope that's an answer.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 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