  title Armageddon
  dialog CREATE,Armageddon,-1,0,150,50
  dialog ADD,STYLE,STYLE1,Verdana,24,BC,BACKGROUND,FOREGROUND
  dialog ADD,TEXT,Time,6,2,,,00:00,STYLE1
  dialog ADD,BUTTON,Set,4,112,34,20,Set
  dialog ADD,BUTTON,About,28,112,34,20,About
  dialog SHOW
:Timer
  %t = @datetime(hh:nn)
  dialog set,time,%T
  if @equal(%T,%A)
    goto counter
    info %X
    %a =
  end 

:Evloop
  wait event,2
  goto @event()

:SetBUTTON
  %k = 10
  %a = @input('Set time of Armageddon - HH:MM')
  goto evloop

:AboutBUTTON
  info Author: Dagur Páll Ammendrup 2001@cr()E-mail: dagurp"@"strik.is@cr()---------------------------------------------------------------------------------------------@cr()Instructions:@cr()1. Click "Set" to select the time you want to shut the system down.@cr()2. When that time comes a countdown starts and when that time@cr() is up the system shuts down. You can cancel at any time.
  goto evloop

:counter
  dialog CREATE,Shut down computer,-1,0,148,95
  dialog ADD,STYLE,STYLE2,Verdana,16,BC,BACKGROUND,FOREGROUND
  dialog ADD,STYLE,STYLE1,Arial,10,BC,BACKGROUND,FOREGROUND
  dialog ADD,TEXT,Texti,2,24,,,Armageddon in:,Style1
  dialog ADD,TEXT,seconds,50,42,,,seconds.,Style1
  dialog ADD,TEXT,TEXT1,24,60,,,10,style2
  dialog ADD,BUTTON,Cancel,70,20,104,18,Cancel
  dialog SHOW
  goto newloop

:newloop
  %k = @pred(%K)
  dialog set,text1,%K
  wait event,1
  if @equal(@event(),CancelButton)
    exit 
  end 
  if @equal(%K,0)
    exitwin 
  end 
  goto newloop

:Close
  exit 
