 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
MeSaR Guest
|
Posted: Sun Jul 06, 2008 4:16 pm Post subject: on off |
|
|
| hey i need a script so alt 1 turn script on and alt 1 turns it off |
|
| Back to top |
|
 |
SpiderGames
Joined: 09 Jun 2008 Posts: 331 Location: Canada
|
Posted: Sun Jul 06, 2008 4:57 pm Post subject: |
|
|
if you want to start it with alt and close it with alt...
it's easyer if you use alt and ctr-alt but w/e..
| Code: |
{Alt}::
{
if valt = 1
{
valt = 0
}
else if valt = 0
{
valt = 1
}
}
if valt = 1
{
Loop,
{
; your script...
if valt = 0
{
Break,
}
else
{
Continue
}
}
}
|
_________________ "I reject your ReAlItY and Substitute with my Own"
_______________________________________
Pie Is exactly 3! |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Jul 06, 2008 5:08 pm Post subject: |
|
|
| doesnt seem to be working just says somethings wrong and cant fin {alt} |
|
| Back to top |
|
 |
vahju
Joined: 17 Feb 2008 Posts: 69
|
Posted: Sun Jul 06, 2008 5:18 pm Post subject: |
|
|
Change
to one of the following:
|
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1078 Location: switzerland
|
Posted: Sun Jul 06, 2008 5:20 pm Post subject: |
|
|
| Code: | #persistent
!1::
V++
M:=mod(V,2)
if M=1
goto,GUI3
else
Gui,3:destroy
return
GUI3:
Gui,3:add,text,x10 y30 ,Myprogram
Gui,3:Show,x0 y40 h60 w200,Myprogram
return
3Guiclose:
if M=1
V++
Gui,3:destroy
return
|
Last edited by garry on Sun Jul 06, 2008 6:08 pm; edited 3 times in total |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Jul 06, 2008 5:28 pm Post subject: |
|
|
| ok guys its not coming up that error anymore but its not turnin on or off |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Jul 06, 2008 5:59 pm Post subject: |
|
|
| nice work gary but it doesnt actually stop wen u press alt 1 it just says ur script closes in 2 seconds but doesnt |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1078 Location: switzerland
|
Posted: Sun Jul 06, 2008 6:02 pm Post subject: |
|
|
try again, made small changes
can make it better with ... ifwinexist .... etc |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Jul 06, 2008 6:05 pm Post subject: |
|
|
this is my full code garry what do u think im doing wrong
#persistent
!1::
V++
M:=mod(V,2)
if M=1
{
msgbox,,,Your script starts in 2 seconds,2
Gui,3:add,text,x10 y30 ,Myprogram
Gui,3:Show,x0 y40 h60 w200,Myprogram
return
}
else
{
msgbox,,,Your script closes in 2 seconds,2
Gui,3:destroy
return
}
return
;WinWait, Call of Duty 4,
IfWinNotActive, Call of Duty 4, , WinActivate, Call of Duty 4,
WinWaitActive, Call of Duty 4,
~LButton::Send, {RButton}
LButton UP::Send, {RButton} |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1078 Location: switzerland
|
Posted: Sun Jul 06, 2008 6:13 pm Post subject: |
|
|
| Quote: | | hey i need a script so alt 1 turn script on and alt 1 turns it off |
script example above just starts/closes a 2nd GUI (your new script) when press alt+1
want you start an exe program ? (I'll try again .... ) |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Jul 06, 2008 6:16 pm Post subject: |
|
|
| ok sorry for the miss understanding erm do u have msn ? |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1078 Location: switzerland
|
Posted: Sun Jul 06, 2008 6:27 pm Post subject: |
|
|
if you login can write to me
I've tried again, just ask, someone has a better solution
| Code: |
#persistent
programx=xy.exe
!1::
V++
M:=mod(V,2)
if M=1
goto,ProgramStart
else
goto,ProgramClose
return
ProgramStart:
;msgbox,%programx% starts
Run,%programx%
Process,wait,%programx%
PID2 = %ErrorLevel%
Process,exist,%programx%
{
sleep,2000
msgbox,Do something
}
return
ProgramClose:
;msgbox,%programx% close
process,close,%PID2%
return
|
|
|
| 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
|