관리 메뉴

ㄴrㅎnㅂrㄹrㄱi

Captcha (GUI) - 입력코드 확인 본문

AUTOHOTKEY/스크립트

Captcha (GUI) - 입력코드 확인

님투 2007. 12. 22. 18:24
반응형
오토핫키로  만든 자동등록 확인하기

사용자 삽입 이미지


  1. ; Captcha example by Titan
  2.  
  3. Gui, Add, Text, x10 y10 w75, Enter the code:
  4. Pass := Captcha(90, 10)
  5. Gui, Add, Edit, vInput x90 y50 w50
  6. Gui, Add, Button, gGo default x145 y50 h20, Enter
  7. Gui, Show, , Captcha
  8.  
  9. Go:
  10. If Input != % Pass
  11.   MsgBox, 16, Error, You didnt enter the code correctly!`n`nThe code was: %Pass%
  12.   MsgBox, 64, Cool, done!`n`nThe code was: %Pass%
  13.  
  14. ~* Esc::
  15.  
  16. Captcha(x, y, len=6, lvl=0, gui=1)
  17. {
  18.   ; Captcha by Titan
  19.   w := len * 15 + 10
  20.   h := 35
  21.   Gui, %gui%: Add, Text, Border Section x%x% y%y% w%w% h%h%
  22.   xw := x + 10
  23.   Loop, % len
  24.   {
  25.     Gui, Font, % Random("Styles") "w" Random("Number", 1, 1000) "s" Random("Number", 8, 12) "c" Random("Colour"), Random("Font")
  26.     key := Pass(1)
  27.     keys = %keys%%key%
  28.     yw := "ys+" Random("Number", 3, 10)
  29.     Gui, %gui%: Add, Text, BackgroundTrans x%xw% %yw%, % key
  30.     xw += % Random("Number", 10, 15)
  31.   }
  32.   Gui, Font
  33.   if (lvl = 1)
  34.   {
  35.     yw = 5
  36.     Loop, % ( Floor(w/3))
  37.       dots = %dots%.
  38.     Loop, 5
  39.     {
  40.       Gui, Font, % "w1" "c" Random("Colour")
  41.       Gui, %gui%: Add, Text, BackgroundTrans + Wrap x%x% y%yw% w3, % dots
  42.       yw += 5
  43.     }
  44.     Gui, Font
  45.   }
  46.   Return, % keys
  47. }
  48.  
  49. Pass(len=5, chars=0)
  50. {
  51.   ; Captcha module by Titan
  52.   chAlpha = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
  53.   chNum = 1234567890
  54.   chAlphaNum = %chAlpha%%chNum%
  55.   If chars in 0,alphanum
  56.     StringSplit, list, chAlphaNum
  57.   else If chars in 1, alpha
  58.     StringSplit, list, chAlpha
  59.   else If chars in 2,num
  60.     StringSplit, list, chNum
  61.   Loop, % len
  62.   {
  63.     Random, rnd, 1, % list0
  64.     i := list%rnd%
  65.     pass = %pass%%i%
  66.   }
  67.   Return, pass
  68. }
  69.  
  70. Random( type, p1=0, p2=0)
  71. {
  72.   ; Captcha module by Titan
  73.     Random, r, % p1, % p2
  74.   {
  75.     Fonts = Arial,Courier,Courier New,Lucida Console,MS Sans Serif,MS Serif,Tahoma,Times New Roman
  76.     StringSplit, Fonts, Fonts, `,
  77.     Random, r, 1, %Fonts0%
  78.     r := Fonts%r%
  79.   }
  80.   else If type in Colour
  81.   {
  82.     Colours = Black,Green,Silver,Lime,Gray,Olive,White,Yellow,Maroon,Navy,Red,Blue,Purple,Teal,Fuchsia,Aqua
  83.     StringSplit, Colours, Colours, `,
  84.     Random, r, 1, %Colours0%
  85.     r := Colours%r%
  86.   }
  87.   else If type in Styles
  88.   {
  89.     Styles = bold, underline, norm,0x7,0x4,0x1,0x10,0x11,0x8,0x5,0xC,0x80,0x100,0x2,0x1000,0x9,0x6
  90.     StringSplit, Styles, Styles, `,
  91.     Random, r, 1, %Styles0%
  92.     r := Styles%r%
  93.   }
  94.   Return, % r
  95. }
  96.  
반응형
Comments