Advertisement
CivReborn

PixelSearch Target

Oct 18th, 2017
6,192
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance,Force
  2. OnMessage(0x201,"Check_Hit")
  3. global Rad1:=,Rad2:=,Speed:=1,THWND:=,Target1:=,Click_Count:=0,Target:={}
  4. BackGround_Color:="ffffff",Target.x:=20,Target.y:=40,Target.w:=15,Target.h:=15,Target_Width:=Target.w
  5. Target_Height:=Target.h,Target.Color:="22aaff",Target.Dir:=2,Target.Timer:=0
  6. Gui,1: +OwnDialogs ;+AlwaysOnTop
  7. Gui,1:Color,Black,Black
  8. Gui,1:Font,cRed s22 Bold Q4
  9. Gui,1:Add,Text, x10 y5 w680 Center vClick_Count,Count: %Click_Count%
  10. Gui,1:Font,
  11. Gui,1:Add,Progress,x20 y40 w660 h330 Background%BackGround_Color% vThe_BackGround
  12. Gui,1:Add,Progress,% "x" Target.x " y"Target.y " w" Target.w " h" Target.h " Background" Target.Color " vTarget1",
  13. GuiControlGet,THwnd,HWND,Target1
  14. Gui,1:Add,Groupbox,cTeal x20 y385 w120 h100 ,Mode
  15. Gui,1:Add,Radio,cLime x35 y415 Checked vRad1 gSubmit_All,Click Mode
  16. Gui,1:Add,Radio,cLime x35 yp+25 vRad2 gSubmit_All,Move Mode
  17. Gui,1:Add,Groupbox,cTeal x160 y385 w520 h100 ,Options
  18. Gui,1:Add,Text,cLime x175 y410 ,Target Color:
  19. Gui,1:Add,Edit,cWhite x+5 yp-2 w80 h20 Center vNew_Target_Color gSubmit_All,% Target.Color
  20. Gui,1:Add,Text,cLime x+20 yp+2 ,Target Speed:
  21. Gui,1:Add,Edit,cWhite x+5 yp-2 w80 h20 Center Number vSpeed gSubmit_All,% Speed
  22. Gui,1:Add,Text,cLime x+20 yp+2 ,Target Width:
  23. Gui,1:Add,Edit,cWhite x+5 yp-2 w80 h20 Center Number vTarget_Width gSubmit_All,% Target.w
  24. Gui,1:Add,Text,cLime x175 y450 ,Background Color:
  25. Gui,1:Add,Edit,cWhite x+5 yp-2 w80 h20 Center vNew_BackGround_Color gSubmit_All,% BackGround_Color
  26. Gui,1:Add,Text,cLime x+20 yp+2 ,Target Height:
  27. Gui,1:Add,Edit,cWhite x+5 yp-2 w80 h20 Center Number vTarget_Height gSubmit_All,% Target.h
  28. Gui,1:Add,Button,x+20 w131 h20 gReload ,Reload
  29. Gui,1:Show,w700 h500,Target
  30. Gui,1:Submit,NoHide
  31. return
  32. GuiClose:
  33.     ExitApp
  34. Reload:
  35.     Reload
  36. Submit_All:
  37.     Gui,1:Submit,NoHide
  38.     if(Rad2=1)
  39.         SetTimer,Move_Target,10
  40.     else
  41.         SetTimer,Move_Target,Off
  42.     GuiControl,1: +Background%New_Target_Color%,Target1
  43.     GuiControl,1: +Background%New_BackGround_Color%,The_BackGround
  44.     GuiControl,1:Move,Target1,w%Target_Width% h%Target_Height%
  45.     Target.w:=Target_Width
  46.     Target.h:=Target_Height
  47.     return
  48. Move_Target:
  49.     Target.Timer++
  50.     if(Target.Timer>30)
  51.         {
  52.             Random,Dir,1,4
  53.             Target.Dir:=Dir
  54.             Target.Timer:=0    
  55.         }
  56.     if(Target.x<20)
  57.             Target.Dir:=2
  58.     else if(Target.x>(680-Target.w))
  59.             Target.Dir:=4
  60.     else if(Target.y<40)
  61.             Target.Dir:=3
  62.     else if(Target.y>(370-Target.h))
  63.             Target.Dir:=1          
  64.     if(Target.Dir=1)
  65.             Target.y-=Speed
  66.     else if(Target.Dir=2)
  67.             Target.x+=Speed
  68.     else if(Target.Dir=3)
  69.             Target.y+=Speed
  70.     else if(Target.Dir=4)
  71.             Target.x-=Speed
  72.     GuiControl,1:Move,Target1,% "x" Target.x " y" Target.y
  73.     return
  74. Check_Hit()
  75.     {
  76.         if(Rad1=1)
  77.             {
  78.                 mouseGetPos,,,,c1,2
  79.                 if(C1==THwnd)
  80.                     {
  81.                         Click_Count++
  82.                         GuiControl,1:,Click_Count,% "Count: " Click_Count
  83.                         Max_X:=680-Target.w
  84.                         Random,x,20,Max_X
  85.                         Target.x:=x
  86.                         Max_Y:=370-Target.h
  87.                         Random,y,40,Max_y
  88.                         Target.y:=y
  89.                         GuiControl,1:Move,Target1,% "x" Target.x " y" Target.y
  90.                     }
  91.             }      
  92.         else if(rad2=1)
  93.             {
  94.                 mouseGetPos,,,,c1,2
  95.                 if(C1==THwnd)
  96.                     {
  97.                         Click_Count++
  98.                         GuiControl,1:,Click_Count,% "Count: " Click_Count
  99.                     }
  100.             }      
  101.     }
  102. *^Numpad1::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement