CivReborn

Diep.io Modified AFK Script

Nov 14th, 2017
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance, Force
  2. CoordMode, Mouse, screen
  3. CoordMode, Pixel, screen
  4.  
  5. ; Global Variables
  6. ;------------------
  7. ;---------------------------
  8. Global Target_Window := Null
  9. Global X1 :=
  10. Global Y1 :=
  11. Global X2 :=
  12. Global Y2 :=
  13. Global Top_Colour1 := Null
  14. Global Top_Colour2 := Null
  15. Global Top_X1 :=
  16. Global Top_Y1 :=
  17. Global Top_X2 :=
  18. Global Top_Y2 :=
  19. Global Colour1 :=
  20. Global Colour2 :=
  21. Global Bottom_Colour1 := Null
  22. Global Bottom_Colour2 := Null
  23. Global Bottom_X1 :=
  24. Global Bottom_Y1 :=
  25. Global Bottom_X2 :=
  26. Global Bottom_Y2 :=
  27. Global Left_Colour1 := Null
  28. Global Left_Colour2 := Null
  29. Global Left_X1 :=
  30. Global Left_Y1 :=
  31. Global Left_X2 :=
  32. Global Left_Y2 :=
  33. Global Right_Colour1 := Null
  34. Global Right_Colour2 := Null
  35. Global Right_X1 :=
  36. Global Right_Y1 :=
  37. Global Right_X2 :=
  38. Global Right_Y2 :=
  39. Global Stop := 0
  40. ; Gui Layout
  41. ;-----------------
  42. ;---------------------------
  43.  
  44. Gui, Font, cwhite
  45.  
  46. Gui, Add, Button, x10 w150 h20 gGet_Target_Window, Add Target Window
  47. Gui, Add, Edit,cBlack x+10 w170 h20 vTarget_Window_Display,
  48. Gui, Add, Text, x10,--------------------------------------------------------------------------------------------------------------
  49. Gui, Font,s10 cAqua
  50. Gui, Add, Text, x10, Set Target Locations
  51. Gui, Font, cwhite s8
  52. Gui, Add, Button, x+155 w50 h16 gTarget_Info, INFO
  53. Gui, Add, Button, x10 y+20 w160 h20 gSet_Top, Set Top
  54. Gui, Add, Button, x+10 w160 h20 gSet_Bottom, Set Bottom
  55. Gui, Add, Button, x10 w160 h20 gSet_Left, Set Left
  56. Gui, Add, Button, x+10 w160 h20 gSet_Right, Set Right
  57. Gui, Add, Text, x10,--------------------------------------------------------------------------------------------------------------
  58.  
  59. Gui, Add, Button, x20 w310 h30 gStart_Script,Start
  60. Gui, Add, Button, x20 w310 h30 gStop_Script,Stop
  61. Gui, Add, Button, x20 w310 h30 gReset,Reset
  62. Gui, +AlwaysOnTop
  63. Gui, Color, Black
  64. Gui, Show,x950 y50 w350 h270, Hellbents Diep.io AFK Script
  65. return
  66.  
  67.  
  68. ; Lables
  69. ;-------------------
  70. ;------------------------------
  71. GuiClose:
  72.     ExitApp
  73.     return
  74. Target_Info:
  75.     msgbox, Click a target button and then press in two different locations that match that buttons side
  76.     .`n`ni.e If you selected the left button, click in two places on the left side
  77.     .`nTry to give some space between them.
  78.     return
  79. Get_Target_Window:
  80.     Target_Window_Find()
  81.     GuiControl,,Target_Window_Display, %Target_Window%
  82.     return
  83. Set_Top:
  84.     Gui, -AlwaysOnTop
  85.     Lock_Pixel()
  86.     Top_X1 := X1
  87.     Top_Y1 := Y1
  88.     Top_X2 := X2
  89.     Top_Y2 := Y2
  90.     Top_Colour1 := Colour1
  91.     Top_Colour2 := Colour2
  92.     Gui, +AlwaysOnTop
  93.     return
  94. Set_Bottom:
  95.     Gui, -AlwaysOnTop
  96.     Lock_Pixel()
  97.     Bottom_X1 := X1
  98.     Bottom_Y1 := Y1
  99.     Bottom_X2 := X2
  100.     Bottom_Y2 := Y2
  101.     Bottom_Colour1 := Colour1
  102.     Bottom_Colour2 := Colour2
  103.     Gui, +AlwaysOnTop
  104.     return
  105. Set_Left:
  106.     Gui, -AlwaysOnTop
  107.     Lock_Pixel()
  108.     Left_X1 := X1
  109.     Left_Y1 := Y1
  110.     Left_X2 := X2
  111.     Left_Y2 := Y2
  112.     Left_Colour1 := Colour1
  113.     Left_Colour2 := Colour2
  114.     Gui, +AlwaysOnTop
  115.     return
  116. Set_Right:
  117.     Gui, -AlwaysOnTop
  118.     Lock_Pixel()
  119.     Right_X1 := X1
  120.     Right_Y1 := Y1
  121.     Right_X2 := X2
  122.     Right_Y2 := Y2
  123.     Right_Colour1 := Colour1
  124.     Right_Colour2 := Colour2
  125.     Gui, +AlwaysOnTop
  126.     return
  127. Reset:
  128.     Reload
  129.     return
  130. Stop_Script:
  131.     Stop := 1
  132.     Send, {Up Up}
  133.     Sleep, 10
  134.     Send, {Down Up}
  135.     Sleep, 10
  136.     Send, {Left Up}
  137.     Sleep, 10
  138.     Send {Right Up}
  139.     return
  140. Start_Script:
  141.     if(Target_Window!=Null&&Top_Colour1!=Null&&Top_Colour2!=Null&&Bottom_Colour1!=Null&&Bottom_Colour2!=Null&&Left_Colour1!=Null&&Left_Colour2!=Null&&Right_Colour1!=Null&&Right_Colour2!=Null)
  142.     Run_Script()
  143.     else
  144.         msgbox, missing info
  145.     return
  146. ; Functions
  147. ;-------------------
  148. ;-----------------------------
  149.  
  150. Target_Window_Find()
  151.     {
  152.         msgbox, Left click the target window twice to lock it.
  153.         i := 0
  154.         isPressed := 0
  155.         Loop
  156.             {
  157.                 WinGetTitle, tempWindow, A
  158.                 ToolTip, %tempWindow%
  159.                 GetKeyState, Left_Mouse, LButton
  160.                 Left_Mouse := GetKeyState("LButton")
  161.                 if(isPressed==0)
  162.                     {
  163.                         if(Left_Mouse==False)
  164.                             {
  165.                                 isPressed := 1
  166.                                 ;msgbox, up
  167.                             }
  168.                     }
  169.                 if(isPressed==1)
  170.                     {
  171.                         if(Left_Mouse==True)
  172.                             {
  173.                                 i++
  174.                                 isPressed := 0
  175.                                 if(i==2)
  176.                                     {
  177.                                         WinGetTitle, Target_Window, A
  178.                                         ToolTip,
  179.                                         break
  180.                                     }
  181.                             }
  182.                     }
  183.             }
  184.         ;msgbox, %Target_Window%   
  185.     }
  186.  
  187. Lock_Pixel()
  188.     {
  189.         i := 0
  190.         isPressed := 0
  191.         Loop
  192.             {
  193.                 MouseGetPos, tempX, tempY
  194.                 ToolTip, %tempX% %tempY%
  195.                 GetKeyState, Left_Mouse, LButton
  196.                 Left_Mouse := GetKeyState("LButton")
  197.                 if(isPressed==0)
  198.                     {
  199.                         if(Left_Mouse==False)
  200.                             {
  201.                                 isPressed := 1
  202.                             }
  203.                     }
  204.                 if(isPressed==1)
  205.                     {
  206.                         if(Left_Mouse==True)
  207.                             {
  208.                                 ;~ if(i==6)
  209.                                     ;~ {
  210.                                         ;~ i := 0
  211.                                         ;~ isPressed := 0
  212.                                     ;~ }
  213.                                 if(i==1)
  214.                                     {
  215.                                         MouseGetPos, X2, Y2
  216.                                         PixelGetColor, Colour2, %X2%, %Y2%
  217.                                         ;msgbox, colour 2 %Colour2%
  218.                                         ToolTip,
  219.                                         break
  220.                                     }
  221.                                 if(i==0)
  222.                                     {
  223.                                         MouseGetPos, X1, Y1
  224.                                         PixelGetColor, Colour1, %X1%, %Y1%
  225.                                         ;msgbox, colour 1 %Colour1%
  226.                                         isPressed := 0
  227.                                         i := 1
  228.                                     }  
  229.                             }
  230.                     }
  231.                
  232.             }
  233.     }
  234.    
  235.    
  236. Temp_Test()
  237.     {
  238.         fff := 0
  239.         new_x := top_x1
  240.         new_y := Top_y1
  241.         Loop
  242.             {
  243.                 PixelGetColor,newcolour, %new_x%, %new_y%
  244.                 ;msgbox, new %newcolour% old %Top_Colour1%
  245.                 if(newcolour==Top_Colour1)
  246.                     {
  247.                         send, {right down}
  248.                         fff := 1
  249.                         ;msgbox, zone
  250.                     }
  251.                 if(newcolour!=Top_Colour1&&fff==1)
  252.                         send, {right up}   
  253.             }
  254.     }
  255.  
  256. Run_Script()
  257.     {
  258.         s1 := 0
  259.         s2 := 0
  260.         t1 := 0
  261.         t2 := 0
  262.         t3 := 0
  263.         t4 := 0
  264.         Loop
  265.             {
  266.                 WinGetTitle, tempWin, A
  267.                 if(tempWin==Target_Window)
  268.                     {
  269.                         if(Stop==1)
  270.                             {
  271.                                 Stop := 0
  272.                                 t1 := 0
  273.                                 t2 := 0
  274.                                 t3 := 0
  275.                                 t4 := 0
  276.                                 break
  277.                             }
  278.                         PixelGetColor, temp_Colour1,%Top_X1%,%Top_Y1%
  279.                         PixelGetColor, temp_Colour2,%Top_X2%,%Top_Y2%
  280.                         if(temp_Colour1==Top_Colour1||temp_Colour2==Top_Colour2)
  281.                             {
  282.                                 Send, {Down Down}
  283.                                 if(s1==0)
  284.                                     {
  285.                                         Send, {Up Up}
  286.                                         s1 :=1
  287.                                     }
  288.                                 ;Send, {Up Up}
  289.                                 s2 := 0
  290.                                 t1 := 1
  291.                             }
  292.                         if(temp_Colour1!=Top_Colour1&&temp_Colour2!=Top_Colour2&&t1==1)
  293.                             {
  294.                                 Send, {Up Up}
  295.                                 ;Send, {Down Up}
  296.                                 t1 := 0
  297.                             }
  298.                         PixelGetColor, temp_Colour1,%Bottom_X1%,%Bottom_Y1%
  299.                         PixelGetColor, temp_Colour2,%Bottom_X2%,%Bottom_Y2%
  300.                         if(temp_Colour1==Bottom_Colour1||temp_Colour2==Bottom_Colour2)
  301.                             {
  302.                                 Send, {Up Down}
  303.                                 if(s2==0)
  304.                                     {
  305.                                         Send, {Down Up}
  306.                                         s2 :=1
  307.                                     }
  308.                                    
  309.                                     s1 := 0
  310.                                 t2 := 1
  311.                             }
  312.                         if(temp_Colour1!=Bottom_Colour1&&temp_Colour2!=Bottom_Colour2&&t2==1)
  313.                             {
  314.                                 Send, {Down Up}
  315.                                 ;Send, {Up Up}
  316.                                 t2 := 0
  317.                             }
  318.                         PixelGetColor, temp_Colour1,%Left_X1%,%Left_Y1%
  319.                         PixelGetColor, temp_Colour2,%Left_X2%,%Left_Y2%
  320.                         if(temp_Colour1==Left_Colour1||temp_Colour2==Left_Colour2)
  321.                             {
  322.                                 Send, {Right Down}
  323.                                 t3 := 1
  324.                             }
  325.                         if(temp_Colour1!=Left_Colour1&&temp_Colour2!=Left_Colour2&&t3==1)
  326.                             {
  327.                                 Send, {Right Up}
  328.                                 t3 := 0
  329.                             }
  330.                         PixelGetColor, temp_Colour1,%Right_X1%,%Right_Y1%
  331.                         PixelGetColor, temp_Colour2,%Right_X2%,%Right_Y2%
  332.                         if(temp_Colour1==Right_Colour1||temp_Colour2==Right_Colour2)
  333.                             {
  334.                                 Send, {Left Down}
  335.                                 t4 := 1
  336.                             }
  337.                         if(temp_Colour1!=Right_Colour1&&temp_Colour2!=Right_Colour2&&t4==1)
  338.                             {
  339.                                 Send, {Left Up}
  340.                                 t4 := 0
  341.                             }
  342.                     }
  343.             }
  344.     }
  345.  
  346.  
  347.  
  348.  
  349. ; Hotkeys
  350. ;-----------------------
  351. ;-------------------------------
  352.  
  353.  
  354. ^r::
  355.     Lock_Pixel()
  356.     return
  357.  
  358. ^x::ExitApp
Add Comment
Please, Sign In to add comment