HSPポータル
サイトマップ お問い合わせ


HSPTV!掲示板


未解決 解決 停止 削除要請

2014
0112
いか三回繰り返す1未解決


いか

リンク

2014/1/12(Sun) 02:35:26|NO.59303

#include "winmm.as"

randomize

screen 1, ginfo_dispx, ginfo_dispy, 4, 0, 0
onclick gosub *clickeda

timeGetTime
a = stat
b = 2 * 1000

z = 100

x0 = rnd(ginfo_dispx - z)
y0 = rnd(ginfo_dispy - z)
x1 = x0 + z
y1 = y0 + z

color rnd(256), rnd(256), rnd(256)
boxf x0, y0, x1, y1

mouse ginfo_dispx/2, ginfo_dispy/2
repeat
await
loop

*clickeda
onclick 0
if (x0<mousex) and (mousex<x1) and (y0<mousey) and (mousey<y1) {

cls
mouse ginfo_dispx/2, ginfo_dispy/2
timeGetTime
c = stat - a

pos 0, 0
mes c
await b

x0 = rnd(ginfo_dispx - z)
y0 = rnd(ginfo_dispy - z)
x1 = x0 + z
y1 = y0 + z

color rnd(256), rnd(256), rnd(256)
boxf x0, y0, x1, y1

timeGetTime
a = stat
}

onclick 1
return
このクリックしたら箱が消えて時間が表示されるのを3回繰り返したらやめるにはどこに repeat loop end をいれたらいいでしょうか。
お願いします。



この記事に返信する


紅蓮

リンク

2014/1/12(Sun) 06:54:00|NO.59304

こういうことでしょうか?

#include "winmm.as" counter=0 randomize screen 1, ginfo_dispx, ginfo_dispy, 4, 0, 0 onclick gosub *clickeda timeGetTime a = stat b = 2 * 1000 z = 100 x0 = rnd(ginfo_dispx - z) y0 = rnd(ginfo_dispy - z) x1 = x0 + z y1 = y0 + z color rnd(256), rnd(256), rnd(256) boxf x0, y0, x1, y1 mouse ginfo_dispx/2, ginfo_dispy/2 repeat await loop *clickeda onclick 0 if (x0<mousex) and (mousex<x1) and (y0<mousey) and (mousey<y1) { cls mouse ginfo_dispx/2, ginfo_dispy/2 timeGetTime c = stat - a counter=counter+1 pos 0, 0 mes c if counter=3 : dialog "3回押しました" : ;end await b x0 = rnd(ginfo_dispx - z) y0 = rnd(ginfo_dispy - z) x1 = x0 + z y1 = y0 + z color rnd(256), rnd(256), rnd(256) boxf x0, y0, x1, y1 timeGetTime a = stat } onclick 1 return



ONION software Copyright 1997-2023(c) All rights reserved.