Advertisement
CivReborn

SCv3.0.0 Paste

Oct 21st, 2017
2,461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Written By: Hellbent aka CivReborn
  2. ;Date Written: July 13th, 2017
  3. ;Date of Last Edit:July 19th, 2017
  4. ;Last PasteBin Save:
  5. ;Youtube Channel: https://www.youtube.com/user/CivReborn
  6. #SingleInstance,Force
  7. CoordMode, Mouse, Screen
  8. SetMouseDelay,-1
  9. Click_Delay := 0
  10. Total_Clicks := 0
  11. Stop := 0
  12. Target_Window:=null
  13. Gui,1:+AlwaysOnTop
  14. Gui,1:Color,White,Black
  15. Gui,1:Add,GroupBox,x10 y10 w480 h50,Mode
  16. Gui,1:Add,Radio, x130 y30 Group Checked vRad1 gClick_Mode ,Fixed
  17. Gui,1:Add,Radio, x+100 y30  vRad2 gClick_Mode ,Free
  18. Gui,1:Add,Button,x440 y27 w20 h20 gMy_Channel,?
  19. Gui,1:Add,GroupBox, x10 y70 w480 h100,Target Window
  20. Gui,1:Add,CheckBox, x30 y95 Checked vUse_Target_Window gSubmit_All,Use Target Window
  21. Gui,1:Add,Button, x180 y85 w280 h30 gSet_Target_Window,Set Target Window
  22. Gui,1:Add,Text,x30 y140 ,Target Window:
  23. Gui,1:Add,Edit,cWhite x+20 w330 Center vTarget_Window
  24. Gui,1:Add,GroupBox,x10 y180 w480 h100, Set Click Area/Target
  25. Gui,1:Add,Button, x100 y210 w150 h30 vSet_Click_Target gSet_Fixed_Location,Set Click Target
  26. Gui,1:Add,Edit,cWhite x+30 y215 w150 Center vTarget_Spot ,
  27. Gui,1:Add,Text,x30 y250 vFixed_Text1,Box Width:
  28. Gui,1:Add,Edit,cWhite x+20 w100 Center vBox_Width gSubmit_All,40
  29. Gui,1:Add,Text,x+50 vFixed_Text2,Box Height:
  30. Gui,1:Add,Edit,cWhite x+20 w100 Center vBox_Height gSubmit_All,40
  31. Gui,1:Add,Button,x70 y200 w200 h30 Hidden vSet_Top_Left gSet_Top_Left,Set Top Left
  32. Gui,1:Add,Edit,cWhite x+20 w150 y205 Center Hidden vTop_Left
  33. Gui,1:Add,Button,x70 y240 w200 h30 Hidden vSet_Bottom_Right gSet_Bottom_Right,Set Bottom Right
  34. Gui,1:Add,Edit,cWhite x+20 w150 y245 Center Hidden vBottom_Right
  35. Gui,1:Add,GroupBox,x10 w480 h100,Speed && Display Options
  36. Gui,1:Add,Checkbox,x30 y+-75 Checked vUse_Click_Delay gSubmit_All,Use Click Delay
  37. Gui,1:Add,CheckBox,x+150 Checked vDisplay_Clicks gSubmit_All,Display Clicks
  38. Gui,1:Add,Text,x30 yp+25,Delay:
  39. Gui,1:Add,Edit,cWhite x+10  w100 Center vClick_Delay gSubmit_All,% Click_Delay
  40. Gui,1:Add,Text,x+30 ,Total Clicks:
  41. Gui,1:Add,Edit,cWhite x+10 w100 Center vTotal_Clicks,% Total_Clicks
  42. Gui,1:Add,Button,x+10 w100 gReset_Click_Counter,Reset Click Count
  43. Gui,1:Add,GroupBox,x10 w480 h55
  44. Gui,1:Add,Button,x25 yp+15 w130 h30 gStart_Clicker,Start
  45. Gui,1:Add,Button,x+30  w130 h30 gStop_Clicker,Stop
  46. Gui,1:Add,Button,x+30  w130 h30 gReset,Reset
  47. Gui,1:Show,,Smart Clicker v3.0
  48. Gui,1:Submit,NoHide
  49. return
  50. GuiClose:
  51.     ExitApp
  52. Submit_All:
  53.     Gui,1:Submit,NoHide
  54.     return
  55. My_Channel:
  56.     Run, https://www.youtube.com/user/CivReborn
  57.     return
  58. Reset:
  59.     Reload
  60. Reset_Click_Counter:
  61.     Total_Clicks := 0
  62.     GuiControl,1:,Total_Clicks,% Total_Clicks
  63.     return
  64. Click_Mode:
  65.     Gui,1:Submit,NoHide
  66.     if(Rad1==1)
  67.         {
  68.             GuiControl,1:Show,Set_Click_Target
  69.             GuiControl,1:Show,Target_Spot
  70.             GuiControl,1:Show,Fixed_Text1
  71.             GuiControl,1:Show,Fixed_Text2
  72.             GuiControl,1:Show,Box_Width
  73.             GuiControl,1:Show,Box_Height
  74.             GuiControl,1:Hide,Set_Top_Left
  75.             GuiControl,1:Hide,Set_Bottom_Right
  76.             GuiControl,1:Hide,Top_Left
  77.             GuiControl,1:Hide,Bottom_Right
  78.         }
  79.     else if(Rad2==1)
  80.         {
  81.             GuiControl,1:Show,Set_Top_Left
  82.             GuiControl,1:Show,Set_Bottom_Right
  83.             GuiControl,1:Show,Top_Left
  84.             GuiControl,1:Show,Bottom_Right
  85.             GuiControl,1:Hide,Set_Click_Target
  86.             GuiControl,1:Hide,Target_Spot
  87.             GuiControl,1:Hide,Fixed_Text1
  88.             GuiControl,1:Hide,Fixed_Text2
  89.             GuiControl,1:Hide,Box_Width
  90.             GuiControl,1:Hide,Box_Height
  91.         }
  92.     return
  93. Set_Target_Window:
  94.     isPressed:=0
  95.     i:= 0
  96.     Loop
  97.         {
  98.             Left_Mouse:=GetKeyState("LButton")
  99.             WinGetTitle,Temp_Window,A
  100.             ToolTip,Left Click on the target window twice to set `n`n Current Window: %Temp_Window%
  101.             if(Left_Mouse==False&&isPressed==0)
  102.                 isPressed:=1
  103.             else if(Left_Mouse==True&&isPressed==1)
  104.                 {
  105.                     i++
  106.                     isPressed:=0
  107.                     if(i>=2)
  108.                         {
  109.                             WinGetTitle,Target_Window,A
  110.                             ToolTip,
  111.                             break
  112.                         }
  113.                 }
  114.         }
  115.     GuiControl,1:,Target_Window,% Target_Window
  116.     return
  117. Set_Fixed_Location:
  118.     Stop:=1
  119.     Get_Click_Pos(Fixed_X,Fixed_Y) 
  120.     GuiControl,1:,Target_Spot,X = %Fixed_X%    Y = %Fixed_Y%       
  121.     return 
  122. Set_Top_Left:
  123.     Stop:=1
  124.     Get_Click_Pos(Top_Left_X,Top_Left_Y)       
  125.     GuiControl,1:,Top_Left,X = %Top_Left_X%    Y = %Top_Left_Y%
  126.     return
  127. Set_Bottom_Right:
  128.     Stop:=1
  129.     Get_Click_Pos(Bottom_Right_X,Bottom_Right_Y)   
  130.     GuiControl,1:,Bottom_Right,X = %Bottom_Right_X%    Y = %Bottom_Right_Y%
  131.     return
  132. Start_Clicker:
  133.     Stop:=0
  134.     if(Rad1==1)
  135.         {
  136.             Run_Fixed(Fixed_X,Fixed_Y)
  137.         }
  138.     else if(Rad2==1)
  139.         {
  140.             Run_Free()
  141.         }
  142.     return
  143. Stop_Clicker:
  144.     Stop:=1
  145.     return 
  146. Run_Fixed(ByRef Fixed_X,ByRef Fixed_Y)
  147.     {
  148.         global
  149.         Size_W:=Box_Width//2
  150.         Size_H:=Box_Height//2
  151.        
  152.         if(Fixed_X!=null&&Fixed_Y!=null)
  153.             {
  154.                 if(Use_Target_Window==1)
  155.                     {
  156.                         if(Target_Window==null)
  157.                             {
  158.                                 MsgBox, 262192, Missing Info,You need to set your target window!
  159.                                 return
  160.                             }
  161.                         if(Use_Click_Delay==1&&Display_Clicks==1)
  162.                             {
  163.                                 Loop   
  164.                                     {
  165.                                         if(Stop==1)
  166.                                             {
  167.                                                 break
  168.                                             }
  169.                                         WinGetTitle,Active_Window,A
  170.                                         MouseGetPos,temp_X,temp_Y
  171.                                         if(Active_Window==Target_Window&&temp_X>=(Fixed_X-Size_W)&&temp_X<=(Fixed_X+Size_W)&&temp_Y>=(Fixed_Y-Size_H)&&temp_Y<=(Fixed_Y+Size_H))
  172.                                             {
  173.                                                 Click, %Fixed_X%  %Fixed_Y%
  174.                                                 Total_Clicks++
  175.                                                 GuiControl,1:,Total_Clicks,% Total_Clicks
  176.                                                 Sleep, %Click_Delay%
  177.                                             }
  178.                                     }
  179.                             }
  180.                         else if(Use_Click_Delay==1&&Display_Clicks==0)
  181.                             {
  182.                                 Loop   
  183.                                     {
  184.                                         if(Stop==1)
  185.                                             {
  186.                                                 break
  187.                                             }
  188.                                         WinGetTitle,Active_Window,A
  189.                                         MouseGetPos,temp_X,temp_Y
  190.                                         if(Active_Window==Target_Window&&temp_X>=(Fixed_X-Size_W)&&temp_X<=(Fixed_X+Size_W)&&temp_Y>=(Fixed_Y-Size_H)&&temp_Y<=(Fixed_Y+Size_H))
  191.                                             {
  192.                                                 Click, %Fixed_X%  %Fixed_Y%
  193.                                                 Sleep, %Click_Delay%
  194.                                             }
  195.                                     }
  196.                             }
  197.                         else if(Use_Click_Delay==0&&Display_Clicks==1)
  198.                             {
  199.                                 Loop   
  200.                                     {
  201.                                         if(Stop==1)
  202.                                             {
  203.                                                 break
  204.                                             }
  205.                                         WinGetTitle,Active_Window,A
  206.                                         MouseGetPos,temp_X,temp_Y
  207.                                         if(Active_Window==Target_Window&&temp_X>=(Fixed_X-Size_W)&&temp_X<=(Fixed_X+Size_W)&&temp_Y>=(Fixed_Y-Size_H)&&temp_Y<=(Fixed_Y+Size_H))
  208.                                             {
  209.                                                 Click, %Fixed_X%  %Fixed_Y%
  210.                                                 Total_Clicks++
  211.                                                 GuiControl,1:,Total_Clicks,% Total_Clicks
  212.                                             }
  213.                                     }
  214.                             }
  215.                         else if(Use_Click_Delay==0&&Display_Clicks==0)
  216.                             {
  217.                                 Loop   
  218.                                     {
  219.                                         if(Stop==1)
  220.                                             {
  221.                                                 break
  222.                                             }
  223.                                         WinGetTitle,Active_Window,A
  224.                                         MouseGetPos,temp_X,temp_Y
  225.                                         if(Active_Window==Target_Window&&temp_X>=(Fixed_X-Size_W)&&temp_X<=(Fixed_X+Size_W)&&temp_Y>=(Fixed_Y-Size_H)&&temp_Y<=(Fixed_Y+Size_H))
  226.                                             {
  227.                                                 Click, %Fixed_X%  %Fixed_Y%
  228.                                             }
  229.                                     }
  230.                             }  
  231.                     }
  232.                 else if(Use_Target_Window==0)
  233.                     {
  234.                         if(Use_Click_Delay==1&&Display_Clicks==1)
  235.                             {
  236.                                 Loop   
  237.                                     {
  238.                                         if(Stop==1)
  239.                                             {
  240.                                                 break
  241.                                             }
  242.                                         MouseGetPos,temp_X,temp_Y
  243.                                         if(temp_X>=(Fixed_X-Size_W)&&temp_X<=(Fixed_X+Size_W)&&temp_Y>=(Fixed_Y-Size_H)&&temp_Y<=(Fixed_Y+Size_H))
  244.                                             {
  245.                                                 Click, %Fixed_X%  %Fixed_Y%
  246.                                                 Total_Clicks++
  247.                                                 GuiControl,1:,Total_Clicks,% Total_Clicks
  248.                                                 Sleep, %Click_Delay%
  249.                                             }
  250.                                     }
  251.                             }
  252.                         else if(Use_Click_Delay==1&&Display_Clicks==0)
  253.                             {
  254.                                 Loop   
  255.                                     {
  256.                                         if(Stop==1)
  257.                                             {
  258.                                                 break
  259.                                             }
  260.                                         MouseGetPos,temp_X,temp_Y
  261.                                         if(temp_X>=(Fixed_X-Size_W)&&temp_X<=(Fixed_X+Size_W)&&temp_Y>=(Fixed_Y-Size_H)&&temp_Y<=(Fixed_Y+Size_H))
  262.                                             {
  263.                                                 Click, %Fixed_X%  %Fixed_Y%
  264.                                                 Sleep, %Click_Delay%
  265.                                             }
  266.                                     }
  267.                             }
  268.                         else if(Use_Click_Delay==0&&Display_Clicks==1)
  269.                             {
  270.                                 Loop   
  271.                                     {
  272.                                         if(Stop==1)
  273.                                             {
  274.                                                 break
  275.                                             }
  276.                                         MouseGetPos,temp_X,temp_Y
  277.                                         if(temp_X>=(Fixed_X-Size_W)&&temp_X<=(Fixed_X+Size_W)&&temp_Y>=(Fixed_Y-Size_H)&&temp_Y<=(Fixed_Y+Size_H))
  278.                                             {
  279.                                                 Click, %Fixed_X%  %Fixed_Y%
  280.                                                 Total_Clicks++
  281.                                                 GuiControl,1:,Total_Clicks,% Total_Clicks
  282.                                             }
  283.                                     }
  284.                             }
  285.                         else if(Use_Click_Delay==0&&Display_Clicks==0)
  286.                             {
  287.                                 Loop   
  288.                                     {
  289.                                         if(Stop==1)
  290.                                             {
  291.                                                 break
  292.                                             }
  293.                                         MouseGetPos,temp_X,temp_Y
  294.                                         if(temp_X>=(Fixed_X-Size_W)&&temp_X<=(Fixed_X+Size_W)&&temp_Y>=(Fixed_Y-Size_H)&&temp_Y<=(Fixed_Y+Size_H))
  295.                                             {
  296.                                                 Click, %Fixed_X%  %Fixed_Y%
  297.                                             }
  298.                                     }
  299.                             }  
  300.                     }
  301.             }
  302.         else if(Fixed_X==null)
  303.             {
  304.                 MsgBox, 262192, Missing Info,You need to set your Click Location!
  305.             }
  306.     }
  307. Run_Free()
  308.     {
  309.         global
  310.         if(Top_Left_X!=null&&Bottom_Right_X!=null)
  311.             {
  312.                 if(Use_Target_Window==1)
  313.                     {
  314.                         if(Target_Window==null)
  315.                             {
  316.                                 MsgBox, 262192, Missing Info,You need to set your target window!
  317.                                 return
  318.                             }
  319.                         if(Use_Click_Delay==1&&Display_Clicks==1)
  320.                             {
  321.                                 Loop   
  322.                                     {
  323.                                         if(Stop==1)
  324.                                             {
  325.                                                 break
  326.                                             }
  327.                                         WinGetTitle,Active_Window,A
  328.                                         MouseGetPos,temp_X,temp_Y
  329.                                         if(Active_Window==Target_Window&&temp_X>=Top_Left_X&&temp_X<=Bottom_Right_X&&temp_Y>=Top_Left_Y&&temp_Y<=Bottom_Right_Y)
  330.                                             {
  331.                                                 Click, %Temp_X%  %Temp_Y%
  332.                                                 Total_Clicks++
  333.                                                 GuiControl,1:,Total_Clicks,% Total_Clicks
  334.                                                 Sleep, %Click_Delay%
  335.                                             }
  336.                                     }
  337.                             }  
  338.                         else if(Use_Click_Delay==1&&Display_Clicks==0)
  339.                             {
  340.                                 Loop   
  341.                                     {
  342.                                         if(Stop==1)
  343.                                             {
  344.                                                 break
  345.                                             }
  346.                                         WinGetTitle,Active_Window,A
  347.                                         MouseGetPos,temp_X,temp_Y
  348.                                         if(Active_Window==Target_Window&&temp_X>=Top_Left_X&&temp_X<=Bottom_Right_X&&temp_Y>=Top_Left_Y&&temp_Y<=Bottom_Right_Y)
  349.                                             {
  350.                                                 Click, %Temp_X%  %Temp_Y%
  351.                                                 Sleep, %Click_Delay%
  352.                                             }
  353.                                     }
  354.                             }
  355.                         else if(Use_Click_Delay==0&&Display_Clicks==0)
  356.                             {
  357.                                 Loop   
  358.                                     {
  359.                                         if(Stop==1)
  360.                                             {
  361.                                                 break
  362.                                             }
  363.                                         WinGetTitle,Active_Window,A
  364.                                         MouseGetPos,temp_X,temp_Y
  365.                                         if(Active_Window==Target_Window&&temp_X>=Top_Left_X&&temp_X<=Bottom_Right_X&&temp_Y>=Top_Left_Y&&temp_Y<=Bottom_Right_Y)
  366.                                             {
  367.                                                 Click, %Temp_X%  %Temp_Y%
  368.                                             }
  369.                                     }
  370.                             }  
  371.                         if(Use_Click_Delay==0&&Display_Clicks==1)
  372.                             {
  373.                                 Loop   
  374.                                     {
  375.                                         if(Stop==1)
  376.                                             {
  377.                                                 break
  378.                                             }
  379.                                         WinGetTitle,Active_Window,A
  380.                                         MouseGetPos,temp_X,temp_Y
  381.                                         if(Active_Window==Target_Window&&temp_X>=Top_Left_X&&temp_X<=Bottom_Right_X&&temp_Y>=Top_Left_Y&&temp_Y<=Bottom_Right_Y)
  382.                                             {
  383.                                                 Click, %Temp_X%  %Temp_Y%
  384.                                                 Total_Clicks++
  385.                                                 GuiControl,1:,Total_Clicks,% Total_Clicks
  386.                                             }
  387.                                     }
  388.                             }      
  389.                     }
  390.                 else if(Use_Target_Window==0)
  391.                     {
  392.                         if(Use_Click_Delay==1&&Display_Clicks==1)
  393.                             {
  394.                                 Loop   
  395.                                     {
  396.                                         if(Stop==1)
  397.                                             {
  398.                                                 break
  399.                                             }
  400.                                         MouseGetPos,temp_X,temp_Y
  401.                                         if(temp_X>=Top_Left_X&&temp_X<=Bottom_Right_X&&temp_Y>=Top_Left_Y&&temp_Y<=Bottom_Right_Y)
  402.                                             {
  403.                                                 Click, %Temp_X%  %Temp_Y%
  404.                                                 Total_Clicks++
  405.                                                 GuiControl,1:,Total_Clicks,% Total_Clicks
  406.                                                 Sleep, %Click_Delay%
  407.                                             }
  408.                                     }
  409.                             }  
  410.                         else if(Use_Click_Delay==1&&Display_Clicks==0)
  411.                             {
  412.                                 Loop   
  413.                                     {
  414.                                         if(Stop==1)
  415.                                             {
  416.                                                 break
  417.                                             }
  418.                                         MouseGetPos,temp_X,temp_Y
  419.                                         if(temp_X>=Top_Left_X&&temp_X<=Bottom_Right_X&&temp_Y>=Top_Left_Y&&temp_Y<=Bottom_Right_Y)
  420.                                             {
  421.                                                 Click, %Temp_X%  %Temp_Y%
  422.                                                 Sleep, %Click_Delay%
  423.                                             }
  424.                                     }
  425.                             }
  426.                         else if(Use_Click_Delay==0&&Display_Clicks==0)
  427.                             {
  428.                                 Loop   
  429.                                     {
  430.                                         if(Stop==1)
  431.                                             {
  432.                                                 break
  433.                                             }
  434.                                         MouseGetPos,temp_X,temp_Y
  435.                                         if(temp_X>=Top_Left_X&&temp_X<=Bottom_Right_X&&temp_Y>=Top_Left_Y&&temp_Y<=Bottom_Right_Y)
  436.                                             {
  437.                                                 Click, %Temp_X%  %Temp_Y%
  438.                                             }
  439.                                     }
  440.                             }  
  441.                         if(Use_Click_Delay==0&&Display_Clicks==1)
  442.                             {
  443.                                 Loop   
  444.                                     {
  445.                                         if(Stop==1)
  446.                                             {
  447.                                                 break
  448.                                             }
  449.                                         MouseGetPos,temp_X,temp_Y
  450.                                         if(temp_X>=Top_Left_X&&temp_X<=Bottom_Right_X&&temp_Y>=Top_Left_Y&&temp_Y<=Bottom_Right_Y)
  451.                                             {
  452.                                                 Click, %Temp_X%  %Temp_Y%
  453.                                                 Total_Clicks++
  454.                                                 GuiControl,1:,Total_Clicks,% Total_Clicks
  455.                                             }
  456.                                     }
  457.                             }      
  458.                     }
  459.             }
  460.         else
  461.             MsgBox, 262192, Missing Info,You need to set your Top Left And Bottom Right Click Location!        
  462.     }
  463. Get_Click_Pos(ByRef X,ByRef Y)
  464.     {
  465.         isPressed:=0
  466.         i:=0
  467.         Loop
  468.             {
  469.                 Left_Mouse:=GetKeyState("LButton")
  470.                 MouseGetPos,X,Y,
  471.                 ToolTip,Left Click Your Target Location To Set It  `n`nCurrent Location: `nX = %X%`nY = %Y%
  472.                 if(Left_Mouse==False&&isPressed==0)
  473.                     isPressed:=1
  474.                 else if(Left_Mouse==True&&isPressed==1)
  475.                     {
  476.                         MouseGetPos,X,Y,
  477.                         ToolTip,
  478.                         break
  479.                     }
  480.             }
  481.     }
  482. esc::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement