 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
jero3n Guest
|
Posted: Sun Jan 14, 2007 2:01 pm Post subject: NEEDS HELP: AUTOTALKER |
|
|
i made this auto-talker:
| Code: |
Gui, Color, red
Gui, Font, S8 Cwhite w600, Arial ;*******
Gui, Add, Text, x120 y5 w110,Auto Talker
Gui, Add, Text, x15 y53,De tekst: ; p = previous
Gui, Add, Text, xp y77 wp,Pauze(in milliseconden):
Gui, Font, S8 Cred w600, Arial ;*********
Gui, Add, Edit, Text x130 y50 w150 vtext,
Gui, Add, Edit, number x130 y80 w150 vduration,
Gui, Add, Button, Default x80 y146 w56 galgud,&OK
Gui, Add, Button, x150 y146 w56 gquit,&Sluit
Gui, Show, Center w300 h190
Return
algud:
Gui, Submit, Nohide
Hotkey, F1, DoThis
RETURN
DoThis:
Loop
{
if GetKeyState("z")
break
else
Sleep, %duration%
Send, %text% {ENTER}
}
Return
Quit:
ExitApp
Return
|
i want that if i press f1, the auto-talker start. that works
but i want too that if i press f2, the auto-talker stops...
how can i do that???????????
plz help me! |
|
| Back to top |
|
 |
Jaytech
Joined: 11 Dec 2006 Posts: 242 Location: Orlando, FL
|
Posted: Sun Jan 14, 2007 4:12 pm Post subject: |
|
|
| Code: |
SetTimer, CheckforF2, 1
F1::
Run, "%A_Desktop%\AutoHotkey.exe" "%A_ScriptDir%\AutoTalker.txt"", , , AutoTalker ;Replace first parameter with your autohotkey directory and the second parameter with your script directory and name
RETURN
CheckforF2:
GetKeyState, X, F2
IfEqual, X, D
Process, close, %AutoTalker%
RETURN
|
Hope that helps  |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 2951 Location: Minnesota
|
Posted: Mon Jan 15, 2007 12:38 am Post subject: |
|
|
Um... why use a timer?
| Code: | DetectHiddenWindows,on
return
F1::Run,"%A_ProgramFiles%\AutoHotkey\AutoHotkey.exe" "%A_ScriptDir%\AutoTalker.ahk",,,AutoTalker
F2::WinClose,ahk_pid %AutoTalker% |
Also, using Process,close leaves the killed script's tray icon sitting there until you hover over it with your mouse. |
|
| Back to top |
|
 |
Jero3n Guest
|
Posted: Mon Jan 15, 2007 4:19 pm Post subject: |
|
|
can you give me the full code jonny?? with that code of you? (i'm not really good in autohotkey scripting)
and then i have a second question: did you know a good tutorial about autohotkey scripting?? |
|
| Back to top |
|
 |
polyethene
Joined: 11 Aug 2004 Posts: 5248 Location: UK
|
Posted: Mon Jan 15, 2007 4:38 pm Post subject: |
|
|
| Jero3n wrote: | | did you know a good tutorial about autohotkey scripting?? | Quick-start Tutorial... _________________ GitHub • Scripts • IronAHK • Contact by email not private message. |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Mon Jan 15, 2007 4:46 pm Post subject: |
|
|
Another thread which might be of interest for gamesters: NEEDS HELP: AUTOTHINKER  |
|
| Back to top |
|
 |
Jero3n Guest
|
Posted: Mon Jan 15, 2007 5:12 pm Post subject: |
|
|
that tut is not very good.. |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Mon Jan 15, 2007 6:25 pm Post subject: |
|
|
| Quote: | | that tut is not very good.. | Indeed, it doesn't cover the standard expectation of most gamesters, to deliver instant scripts without that they've to invest any personal effort.
So, you're damn right, life stinks.  |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 2951 Location: Minnesota
|
Posted: Mon Jan 15, 2007 8:48 pm Post subject: |
|
|
| Quote: | | can you give me the full code jonny?? |
What full code? That's all I wrote. I only made it to demonstrate how to start and stop a script from another script. You need DetectHiddenWindows,on in the auto-execute, the line assigned to F1 to start it, and the line assigned to F2 to stop it. |
|
| Back to top |
|
 |
Justineo14
Joined: 30 Oct 2006 Posts: 43
|
Posted: Mon Jan 15, 2007 10:59 pm Post subject: Try this |
|
|
| Code: | Gui, Color, red
Gui, Font, S8 Cwhite w600, Arial ;*******
Gui, Add, Text, x120 y5 w110,Auto Talker
Gui, Add, Text, x15 y53,De tekst: ; p = previous
Gui, Add, Text, xp y77 wp,Pauze(in milliseconden):
Gui, Font, S8 Cred w600, Arial ;*********
Gui, Add, Edit, Text x130 y50 w150 vtext,
Gui, Add, Edit, number x130 y80 w150 vduration,
Gui, Add, Button, Default x80 y146 w56 galgud,&OK
Gui, Add, Button, x150 y146 w56 gquit,&Sluit
Gui, Show, Center w300 h190
Return
algud:
Gui, Submit, Nohide
Hotkey, F1, DoThis
RETURN
DoThis:
Loop
{
if GetKeyState("F2")
break
else
Sleep, %duration%
Send, %text% {ENTER}
}
Return
Quit:
ExitApp
Return |
Hope that helps  _________________ Tex© Click here to mail me |
|
| Back to top |
|
 |
Jero3n Guest
|
Posted: Tue Jan 16, 2007 5:48 pm Post subject: |
|
|
| if i then click at F2, it dont stop. how can that???? |
|
| Back to top |
|
 |
Jero3n Guest
|
Posted: Fri Jan 19, 2007 3:12 pm Post subject: |
|
|
plz give me an answer  |
|
| Back to top |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1651 Location: Denmark
|
Posted: Fri Jan 19, 2007 3:38 pm Post subject: |
|
|
GetKeyState checks if the key is down when it's called.
If F2 is pressed and released during the sleep your test fails.
You could make F2 a hotkey that stops the loop:
| Code: | DoThis:
stopped = 0
Hotkey, F2, StopIt
Loop
{
Sleep, %duration%
if stopped = 1
break
else
Send, %text% {ENTER}
}
Hotkey, F2, off
Return
StopIt:
Critical, On
stopped = 1
Return
|
_________________ RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2 |
|
| Back to top |
|
 |
Jero3n Guest
|
Posted: Fri Jan 19, 2007 8:08 pm Post subject: |
|
|
thx now it works  |
|
| Back to top |
|
 |
Jero3n
Joined: 19 Jan 2007 Posts: 147
|
|
| 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
|