rendered paste bodymenu * {
-
Raad het getal! V1.2:/dialog -dm rg rg
-
}
dialog rg {
size -1 -1 100 100
title "Raad t getal! V1.2"
option dbu
button "Start" 1, 40 5 20 10, center
button "help" 9, 70 5 20 10, center
edit "lower..." 2, 5 20 40 10, disable
edit "higher..." 3, 55 20 40 10, disable
edit "" 4, 34 32 32 10, disable
button "try" 5, 40 45 20 10, disable center
text "-" 6, 45 20 10 10, center
text "turns:" 7, 10 60 80 10, center
edit "" 8, 30 70 40 10, center disable
radio "easy" 14, 5 2 20 8
radio "hard" 15, 5 10 20 8
}
dialog rgh {
size 615 296 100 40
title "help"
option dbu
text %lol, 1, 5 5 90 25, center
button "next" 2, 25 30 50 10
}
on *:dialog:rg:sclick:*:{
if ($did == 1) { /did -e rg 5
/did -e rg 4
/did -b rg 1
/did -ra rg 2 0000
if (%rghelp == on) { /set %rg3 on }
/did -ra rg 3 $iif($did(15).state == 1,10000,1000)
/set %lownum 1
/set %highnum $iif($did(15).state == 1,9999,999)
/set %ansnum $rand(1,$iif($did(15).state == 1,9999,999))
)
}
if ($did == 5) && ($did(4) isnum) && ($did(4) <= %highnum) && ($did(4) >= %lownum) {
inc %turns
if (%rghelp == on) { /set %rg5 on }
/did -ra rg 8 %turns
if ($did(4) < %ansnum) { /did -ra rg 2 $did(4) | /set %lownum $did(4) }
if ($did(4) > %ansnum) { /did -ra rg 3 $did(4) | /set %highnum $did(4) }
if ($did(4) == %ansnum) {
/inc %wontime
/echo -a 4Congratulations 5-4 %ansnum was the right number5 - 4U have won this7 %wontime 4times already!
/did -b rg 4
/did -e rg 1
/did -b rg 5
/unset %turns
}
}
if ($did == 9) { /set %lol First, choose the easy/hard mode
/dialog -dm rgh rgh
/set %rghelp on
set %trg 1 }
}
on *:dialog:rgh:sclick:2:{
if (%trg == 1) { /set %lol Then, Push the "Start" button
/dialog -x rgh
/dialog -dm rgh rgh
inc %trg
halt }
if (%trg == 2) && (%rg3 == on) { /set %lol Then, type a number that is between $did(rg,2) and $did(rg,3)
/dialog -x rgh
/dialog -dm rgh rgh
inc %trg
halt }
if (%trg == 3) { /set %lol Then, push the "try" button
/dialog -x rgh
/dialog -dm rgh rgh
inc %trg
halt }
if (%trg == 4) && (%rg5 == on) { /set %lol Now, type again a number, but now between $did(rg,2) and $did(rg,3)
/dialog -x rgh
/dialog -dm rgh rgh
inc %trg
halt }
if (%trg == 5) { /set %lol Again push the try button, do this and stop if u got the number it was.
/dialog -x rgh
/dialog -dm rgh rgh
inc %trg
unset %lol
unset %rg3
unset %rg5
unset %rghelp
}
if (%trg == 6) { /unset %rghelp | /unset %trg | /dialog -x rgh }
}
on *:dialog:rg:init:0:{ did -c $dname 14 }