AutoHotkey Community

It is currently May 26th, 2012, 7:36 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: May 9th, 2009, 12:49 am 
ive just learned to make a script / bot or what we should call it. but how do i make it to restart the bot / script? like make a Loop
i want the script to not stop after it have done its job. i want it to start over and over again and never stop.
How do i make it to do that?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 9th, 2009, 12:53 am 
Offline

Joined: April 27th, 2008, 5:28 pm
Posts: 489
Code:
Loop
{
  Your code
}


You should use a hotkey to exit your script when you need to. Put this after the loop closing bracket
Code:
^x:: ;this would exit the script when Ctrl x is pressed.
exitapp

_________________
Check out my scripts.
(MyIpChanger) (XPSnap) (SavePictureAs)

All my scripts are tested on Windows 7, AutoHotkey_L 32 bit Ansi unless otherwise stated.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: ty
PostPosted: May 9th, 2009, 1:01 am 
DataLife wrote:
Code:
Loop
{
  Your code
}


You should use a hotkey to exit your script when you need to. Put this after the loop closing bracket
Code:
^x:: ;this would exit the script when Ctrl x is pressed.
exitapp



Should i just open the script in notepad and write Loop under this:
MouseClick, left, 592, 453
Sleep, 100
MouseClick, left, 162, 470
Sleep, 100
MouseClick, left, 353, 536
Sleep, 100
MouseClick, left, 1015, 427
Sleep, 100
MouseClick, left, 495, 670
Sleep, 100
MouseClick, left, 137, 471
Sleep, 100
MouseClick, left, 358, 449
Sleep, 100
MouseClick, left, 147, 477
Sleep, 100
MouseClick, left, 340, 468
Sleep, 100
MouseClick, left, 1016, 378
Sleep, 100
MouseClick, left, 506, 649
Sleep, 100
MouseClick, left, 122, 472
Sleep, 100


Report this post
Top
  
Reply with quote  
 Post subject: :)
PostPosted: May 9th, 2009, 1:05 am 
sorry i forgot to ask could you complete the script for me to put loop in it and the exit thingy? here is rapidshare link: http://rapidshare.com/files/230778594/s ... t.rar.html



Thanks so much if you could help me with this :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 9th, 2009, 1:22 am 
Offline

Joined: February 24th, 2005, 8:45 am
Posts: 278
If your whole code is what you wrote, then:

After running the script, press Ctrl + s to start the loop, and Ctrl + x to end it.

Code:
^s::
GoSub, start
return

^x::
ExitApp
return

start:
Loop
{
MouseClick, left, 592, 453
Sleep, 100
MouseClick, left, 162, 470
Sleep, 100
MouseClick, left, 353, 536
Sleep, 100
MouseClick, left, 1015, 427
Sleep, 100
MouseClick, left, 495, 670
Sleep, 100
MouseClick, left, 137, 471
Sleep, 100
MouseClick, left, 358, 449
Sleep, 100
MouseClick, left, 147, 477
Sleep, 100
MouseClick, left, 340, 468
Sleep, 100
MouseClick, left, 1016, 378
Sleep, 100
MouseClick, left, 506, 649
Sleep, 100
MouseClick, left, 122, 472
Sleep, 100
}

_________________
My small "thanks" to AHK in shape of these dedicated 3d images
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: cmon
PostPosted: May 9th, 2009, 1:27 am 
Come on please. Help me ive tryed everything u said now it just saying Error and something about IF and something about #LINE 4 {Loop Error i dont understand.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 9th, 2009, 1:31 am 
Offline

Joined: February 24th, 2005, 8:45 am
Posts: 278
Did you copy exactly what I wrote in a new file and ran it? . I don't see why you will get an error.

Post the whole script and exact error if you still get it

_________________
My small "thanks" to AHK in shape of these dedicated 3d images
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: :)
PostPosted: May 9th, 2009, 1:32 am 
sosaited wrote:
If your whole code is what you wrote, then:

