Advertisement
pastamaker

password

Jun 18th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; #Warn  ; Enable warnings to assist with detecting common errors.
  2. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  3. SetWorkingDir %A_ScriptDir%\png ; easy way to find images
  4.  
  5.  
  6. #SingleInstance,force
  7. SetBatchLines,-1
  8. #Include,<hellbents_gdip>
  9. popUp:=Layered_Window_SetUp(4,200,400,A_ScreenWidth,A_ScreenHeight,1,"+alwaysontop")
  10.  
  11. s:=20
  12. n:=5
  13.  
  14. map := Gdip_CreateBitmap(3*s*n + s, 4*s)                    
  15. g := Gdip_GraphicsFromImage(map)
  16. gdip_GetImageDimensions(map,  w,  h)
  17. fill_boxx(g,"9279B4",0,0,w,h)
  18. map0:=Gdip_CloneBitmapArea(map,0,0,w,h)
  19. ;~ map0:=map
  20. ;~ map := Gdip_CreateBitmap(3*s*n + s, 4*s)                    
  21. ;~ g := Gdip_GraphicsFromImage(map)
  22.  
  23. x:=s
  24. y:=s
  25. maps:=[]
  26. maps[0]:=map0
  27. loop % n {
  28.     fill_boxx(g,"0ff0fa",x,y,2*s,2*s)
  29.     mapt := Gdip_CreateBitmap(3*s*n + s, 4*s)                    
  30.     gt := Gdip_GraphicsFromImage(mapt)
  31.     Gdip_DrawImage(gt, map, 0, 0 ,w,h)
  32.     maps[A_Index]:=mapt
  33.     x+=3*s
  34. }
  35.  
  36.  
  37. myPassword=% makeItUp(n,keys)
  38. UpdateLayeredWindow(popUp.hwnd, popUp.hdc, popUp.x, popUp.y, popUp.w, popUp.h)
  39. t:=0
  40. deadline:= 80000
  41. slept:=25
  42. gosub start
  43.  loop % deadline//slept {
  44.     Sleep slept
  45.     if(getkeystate(keys[t+1]))
  46.         t++
  47.     Gdip_GraphicsClear(popUp.g)
  48.     Gdip_DrawImage(popup.g, map0, 0, 0 ,w,h)
  49.     Gdip_DrawImage(popup.g, maps[t], 0, 0 ,w,h)
  50.     pass:=mod(A_Index,15)
  51.     (pass > 5 )?(Gdip_DrawImage(popup.g, maps[5], 0, 0 ,w,h))0
  52.  
  53.     Gdip_TextToGraphics(popup.g, mypassword,"x20 y0 s50 cffff0000 ", "Segoe Print")
  54.     UpdateLayeredWindow(popUp.hwnd, popUp.hdc)
  55.     if(t=5){
  56.         SoundBeep
  57.         goto win
  58.     }
  59. }
  60. gosub lose
  61. return
  62. makeItUp(n,byref keys){
  63.     it=
  64.     keys:=[]
  65.     loop % n {
  66.         random,nextdigit,0,9
  67.         it.=nextdigit " "
  68.         keys.insert(nextdigit)
  69.     }
  70.     return it
  71. }
  72. lose:
  73. Gdip_GraphicsClear(popUp.g)
  74. Gdip_DrawImage(popup.g, maps[0], 0, 0 ,w,h)
  75. Gdip_TextToGraphics(popup.g, "YOU LOSE!","x0 y0 s50 cffff0000 ", "Segoe Print")
  76. UpdateLayeredWindow(popUp.hwnd, popUp.hdc)
  77. return
  78. win:
  79. Gdip_GraphicsClear(popUp.g)
  80. Gdip_DrawImage(popup.g, maps[0], 0, 0 ,w,h)
  81. Gdip_TextToGraphics(popup.g, "YOU WIN!","x0 y0 s50 cff000000 ", "Segoe Print")
  82. UpdateLayeredWindow(popUp.hwnd, popUp.hdc)
  83. return
  84. start:
  85. Sleep 250
  86. Gdip_GraphicsClear(popUp.g)
  87. Gdip_DrawImage(popup.g, maps[0], 0, 0 ,w,h)
  88. Gdip_TextToGraphics(popup.g, "'bout to start","x0 y0 s35 cffff0000 ", "Segoe Print")
  89. UpdateLayeredWindow(popUp.hwnd, popUp.hdc)
  90. Sleep 750
  91. return
  92. r::Reload
  93. 1::
  94. return
  95. 2::
  96. return
  97. 3::
  98. return
  99. 4::
  100. return
  101. 5::
  102. return
  103. 6::
  104. return
  105. 7::
  106. return
  107. 8::
  108. return
  109. 9::
  110. return
  111. 0::
  112. return
  113.  
  114.  
  115.  
  116. x::
  117. Layered_Window_ShutDown(popUp)
  118. ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement