Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance, Force
- CoordMode, Mouse, screen
- CoordMode, Pixel, screen
- ; Global Variables
- ;------------------
- ;---------------------------
- Global Target_Window := Null
- Global X1 :=
- Global Y1 :=
- Global X2 :=
- Global Y2 :=
- Global Top_Colour1 := Null
- Global Top_Colour2 := Null
- Global Top_X1 :=
- Global Top_Y1 :=
- Global Top_X2 :=
- Global Top_Y2 :=
- Global Colour1 :=
- Global Colour2 :=
- Global Bottom_Colour1 := Null
- Global Bottom_Colour2 := Null
- Global Bottom_X1 :=
- Global Bottom_Y1 :=
- Global Bottom_X2 :=
- Global Bottom_Y2 :=
- Global Left_Colour1 := Null
- Global Left_Colour2 := Null
- Global Left_X1 :=
- Global Left_Y1 :=
- Global Left_X2 :=
- Global Left_Y2 :=
- Global Right_Colour1 := Null
- Global Right_Colour2 := Null
- Global Right_X1 :=
- Global Right_Y1 :=
- Global Right_X2 :=
- Global Right_Y2 :=
- Global Stop := 0
- ; Gui Layout
- ;-----------------
- ;---------------------------
- Gui, Font, cwhite
- Gui, Add, Button, x10 w150 h20 gGet_Target_Window, Add Target Window
- Gui, Add, Edit,cBlack x+10 w170 h20 vTarget_Window_Display,
- Gui, Add, Text, x10,--------------------------------------------------------------------------------------------------------------
- Gui, Font,s10 cAqua
- Gui, Add, Text, x10, Set Target Locations
- Gui, Font, cwhite s8
- Gui, Add, Button, x+155 w50 h16 gTarget_Info, INFO
- Gui, Add, Button, x10 y+20 w160 h20 gSet_Top, Set Top
- Gui, Add, Button, x+10 w160 h20 gSet_Bottom, Set Bottom
- Gui, Add, Button, x10 w160 h20 gSet_Left, Set Left
- Gui, Add, Button, x+10 w160 h20 gSet_Right, Set Right
- Gui, Add, Text, x10,--------------------------------------------------------------------------------------------------------------
- Gui, Add, Button, x20 w310 h30 gStart_Script,Start
- Gui, Add, Button, x20 w310 h30 gStop_Script,Stop
- Gui, Add, Button, x20 w310 h30 gReset,Reset
- Gui, +AlwaysOnTop
- Gui, Color, Black
- Gui, Show,x950 y50 w350 h270, Hellbents Diep.io AFK Script
- return
- ; Lables
- ;-------------------
- ;------------------------------
- GuiClose:
- ExitApp
- return
- Target_Info:
- msgbox, Click a target button and then press in two different locations that match that buttons side
- .`n`ni.e If you selected the left button, click in two places on the left side
- .`nTry to give some space between them.
- return
- Get_Target_Window:
- Target_Window_Find()
- GuiControl,,Target_Window_Display, %Target_Window%
- return
- Set_Top:
- Gui, -AlwaysOnTop
- Lock_Pixel()
- Top_X1 := X1
- Top_Y1 := Y1
- Top_X2 := X2
- Top_Y2 := Y2
- Top_Colour1 := Colour1
- Top_Colour2 := Colour2
- Gui, +AlwaysOnTop
- return
- Set_Bottom:
- Gui, -AlwaysOnTop
- Lock_Pixel()
- Bottom_X1 := X1
- Bottom_Y1 := Y1
- Bottom_X2 := X2
- Bottom_Y2 := Y2
- Bottom_Colour1 := Colour1
- Bottom_Colour2 := Colour2
- Gui, +AlwaysOnTop
- return
- Set_Left:
- Gui, -AlwaysOnTop
- Lock_Pixel()
- Left_X1 := X1
- Left_Y1 := Y1
- Left_X2 := X2
- Left_Y2 := Y2
- Left_Colour1 := Colour1
- Left_Colour2 := Colour2
- Gui, +AlwaysOnTop
- return
- Set_Right:
- Gui, -AlwaysOnTop
- Lock_Pixel()
- Right_X1 := X1
- Right_Y1 := Y1
- Right_X2 := X2
- Right_Y2 := Y2
- Right_Colour1 := Colour1
- Right_Colour2 := Colour2
- Gui, +AlwaysOnTop
- return
- Reset:
- Reload
- return
- Stop_Script:
- Stop := 1
- Send, {Up Up}
- Sleep, 10
- Send, {Down Up}
- Sleep, 10
- Send, {Left Up}
- Sleep, 10
- Send {Right Up}
- return
- Start_Script:
- 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)
- Run_Script()
- else
- msgbox, missing info
- return
- ; Functions
- ;-------------------
- ;-----------------------------
- Target_Window_Find()
- {
- msgbox, Left click the target window twice to lock it.
- i := 0
- isPressed := 0
- Loop
- {
- WinGetTitle, tempWindow, A
- ToolTip, %tempWindow%
- GetKeyState, Left_Mouse, LButton
- Left_Mouse := GetKeyState("LButton")
- if(isPressed==0)
- {
- if(Left_Mouse==False)
- {
- isPressed := 1
- ;msgbox, up
- }
- }
- if(isPressed==1)
- {
- if(Left_Mouse==True)
- {
- i++
- isPressed := 0
- if(i==2)
- {
- WinGetTitle, Target_Window, A
- ToolTip,
- break
- }
- }
- }
- }
- ;msgbox, %Target_Window%
- }
- Lock_Pixel()
- {
- i := 0
- isPressed := 0
- Loop
- {
- MouseGetPos, tempX, tempY
- ToolTip, %tempX% %tempY%
- GetKeyState, Left_Mouse, LButton
- Left_Mouse := GetKeyState("LButton")
- if(isPressed==0)
- {
- if(Left_Mouse==False)
- {
- isPressed := 1
- }
- }
- if(isPressed==1)
- {
- if(Left_Mouse==True)
- {
- ;~ if(i==6)
- ;~ {
- ;~ i := 0
- ;~ isPressed := 0
- ;~ }
- if(i==1)
- {
- MouseGetPos, X2, Y2
- PixelGetColor, Colour2, %X2%, %Y2%
- ;msgbox, colour 2 %Colour2%
- ToolTip,
- break
- }
- if(i==0)
- {
- MouseGetPos, X1, Y1
- PixelGetColor, Colour1, %X1%, %Y1%
- ;msgbox, colour 1 %Colour1%
- isPressed := 0
- i := 1
- }
- }
- }
- }
- }
- Temp_Test()
- {
- fff := 0
- new_x := top_x1
- new_y := Top_y1
- Loop
- {
- PixelGetColor,newcolour, %new_x%, %new_y%
- ;msgbox, new %newcolour% old %Top_Colour1%
- if(newcolour==Top_Colour1)
- {
- send, {right down}
- fff := 1
- ;msgbox, zone
- }
- if(newcolour!=Top_Colour1&&fff==1)
- send, {right up}
- }
- }
- Run_Script()
- {
- s1 := 0
- s2 := 0
- t1 := 0
- t2 := 0
- t3 := 0
- t4 := 0
- Loop
- {
- WinGetTitle, tempWin, A
- if(tempWin==Target_Window)
- {
- if(Stop==1)
- {
- Stop := 0
- t1 := 0
- t2 := 0
- t3 := 0
- t4 := 0
- break
- }
- PixelGetColor, temp_Colour1,%Top_X1%,%Top_Y1%
- PixelGetColor, temp_Colour2,%Top_X2%,%Top_Y2%
- if(temp_Colour1==Top_Colour1||temp_Colour2==Top_Colour2)
- {
- Send, {Down Down}
- if(s1==0)
- {
- Send, {Up Up}
- s1 :=1
- }
- ;Send, {Up Up}
- s2 := 0
- t1 := 1
- }
- if(temp_Colour1!=Top_Colour1&&temp_Colour2!=Top_Colour2&&t1==1)
- {
- Send, {Up Up}
- ;Send, {Down Up}
- t1 := 0
- }
- PixelGetColor, temp_Colour1,%Bottom_X1%,%Bottom_Y1%
- PixelGetColor, temp_Colour2,%Bottom_X2%,%Bottom_Y2%
- if(temp_Colour1==Bottom_Colour1||temp_Colour2==Bottom_Colour2)
- {
- Send, {Up Down}
- if(s2==0)
- {
- Send, {Down Up}
- s2 :=1
- }
- s1 := 0
- t2 := 1
- }
- if(temp_Colour1!=Bottom_Colour1&&temp_Colour2!=Bottom_Colour2&&t2==1)
- {
- Send, {Down Up}
- ;Send, {Up Up}
- t2 := 0
- }
- PixelGetColor, temp_Colour1,%Left_X1%,%Left_Y1%
- PixelGetColor, temp_Colour2,%Left_X2%,%Left_Y2%
- if(temp_Colour1==Left_Colour1||temp_Colour2==Left_Colour2)
- {
- Send, {Right Down}
- t3 := 1
- }
- if(temp_Colour1!=Left_Colour1&&temp_Colour2!=Left_Colour2&&t3==1)
- {
- Send, {Right Up}
- t3 := 0
- }
- PixelGetColor, temp_Colour1,%Right_X1%,%Right_Y1%
- PixelGetColor, temp_Colour2,%Right_X2%,%Right_Y2%
- if(temp_Colour1==Right_Colour1||temp_Colour2==Right_Colour2)
- {
- Send, {Left Down}
- t4 := 1
- }
- if(temp_Colour1!=Right_Colour1&&temp_Colour2!=Right_Colour2&&t4==1)
- {
- Send, {Left Up}
- t4 := 0
- }
- }
- }
- }
- ; Hotkeys
- ;-----------------------
- ;-------------------------------
- ^r::
- Lock_Pixel()
- return
- ^x::ExitApp
Add Comment
Please, Sign In to add comment