Extremely irritating MsgBox (bored ...)

Post your working scripts, libraries and tools
burque505
Posts: 694
Joined: 22 Jan 2017, 19:37

Extremely irritating MsgBox (bored ...)

07 Jul 2018, 10:54

Idle hands, et cetera :twisted:

Code: Select all

#Persistent
SetBatchLines, -1
SetKeyDelay, -1

count := 0

Loop
{  
   IfMsgBox, OK
      break
   msgbox, 524320, Stop, Stop!, 1
   IfMsgBox, OK
      break
   If (count == 5){
   msgbox, 48, Stop, Stop!`r`nNo`, really`, stop!, 3
   count := 0
   IfMsgBox, OK
      break
   }
   Else {
   msgbox, 48, Stop, Stop!, 1
   IfMsgBox, OK
      break
   }
   count++
}

ExitApp

Escape::ExitApp
stop.gif
stop.gif (51.14 KiB) Viewed 368 times
User avatar
TheDewd
Posts: 1137
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Extremely irritating MsgBox (bored ...)

09 Jul 2018, 11:40

Code: Select all

LC := 1

Loop {
	LC := (LC > 26 ? 1 : LC)
	L := Chr(64 + LC)
	I := (Mod(LC, 2) ? 48 : 524320)
	MsgBox, % I, % LC, % L, 1
	IfMsgBox, OK
		return
	LC++
}
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.
User avatar
TheDewd
Posts: 1137
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Extremely irritating MsgBox (bored ...)

09 Jul 2018, 14:37

GeekDude wrote:MsgBox,% *&L&1?48:524320,% *&L-64,% L,0.25
Will you explain this to me? It appears to be ternary still, but I haven't seen it written like that.
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.
GeekDude
Posts: 847
Joined: 02 Oct 2013, 22:13

Re: Extremely irritating MsgBox (bored ...)

09 Jul 2018, 14:45

*&L gets the address of variable L using & then the value of the byte at that address (which is the character code) using *.

So, replacing that with Asc(L) for clarity, Asc(L) & 1 is checking whether the last binary digit is 1 or 0. Even numbers end in binary 0 while odd numbers end in binary 1. It's similar to your Mod(LC, 2) check.

Then the next parameter *&L-64 is just more of the same. Get the character code of L and subtract 64.
burque505
Posts: 694
Joined: 22 Jan 2017, 19:37

Re: Extremely irritating MsgBox (bored ...)

09 Jul 2018, 14:54

Very nice, guys :bravo:

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 31 guests