Add a msgbox to an existing script
- SpikeVanHellsing
- Posts: 24
- Joined: 16 May 2017, 21:33
Add a msgbox to an existing script
I have a few scripts that i use and i would like to add a msg box or tooltip to them that will display when they have been activated or deactivated and that will do away on its own after a set period of tile say like a minute or less. Is there any possible way to do this?
Re: Add a msgbox to an existing script
I researched it and this isn't possible with ahk
- SpikeVanHellsing
- Posts: 24
- Joined: 16 May 2017, 21:33
Re: Add a msgbox to an existing script
Ok then could i add in a msgbox just to tell me that the script will be ran after i manually close it with the ok buton?
- flyingDman
- Posts: 2817
- Joined: 29 Sep 2013, 19:01
Re: Add a msgbox to an existing script
@SpikeVanHellsing Why don't you provide an example of the types of script you want to add a msgbox to?
This msgbox cancels itself in 10 seconds:
and can be incorporated in most scripts.
A tooltip can be incorporated and dismissed after a period of your choice using a settimer like so:
This msgbox cancels itself in 10 seconds:
Code: Select all
Msgbox,,,I'll go away in ten seconds, 10
A tooltip can be incorporated and dismissed after a period of your choice using a settimer like so:
Code: Select all
tooltip, This is a test, %a_screenwidth%, %a_screenheight%
SetTimer, dismissTT, 7000
return
dismissTT:
ToolTip
return
14.3 & 1.3.7
- SpikeVanHellsing
- Posts: 24
- Joined: 16 May 2017, 21:33
Re: Add a msgbox to an existing script
@flyingDman This is one of the scrypts that i use to press shift every so often:
And this is a script i use just as a generic rapid click someone made for me a few years ago:
Now my question is how and where would i add either the tooltip or msgbox code into either of these scripts?
Code: Select all
#MaxThreadsPerHotkey 2
F1::
Toggle := !Toggle
loop
{
If not Toggle
break
sendinput, {LShift down}
sleep 125
sendinput, {LShift up}
sleep 200000
}
return
Code: Select all
F1::domino66Click()
domino66Click(Interval=0){
static Toggler
Toggler := !Toggler
TPer := Toggler ? Interval : "off"
SetTimer, ClickClick, %TPer%
return
ClickClick:
Click
return
}
- SpikeVanHellsing
- Posts: 24
- Joined: 16 May 2017, 21:33
Re: Add a msgbox to an existing script
Anyone? I have tried pasting the msgbox code both before and after my trigger key in my scripts and nothing happens. What am i doing wrong?
- SpikeVanHellsing
- Posts: 24
- Joined: 16 May 2017, 21:33
Re: Add a msgbox to an existing script
Please someone. If i add in the msgbox code it runs but nothing else happens.
Re: Add a msgbox to an existing script
example splashimage if running
Code: Select all
#MaxThreadsPerHotkey 2
F1::
Toggle := !Toggle
if (toggle=1)
Splashimage,,b w600 h150 x100 Y400 CWsilver m9 b fs10 zh0,Running...
loop
{
If not Toggle
{
Splashimage, off
break
}
msgbox, 262208, ,sendinput`, {LShift down},1 ;- msgbox for test
;sleep 125
;sendinput, {LShift up}
;sleep 200000
}
return
esc::exitapp
- SpikeVanHellsing
- Posts: 24
- Joined: 16 May 2017, 21:33
Re: Add a msgbox to an existing script
so this does work, however its not what i am looking for. after doing some digging i think what i am looking for is a tooltip. seeing as it doesn't take focus away from the active window.garry wrote: ↑11 Jul 2020, 09:56example splashimage if runningCode: Select all
#MaxThreadsPerHotkey 2 F1:: Toggle := !Toggle if (toggle=1) Splashimage,,b w600 h150 x100 Y400 CWsilver m9 b fs10 zh0,Running... loop { If not Toggle { Splashimage, off break } msgbox, 262208, ,sendinput`, {LShift down},1 ;- msgbox for test ;sleep 125 ;sendinput, {LShift up} ;sleep 200000 } return esc::exitapp
Re: Add a msgbox to an existing script
Code: Select all
#MaxThreadsPerHotkey 2
F1::
Toggle := !Toggle
loop
{
If not Toggle
{
tooltip, break
sleep, 2000
tooltip
break
}
tooltip, LShift down
;sendinput, {LShift down}
sleep 1250
;sendinput, {LShift up}
tooltip, LShift up
sleep 2000
tooltip, Loop %a_index%
sleep 2000
}
return
Re: Add a msgbox to an existing script
@haichen , thank you
splashimage doesn't steal the focus , only the msgbox example ( which isn't needed )
for splashimage you can set position , size , color etc , I like to use for : It's running ... / Finished ( when no GUI exist ) , Tooltip for short , fast messages
splashimage doesn't steal the focus , only the msgbox example ( which isn't needed )
for splashimage you can set position , size , color etc , I like to use for : It's running ... / Finished ( when no GUI exist ) , Tooltip for short , fast messages
- SpikeVanHellsing
- Posts: 24
- Joined: 16 May 2017, 21:33
Re: Add a msgbox to an existing script
thank you both for your help with this. however, i do not want a splashimage and the code did nothing but sycle through the tooltip. I didnt know adding a tolltip would be so hard. but all i want is for a tooltip to be displayed when the script is activated and deactivated. if this can't be done then so be it.haichen wrote: ↑14 Jul 2020, 03:09You can click on the code to jump to the HelpCode: Select all
#MaxThreadsPerHotkey 2 F1:: Toggle := !Toggle loop { If not Toggle { tooltip, break sleep, 2000 tooltip break } tooltip, LShift down ;sendinput, {LShift down} sleep 1250 ;sendinput, {LShift up} tooltip, LShift up sleep 2000 tooltip, Loop %a_index% sleep 2000 } return
Re: Add a msgbox to an existing script
Code: Select all
#MaxThreadsPerHotkey 2
CoordMode, ToolTip, Screen
F1::
Toggle := !Toggle
loop
{
If not Toggle
{
tooltip, break, A_ScreenWidth-300, 150
break
}
tooltip, running, A_ScreenWidth-300, 150
sendinput, {LShift down}
sleep 250
sendinput, {LShift up}
sleep 200000
tooltip, ready, A_ScreenWidth-300, 150
}
return
- SpikeVanHellsing
- Posts: 24
- Joined: 16 May 2017, 21:33
Re: Add a msgbox to an existing script
while this actually runs, the tooltip doesn't go away. i need something like what flyingDman posted for a tooltip and to be able to just insert the tooltip into which ever existing code i use. For examplehaichen wrote: ↑14 Jul 2020, 11:28Is this better?Code: Select all
#MaxThreadsPerHotkey 2 CoordMode, ToolTip, Screen F1:: Toggle := !Toggle loop { If not Toggle { tooltip, break, A_ScreenWidth-300, 150 break } tooltip, running, A_ScreenWidth-300, 150 sendinput, {LShift down} sleep 250 sendinput, {LShift up} sleep 200000 tooltip, ready, A_ScreenWidth-300, 150 } return
Code: Select all
F2::
{
toggle:=!toggle
if (toggle)
{
sendinput, {w down}
}
else
{
sendinput, {w up}
}
}
return
- SpikeVanHellsing
- Posts: 24
- Joined: 16 May 2017, 21:33
Re: Add a msgbox to an existing script
Wow 10 days without anything. Guess I'm asking for too much. If I understand that uh polvolo mace creater thing more I'd try to do it myself. Well, thank you everyone who's tried to help. I appreciate it.