After running the script, press Ctrl + s to start the loop, and Ctrl + x to end it.

Code:
^s::
GoSub, start
return

^x::
ExitApp
return

start:
Loop
{
MouseClick, left, 592, 453
Sleep, 100
MouseClick, left, 162, 470
Sleep, 100
MouseClick, left, 353, 536
Sleep, 100
MouseClick, left, 1015, 427
Sleep, 100
MouseClick, left, 495, 670
Sleep, 100
MouseClick, left, 137, 471
Sleep, 100
MouseClick, left, 358, 449
Sleep, 100
MouseClick, left, 147, 477
Sleep, 100
MouseClick, left, 340, 468
Sleep, 100
MouseClick, left, 1016, 378
Sleep, 100
MouseClick, left, 506, 649
Sleep, 100
MouseClick, left, 122, 472
Sleep, 100
}



Thanks. but the bot goes To fast i didnt Record it so fast. i recored the bot and used like 15 min. how to get it to normal speed?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 9th, 2009, 1:35 am 
Offline

Joined: February 24th, 2005, 8:45 am
Posts: 278
You want 15 minutes gap between Loops or Mouseclicks?

If you want the loop to start after every 15 minutes then:

Code:
^s::
GoSub, start
return

^x::
ExitApp
return

start:
Loop
{
MouseClick, left, 592, 453
Sleep, 100
MouseClick, left, 162, 470
Sleep, 100
MouseClick, left, 353, 536
Sleep, 100
MouseClick, left, 1015, 427
Sleep, 100
MouseClick, left, 495, 670
Sleep, 100
MouseClick, left, 137, 471
Sleep, 100
MouseClick, left, 358, 449
Sleep, 100
MouseClick, left, 147, 477
Sleep, 100
MouseClick, left, 340, 468
Sleep, 100
MouseClick, left, 1016, 378
Sleep, 100
MouseClick, left, 506, 649
Sleep, 100
MouseClick, left, 122, 472
Sleep, 900000
}

_________________
My small "thanks" to AHK in shape of these dedicated 3d images
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 9th, 2009, 1:46 am 
no i dont want to wait 15 min after each loop i want it to go slower the bot didnt even do what it should do becouse it was way to fast. is it possible to make the bot to do its work slowly?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 9th, 2009, 1:49 am 
Offline

Joined: February 24th, 2005, 8:45 am
Posts: 278
Increase the Sleep duration from 100 to 500 or 1000 (1 second) between each MouseClick.

_________________
My small "thanks" to AHK in shape of these dedicated 3d images
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 9th, 2009, 1:55 am 
Thanks that worked. But why does not the script scroll down? ive made it to scroll the site a little bit down.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 9th, 2009, 2:00 am 
Offline

Joined: February 24th, 2005, 8:45 am
Posts: 278
I didn't understand what you are trying to ask. Scroll down what?

If you mean the code in the posts, then click anywhere in the code area, or click on Expand button.

_________________
My small "thanks" to AHK in shape of these dedicated 3d images
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 9th, 2009, 2:55 am 
nah i made everything to work like i wanted to.

Thanks for all the help :)
Im very happy now im searched for a bot in alot of days. but now i dont need one since i got one :) Ty


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 9th, 2009, 2:56 am 
Offline

Joined: April 27th, 2008, 5:28 pm
Posts: 489
sinder151 wrote:
Thanks that worked. But why does not the script scroll down? ive made it to scroll the site a little bit down.


I think he means scroll down a webpage. If that is the case determine where and when you want to scroll and how much by doing this.
Code:
Send {down} ; this is the same as arrow down one time
;or you could use
Send {pgdn} ;page down one time

_________________
Check out my scripts.
(MyIpChanger) (XPSnap) (SavePictureAs)

All my scripts are tested on Windows 7, AutoHotkey_L 32 bit Ansi unless otherwise stated.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: dmg, krajan, over21, RaptorX, Yahoo [Bot] and 65 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