gnamp

Small Basic 'Time is Money' Clock

Aug 10th, 2012
500
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Money Clock ~~ Dominic McGough 2001 & 2012
  2. 'Time is Money
  3. TextWindow.WriteLine ("About how much do you make per hour? (net)")
  4. TextWindow.Write ("Input eg. 7.50 : ")
  5. wage = TextWindow.Read() * 100
  6. TextWindow.WriteLine ("The clock should appear in a new window")
  7.  
  8. GraphicsWindow.Width = 230
  9. GraphicsWindow.Height = 100
  10. GraphicsWindow.Left = (Desktop.Width / 2) - (GraphicsWindow.Width / 2)
  11. GraphicsWindow.Top = (Desktop.Height / 2) - (GraphicsWindow.Height / 2)
  12. GraphicsWindow.CanResize = "False"
  13. GraphicsWindow.Title = "Dominic's Money Clock"
  14. GraphicsWindow.BackgroundColor = "Black"
  15. GraphicsWindow.BrushColor = "dark Gray"
  16. GraphicsWindow.FontName = "Courier New"
  17.  
  18. 'starting amount
  19. pounds = 0
  20. pence = 0
  21.  
  22.  
  23. moneypersec = (wage / 60 )/ 60
  24.  
  25. StartTime = Clock.Time
  26. StartDate = Clock.Date
  27.  
  28. Timer.Interval = 1000
  29. Timer.Tick = OnTick
  30.  
  31. Sub OnTick
  32.   pence = pence + moneypersec  
  33.   If pence > 99 Then
  34.     pounds = pounds + 1
  35.     pence = 0
  36.     EndIf
  37.     GraphicsWindow.Clear()
  38.   GraphicsWindow.FontSize = 11
  39.   GraphicsWindow.BrushColor = "cornflowerblue"
  40.   GraphicsWindow.DrawText(0,0, " Since starting the money clock at ")
  41.   GraphicsWindow.DrawText(0,13, " " + StartTime + " on " + StartDate)
  42.   GraphicsWindow.DrawText(0,26, " you've made: ")
  43.   GraphicsWindow.BrushColor = "Green"
  44.   GraphicsWindow.FontSize = 42
  45.   If pence < 9 Then
  46.     GraphicsWindow.DrawText(0,42, " £" + pounds + ".0" + Math.Round(pence))
  47.     Else
  48.       GraphicsWindow.DrawText(0,42, " £" + pounds + "." + Math.Round(pence))
  49.     EndIf
  50.     GraphicsWindow.BrushColor = "darksalmon"
  51.     GraphicsWindow.FontSize = 7
  52.     GraphicsWindow.DrawText(0,95, "              Dominic McGough 2001 & 2012")
  53.   EndSub
Add Comment
Please, Sign In to add comment