All pastes #510665 Raw Edit

Mine

public text v1 · immutable
·published 2007-05-26 00:11 UTC
rendered paste body
alias game { dialog -m Game Game }
dialog -l game {
  title "Kewl game!"
  size -1 -1 52 40
  option dbu
  button "Start!", 1, 16 13 20 13
  text "", 2, 13 30 25 8, center
}
on *:DIALOG:game:sclick:1:{
  if ($did(1) == Start!) {
    .timergame.time 9 1 game.update.time
    .timergame.end 1 10 end.game
    did -o game 1 1 Click!
    did -o game 2 1 0:10
    set %game.secs 10
    set %game.count 0
  }
  elseif ($did(1) == Click!) inc %game.count
  else {
    unset %game.*
    did -o game 1 1 Start!
    did -r game 2
  }
}
on *:DIALOG:game:close:*:{
  unset %game.*
  .timergame.* off
}
alias game.update.time {
  did -o game 2 1 $+(0:0,$calc(%game.secs -1))
  dec %game.secs
}
alias end.game {
  did -o game 2 1 %game.count $iif(%game.count == 1,click!,clicks!)
  did -o game 1 1 Reset
  did -b game 1
  .timergame.enable 1 3 did -e game 1
}