 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
sa0sin' Guest
|
Posted: Tue Aug 19, 2008 5:45 pm Post subject: Macro to send random number every 5 minutes |
|
|
Hello =] i needed a script that clicks a hot key any hot key from the number
1-0 . it needs to be clicked every 5 minutes 1 time.
i hope someone plz helps me make this script. thanks alot
( i really need this !)
[Title edited. Please write descriptive titles for your topics. ~jaco0646] |
|
| Back to top |
|
 |
Razlin
Joined: 05 Nov 2007 Posts: 434 Location: canada
|
Posted: Tue Aug 19, 2008 5:50 pm Post subject: |
|
|
Show me some code, I'll help you code.
Show me some cash, I'll code for you. _________________ -=Raz=- |
|
| Back to top |
|
 |
Sivvy
Joined: 21 Jul 2008 Posts: 711 Location: Calgary, AB, Canada
|
Posted: Tue Aug 19, 2008 5:52 pm Post subject: |
|
|
| Code: | #Persistent
SetTimer, NumberToPick, 300000
NumberToPick:
Random, NumberToPress, 0, 9
Send, %NumberToPress%
Return |
I'll show a better way if I see you try to code a little. Otherwise, you can figure out how to make it work. |
|
| Back to top |
|
 |
sa0sin Guest
|
Posted: Tue Aug 19, 2008 5:54 pm Post subject: |
|
|
o0o ok imma try this out how can i run the script .i will script it
do i copy what u scripted, put on a notepad and run it? |
|
| Back to top |
|
 |
Sivvy
Joined: 21 Jul 2008 Posts: 711 Location: Calgary, AB, Canada
|
Posted: Tue Aug 19, 2008 5:55 pm Post subject: |
|
|
| Close... Notepad, save it as a .AHK file. |
|
| Back to top |
|
 |
sa0sin Guest
|
Posted: Tue Aug 19, 2008 6:14 pm Post subject: |
|
|
ok im trying to get a script running
this is a little different it runs the script for about 8 seconds then stops after that
WinWait, Hero OnLine,
IfWinNotActive, Hero OnLine, , WinActivate, Hero OnLine,
WinWaitActive, Hero OnLine,
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100
Send, 22222
MouseClick, right, 837, 980
Sleep, 100
MouseClick, right, 837, 980
Sleep, 100 |
|
| Back to top |
|
 |
Krogdor
Joined: 18 Apr 2008 Posts: 1145 Location: The Interwebs
|
Posted: Tue Aug 19, 2008 6:19 pm Post subject: |
|
|
First off, your code can be shortened to:
| Code: | WinWait, Hero OnLine,
IfWinNotActive, Hero OnLine, , WinActivate, Hero OnLine,
WinWaitActive, Hero OnLine,
Loop, 42 {
MouseClick, right, 837, 980
Sleep, 100
If (A_Index = 40)
Send, 22222
} |
Second, you said it only runs for eight seconds. That is about how long it should run with the amount of sleep that are in it; do you want it to run for longer? |
|
| Back to top |
|
 |
sa0sin Guest
|
Posted: Tue Aug 19, 2008 6:28 pm Post subject: |
|
|
yea. i want to right click every 4 seconds and hit #2 6 times every 262 seconds
that pretty much sums it up |
|
| Back to top |
|
 |
sa0sin Guest
|
Posted: Tue Aug 19, 2008 6:29 pm Post subject: |
|
|
Your script only right clicked twice but its a start =]
is there a way to make it go on for ever? |
|
| Back to top |
|
 |
Krogdor
Joined: 18 Apr 2008 Posts: 1145 Location: The Interwebs
|
Posted: Tue Aug 19, 2008 6:32 pm Post subject: |
|
|
| Code: | WinWait, Hero OnLine,
IfWinNotActive, Hero OnLine, , WinActivate, Hero OnLine,
WinWaitActive, Hero OnLine,
SetTimer, RightClick, 4000 ;four seconds
SetTimer, 222222, 262000 ;262 seconds
Return
RightClick:
MouseClick, Right, 837, 980
Return
222222:
Send, 222222
Return |
|
|
| Back to top |
|
 |
BoBo² Guest
|
Posted: Tue Aug 19, 2008 6:32 pm Post subject: |
|
|
| Quote: | | is there a way to make it go on for ever? | I doubt that your PC will run that long. But you can have a try with Loop. And no, I won't script it for you, and yes, you've to read the manual to get an idea about it. Good luck.  |
|
| Back to top |
|
 |
sa0sin Guest
|
Posted: Tue Aug 19, 2008 6:34 pm Post subject: |
|
|
| o0o i hope this works=D |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Aug 19, 2008 6:38 pm Post subject: |
|
|
| well Krogdor i ran it and it didnt start |
|
| Back to top |
|
 |
Krogdor
Joined: 18 Apr 2008 Posts: 1145 Location: The Interwebs
|
Posted: Tue Aug 19, 2008 6:57 pm Post subject: |
|
|
| Did the window "Hero OnLine" (case sensitive) exist when you started the script? |
|
| Back to top |
|
 |
Sivvy
Joined: 21 Jul 2008 Posts: 711 Location: Calgary, AB, Canada
|
Posted: Tue Aug 19, 2008 6:58 pm Post subject: |
|
|
More info... Didn't start could mean many things. Could mean you didn't get the green symbol in the tray, could mean you did, but nothing happened, or even that it started, but didn't do anything you noticed.
First. Did you get the little green Icon in the Tray? |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|