severen1999

Waifu Roll Timer

Mar 6th, 2021
1,187
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;~ #RequireAdmin
  2. #include <GUIConstantsEx.au3>;required external constants file
  3. #include <MsgBoxConstants.au3>;required external constants file
  4. Global $60Count = 0, $begin = TimerInit(), $Minutes = 0
  5.  
  6. If IsAdmin() Then ;if program is running as admin (windows 10 requires this)
  7.     Global $admin = 1 ;set variable to 1 representing true
  8.     _gettime() ; begin loop
  9. Else
  10.     Global $admin = 0
  11.     MsgBox("", "", "Don't Have Admin Rights.  Rerun with as admin to continue.") ;warn user that program isn't running as admin
  12.     Exit ;quit program
  13. EndIf
  14.  
  15. Func _gettime() ;Get user input regarding minutes to wait until rolls
  16.     $Minutes = InputBox("", "Timer", "Wait for ? minutes") ;ask user for minutes to wait
  17.     _starttimer() ;go to _starttimer function
  18. EndFunc   ;==>_gettime
  19.  
  20. Func _starttimer() ;function calculates time in seconds that's passed since user input
  21.     While $Minutes > $60Count ;do until passed minutes is greater than time input
  22.         $dif = TimerDiff($begin)
  23.         $dif2 = StringLeft($dif, StringInStr($dif, ".") - 1)
  24.         $Count = Int($dif / 1000)
  25.         $60Count = Int($Count / 60)
  26.         Sleep(20) ;pause for 20 ms
  27.     WEnd
  28.     $dif = 0
  29.     $dif2 = 0
  30.     $Count = 0
  31.     $60Count = 0
  32.     ;Show PopUp box to user letting them know the timer has ended
  33.     MsgBox(BitOR($MB_ICONINFORMATION, $MB_SETFOREGROUND, $MB_DEFAULT_DESKTOP_ONLY, $MB_TOPMOST), "HEY!!!", "It's Time To ROLL", "")
  34.     Sleep(1000) ;sleep for 10 seconds until restarting
  35.  
  36.     $msgBox = MsgBox(327684, "", "Continue?") ;Yes/No popup asking to continue? If No pressed then exit, else then restart
  37.     If $msgBox = 6 Then ;if Yes pressed
  38.         $Minutes = 0
  39.         $begin = TimerInit()
  40.         _gettime()
  41.     Else ;if No pressed
  42.         Exit ;quit program
  43.     EndIf
  44. EndFunc   ;==>_starttimer
  45.  
RAW Paste Data