tabnation

rid ahk security code

Sep 21st, 2026
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.24 KB | None | 0 0
  1.  
  2. ;enter time down to the second
  3.  
  4. f1::
  5. FormatTime, CurrentTime,, HH:mm:ss
  6.  
  7. InputBox, UserInput, Security Check, Enter the current time (HH:MM:SS):
  8.  
  9. if (UserInput = CurrentTime)
  10. MsgBox, Correct! Somehow you did it.
  11. else
  12. MsgBox, Incorrect.`nExpected: %CurrentTime%`nYou entered: %UserInput%
  13. return
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22. ; gui button moves when wrong
  23.  
  24. f2::
  25. #NoEnv
  26. #SingleInstance Force
  27. SetWorkingDir %A_ScriptDir%
  28.  
  29. Gui, Font, s10
  30. Gui, Add, Text, x20 y20, What is 7 + 5?
  31. Gui, Add, Edit, vAnswer x20 y50 w200
  32. Gui, Add, Button, vRunButton gCheckAnswer x20 y90 w100 h30, Submit
  33. Gui, Show, w400 h250, Extremely Secure System
  34. return
  35.  
  36.  
  37. CheckAnswer:
  38. Gui, Submit, NoHide
  39.  
  40. if (Answer = "12")
  41. {
  42. MsgBox, Correct! Security verification complete.
  43. ExitApp
  44. }
  45. else
  46. {
  47. ; Get random position inside the GUI
  48. Random, NewX, 20, 280
  49. Random, NewY, 120, 200
  50.  
  51. ; Move the button
  52. GuiControl, Move, RunButton, x%NewX% y%NewY%
  53.  
  54. ; Make the user suffer
  55. Random, Joke, 1, 4
  56.  
  57. if (Joke = 1)
  58. MsgBox, Wrong. The button has relocated.
  59. else if (Joke = 2)
  60. MsgBox, Incorrect. Try finding the button.
  61. else if (Joke = 3)
  62. MsgBox, Security level increased.
  63. else
  64. MsgBox, Nice try. I moved the button.
  65.  
  66. GuiControl, Focus, Answer
  67. }
  68. return
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78. ;Button gets progressively smaller
  79.  
  80. f3::
  81. #NoEnv
  82. #SingleInstance Force
  83. SetWorkingDir %A_ScriptDir%
  84.  
  85. Gui, Font, s10
  86. Gui, Add, Text, x20 y20, What is 7 + 5?
  87. Gui, Add, Edit, vAnswer x20 y50 w220 h25
  88. Gui, Add, Button, vSubmitButton gCheckAnswer1 x20 y90 w120 h35, Submit
  89. Gui, Show, w350 h180, Extremely Secure System
  90. return
  91.  
  92.  
  93. CheckAnswer1:
  94. Gui, Submit, NoHide
  95.  
  96. if (Answer = "12")
  97. {
  98. MsgBox, 64, Success, Correct!`n`nSecurity verification complete.
  99. ExitApp
  100. }
  101.  
  102. ; Count the failed attempts
  103. FailCount++
  104.  
  105. ; Make the button smaller
  106. NewWidth := 120 - (FailCount * 15)
  107. NewHeight := 35 - (FailCount * 4)
  108.  
  109. ; Don't let it become completely unusable
  110. if (NewWidth < 25)
  111. NewWidth := 25
  112.  
  113. if (NewHeight < 10)
  114. NewHeight := 10
  115.  
  116. ; Move it slightly as well
  117. Random, NewX, 20, 280
  118. Random, NewY, 90, 140
  119.  
  120. GuiControl, Move, SubmitButton, x%NewX% y%NewY% w%NewWidth% h%NewHeight%
  121.  
  122. ; Different message depending on how many times they've failed
  123. if (FailCount = 1)
  124. Message := "Wrong.`n`nThe button has been slightly reduced."
  125. else if (FailCount = 2)
  126. Message := "Still wrong.`n`nThe button is getting smaller."
  127. else if (FailCount = 3)
  128. Message := "Incorrect.`n`nYou are making the button nervous."
  129. else if (FailCount = 4)
  130. Message := "Wrong again.`n`nThe button is now approximately the size of a peanut."
  131. else if (FailCount = 5)
  132. Message := "Incorrect.`n`nGood luck clicking the button now."
  133. else
  134. Message := "Wrong.`n`nThe button continues to shrink."
  135.  
  136. MsgBox, 48, Security Failure, %Message%
  137.  
  138. GuiControl, Focus, Answer
  139. return
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147. ;Enter the number of windows currently open
  148.  
  149. f4::
  150. #NoEnv
  151. #SingleInstance Force
  152. SetWorkingDir %A_ScriptDir%
  153.  
  154. ; Count currently open windows
  155. WinGet, WindowCount, Count
  156.  
  157. Gui, Font, s10
  158. Gui, Add, Text, x20 y20 w320, Security Check
  159. Gui, Add, Text, x20 y50 w320, Enter the number of windows currently open:
  160. Gui, Add, Edit, vAnswer x20 y80 w200 h25
  161. Gui, Add, Button, gCheckAnswer2 x20 y120 w100 h30, Submit
  162.  
  163. Gui, Show, w370 h180, Extremely Secure System
  164. return
  165.  
  166.  
  167. CheckAnswer2:
  168. Gui, Submit, NoHide
  169.  
  170. if (Answer = WindowCount)
  171. {
  172. MsgBox, 64, Success, Correct!`n`nYou have successfully proven that you know how many windows you have open.
  173. ExitApp
  174. }
  175. else
  176. {
  177. MsgBox, 48, Incorrect, Wrong.`n`nYou entered: %Answer%`nActual count: %WindowCount%`n`nSecurity verification failed.
  178. }
  179. return
  180.  
  181.  
  182. ;Enter the number of pixels between two buttons
  183.  
  184.  
  185. f5::
  186. #NoEnv
  187. #SingleInstance Force
  188. SetWorkingDir %A_ScriptDir%
  189.  
  190. Gui, Font, s10
  191.  
  192. Gui, Add, Text, x20 y20 w400, EXTREMELY SECURE VERIFICATION
  193. Gui, Add, Text, x20 y50 w400, Enter the number of pixels between the two buttons:
  194.  
  195. Gui, Add, Button, vButtonOne x40 y100 w100 h35, BUTTON 1
  196. Gui, Add, Button, vButtonTwo x240 y100 w100 h35, BUTTON 2
  197.  
  198. Gui, Add, Edit, vAnswer x120 y155 w140 h25
  199. Gui, Add, Button, gCheckAnswer3 x160 y195 w100 h30, Submit
  200.  
  201. Gui, Show, w400 h250, Pixel Security System
  202.  
  203. ; Get Button 1 position
  204. GuiControlGet, ButtonOnePos, Pos, ButtonOne
  205.  
  206. ; Get Button 2 position
  207. GuiControlGet, ButtonTwoPos, Pos, ButtonTwo
  208.  
  209. ; Calculate right edge of Button 1
  210. ButtonOneRight := ButtonOnePosX + ButtonOnePosW
  211.  
  212. ; Calculate left edge of Button 2
  213. ButtonTwoLeft := ButtonTwoPosX
  214.  
  215. ; Calculate the gap
  216. CorrectAnswer := ButtonTwoLeft - ButtonOneRight
  217.  
  218. return
  219.  
  220.  
  221. CheckAnswer3:
  222. Gui, Submit, NoHide
  223.  
  224. if (Answer = CorrectAnswer)
  225. {
  226. MsgBox, 64, ACCESS GRANTED, Correct!`n`nThe buttons are exactly %CorrectAnswer% pixels apart.`n`nYou have successfully proven that you understand completely unnecessary mathematics.
  227. ExitApp
  228. }
  229. else
  230. {
  231. MsgBox, 48, ACCESS DENIED, Incorrect!`n`nYou entered: %Answer% pixels.`n`nThe correct answer is %CorrectAnswer% pixels.`n`nPerhaps you should physically measure the screen.
  232. }
  233. return
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244. ;Click the button when the clock reaches a specific second
  245.  
  246. f6::
  247. #NoEnv
  248. #SingleInstance Force
  249. SetWorkingDir %A_ScriptDir%
  250.  
  251. ; Pick a random target second
  252. Random, TargetSecond, 0, 59
  253.  
  254. Gui, Font, s10
  255. Gui, Add, Text, x20 y20 w360 Center, EXTREMELY SECURE VERIFICATION
  256. Gui, Add, Text, x20 y55 w360 Center, Click the button when the clock reaches:
  257. Gui, Add, Text, vTargetText x20 y85 w360 Center cRed, SECOND %TargetSecond%
  258.  
  259. Gui, Add, Text, vClockText x20 y120 w360 Center, Current second: 00
  260.  
  261. Gui, Add, Button, vClickButton gCheckClick x130 y165 w140 h40, CLICK ME
  262.  
  263. Gui, Show, w400 h240, Precision Security System
  264.  
  265. SetTimer, UpdateClock, 50
  266. return
  267.  
  268.  
  269. UpdateClock:
  270. FormatTime, CurrentSecond,, ss
  271.  
  272. GuiControl,, ClockText, Current second: %CurrentSecond%
  273. return
  274.  
  275.  
  276. CheckClick:
  277. FormatTime, ClickSecond,, ss
  278.  
  279. ClickSecond := ClickSecond + 0
  280.  
  281. if (ClickSecond = TargetSecond)
  282. {
  283. MsgBox, 64, ACCESS GRANTED, PERFECT!`n`nYou clicked at exactly second %TargetSecond%.`n`nYour ability to stare at a clock has been verified.
  284. ExitApp
  285. }
  286. else
  287. {
  288. Difference := ClickSecond - TargetSecond
  289.  
  290. if (Difference < 0)
  291. Difference := -Difference
  292.  
  293. MsgBox, 48, ACCESS DENIED, WRONG!`n`nTarget second: %TargetSecond%`nYou clicked at: %ClickSecond%`n`nYou were %Difference% second(s) off.`n`nPlease develop faster reflexes.
  294. }
  295. return
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304. ; The instructions change every 5 seconds.
  305.  
  306. f7::
  307. #NoEnv
  308. #SingleInstance Force
  309. SetWorkingDir %A_ScriptDir%
  310.  
  311. FailCount := 0
  312. InstructionNumber := 1
  313. TimeLeft := 5
  314.  
  315. Gui, Font, s10, Segoe UI
  316.  
  317. Gui, Add, Text, x20 y20 w400 h25 Center, EXTREMELY SECURE VERIFICATION
  318.  
  319. Gui, Add, Text, x20 y55 w400 h25 Center, CURRENT INSTRUCTION:
  320.  
  321. Gui, Add, Text, vInstructions x30 y90 w380 h45 Center, Click the button.
  322.  
  323. Gui, Add, Button, vActionButton gDoAction x145 y150 w150 h40, CLICK ME
  324.  
  325. Gui, Add, Text, vTimerText x20 y205 w400 h25 Center, Instructions change in 5 seconds...
  326.  
  327. Gui, Show, w440 h255, Extremely Secure System
  328.  
  329. SetTimer, ChangeInstructions, 5000
  330. SetTimer, UpdateTimer, 1000
  331.  
  332. return
  333.  
  334.  
  335. ChangeInstructions:
  336. Random, InstructionNumber, 1, 5
  337. TimeLeft := 5
  338.  
  339. if (InstructionNumber = 1)
  340. {
  341. NewInstruction := "Click the button."
  342. }
  343. else if (InstructionNumber = 2)
  344. {
  345. NewInstruction := "Do NOT click the button."
  346. }
  347. else if (InstructionNumber = 3)
  348. {
  349. NewInstruction := "Click the button twice."
  350. }
  351. else if (InstructionNumber = 4)
  352. {
  353. NewInstruction := "Click the button only once."
  354. }
  355. else
  356. {
  357. NewInstruction := "Click the button before the instructions change."
  358. }
  359.  
  360. GuiControl,, Instructions, %NewInstruction%
  361. return
  362.  
  363.  
  364. UpdateTimer:
  365. TimeLeft--
  366.  
  367. if (TimeLeft < 0)
  368. TimeLeft := 5
  369.  
  370. GuiControl,, TimerText, Instructions change in %TimeLeft% seconds...
  371. return
  372.  
  373.  
  374. DoAction:
  375.  
  376. if (InstructionNumber = 1)
  377. {
  378. MsgBox, 64, ACCESS GRANTED, Correct!`n`nYou followed the instructions.`n`nSecurity verification complete.
  379. ExitApp
  380. }
  381.  
  382. else if (InstructionNumber = 2)
  383. {
  384. MsgBox, 48, SECURITY FAILURE, You clicked it.`n`nThe instructions specifically said NOT to.`n`nExcellent work.
  385. }
  386.  
  387. else if (InstructionNumber = 3)
  388. {
  389. FailCount++
  390.  
  391. if (FailCount >= 2)
  392. {
  393. MsgBox, 64, ACCESS GRANTED, You clicked twice.`n`nSomehow, you survived the verification process.
  394. ExitApp
  395. }
  396. else
  397. {
  398. MsgBox, 48, SECURITY FAILURE, Thats one click.`n`nYou need to click it one more time.
  399. }
  400. }
  401.  
  402. else if (InstructionNumber = 4)
  403. {
  404. MsgBox, 64, ACCESS GRANTED, Correct!`n`nYou clicked exactly once.
  405. ExitApp
  406. }
  407.  
  408. else if (InstructionNumber = 5)
  409. {
  410. MsgBox, 64, ACCESS GRANTED, You clicked the button.`n`nVerification complete.
  411. ExitApp
  412. }
  413.  
  414. return
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426. ; Enter a random 8-digit number shown for exactly 0.75 seconds
  427.  
  428. f8::
  429. #NoEnv
  430. #SingleInstance Force
  431. SetWorkingDir %A_ScriptDir%
  432.  
  433. ; Generate a random 8-digit number
  434. Random, RandomNumber, 10000000, 99999999
  435.  
  436. Gui, Font, s10, Segoe UI
  437. Gui, Add, Text, x20 y20 w400 h25 Center, EXTREMELY SECURE VERIFICATION
  438.  
  439. Gui, Add, Text, x20 y60 w400 h25 Center, Memorize this number:
  440.  
  441. Gui, Add, Text, vNumberText x20 y95 w400 h45 Center, %RandomNumber%
  442.  
  443. Gui, Add, Edit, vAnswer x110 y155 w220 h30
  444.  
  445. Gui, Add, Button, gCheckAnswer5 x155 y200 w130 h40, SUBMIT
  446.  
  447. Gui, Add, Text, vStatusText x20 y250 w400 h25 Center, Number will disappear in 0.75 seconds...
  448.  
  449. Gui, Show, w440 h290, Extremely Secure System
  450.  
  451. ; Wait exactly 750 milliseconds
  452. SetTimer, HideNumber, -3000
  453.  
  454. return
  455.  
  456.  
  457. HideNumber:
  458. GuiControl,, NumberText, ????????
  459. GuiControl,, StatusText, The number is gone. Good luck.
  460. return
  461.  
  462.  
  463. CheckAnswer5:
  464. Gui, Submit, NoHide
  465.  
  466. if (Answer = RandomNumber)
  467. {
  468. MsgBox, 64, ACCESS GRANTED, Correct!`n`nYou successfully memorized an 8-digit number in 0.75 seconds.`n`nYour brain has been verified.
  469. ExitApp
  470. }
  471. else
  472. {
  473. MsgBox, 48, ACCESS DENIED, Incorrect.`n`nYou entered: %Answer%`n`nThe correct number was: %RandomNumber%`n`nPerhaps 750 milliseconds was excessive.
  474. }
  475. return
  476.  
  477.  
  478. GuiClose:
  479. ExitApp
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489. ; You have to click "I Agree" three times, but it moves each time.
  490.  
  491.  
  492. f9::
  493. #NoEnv
  494. #SingleInstance Force
  495. SetWorkingDir %A_ScriptDir%
  496.  
  497. ClickCount := 0
  498.  
  499. Gui, Font, s10, Segoe UI
  500.  
  501. Gui, Add, Text, x20 y20 w420 h25 Center, EXTREMELY SECURE AGREEMENT
  502.  
  503. Gui, Add, Text, x20 y55 w420 h40 Center, You must click "I Agree" three times.
  504. Gui, Add, Text, x20 y95 w420 h25 Center, The button may or may not remain where you expect.
  505.  
  506. Gui, Add, Text, vCountText x20 y135 w420 h25 Center, Agreements completed: 0 / 3
  507.  
  508. Gui, Add, Button, vAgreeButton gAgree x160 y180 w140 h40, I AGREE
  509.  
  510. Gui, Show, w460 h250, Extremely Secure System
  511.  
  512. return
  513.  
  514.  
  515. Agree:
  516. ClickCount++
  517.  
  518. if (ClickCount >= 3)
  519. {
  520. MsgBox, 64, ACCESS GRANTED, You clicked "I Agree" three times.`n`nYou are now officially extremely secure.`n`nThank you for agreeing to absolutely nothing.
  521. ExitApp
  522. }
  523.  
  524. GuiControl,, CountText, Agreements completed: %ClickCount% / 3
  525.  
  526. ; Pick a new random location
  527. Random, NewX, 30, 310
  528. Random, NewY, 175, 195
  529.  
  530. GuiControl, Move, AgreeButton, x%NewX% y%NewY%
  531.  
  532. if (ClickCount = 1)
  533. {
  534. MsgBox, 48, AGREEMENT REQUIRED, Thank you for agreeing.`n`nPlease agree again.
  535. }
  536. else if (ClickCount = 2)
  537. {
  538. MsgBox, 48, ALMOST THERE, One more agreement required.`n`nThe button has moved because security.
  539. }
  540.  
  541. return
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552. ; After submitting, it asks you to confirm your answer — then asks you to confirm the confirmation
  553.  
  554. f10::
  555. #NoEnv
  556. #SingleInstance Force
  557. SetWorkingDir %A_ScriptDir%
  558.  
  559. Gui, Font, s10, Segoe UI
  560.  
  561. Gui, Add, Text, x20 y20 w420 h25 Center, EXTREMELY SECURE VERIFICATION
  562.  
  563. Gui, Add, Text, x20 y55 w420 h25 Center, What is 7 + 5?
  564.  
  565. Gui, Add, Edit, vAnswer x160 y100 w120 h30
  566.  
  567. Gui, Add, Button, gSubmitAnswer x160 y155 w120 h40, SUBMIT
  568.  
  569. Gui, Show, w460 h230, Extremely Secure System
  570.  
  571. return
  572.  
  573.  
  574. SubmitAnswer:
  575.  
  576. Gui, Submit, NoHide
  577.  
  578. ; First confirmation
  579. MsgBox, 36, CONFIRM YOUR ANSWER, You entered:`n`n%Answer%`n`nAre you absolutely sure this is your answer?
  580.  
  581. IfMsgBox, No
  582. {
  583. MsgBox, 48, CANCELLED, Your answer has not been accepted.`n`nPlease reconsider your life choices.
  584. return
  585. }
  586.  
  587. ; Second confirmation
  588. MsgBox, 36, CONFIRM YOUR CONFIRMATION, You confirmed that "%Answer%" is your answer.`n`nDo you confirm that you just confirmed your answer?
  589.  
  590. IfMsgBox, No
  591. {
  592. MsgBox, 48, CONFIRMATION CANCELLED, Your confirmation has been cancelled.`n`nNothing has been accomplished.
  593. return
  594. }
  595.  
  596. ; Third level of unnecessary bureaucracy
  597. MsgBox, 36, FINAL CONFIRMATION, You have confirmed your confirmation.`n`nAre you REALLY, REALLY sure you confirmed your confirmation?
  598.  
  599. IfMsgBox, No
  600. {
  601. MsgBox, 48, SECURITY FAILURE, The confirmation of your confirmation was not confirmed.`n`nPlease start over.
  602. return
  603. }
  604.  
  605. ; Finally check the answer
  606. if (Answer = "12")
  607. {
  608. MsgBox, 64, ACCESS GRANTED, Correct!`n`nYour answer was confirmed.`nYour confirmation was confirmed.`nYour confirmation of the confirmation was confirmed.`n`nSecurity verification complete.
  609. ExitApp
  610. }
  611. else
  612. {
  613. MsgBox, 48, ACCESS DENIED, Unfortunately, after all of that...`n`nyour answer was wrong.`n`nCorrect answer: 12`nYour answer: %Answer%
  614. }
  615.  
  616. return
  617.  
  618.  
  619.  
  620. esc::exitapp
Advertisement
Add Comment
Please, Sign In to add comment