Extremely irritating MsgBox (bored ...)

Post your working scripts, libraries and tools for AHK v1.1 and older
burque505
Posts: 1736
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 1557 times
User avatar
TheDewd
Posts: 1510
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++
}
geek
Posts: 1052
Joined: 02 Oct 2013, 22:13
Location: GeekDude
Contact:

Re: Extremely irritating MsgBox (bored ...)

09 Jul 2018, 14:11

TheDewd wrote:

Code: Select all

code
;)

Code: Select all

Loop {
	L:=Chr(65+Mod(A_Index-1,26))
	MsgBox,% *&L&1?48:524320,% *&L-64,% L,0.25
	IfMsgBox, OK
		return
}
User avatar
TheDewd
Posts: 1510
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.
geek
Posts: 1052
Joined: 02 Oct 2013, 22:13
Location: GeekDude
Contact:

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: 1736
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 (v1)”

Who is online

Users browsing this forum: Theda and 160 guests