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 

autohotkey Loop answear Fast please :)
Goto page 1, 2  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
sinder151
Guest





PostPosted: Fri May 08, 2009 11:49 pm    Post subject: autohotkey Loop answear Fast please :) Reply with quote

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?
Back to top
DataLife



Joined: 27 Apr 2008
Posts: 369

PostPosted: Fri May 08, 2009 11:53 pm    Post subject: Reply with quote

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

_________________
Unless otherwise stated, all code is untested

Check out my scripts.
http://www.autohotkey.net/~DataLife/MyIpChanger/MyIpChanger.ahk
http://www.autohotkey.net/~DataLife/XPSnap.ahk
http://www.autohotkey.net/~DataLife/SavePictureAs.ahk
Back to top
View user's profile Send private message Send e-mail
sinder151
Guest





PostPosted: Sat May 09, 2009 12:01 am    Post subject: ty Reply with quote

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
Back to top
sinder151
Guest





PostPosted: Sat May 09, 2009 12:05 am    Post subject: :) Reply with quote

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/sinders_mafia_bot.rar.html



Thanks so much if you could help me with this Smile
Back to top
sosaited



Joined: 24 Feb 2005
Posts: 278

PostPosted: Sat May 09, 2009 12:22 am    Post subject: Reply with quote

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





PostPosted: Sat May 09, 2009 12:27 am    Post subject: cmon Reply with quote

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.
Back to top
sosaited



Joined: 24 Feb 2005
Posts: 278

PostPosted: Sat May 09, 2009 12:31 am    Post subject: Reply with quote

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





PostPosted: Sat May 09, 2009 12:32 am    Post subject: :) Reply with quote

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?
Back to top
sosaited



Joined: 24 Feb 2005
Posts: 278

PostPosted: Sat May 09, 2009 12:35 am    Post subject: Reply with quote

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





PostPosted: Sat May 09, 2009 12:46 am    Post subject: Reply with quote

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?
Back to top
sosaited



Joined: 24 Feb 2005
Posts: 278

PostPosted: Sat May 09, 2009 12:49 am    Post subject: Reply with quote

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





PostPosted: Sat May 09, 2009 12:55 am    Post subject: Reply with quote

Thanks that worked. But why does not the script scroll down? ive made it to scroll the site a little bit down.
Back to top
sosaited



Joined: 24 Feb 2005
Posts: 278

PostPosted: Sat May 09, 2009 1:00 am    Post subject: Reply with quote

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





PostPosted: Sat May 09, 2009 1:55 am    Post subject: Reply with quote

nah i made everything to work like i wanted to.

Thanks for all the help Smile
Im very happy now im searched for a bot in alot of days. but now i dont need one since i got one Smile Ty
Back to top
DataLife



Joined: 27 Apr 2008
Posts: 369

PostPosted: Sat May 09, 2009 1:56 am    Post subject: Reply with quote

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

_________________
Unless otherwise stated, all code is untested

Check out my scripts.
http://www.autohotkey.net/~DataLife/MyIpChanger/MyIpChanger.ahk
http://www.autohotkey.net/~DataLife/XPSnap.ahk
http://www.autohotkey.net/~DataLife/SavePictureAs.ahk
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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