do When

Propose new features and changes
SSpeed
Posts: 22
Joined: 04 Jul 2018, 09:48

do When

26 Jul 2019, 15:53

do when

the When command

Code: Select all

when the_game_is_closed(), 24000
	exitapp
Faster, easier, more elegant than setting timers.

Code: Select all

when a_raider_is_detected()
{	fire_a_warning_shot()
	notify_the_user()
	cooldown when not a_raider_is_detected()
}
(the above code is equivalent to the code below)


and finally, le coup de grace.

Code: Select all

while internet_browser.active, 10000
when (flash_player.active and site="YouTube"), 2000
{	adjust_settings_macro()
	cooldown when not (flash_player.active and site="YouTube")
}
(which is equivalent to)
.
Glad to share :)



Is it to be implemented?
perhaps Cooldown should be simpler, like making it function without a need for parameters?
edit: on second thought, I think cooldown should be implicit.
User avatar
nnnik
Posts: 4283
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: do When

28 Jul 2019, 04:40

It could be implemented.
I also think that a syntax that handles events (or can be used to create value polling more easily).
Nonetheless the design you provided is probably very clunky and limited.
The second parameter seems very strange and we might be better off putting it into a function which could provide a simple polling mechanism.

There are also a lot of things that are not clear from this example.
Recommends AHK Studio
User avatar
Delta Pythagorean
Posts: 483
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Somewhere in the US

Re: do When

08 Sep 2019, 04:23

Wouldn't this count as both an OnMessage and an #If?
SSpeed
Posts: 22
Joined: 04 Jul 2018, 09:48

Re: do When

14 Sep 2019, 17:42

Code: Select all

When WinActive(game.window) {
	Run(game.script)
	When !WinActive(game.window)
		WinClose(game.script)
}

Code: Select all

When WinExist(chrome.window) {
	Msgbox you've opened chrome
	When !WinExist(chrome.window)
		Msgbox you've closed chrome
}
I think I like this version more than the OP.

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 17 guests