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 

Macro to send random number every 5 minutes
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
sa0sin'
Guest





PostPosted: Tue Aug 19, 2008 5:45 pm    Post subject: Macro to send random number every 5 minutes Reply with quote

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

PostPosted: Tue Aug 19, 2008 5:50 pm    Post subject: Reply with quote

Show me some code, I'll help you code.
Show me some cash, I'll code for you.
_________________
-=Raz=-
Back to top
View user's profile Send private message
Sivvy



Joined: 21 Jul 2008
Posts: 711
Location: Calgary, AB, Canada

PostPosted: Tue Aug 19, 2008 5:52 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
sa0sin
Guest





PostPosted: Tue Aug 19, 2008 5:54 pm    Post subject: Reply with quote

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

PostPosted: Tue Aug 19, 2008 5:55 pm    Post subject: Reply with quote

Close... Notepad, save it as a .AHK file.
Back to top
View user's profile Send private message MSN Messenger
sa0sin
Guest





PostPosted: Tue Aug 19, 2008 6:14 pm    Post subject: Reply with quote

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

PostPosted: Tue Aug 19, 2008 6:19 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
sa0sin
Guest





PostPosted: Tue Aug 19, 2008 6:28 pm    Post subject: Reply with quote

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





PostPosted: Tue Aug 19, 2008 6:29 pm    Post subject: Reply with quote

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

PostPosted: Tue Aug 19, 2008 6:32 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
BoBo²
Guest





PostPosted: Tue Aug 19, 2008 6:32 pm    Post subject: Reply with quote

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. Confused
Back to top
sa0sin
Guest





PostPosted: Tue Aug 19, 2008 6:34 pm    Post subject: Reply with quote

o0o i hope this works=D
Back to top
Guest






PostPosted: Tue Aug 19, 2008 6:38 pm    Post subject: Reply with quote

well Krogdor i ran it and it didnt start
Back to top
Krogdor



Joined: 18 Apr 2008
Posts: 1145
Location: The Interwebs

PostPosted: Tue Aug 19, 2008 6:57 pm    Post subject: Reply with quote

Did the window "Hero OnLine" (case sensitive) exist when you started the script?
Back to top
View user's profile Send private message AIM Address
Sivvy



Joined: 21 Jul 2008
Posts: 711
Location: Calgary, AB, Canada

PostPosted: Tue Aug 19, 2008 6:58 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
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