d3ullist

ChangeDate

Jul 13th, 2021 (edited)
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;https://github.com/jNizM/ahk_notepad-plus-plus
  2. ;Hotkeys https://autohotkey.com/docs/Hotkeys.htm
  3. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  4. ; #Warn  ; Enable warnings to assist with detecting common errors.
  5. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  6. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  7. #MaxThreadsPerHotkey 13
  8. #SingleInstance
  9.  
  10. ; full screen, steam play: 425 415
  11. ; play green, steam play: 0x36c343 (54 15 67)
  12.  
  13. +F2::
  14.     loop {
  15.         if CheckForColor(425, 415, 0x511E25)
  16.             Break
  17.         sleep 1000
  18.     }
  19.  
  20.     SetDateOneAhead()
  21.    
  22.     ; Click steam start game button
  23.     ClickAtPos(425, 415)
  24.    
  25.     timePassed := timePassed + 1
  26.    
  27.     loop {
  28.         if CheckForColor(425, 415, 0x2E84BB)
  29.             Break
  30.         if timePassed > 10000
  31.             Break
  32.         sleep 1000
  33.         timePassed += 1000
  34.     }
  35.    
  36.     ; Click steam start game button
  37.     ClickAtPos(1435, 218)
  38.    
  39.     sleep 1000
  40.    
  41. return
  42.  
  43. ^!d::run %comspec% /c date %realdate%
  44.  
  45. #IfWinNotActive, ahk_class HwndWrapper[DefaultDomain;;1faeaa34-0adc-4b9b-857c-3df627eee751]
  46. F12::Reload
  47.  
  48. +F1::ListHotkeys
  49.  
  50. SetDateOneAhead()
  51. {
  52.     realdate := %A_MM%-%A_DD%-%A_YYYY%
  53.     realdate += 1, Days
  54.     FormatTime, nDate, %realdate%, MM-dd-yyyy
  55.     run %comspec% /c date %nDate%
  56. }
  57.  
  58. CheckForColor(x, y, color)
  59. {
  60.     PixelGetColor, OutputVar, 891, 864,
  61.     ; MouseMove, x, y,
  62.     WriteLine(OutputVar)
  63.     return OutputVar = color
  64. }
  65.  
  66. WriteLine(message:="", timeout:=3)
  67. {
  68.     if (message != "")
  69.     {
  70.         ; https://autohotkey.com/docs/commands/Progress.htm
  71.         Progress, B2 ZH-1 FS12, %message%
  72.         SetTimer, TimeoutTimer, % -timeout*1000
  73.     }
  74. }
  75.  
  76. ClickAtPos(x := 0, y := 0, delay := 10)
  77. {
  78.     ; MouseMove, x, y
  79.     sleep delay
  80.     ControlClick, x y, HwndWrapper[BlueStacks.exe;;3bc1fb9d-73e0-4e3d-a17f-3c915ee9ba61],,,, Pos
  81.     Click
  82. }
  83.  
  84. TimeoutTimer:
  85.     Progress, Off
  86. Return
Add Comment
Please, Sign In to add comment