I would like to know how to change an images position every time a messagebox appears, and presses ok. Apparently this isn't working. Any reason why? Thanks.
#SingleInstance Force
image=image.png
Random, rand, 1, 10000
Loop
{
sleep, rand
MsgBox, 48, Test, Test
IfMsgBox, Ok
SplashImage, %image%, B x%rand% y%rand%
}
esc::ExitApp
Splash Image Problem
-
- Posts: 4
- Joined: 15 Jun 2017, 11:15
Re: Splash Image Problem
The Random command is outside of the Loop, which means that it is only executed once. It must be inside the Loop so that it executes with every iteration and produces new results.
Code: Select all
#SingleInstance, Force
Image := "test.png"
Loop {
Random, Rand, 1, 10000
Sleep, % Rand
MsgBox, 48, Test, Test
IfMsgBox, OK
SplashImage, % Image, % "B x" Rand " y" Rand
}
Esc::
ExitApp
return
Who is online
Users browsing this forum: -Elaphe-, downstairs, Google [Bot], sebalotek and 189 guests