Advertisement
Guest User

HB Matrix Clicker

a guest
Dec 17th, 2018
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.     Written By: Hellbent aka CivReborn (Youtube)
  3.     Date Started: June 27th, 2018
  4.     Date Of Last Edit: July 3rd, 2018
  5.     Matrix Clicker v1.1
  6.     Paste:
  7. */
  8. #SingleInstance,Force
  9. SetBatchLines,-1
  10. CoordMode,Mouse,Screen
  11. SetMouseDelay,30ms
  12. OnExit,GuiClose
  13. global Win:={W:400,H:250},Brush:=[],Pen:=[],Button1:={},Win2:={},Win3:={},Win4:={},Checks:={},Radio1:={}
  14. global BC:=["Black","White","Yellow","Lime","Maroon","Aqua","Purple","0077ff","000211"],IsOn,pButton:={},String:={},letter_Array:=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0","!","@","#","$","%","^","&","*","(",")","-","_","=","+","~","<",",",".","?",":",";",">","|","\"," "],colours:=["ff00ff00","ff036F19","ff086714","ff24D95B","ff0D8422","ff00bb00","ff00aa00","ff11ff11","ff22ff22","ff33aa33","ff33dd33"]
  15. global MovWin:=0,Always:=1,Free_Mode:=0,No_Count:=1,GUI_Count:=0,ToolTip_Count:=0,Target_X,Target_Y,tgui,num:="",HovOn:=0,Click_Count:=0,Click_Forever:=1,Fixed_Amount:=0,Fixed_Click_Amount:=0,SPSLD,Speed:=10
  16. global Delay:=1000/speed,Startkey:="numpad1",StopKey:="Numpad2",PauseKey:="Numpad3",PauseOn:=0,Stop:=1
  17. Hotkey,%StartKey%,SCLer
  18. Hotkey,%StopKey%,STCLer
  19. Hotkey,%PauseKey%,PCLer
  20. CGUI()
  21. OnMessage(0x200,"Whv")
  22. OnMessage(0x07,"Show_Win")
  23. CGUI2(),CGUI3(),CGUI4(),DBG(),ACB(),ACH(),ARB(),SetSPos(),AddTag(),CL_CoU(),SetUp()
  24. SetTimer,M_Loop,10
  25. return
  26. GuiClose:
  27.     Loop,% Brush.Length()
  28.         Gdip_DeleteBrush(Brush[A_Index])
  29.         Gdip_DeletePen(Pen[A_Index])
  30.     Loop,% Button.Length()
  31.         Gdip_DisposeImage(Button1[A_Index].Bitmap)
  32.     Loop,% Checks.Length()
  33.         Gdip_DisposeImage(Checks[A_Index].Bitmap)
  34.     Layered_Window_ShutDown(Win),Layered_Window_ShutDown(Win2),Layered_Window_ShutDown(Win3),Layered_Window_ShutDown(Win4)
  35.     ExitApp
  36. HotkeysGuiClose:
  37.     Gui,Hotkeys:Destroy
  38.     return
  39. M_Loop:
  40.     Critical
  41.     Draw_Inner()
  42.     Loop,% String.Length()
  43.         String[A_Index].Update()
  44.     UpdateLayeredWindow(Win2.hwnd, Win2.hdc, Win2.X, Win2.Y, Win2.W, Win2.H)
  45.     return
  46. Start:
  47.     Button1[Num].Draw_Pressed()
  48.     if(Free_Mode=1){
  49.         MsgShow(1)
  50.         return
  51.     }
  52.     gosub,SCLer
  53.     return
  54. MTAG:
  55.     Try{
  56.         Run,https://www.youtube.com/user/CivReborn
  57.     }
  58.     return     
  59. Stop:  
  60.     Button1[Num].Draw_Pressed()
  61.     Stop:=1
  62.     PauseOn:=0
  63.     SetTimer,M_Loop,on
  64.     return
  65. Reload:
  66.     Button1[Num].Draw_Pressed()
  67.     Reload
  68.     return
  69. Hotkeys:   
  70.     Button1[Num].Draw_Pressed()
  71.     Gui,Hotkeys:Destroy
  72.     Gui,Hotkeys:+Owner1 +ToolWindow -Caption -DPIScale
  73.     Gui,Hotkeys:Color,002200,00ff00
  74.     Gui,Hotkeys:Font,cLime s10 Bold Q5,Microsoft YaHei UI
  75.     Gui,Hotkeys:Add,Text,cLime x10 y10 w50,Start:
  76.     Gui,Hotkeys:Add,Hotkey,x+10  w120 vStartKey,%StartKey%
  77.     Gui,Hotkeys:Add,Button,x+10 w90 h25 -Theme gUDSTRK,Update
  78.     Gui,Hotkeys:Add,Text,cLime x10 y+15 w50,Stop:
  79.     Gui,Hotkeys:Add,Hotkey,x+10  w120 vStopKey,% StopKey
  80.     Gui,Hotkeys:Add,Button,x+10 w90 h25 -Theme gUDSTPK,Update
  81.     Gui,Hotkeys:Add,Text,cLime x10 y+15 w50 ,Pause:
  82.     Gui,Hotkeys:Add,Hotkey,x+10  w120 vPauseKey,% PauseKey
  83.     Gui,Hotkeys:Add,Button,x+10 w90 h25 -Theme gUDPK,Update
  84.     Gui,Hotkeys:Add,Button,x30 y140 w240 h30 -Theme gHotkeysGuiClose,Done
  85.     Add_Border_Trim("Hotkeys",0,0,300,180,"00aa00",2)
  86.     Gui,Hotkeys:Show,w300 h180
  87.     return
  88. UDSTRK:
  89.     GuiControlGet,newkey,,StartKey
  90.     if(newkey!=Startkey&&newkey!=null){
  91.         Hotkey,%StartKey%,SCLer,Off
  92.         StartKey:=NewKey
  93.         Hotkey,%StartKey%,SCLer,On
  94.     }
  95.     return 
  96. Add_Border_Trim(Window,x,y,w,h,Color,Thickness:=1){
  97.     y2:=y+h-Thickness,x2:=x+w-Thickness
  98.     Gui,%Window%:Add,Progress,x%x% y%y% w%w% h%Thickness% Background%color%
  99.     Gui,%Window%:Add,Progress,x%x% y%y% w%Thickness% h%h% Background%color%
  100.     Gui,%Window%:Add,Progress,x%x% y%y2% w%w% h%Thickness% Background%color%
  101.     Gui,%Window%:Add,Progress,x%x2% y%y% w%Thickness% h%h% Background%color%
  102. }  
  103. AddTag(){
  104.     if(Stop=1){
  105.         DeleteObject(pbit),pbit:=Gdip_CreateBitmap(20,20),g:=Gdip_GraphicsFromImage(pbit),Gdip_SetSmoothingMode(g,1)
  106.         b1:=New_Brush("00aa00"),Fill_Box(g,b1,0,0,20,20),Gdip_DeleteBrush(b1),b1:=New_Brush("002200"),Fill_Box(g,b1,1,1,18,18)
  107.         Gdip_DeleteBrush(b1),b1:=Gdip_CreateLineBrushFromRect(2, 2,16,16,"0x33ffffff", "0xff000000"),Fill_Box(g,b1,2,2,16,16)
  108.         Gdip_DeleteBrush(b1),Gdip_TextToGraphics(g,"HB","y-1 s10 r5 cff00aa00 Bold vCenter Center","Microsoft YaHei UI",20,20)
  109.         Gdip_DrawImage(Win.G,pbit,15,6,20,20),UpdateLayeredWindow(Win.hwnd, Win.hdc),Gdip_DeleteGraphics(g)
  110.     }else if(Stop=0&&PauseOn=1){
  111.         DeleteObject(pbit),pbit:=Gdip_CreateBitmap(20,20),g:=Gdip_GraphicsFromImage(pbit),Gdip_SetSmoothingMode(g,1),b1:=New_Brush("bb7700")
  112.         Fill_Box(g,b1,0,0,20,20),Gdip_DeleteBrush(b1),b1:=New_Brush("002200"),Fill_Box(g,b1,1,1,18,18),Gdip_DeleteBrush(b1)
  113.         b1:=Gdip_CreateLineBrushFromRect(2, 2,16,16,"0x33ffffff", "0xff000000"),Fill_Box(g,b1,2,2,16,16),Gdip_DeleteBrush(b1)
  114.         Gdip_TextToGraphics(g,"HB","y-1 s10 r5 cff995500 Bold vCenter Center","Microsoft YaHei UI",20,20)
  115.         Gdip_DrawImage(Win.G,pbit,15,6,20,20),UpdateLayeredWindow(Win.hwnd, Win.hdc),Gdip_DeleteGraphics(g)
  116.     }else if(Stop=0&&PauseOn=0){
  117.         DeleteObject(pbit),pbit:=Gdip_CreateBitmap(20,20),g:=Gdip_GraphicsFromImage(pbit),Gdip_SetSmoothingMode(g,1)
  118.         b1:=New_Brush("ff0000"),Fill_Box(g,b1,0,0,20,20),Gdip_DeleteBrush(b1),b1:=New_Brush("002200"),Fill_Box(g,b1,1,1,18,18),Gdip_DeleteBrush(b1)
  119.         b1:=Gdip_CreateLineBrushFromRect(2, 2,16,16,"0x33ffffff", "0xff000000"),Fill_Box(g,b1,2,2,16,16),Gdip_DeleteBrush(b1)
  120.         Gdip_TextToGraphics(g,"HB","y-1 s10 r5 cffff0000 Bold vCenter Center","Microsoft YaHei UI",20,20)
  121.         Gdip_DrawImage(Win.G,pbit,15,6,20,20),UpdateLayeredWindow(Win.hwnd, Win.hdc),Gdip_DeleteGraphics(g)
  122.     }
  123. }
  124. SCLer:
  125.     if(Free_mode=0&&Target_X=null){
  126.         MsgShow(2)
  127.         return
  128.     }
  129.     SetTimer,M_Loop,off
  130.     Stop:=0,PauseOn:=0
  131.     (Speed=20)?(Offset:=21):(Speed=19)?(Offset:=23):(Speed=18)?(Offset:=25):(Speed=17)?(Offset:=27):(Speed=16)?(Offset:=29):(Speed=15)?(Offset:=30):(Speed=14)?(Offset:=32)
  132.     :(Speed=13)?(Offset:=35):(Speed=12)?(Offset:=37):(Speed=11)?(Offset:=39):(Speed=10)?(Offset:=41):(Speed=9)?(Offset:=43):(Speed=8)?(Offset:=50):(Speed=7)?(Offset:=58)
  133.     :(Speed=6)?(Offset:=70):(Speed=5)?(Offset:=82):(Speed=4)?(Offset:=94):(Speed=3)?(Offset:=126):(Speed=2)?(Offset:=158):(Speed=1)?(Offset:=350)
  134.     tca:=Fixed_Click_Amount,Start_Time:=A_TickCount
  135.     if(Fixed_Amount=1)
  136.         Click_Count:=0
  137.     AddTag()
  138.     DllCall("QueryPerformanceCounter", "Int64*", CounterBefore)
  139.     While(Stop=0){
  140.         if(PauseOn!=1){
  141.             DllCall("QueryPerformanceCounter", "Int64*", CounterAfter)
  142.             if(((CounterAfter - CounterBefore)/1000)>Delay+Offset){
  143.                 DllCall("QueryPerformanceCounter", "Int64*", CounterBefore)
  144.                 if(Free_Mode=1)
  145.                     Click,
  146.                 else if(Free_Mode=0)
  147.                     Click,%Target_X%,%Target_Y%
  148.                 if(GUI_Count=1){
  149.                     Click_Count++
  150.                     CL_CoU()
  151.                 }
  152.                 else if(Tooltip_Count=1)
  153.                     Tooltip,% ++Click_Count
  154.                 if(Fixed_Amount=1){
  155.                     if(--tca<=0)
  156.                         Stop:=1
  157.                 }  
  158.             }
  159.         }
  160.     }
  161.     Tooltip,
  162.     PauseOn:=0
  163.     AddTag()
  164.     SetTimer,M_Loop,on
  165.     return
  166. UDSTPK:
  167.     GuiControlGet,newkey,,StopKey
  168.     if(newkey!=Stopkey&&newkey!=null){
  169.             Hotkey,%StopKey%,STCLer,Off
  170.             StopKey:=NewKey
  171.             Hotkey,%StopKey%,STCLer,On
  172.     }
  173.     return
  174. STCLer:
  175.     Stop:=1
  176.     SetTimer,M_Loop,on
  177.     return
  178. UDPK:
  179.     GuiControlGet,newkey,,PauseKey
  180.     if(newkey!=PauseKey&&newkey!=null){
  181.         Hotkey,%PauseKey%,PCLer,Off
  182.         PauseKey:=NewKey
  183.         Hotkey,%PauseKey%,PCLer,On
  184.     }
  185.     return
  186. PCLer:
  187.     if(Stop=0){
  188.         PauseOn:=!PauseOn
  189.         if(PauseOn){
  190.             SetTimer,M_Loop,on
  191.             AddTag()
  192.         }
  193.         else    {
  194.             SetTimer,M_Loop,off
  195.             AddTag()
  196.         }
  197.     }
  198.     return
  199. Reset_Count:
  200.     Button1[Num].Draw_Pressed()
  201.     Click_Count:=0
  202.     CL_CoU()
  203.     return
  204. Set_Position:
  205.     Button1[Num].Draw_Pressed()
  206.     Set_CP(Target_X,Target_Y)
  207.     SetSPos()
  208.     return
  209. ADJSLD:
  210.     CoordMode,Mouse,Client
  211.     SetTimer,M_Loop,Off
  212.     slider1.UpDate()
  213.     SetTimer,M_Loop,on
  214.     CoordMode,Mouse,Screen
  215.     return
  216. Counter:
  217.     Loop,3  {
  218.         if(Radio1[A_Index].Name=A_GuiControl){
  219.             Radio1[A_Index].Draw_One()
  220.             Radio1[A_Index].State:=1
  221.         }else   {
  222.             Radio1[A_Index].Draw_Zero()
  223.             Radio1[A_Index].State:=0
  224.         }
  225.     }
  226.     (A_GuiControl="No_Count")?(No_Count:=1,GUI_Count:=0,ToolTip_Count:=0):(A_GuiControl="GUI_Count")?(No_Count:=0,GUI_Count:=1,ToolTip_Count:=0):(A_GuiControl="ToolTip_Count")?(No_Count:=0,GUI_Count:=0,ToolTip_Count:=1)
  227.     return
  228. Duration:
  229.     Loop,2  {
  230.         if(Radio1[A_Index+3].Name=A_GuiControl){
  231.             Radio1[A_Index+3].Draw_One()
  232.             Radio1[A_Index+3].State:=1
  233.         }else   {
  234.             Radio1[A_Index+3].Draw_Zero()
  235.             Radio1[A_Index+3].State:=0
  236.         }
  237.     }
  238.     (A_GuiControl="Click_Forever")?(Click_Forever:=1,Fixed_Amount:=0):(A_GuiControl="Fixed_Amount")?(Click_Forever:=0,Fixed_Amount:=1)
  239.     return
  240. SubSl:
  241.     Slider1.Subtract()
  242.     return 
  243. AddSl:
  244.     slider1.Add()
  245.     return
  246. ARB(){
  247.     Radio1[1]:=New Rad1(15,30,110,20,1,"33ff33","114411","No Count",12,"ff000000","ff777777","No_Count",1,"Counter")
  248.     Radio1[2]:=New Rad1(135,30,110,20,0,"33ff33","114411","GUI Count",12,"ff000000","ff777777","GUI_Count",1,"Counter")
  249.     Radio1[3]:=New Rad1(255,30,110,20,0,"33ff33","114411","ToolTip Count",12,"ff000000","ff777777","ToolTip_Count",1,"Counter")
  250.     Radio1[4]:=New Rad1(35,55,110,20,1,"33ff33","114411","Click Forever",12,"ff000000","ff777777","Click_Forever",2,"Duration")
  251.     Radio1[5]:=New Rad1(155,55,110,20,0,"33ff33","114411","Fixed Amount",12,"ff000000","ff777777","Fixed_Amount",2,"Duration")
  252.     Gui,3:Add,Text,x15 y30 w110 h20 vNo_Count gCounter
  253.     Gui,3:Add,Text,x135 y30 w110 h20 vGUI_Count gCounter
  254.     Gui,3:Add,Text,x255 y30 w110 h20 vToolTip_Count gCounter
  255.     Gui,3:Add,Text,x35 y55 w110 h20 vClick_Forever gDuration
  256.     Gui,3:Add,Text,x155 y55 w110 h20 vFixed_Amount gDuration
  257.     Gui,3:Add,Edit,x275 y56 w60 h18 Number Limit7 vFixed_Click_Amount gSetCAMOUNT,% Fixed_Click_Amount
  258.     Gui,1:Add,Text,x15 y6 w20 h20 gMTAG,
  259.     SetCAMOUNT()   
  260. }
  261. CGUI4(){
  262.     global
  263.     Win4:=Layered_Window_SetUp(4,0,0,Win2.W,Win2.H,4,"+Parent2 -Caption -DPIScale +LastFound")
  264.     UpdateLayeredWindow(Win4.hwnd, Win4.hdc, Win4.X, Win4.Y, Win4.W, Win4.H)
  265.     slider1:=New Slide()
  266.     Gui, 4:Add, Text, x15 y110 w250 h36 vSPSLD gADJSLD
  267.     Gui, 4:Add, Text, x275 y113 w30 h30 vSubSl gSubSl
  268.     Gui, 4:Add, Text, x325 y113 w30 h30 vAddSl gAddSl
  269. }
  270. class Slide {
  271.     __New(){
  272.         This.LX:=10,This.LY:=Ly,This.LW:=300,This.LH:=5,This.BX:=110
  273.         This.BY:=118,This.BW:=Bw,This.BH:=Bh,This.Bitmap:="",This.Draw_Bottom(),This.Draw_Top(),This.Display()
  274.     }
  275.     Draw_Bottom(){
  276.         DeleteObject(This.Bitmap)
  277.         This.Bitmap2:=Gdip_CreateBitmap(250,36)
  278.         g:=Gdip_GraphicsFromImage(This.Bitmap2)
  279.         Gdip_SetSmoothingMode(g,1),This.Brush:=New_Brush("00aa00")
  280.         Fill_Box(g,This.Brush,0,0,250,36),Gdip_DeleteBrush(This.Brush)
  281.         This.Brush:=New_Brush("002200"),Fill_Box(g,This.Brush,1,1,248,34),Gdip_DeleteBrush(This.Brush)
  282.         This.Brush:=Gdip_CreateLineBrushFromRect(0, 0,250,36,"0x33ffffff", "0xff000000"),Fill_Box(g,This.Brush,2,2,246,32)
  283.         Gdip_SetSmoothingMode(g,2),This.Brush:=New_Brush("00aa00"),Fill_Box(g,This.Brush,10,15,230,6),Gdip_DeleteBrush(This.Brush)
  284.         This.Brush:=New_Brush("000000","ff"),Fill_Box(g,This.Brush,12,17,226,2),Gdip_DeleteBrush(This.Brush)
  285.         Gdip_DrawImage(Win4.G, This.BitMap2,15,110,250,36),UpdateLayeredWindow(Win4.hwnd, Win4.hdc)
  286.         Gdip_DeleteBrush(This.Brush),Gdip_DeleteGraphics(g)
  287.     }
  288.     Draw_Top(){
  289.         DeleteObject(This.Bitmap),This.Bitmap:=Gdip_CreateBitmap(50,20),g:=Gdip_GraphicsFromImage(This.Bitmap)
  290.         Gdip_SetSmoothingMode(g,2),This.Brush:=New_Brush("00aa00"),Fill_Box(g,This.Brush,0,0,50,20),Gdip_DeleteBrush(This.Brush)
  291.         Gdip_SetSmoothingMode(g,1),This.Brush:=New_Brush("000000"),Fill_Box(g,This.Brush,1,1,48,18),Gdip_DeleteBrush(This.Brush)
  292.         This.Brush:=New_Brush("002200"),Fill_Box(g,This.Brush,2,2,46,16),Gdip_DeleteBrush(This.Brush)
  293.         This.Brush:=Gdip_CreateLineBrushFromRect(2, 2,46,16,"0x33ffffff", "0xff000000"),Fill_Box(g,This.Brush,2,2,46,16),xt:=8
  294.         Loop 4  {
  295.             Gdip_SetSmoothingMode(g,1),This.Brush:=New_Brush("00aa00"),Fill_Box(g,This.Brush,xt,4,3,12)
  296.             Gdip_DeleteBrush(This.Brush),Gdip_SetSmoothingMode(g,2),This.Brush:=New_Brush("000000")
  297.             Fill_Box(g,This.Brush,xt+1,5,1,10),Gdip_DeleteBrush(This.Brush),xt+=10
  298.         }
  299.                
  300.         Gdip_DrawImage(Win4.G, This.BitMap,This.BX,This.BY,50,20),UpdateLayeredWindow(Win4.hwnd, Win4.hdc),Gdip_DeleteBrush(This.Brush),Gdip_DeleteGraphics(g)
  301.     }
  302.     UpDate(){
  303.         While(GetKeyState("LButton")){
  304.             MouseGetPos,slx,
  305.             if(slx>62&&slx<236)
  306.                 This.BX:=slx-34
  307.             else if(slx<62)
  308.                 This.BX:=62-34
  309.             else if(slx>236)
  310.                 This.BX:=236-34
  311.             Gdip_GraphicsClear(Win4.G),Gdip_DrawImage(Win4.G, This.BitMap2,15,110,250,36)
  312.             Gdip_DrawImage(Win4.G, This.BitMap,This.BX,This.BY,50,20),speed:= Floor(This.BX/9.1578)-2
  313.             This.Display(),UpdateLayeredWindow(Win4.hwnd, Win4.hdc)
  314.             ToolTip,% speed            
  315.         }
  316.         ToolTip,
  317.         Delay:=1000/Speed
  318.     }
  319.     Add(){
  320.         if(Speed<20){
  321.             Speed++
  322.             This.BX:=Speed*9.1578+16
  323.             if(Speed=20)
  324.                 This.Bx:=236-34
  325.             Gdip_GraphicsClear(Win4.G),Gdip_DrawImage(Win4.G, This.BitMap2,15,110,250,36)
  326.             Gdip_DrawImage(Win4.G, This.BitMap,This.BX,This.BY,50,20),This.Display(),UpdateLayeredWindow(Win4.hwnd, Win4.hdc)
  327.         }
  328.         Delay:=1000/Speed  
  329.     }
  330.     Subtract(){
  331.         if(Speed>1){
  332.             Speed--
  333.             This.BX:=Speed*9.1578+16
  334.             if(Speed=1)
  335.                 This.Bx:=62-34
  336.             Gdip_GraphicsClear(Win4.G),Gdip_DrawImage(Win4.G, This.BitMap2,15,110,250,36)
  337.             Gdip_DrawImage(Win4.G, This.BitMap,This.BX,This.BY,50,20),This.Display(),UpdateLayeredWindow(Win4.hwnd, Win4.hdc)
  338.         }
  339.         Delay:=1000/Speed  
  340.     }  
  341.     Display(){
  342.         DeleteObject(This.Bitmap3),This.Bitmap3:=Gdip_CreateBitmap(90,30),g:=Gdip_GraphicsFromImage(This.Bitmap3)
  343.         Gdip_SetSmoothingMode(g,1),This.Brush:=New_Brush("00aa00"),Fill_Box(g,This.Brush,0,0,90,30),Gdip_DeleteBrush(This.Brush)
  344.         Gdip_SetSmoothingMode(g,1),This.Brush:=New_Brush("000000"),Fill_Box(g,This.Brush,1,1,88,28),Gdip_DeleteBrush(This.Brush)
  345.         This.Brush:=New_Brush("002200"),Fill_Box(g,This.Brush,2,2,86,26),Gdip_DeleteBrush(This.Brush),This.Brush:=New_Brush("00ff00")
  346.         Fill_Box(g,This.Brush,30,4,1,22),Fill_Box(g,This.Brush,60,4,1,22),Gdip_DeleteBrush(This.Brush),This.Brush:=Gdip_CreateLineBrushFromRect(2, 2,86,26,"0x33ffffff", "0xff000000")
  347.         Fill_Box(g,This.Brush,2,2,86,26),Gdip_TextToGraphics(g,Speed," s12 r5 cff00ff00 Bold vCenter Center","Microsoft YaHei UI",90,30)
  348.         Gdip_TextToGraphics(g,"-             +"," s12 r5 cff00ff00 Bold vCenter Center","Microsoft YaHei UI",90,30),Gdip_DrawImage(Win4.G, This.BitMap3,275,113,90,30)
  349.         UpdateLayeredWindow(Win4.hwnd, Win4.hdc),Gdip_DeleteBrush(This.Brush),Gdip_DeleteGraphics(g)
  350.     }
  351. }
  352. class Butt  {
  353.     __New(x,y,w,h,font_Size,Text_Colour,Text,Name,Hover_Text_Colour,Hover_BC_Colour,Win_Number,Pressed_BC_Colour:="",Pressed_Text_Colour:="",Underline_Flag:=0){
  354.         This.X:=x,This.Y:=y,This.W:=w,This.H:=h,This.Font_Size:=font_Size,This.Colour:=Text_Colour,This.Hover_Text_Colour:=Hover_Text_Colour
  355.         This.Pressed_Text_Colour:=Pressed_Text_Colour,This.Text:=Text,This.Name:=Name,This.Hover_BC_Colour:=Hover_BC_Colour
  356.         This.Pressed_BC_Colour:=Pressed_BC_Colour,This.Window_Number:=Win_Number,This.UnderLine_Flag:=Underline_Flag,This.Draw_Norm()
  357.     }
  358.     Draw_Norm(){
  359.         global
  360.         DeleteObject(This.Bitmap),This.Bitmap:=Gdip_CreateBitmap(This.W,This.H),g:=Gdip_GraphicsFromImage(This.Bitmap),Gdip_SetSmoothingMode(g,1)
  361.         This.Brush:=New_Brush("00aa00"),Fill_Box(g,This.Brush,0,0,This.W,This.H),Gdip_DeleteBrush(This.Brush),This.Brush:=New_Brush("000000")
  362.         Fill_Box(g,This.Brush,1,1,This.W-2,This.H-2),Gdip_DeleteBrush(This.Brush),This.Brush:=New_Brush("002200"),Fill_Box(g,This.Brush,2,2,This.W-4,This.H-4)
  363.         Gdip_DeleteBrush(This.Brush),Gdip_TextToGraphics(g,This.Text,"s" This.Font_Size " r5 c" This.Colour " Bold vCenter Center","Microsoft YaHei UI",This.W,This.H)
  364.         This.Brush:=Gdip_CreateLineBrushFromRect(2, 2,This.W-4,This.H-4,"0x33ffffff", "0xff000000"),Fill_Box(g,This.Brush,0,0,This.W,This.H)
  365.         if(This.Window_Number=1)
  366.             Gdip_DrawImage(Win.G, This.BitMap,This.X,This.Y,This.W,This.H),UpdateLayeredWindow(Win.hwnd, Win.hdc)
  367.         else if(This.Window_Number=3)
  368.             Gdip_DrawImage(Win3.G, This.BitMap,This.X,This.Y,This.W,This.H),UpdateLayeredWindow(Win3.hwnd, Win3.hdc)
  369.         Gdip_DeleteGraphics(g) 
  370.     }
  371.     Draw_Hover(){
  372.         global
  373.         DeleteObject(This.Bitmap),This.Bitmap:=Gdip_CreateBitmap(This.W,This.H),g:=Gdip_GraphicsFromImage(This.Bitmap),Gdip_SetSmoothingMode(g,1)
  374.         This.Brush:=New_Brush("00aa00"),Fill_Box(g,This.Brush,0,0,This.W,This.H),Gdip_DeleteBrush(This.Brush),This.Brush:=New_Brush("333333")
  375.         Fill_Box(g,This.Brush,1,1,This.W-2,This.H-2),Gdip_DeleteBrush(This.Brush),This.Brush:=New_Brush(This.Hover_BC_Colour),Fill_Box(g,This.Brush,2,2,This.W-4,This.H-4)
  376.         Gdip_DeleteBrush(This.Brush)
  377.         If(This.UnderLine_Flag=1)
  378.             Gdip_TextToGraphics(g,This.Text,"s" This.Font_Size " r5 c" This.Hover_Text_Colour " Bold Underline vCenter Center","Microsoft YaHei UI",This.W,This.H)
  379.         else   
  380.             Gdip_TextToGraphics(g,This.Text,"s" This.Font_Size " r5 c" This.Hover_Text_Colour " Bold vCenter Center","Microsoft YaHei UI",This.W,This.H)
  381.         This.Brush:=Gdip_CreateLineBrushFromRect(2, 2,This.W-4,This.H-4,"0x11ffffff", "0xff000000"),Fill_Box(g,This.Brush,0,0,This.W,This.H)
  382.         if(This.Window_Number=1)
  383.             Gdip_DrawImage(Win.G, This.BitMap,This.X,This.Y,This.W,This.H),UpdateLayeredWindow(Win.hwnd, Win.hdc)
  384.         else if(This.Window_Number=3)
  385.             Gdip_DrawImage(Win3.G, This.BitMap,This.X,This.Y,This.W,This.H),UpdateLayeredWindow(Win3.hwnd, Win3.hdc)
  386.         Gdip_DeleteBrush(This.Brush),Gdip_DeleteGraphics(g)
  387.     }
  388.     Draw_Pressed(){
  389.         global
  390.         DeleteObject(This.Bitmap),This.Bitmap:=Gdip_CreateBitmap(This.W,This.H),g:=Gdip_GraphicsFromImage(This.Bitmap),Gdip_SetSmoothingMode(g,1)
  391.         This.Brush:=New_Brush("00aa00"),Fill_Box(g,This.Brush,0,0,This.W,This.H),Gdip_DeleteBrush(This.Brush),This.Brush:=New_Brush("333333")
  392.         Fill_Box(g,This.Brush,1,1,This.W-2,This.H-2),Gdip_DeleteBrush(This.Brush),This.Brush:=New_Brush(This.Pressed_BC_Colour)
  393.         Fill_Box(g,This.Brush,2,2,This.W-4,This.H-4),Gdip_DeleteBrush(This.Brush)
  394.         If(This.UnderLine_Flag=1)
  395.             Gdip_TextToGraphics(g,This.Text,"s" This.Font_Size " r5 c" This.Pressed_Text_Colour " Bold Underline vCenter Center","Microsoft YaHei UI",This.W,This.H)
  396.         else   
  397.             Gdip_TextToGraphics(g,This.Text,"s" This.Font_Size " r5 c" This.Pressed_Text_Colour " Bold vCenter Center","Microsoft YaHei UI",This.W,This.H)
  398.         This.Brush:=Gdip_CreateLineBrushFromRect(2, 2,This.W-4,This.H-4,"0x11ffffff", "0xff000000"),Fill_Box(g,This.Brush,0,0,This.W,This.H)
  399.         if(This.Window_Number=1)
  400.             Gdip_DrawImage(Win.G, This.BitMap,This.X,This.Y,This.W,This.H),UpdateLayeredWindow(Win.hwnd, Win.hdc)
  401.         else if(This.Window_Number=3)
  402.             Gdip_DrawImage(Win3.G, This.BitMap,This.X,This.Y,This.W,This.H),UpdateLayeredWindow(Win3.hwnd, Win3.hdc)
  403.         Gdip_DeleteBrush(This.Brush),Gdip_DeleteGraphics(g)
  404.         SetTimer,OT,Off
  405.         MouseGetPos,,,,ctrl1,2
  406.         While(GetKeyState("LButton"))
  407.             sleep,-1
  408.         MouseGetPos,,,,ctrl2,2
  409.         if(ctrl1=ctrl2)
  410.             This.Draw_Hover()
  411.         SetTimer,OT,On 
  412.     }
  413. }
  414. class Rad1  {
  415.     __New(x,y,w,h,State,On_Colour,Off_Colour,Text,Font_Size,On_Font_Colour,Off_Font_Colour,Name,Group_Name,Label){
  416.         This.X:=x,This.Y:=y,This.W:=w,This.H:=h,This.Name:=Name,This.Label:=Label,This.Group_Name:=Group_Name,This.Text:=Text
  417.         This.On_Font_Colour:=On_Font_Colour,This.Off_Font_Colour:=Off_Font_Colour,This.Font_Size:=Font_Size,This.On_Colour:=On_Colour
  418.         This.Off_Colour:=Off_Colour,This.State:=State,This.Bitmap:=""
  419.         if(This.State=1)
  420.             This.Draw_One()
  421.         else
  422.             This.Draw_Zero()
  423.     }
  424.     Draw_One(){
  425.         DeleteObject(This.Bitmap),This.Bitmap:=Gdip_CreateBitmap(This.W,This.H),g:=Gdip_GraphicsFromImage(This.Bitmap),Gdip_SetSmoothingMode(g,1)
  426.         This.Brush:=New_Brush("00aa00"),Fill_Box(g,This.Brush,0,0,This.W,This.H),Gdip_DeleteBrush(This.Brush),This.Brush:=New_Brush("000000")
  427.         Fill_Box(g,This.Brush,1,1,This.W-2,This.H-2),Gdip_DeleteBrush(This.Brush),This.Brush:=New_Brush(This.On_Colour),Fill_Box(g,This.Brush,2,2,This.W-4,This.H-4)
  428.         Gdip_DeleteBrush(This.Brush),This.Brush:=Gdip_CreateLineBrushFromRect(0, 0,This.W-4,This.H-4,"0x11ffffff", "0xdd000000")
  429.         Fill_Box(g,This.Brush,0,0,This.W,This.H),Gdip_TextToGraphics(g,This.Text,"s" This.Font_Size " r5 c" This.On_Font_Colour " Bold vCenter Center","Microsoft YaHei UI",This.W,This.H)
  430.         Gdip_DrawImage(Win3.G, This.BitMap,This.X,This.Y,This.W,This.H),UpdateLayeredWindow(Win3.hwnd, Win3.hdc),Gdip_DeleteBrush(This.Brush),Gdip_DeleteGraphics(g)
  431.     }
  432.     Draw_Zero(){
  433.         DeleteObject(This.Bitmap),This.Bitmap:=Gdip_CreateBitmap(This.W,This.H),g:=Gdip_GraphicsFromImage(This.Bitmap),Gdip_SetSmoothingMode(g,1)
  434.         This.Brush:=New_Brush("00aa00"),Fill_Box(g,This.Brush,0,0,This.W,This.H),Gdip_DeleteBrush(This.Brush),This.Brush:=New_Brush("000000")
  435.         Fill_Box(g,This.Brush,1,1,This.W-2,This.H-2),Gdip_DeleteBrush(This.Brush),This.Brush:=New_Brush(This.Off_Colour),Fill_Box(g,This.Brush,2,2,This.W-4,This.H-4)
  436.         Gdip_DeleteBrush(This.Brush),This.Brush:=Gdip_CreateLineBrushFromRect(0, 0,This.W-4,This.H-4,"0x11ffffff", "0xdd000000"),Fill_Box(g,This.Brush,0,0,This.W,This.H)
  437.         Gdip_TextToGraphics(g,This.Text,"s" This.Font_Size " r5 c" This.Off_Font_Colour " Bold vCenter Center","Microsoft YaHei UI",This.W,This.H)
  438.         Gdip_DrawImage(Win3.G, This.BitMap,This.X,This.Y,This.W,This.H),UpdateLayeredWindow(Win3.hwnd, Win3.hdc),Gdip_DeleteBrush(This.Brush),Gdip_DeleteGraphics(g)
  439.     }
  440. }
  441. class Check1    {
  442.     __New(x,y,w,h,State,On_Colour,Off_Colour,Text,Font_Size,On_Font_Colour,Off_Font_Colour,Name){
  443.         This.X:=x,This.Y:=y,This.W:=w,This.H:=h,This.Name:=Name,This.Text:=Text,This.On_Font_Colour:=On_Font_Colour,This.Off_Font_Colour:=Off_Font_Colour
  444.         This.Font_Size:=Font_Size,This.On_Colour:=On_Colour,This.Off_Colour:=Off_Colour,This.State:=State,This.Bitmap:=""
  445.         if(This.State=1)
  446.             This.Draw_One()
  447.         else
  448.             This.Draw_Zero()
  449.     }
  450.     Draw_One(){
  451.         DeleteObject(This.Bitmap),This.Bitmap:=Gdip_CreateBitmap(This.W,This.H),g:=Gdip_GraphicsFromImage(This.Bitmap),Gdip_SetSmoothingMode(g,1)
  452.         This.Brush:=New_Brush("00aa00"),Fill_Box(g,This.Brush,0,0,This.W,This.H),Gdip_DeleteBrush(This.Brush),This.Brush:=New_Brush("000000")
  453.         Fill_Box(g,This.Brush,1,1,This.W-2,This.H-2),Gdip_DeleteBrush(This.Brush),This.Brush:=New_Brush(This.On_Colour),Fill_Box(g,This.Brush,2,2,This.W-4,This.H-4)
  454.         Gdip_DeleteBrush(This.Brush),This.Brush:=Gdip_CreateLineBrushFromRect(0, 0,This.W-4,This.H-4,"0x11ffffff", "0xdd000000"),Fill_Box(g,This.Brush,0,0,This.W,This.H)
  455.         Gdip_TextToGraphics(g,This.Text,"s" This.Font_Size " r5 c" This.On_Font_Colour " Bold vCenter Center","Microsoft YaHei UI",This.W,This.H)
  456.         Gdip_DrawImage(Win3.G, This.BitMap,This.X,This.Y,This.W,This.H),UpdateLayeredWindow(Win3.hwnd, Win3.hdc),Gdip_DeleteBrush(This.Brush),Gdip_DeleteGraphics(g)
  457.     }
  458.     Draw_Zero(){
  459.         DeleteObject(This.Bitmap),This.Bitmap:=Gdip_CreateBitmap(This.W,This.H),g:=Gdip_GraphicsFromImage(This.Bitmap),Gdip_SetSmoothingMode(g,1)
  460.         This.Brush:=New_Brush("00aa00"),Fill_Box(g,This.Brush,0,0,This.W,This.H),Gdip_DeleteBrush(This.Brush),This.Brush:=New_Brush("000000")
  461.         Fill_Box(g,This.Brush,1,1,This.W-2,This.H-2),Gdip_DeleteBrush(This.Brush),This.Brush:=New_Brush(This.Off_Colour),Fill_Box(g,This.Brush,2,2,This.W-4,This.H-4)
  462.         Gdip_DeleteBrush(This.Brush),This.Brush:=Gdip_CreateLineBrushFromRect(0, 0,This.W-4,This.H-4,"0x11ffffff", "0xdd000000"),Fill_Box(g,This.Brush,0,0,This.W,This.H)
  463.         Gdip_TextToGraphics(g,This.Text,"s" This.Font_Size " r5 c" This.Off_Font_Colour " Bold vCenter Center","Microsoft YaHei UI",This.W,This.H)
  464.         Gdip_DrawImage(Win3.G, This.BitMap,This.X,This.Y,This.W,This.H),UpdateLayeredWindow(Win3.hwnd, Win3.hdc),Gdip_DeleteBrush(This.Brush),Gdip_DeleteGraphics(g)
  465.     }
  466. }  
  467. Check_Pos(a1:="",a2:="",a3:="",a4:="",a5:="",a6:="",a7:="",a8:=""){
  468.     WinGetPos,a2,a6,,,HB M-Clicker
  469.     if(a1-a2<a3&&a1-a2>a4&&a5-a6>a7&&a5-a6<a8)
  470.         return true
  471.     else
  472.         return false
  473. }
  474. MW(){
  475.     SetTimer,M_Loop,Off
  476.     PostMessage,0xA1,2
  477.     MovWin:=1
  478.     While(GetKeyState("LButton"))
  479.         Sleep,10
  480.     SetTimer,M_Loop,30
  481.     MovWin:=0
  482. }
  483. MINW(){
  484.     Gui,1:Minimize
  485. }
  486. CGUI(){
  487.     global
  488.     Win:=Layered_Window_SetUp(4,A_ScreenWidth//2-Win.W//2,A_ScreenHeight//2-Win.H//2,Win.W,Win.H,1,"+AlwaysOnTop -Caption -DPIScale")
  489.     Gui,1:Add,Text,x70 y5 w260 h20 vtitle  gMW
  490.     Gui,1:Add,Text,x350 y7 w15 h15 vWMB gMINW
  491.     Gui,1:Add,Text,x370 y7 w15 h15 vWCB gGuiClose
  492.     Gui,1:Show,,HB MC
  493. }
  494. CGUI2(){
  495.     global
  496.     Win2:=Layered_Window_SetUp(4,10,30,Win.W-20,Win.H-40,2,"+Parent1 -Caption -DPIScale")
  497. }
  498. CGUI3(){
  499.     global
  500.     Win3:=Layered_Window_SetUp(4,0,0,Win2.W,Win2.H,3,"+Parent2 -Caption -DPIScale +LastFound") 
  501.     UpdateLayeredWindow(Win3.hwnd, Win3.hdc, Win3.X, Win3.Y, Win3.W, Win3.H)   
  502. }
  503. Set_CP(ByRef Target_X,ByRef Target_Y){
  504.     While(!GetKeyState("LButton"))
  505.         ToolTip, Click Somewhere.
  506.     ToolTip,
  507.     MouseGetPos,Target_X,Target_Y
  508. }
  509. SetSPos(){
  510.     bitm:=Gdip_CreateBitmap(60,21),g:=Gdip_GraphicsFromImage(bitm),Gdip_SetSmoothingMode(g,2)
  511.     tbr:=New_Brush("22aa22","ff"),Fill_Box(g,tbr,0,0,60,21),tpn:=New_Pen("004400","ff",1)
  512.     Gdip_DrawRectangle(g, tpn,0,0,59,20),Gdip_DeletePen(tpn),Gdip_DeleteBrush(tbr)
  513.     Gdip_TextToGraphics(g,Target_X " " Target_Y," s10 r5 cff000000 Bold vCenter Center","Microsoft YaHei UI",60,21)
  514.     Gdip_DrawImage(Win3.G, bitm,100,81,60,21),UpdateLayeredWindow(Win3.hwnd, Win3.hdc),Gdip_DeleteGraphics(g),Gdip_DisposeImage(bitm)
  515. }
  516. CL_CoU(){
  517.     bitm:=Gdip_CreateBitmap(60,21),g:=Gdip_GraphicsFromImage(bitm),Gdip_SetSmoothingMode(g,2),tbr:=New_Brush("22aa22","ff")
  518.     Fill_Box(g,tbr,0,0,60,21),tpn:=New_Pen("004400","ff",1),Gdip_DrawRectangle(g, tpn,0,0,59,20),Gdip_DeletePen(tpn),Gdip_DeleteBrush(tbr)
  519.     Gdip_TextToGraphics(g,Click_Count," s10 r5 cff000000 Bold vCenter Center","Microsoft YaHei UI",60,21)
  520.     Gdip_DrawImage(Win3.G, bitm,290,81,60,21),UpdateLayeredWindow(Win3.hwnd, Win3.hdc),Gdip_DeleteGraphics(g),Gdip_DisposeImage(bitm)
  521. }
  522. ACB(){
  523.     global
  524.     Button1[1]:=New Butt(350,7,16,15,12,"ff33bb44","-","WMB","ff000000","22cc22",1),Button1[2]:=New Butt(370,7,16,15,12,"ff33bb55","X","WCB","ff000000","880000",1)
  525.     Button1[3]:=New Butt(70,3,260,24,12,"ff00ff00","HB Matrix Clicker","Title","ff000000","aaccaa",1,,,1),Button1[4]:=New Butt(5,153,120,25,14,"ff00ff00","Start","Start","ff000000","22cc22",3,"115511","ff000000",1)
  526.     Button1[5]:=New Butt(130,153,120,25,14,"ff00ff00","Stop","Stop","ff000000","22cc22",3,"115511","ff000000",1),Button1[6]:=New Butt(255,153,120,25,14,"ff00ff00","Reload","Reload","ff000000","22cc22",3,"115511","ff000000",1)
  527.     Button1[7]:=New Butt(20,182,340,25,14,"ff00ff00","HotKeys","Hotkeys","ff000000","22cc22",3,"115511","ff000000",1),Button1[8]:=New Butt(5,80,90,25,12,"ff00ff00","Set Position","Set_Position","ff000000","22cc22",3,"115511","ff000000",1)
  528.     Button1[9]:=New Butt(190,80,90,25,12,"ff00ff00","Reset Count","Reset_Count","ff000000","22cc22",3,"115511","ff000000",1)
  529.     Gui,3:Add,Text,x5 y153 w120 h25 gStart vStart
  530.     Gui,3:Add,Text,x130 y153 w120 h25 gStop vStop
  531.     Gui,3:Add,Text,x255 y153 w120 h25 gReload vReload
  532.     Gui,3:Add,Text,x20 y182 w340 h25 gHotkeys vHotkeys
  533.     Gui,3:Add,Text,x5 y80 w90 h25 gSet_Position vSet_Position
  534.     Gui,3:Add,Text,x190 y80 w90 h25 gReset_Count vReset_Count
  535. }
  536. SetCAMOUNT(){
  537.     gui,3:Submit,NoHide
  538.     bitm:=Gdip_CreateBitmap(60,21),g:=Gdip_GraphicsFromImage(bitm),Gdip_SetSmoothingMode(g,2),tbr:=New_Brush("22aa22","ff")
  539.     Fill_Box(g,tbr,0,0,60,21),tpn:=New_Pen("004400","ff",1),Gdip_DrawRectangle(g, tpn,0,0,59,20),Gdip_DeletePen(tpn),Gdip_DeleteBrush(tbr)
  540.     Gdip_TextToGraphics(g,Fixed_Click_Amount," s10 r5 cff000000 Bold vCenter Center","Microsoft YaHei UI",60,21)
  541.     Gdip_DrawImage(Win3.G, bitm,275,56,60,18),UpdateLayeredWindow(Win3.hwnd, Win3.hdc),Gdip_DeleteGraphics(g),Gdip_DisposeImage(bitm)
  542. }
  543. DBG(){
  544.     global
  545.     Brush[1]:=New_Brush("000000"),Gdip_FillRoundedRectangle(Win.G,Brush[1],0,0, Win.w, Win.h, 15),Brush[2]:=Gdip_CreateLineBrushFromRect(0, 0, Win.w, 150,"0x44aaffaa", "0xff000000")
  546.     Gdip_FillRoundedRectangle(Win.G,Brush[2],0,0,win.w, 100, 15),Pen[1]:=New_Pen("00bb00","ff",2),Gdip_DrawRoundedRectangle(Win.G, Pen[1],0,0, Win.w-1, Win.h-1, 15)
  547.     Gdip_DeletePen(Pen[1]),Pen[1]:=New_Pen("00bb00","ff",2),Gdip_DrawRoundedRectangle(Win.G, Pen[1],0,0, Win.w-1, Win.h, 15),Gdip_DeletePen(Pen[1])
  548.     Brush[4]:=New_Brush("ffffff","11"),Gdip_FillEllipse(Win.G,Brush[4], 0, 30, 5,200),Gdip_FillEllipse(Win.G,Brush[4], 390, 30, 5,200),Gdip_FillEllipse(Win.G,Brush[4], 15, 235, 370,10)
  549.     Pen[2]:=New_Pen("000000","ff",2),Gdip_DrawRectangle(Win1.G, Pen[2],9,29, Win.w-18, Win.h-38),Gdip_DeletePen(Pen[2]),Pen[2]:=New_Pen("00bb00","ff",1)
  550.     Gdip_DrawRectangle(Win.G, Pen[2],9,29, Win.w-18, Win.h-38),Gdip_DeletePen(Pen[2]),Draw_Inner() 
  551.     UpdateLayeredWindow(Win.hwnd, Win.hdc, Win.X, Win.Y, Win.W, Win.H),UpdateLayeredWindow(Win2.hwnd, Win2.hdc, Win2.X, Win2.Y, Win2.W, Win2.H)
  552. }
  553. RandomNumber(min,max){
  554.     Random,out,Min,Max
  555.     return out
  556. }
  557. Draw_Inner(){  
  558.     Brush[2]:=New_Brush("001100","55"),Fill_Box(Win2.G,Brush[2],0,0, Win2.w, Win2.h)
  559. }
  560. Class Strings   {
  561.     __New(x,y,w,h){
  562.         This.X:=x,This.Y:=y,This.W:=w,This.H:=h,This.Font_Size:=RandomNumber(6,18),col:=RandomNumber(1,10),This.Counter:=RandomNumber(0,80),This.Colour:=colours[col]
  563.         This.Speed:=floor(This.Font_Size/4),This.Create_Bitmap()
  564.     }
  565.     Create_Bitmap(){
  566.         DeleteObject(This.Bitmap)
  567.         Gdip_DisposeImage(This.Bitmap)
  568.         This.Bitmap:=Gdip_CreateBitmap(This.W,This.H)
  569.         temp_Array:="",This.Array1:=[]
  570.         loop 70 {
  571.             val:=RandomNumber(1,34)
  572.             (val>30)?(temp_Array.=" `n",This.Array1[A_Index]:=" "):(temp_Array.=Letter_Array[val] "`n",This.Array1[A_Index]:=Letter_Array[val])
  573.         }
  574.         g:=Gdip_GraphicsFromImage(This.Bitmap),Gdip_SetSmoothingMode(g,4)
  575.         Gdip_TextToGraphics(g,temp_array,"s" This.Font_Size " r5 c" This.Colour " Bold Center","Chiller",20,400)   
  576.         Gdip_DeleteGraphics(g) 
  577.     }
  578.     Change_Things(){
  579.         DeleteObject(This.Bitmap)
  580.         Gdip_DisposeImage(This.Bitmap)
  581.         ;~ DeleteObject(This.Bitmap)
  582.         This.Bitmap:=Gdip_CreateBitmap(This.W,This.H)
  583.         temp_Array:=""
  584.         loop 70 {
  585.             rn:=RandomNumber(1,5)          
  586.             (rn=3)?(val:=RandomNumber(1,61),temp_Array.=Letter_Array[val] "`n"):(temp_Array.=This.Array1[A_Index] "`n")
  587.         }
  588.         g:=Gdip_GraphicsFromImage(This.Bitmap),Gdip_SetSmoothingMode(g,4)
  589.         Gdip_TextToGraphics(g,temp_array,"s" This.Font_Size " r5 c" This.Colour " Bold Center","Chiller",20,400)   
  590.         Gdip_DeleteGraphics(g),DeleteObject(This.Bitmap)   
  591.     }
  592.     UpDate(){
  593.         This.y+=This.Speed
  594.         if(++This.Counter>85)
  595.             This.Counter:=RandomNumber(0,80),This.Change_Things()
  596.         if(This.Y>Win.H){
  597.             This.Y:=RandomNumber(-400,-1150),This.X:=5*RandomNumber(0,Win.W//5-3)
  598.             This.Font_Size:=RandomNumber(6,22),This.Speed:=floor(This.Font_Size/4)
  599.             This.Create_Bitmap()
  600.         }
  601.         if(This.Y>-400&&This.Y<Win.H)
  602.             Gdip_DrawImage(Win2.G, This.BitMap,This.X,This.Y,This.W,This.H)
  603.     }
  604. }
  605. SetUp(){
  606.     x:=5
  607.     Loop, % Win2.W//5 - 3
  608.         String[A_Index]:=New Strings(x,RandomNumber(-400,-1150),20,400),x+=5   
  609. }  
  610. OT(){
  611.     MouseGetPos,,,,ctrl,2
  612.     GuiControlGet,name,%tgui%:Name,% ctrl
  613.     if(name!=Button1[Num].Name&&MovWin!=1){
  614.         Button1[Num].Draw_Norm(),Num:="",HovOn:=0,tgui:=""
  615.         SetTimer,OT,Off
  616.     }
  617. }
  618. Whv(){
  619.     if(HovOn=0){
  620.         MouseGetPos,,,,ctrl,2
  621.         GuiControlGet,name,%A_Gui%:Name,% ctrl
  622.         Loop, % Button1.Length()
  623.             if(Button1[A_Index].Name=name){
  624.                 HovOn:=1,tgui:=A_Gui,Num:=A_Index
  625.                 Button1[A_Index].Draw_Hover()
  626.                 SetTimer,OT,30
  627.             }
  628.     }
  629.     if(Stop=0&&PauseOn=0&&Free_Mode=1){
  630.         Stop:=1
  631.     }
  632. }      
  633. Show_Win(){
  634.     Button1[3].Draw_Norm()
  635. }  
  636. ACH(){
  637.     global
  638.     Checks[1]:=New Check1(50,5,120,20,1,"33ff33","114411","AlwaysOnTop",12,"ff000000","ff777777","Always")
  639.     Checks[3]:=New Check1(210,5,120,20,0,"33ff33","114411","Free Mode",12,"ff000000","ff777777","Free_Mode")
  640.     Gui,3:Add,Text,x50 y5 w120 h25 gAOT vAlways
  641.     Gui,3:Add,Text,x210 y5 w120 h25 gFM vFree_Mode
  642. }
  643. FM(){
  644.     Free_Mode:=!Free_Mode
  645.     if(Free_Mode){
  646.         Checks[3].Draw_One()
  647.     }else   {
  648.         Checks[3].Draw_Zero()
  649.     }
  650. }
  651. AOT(){
  652.     Always:=!Always
  653.     if(Always){
  654.         Checks[1].Draw_One()
  655.         Gui,1:+AlwaysOnTop
  656.     }else   {
  657.         Checks[1].Draw_Zero()
  658.         Gui,1:-AlwaysOnTop
  659.     }
  660. }  
  661. MsgShow(MsNum){
  662.     Gui,1:+OwnDialogs
  663.     if(MsNum=1)
  664.         MsgBox, 262192,Use Hotkeys,Use hotkeys to start and stop the auto clicker when in free mode.
  665.     else if(MsNum=2)
  666.         MsgBox, 262192,Set a position to click,Set a click position or switch to ""Free Mode""
  667. }
  668. Gdip_DeleteBrush(pBrush)
  669. {
  670.    return DllCall("gdiplus\GdipDeleteBrush", A_PtrSize ? "UPtr" : "UInt", pBrush)
  671. }
  672. Gdip_DeletePen(pPen)
  673. {
  674.    return DllCall("gdiplus\GdipDeletePen", A_PtrSize ? "UPtr" : "UInt", pPen)
  675. }
  676. Gdip_DisposeImage(pBitmap)
  677. {
  678.    return DllCall("gdiplus\GdipDisposeImage", A_PtrSize ? "UPtr" : "UInt", pBitmap)
  679. }
  680. Layered_Window_ShutDown(This)
  681.     {
  682.         SelectObject(This.hdc,This.obm)
  683.         DeleteObject(This.hbm)
  684.         DeleteDC(This.hdc)
  685.         gdip_deleteGraphics(This.g)
  686.         Gdip_Shutdown(This.Token)
  687.     }
  688. UpdateLayeredWindow(hwnd, hdc, x="", y="", w="", h="", Alpha=255)
  689. {
  690.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  691.    
  692.     if ((x != "") && (y != ""))
  693.         VarSetCapacity(pt, 8), NumPut(x, pt, 0, "UInt"), NumPut(y, pt, 4, "UInt")
  694.  
  695.     if (w = "") ||(h = "")
  696.         WinGetPos,,, w, h, ahk_id %hwnd%
  697.    
  698.     return DllCall("UpdateLayeredWindow"
  699.                     , Ptr, hwnd
  700.                     , Ptr, 0
  701.                     , Ptr, ((x = "") && (y = "")) ? 0 : &pt
  702.                     , "int64*", w|h<<32
  703.                     , Ptr, hdc
  704.                     , "int64*", 0
  705.                     , "uint", 0
  706.                     , "UInt*", Alpha<<16|1<<24
  707.                     , "uint", 2)
  708. }
  709. DeleteObject(hObject)
  710. {
  711.    return DllCall("DeleteObject", A_PtrSize ? "UPtr" : "UInt", hObject)
  712. }
  713. Gdip_CreateBitmap(Width, Height, Format=0x26200A)
  714. {
  715.     DllCall("gdiplus\GdipCreateBitmapFromScan0", "int", Width, "int", Height, "int", 0, "int", Format, A_PtrSize ? "UPtr" : "UInt", 0, A_PtrSize ? "UPtr*" : "uint*", pBitmap)
  716.     Return pBitmap
  717. }
  718. Gdip_GraphicsFromImage(pBitmap)
  719. {
  720.     DllCall("gdiplus\GdipGetImageGraphicsContext", A_PtrSize ? "UPtr" : "UInt", pBitmap, A_PtrSize ? "UPtr*" : "UInt*", pGraphics)
  721.     return pGraphics
  722. }
  723. Gdip_SetSmoothingMode(pGraphics, SmoothingMode)
  724. {
  725.    return DllCall("gdiplus\GdipSetSmoothingMode", A_PtrSize ? "UPtr" : "UInt", pGraphics, "int", SmoothingMode)
  726. }
  727. New_Brush(colour:="000000",Alpha:="FF")
  728.     {
  729.         static Hellbent_Brush:=[]
  730.         new_colour := "0x" Alpha colour
  731.         Hellbent_Brush[Hellbent_Brush.Length()+1]:=Gdip_BrushCreateSolid(new_colour)
  732.         return Hellbent_Brush[Hellbent_Brush.Length()]
  733.     }
  734. Fill_Box(pGraphics,pBrush,x,y,w,h) 
  735.     {
  736.         Ptr := A_PtrSize ? "UPtr" : "UInt"
  737.         return DllCall("gdiplus\GdipFillRectangle"
  738.                     , Ptr, pGraphics
  739.                     , Ptr, pBrush
  740.                     , "float", x
  741.                     , "float", y
  742.                     , "float", w
  743.                     , "float", h)
  744.     }
  745. Gdip_CreateLineBrushFromRect(x, y, w, h, ARGB1, ARGB2, LinearGradientMode=1, WrapMode=1)
  746. {
  747.     CreateRectF(RectF, x, y, w, h)
  748.     DllCall("gdiplus\GdipCreateLineBrushFromRect", A_PtrSize ? "UPtr" : "UInt", &RectF, "int", ARGB1, "int", ARGB2, "int", LinearGradientMode, "int", WrapMode, A_PtrSize ? "UPtr*" : "UInt*", LGpBrush)
  749.     return LGpBrush
  750. }
  751. Gdip_TextToGraphics(pGraphics, Text, Options, Font="Arial", Width="", Height="", Measure=0)
  752. {
  753.     IWidth := Width, IHeight:= Height
  754.    
  755.     RegExMatch(Options, "i)X([\-\d\.]+)(p*)", xpos)
  756.     RegExMatch(Options, "i)Y([\-\d\.]+)(p*)", ypos)
  757.     RegExMatch(Options, "i)W([\-\d\.]+)(p*)", Width)
  758.     RegExMatch(Options, "i)H([\-\d\.]+)(p*)", Height)
  759.     RegExMatch(Options, "i)C(?!(entre|enter))([a-f\d]+)", Colour)
  760.     RegExMatch(Options, "i)Top|Up|Bottom|Down|vCentre|vCenter", vPos)
  761.     RegExMatch(Options, "i)NoWrap", NoWrap)
  762.     RegExMatch(Options, "i)R(\d)", Rendering)
  763.     RegExMatch(Options, "i)S(\d+)(p*)", Size)
  764.  
  765.     if !Gdip_DeleteBrush(Gdip_CloneBrush(Colour2))
  766.         PassBrush := 1, pBrush := Colour2
  767.    
  768.     if !(IWidth && IHeight) && (xpos2 || ypos2 || Width2 || Height2 || Size2)
  769.         return -1
  770.  
  771.     Style := 0, Styles := "Regular|Bold|Italic|BoldItalic|Underline|Strikeout"
  772.     Loop, Parse, Styles, |
  773.     {
  774.         if RegExMatch(Options, "\b" A_loopField)
  775.         Style |= (A_LoopField != "StrikeOut") ? (A_Index-1) : 8
  776.     }
  777.  
  778.     Align := 0, Alignments := "Near|Left|Centre|Center|Far|Right"
  779.     Loop, Parse, Alignments, |
  780.     {
  781.         if RegExMatch(Options, "\b" A_loopField)
  782.             Align |= A_Index//2.1      ; 0|0|1|1|2|2
  783.     }
  784.  
  785.     xpos := (xpos1 != "") ? xpos2 ? IWidth*(xpos1/100) : xpos1 : 0
  786.     ypos := (ypos1 != "") ? ypos2 ? IHeight*(ypos1/100) : ypos1 : 0
  787.     Width := Width1 ? Width2 ? IWidth*(Width1/100) : Width1 : IWidth
  788.     Height := Height1 ? Height2 ? IHeight*(Height1/100) : Height1 : IHeight
  789.     if !PassBrush
  790.         Colour := "0x" (Colour2 ? Colour2 : "ff000000")
  791.     Rendering := ((Rendering1 >= 0) && (Rendering1 <= 5)) ? Rendering1 : 4
  792.     Size := (Size1 > 0) ? Size2 ? IHeight*(Size1/100) : Size1 : 12
  793.  
  794.     hFamily := Gdip_FontFamilyCreate(Font)
  795.     hFont := Gdip_FontCreate(hFamily, Size, Style)
  796.     FormatStyle := NoWrap ? 0x4000 | 0x1000 : 0x4000
  797.     hFormat := Gdip_StringFormatCreate(FormatStyle)
  798.     pBrush := PassBrush ? pBrush : Gdip_BrushCreateSolid(Colour)
  799.     if !(hFamily && hFont && hFormat && pBrush && pGraphics)
  800.         return !pGraphics ? -2 : !hFamily ? -3 : !hFont ? -4 : !hFormat ? -5 : !pBrush ? -6 : 0
  801.    
  802.     CreateRectF(RC, xpos, ypos, Width, Height)
  803.     Gdip_SetStringFormatAlign(hFormat, Align)
  804.     Gdip_SetTextRenderingHint(pGraphics, Rendering)
  805.     ReturnRC := Gdip_MeasureString(pGraphics, Text, hFont, hFormat, RC)
  806.  
  807.     if vPos
  808.     {
  809.         StringSplit, ReturnRC, ReturnRC, |
  810.        
  811.         if (vPos = "vCentre") || (vPos = "vCenter")
  812.             ypos += (Height-ReturnRC4)//2
  813.         else if (vPos = "Top") || (vPos = "Up")
  814.             ypos := 0
  815.         else if (vPos = "Bottom") || (vPos = "Down")
  816.             ypos := Height-ReturnRC4
  817.        
  818.         CreateRectF(RC, xpos, ypos, Width, ReturnRC4)
  819.         ReturnRC := Gdip_MeasureString(pGraphics, Text, hFont, hFormat, RC)
  820.     }
  821.  
  822.     if !Measure
  823.         E := Gdip_DrawString(pGraphics, Text, hFont, hFormat, pBrush, RC)
  824.  
  825.     if !PassBrush
  826.         Gdip_DeleteBrush(pBrush)
  827.     Gdip_DeleteStringFormat(hFormat)  
  828.     Gdip_DeleteFont(hFont)
  829.     Gdip_DeleteFontFamily(hFamily)
  830.     return E ? E : ReturnRC
  831. }
  832. Gdip_DrawImage(pGraphics, pBitmap, dx="", dy="", dw="", dh="", sx="", sy="", sw="", sh="", Matrix=1)
  833. {
  834.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  835.    
  836.     if (Matrix&1 = "")
  837.         ImageAttr := Gdip_SetImageAttributesColorMatrix(Matrix)
  838.     else if (Matrix != 1)
  839.         ImageAttr := Gdip_SetImageAttributesColorMatrix("1|0|0|0|0|0|1|0|0|0|0|0|1|0|0|0|0|0|" Matrix "|0|0|0|0|0|1")
  840.  
  841.     if (sx = "" && sy = "" && sw = "" && sh = "")
  842.     {
  843.         if (dx = "" && dy = "" && dw = "" && dh = "")
  844.         {
  845.             sx := dx := 0, sy := dy := 0
  846.             sw := dw := Gdip_GetImageWidth(pBitmap)
  847.             sh := dh := Gdip_GetImageHeight(pBitmap)
  848.         }
  849.         else
  850.         {
  851.             sx := sy := 0
  852.             sw := Gdip_GetImageWidth(pBitmap)
  853.             sh := Gdip_GetImageHeight(pBitmap)
  854.         }
  855.     }
  856.  
  857.     E := DllCall("gdiplus\GdipDrawImageRectRect"
  858.                 , Ptr, pGraphics
  859.                 , Ptr, pBitmap
  860.                 , "float", dx
  861.                 , "float", dy
  862.                 , "float", dw
  863.                 , "float", dh
  864.                 , "float", sx
  865.                 , "float", sy
  866.                 , "float", sw
  867.                 , "float", sh
  868.                 , "int", 2
  869.                 , Ptr, ImageAttr
  870.                 , Ptr, 0
  871.                 , Ptr, 0)
  872.     if ImageAttr
  873.         Gdip_DisposeImageAttributes(ImageAttr)
  874.     return E
  875. }
  876. Gdip_DeleteGraphics(pGraphics)
  877. {
  878.    return DllCall("gdiplus\GdipDeleteGraphics", A_PtrSize ? "UPtr" : "UInt", pGraphics)
  879. }
  880. Layered_Window_SetUp(Smoothing,Window_X,Window_Y,Window_W,Window_H,Window_Name:=1,Window_Options:="")
  881.     {
  882.         Layered:={}
  883.         Layered.W:=Window_W
  884.         Layered.H:=Window_H
  885.         Layered.X:=Window_X
  886.         Layered.Y:=Window_Y
  887.         Layered.Name:=Window_Name
  888.         Layered.Options:=Window_Options
  889.         Layered.Token:=Gdip_Startup()
  890.         Create_Layered_GUI(Layered)
  891.         Layered.hwnd:=winExist()
  892.         Layered.hbm := CreateDIBSection(Window_W,Window_H)
  893.         Layered.hdc := CreateCompatibleDC()
  894.         Layered.obm := SelectObject(Layered.hdc,Layered.hbm)
  895.         Layered.G := Gdip_GraphicsFromHDC(Layered.hdc)
  896.         Gdip_SetSmoothingMode(Layered.G,Smoothing)
  897.         return Layered
  898.     }
  899. Gdip_GraphicsClear(pGraphics, ARGB=0x00ffffff)
  900. {
  901.     return DllCall("gdiplus\GdipGraphicsClear", A_PtrSize ? "UPtr" : "UInt", pGraphics, "int", ARGB)
  902. }
  903. New_Pen(colour:="000000",Alpha:="FF",Width:= 5)
  904.     {
  905.         static Hellbent_Pen:=[]
  906.         new_colour := "0x" Alpha colour
  907.         Hellbent_Pen[Hellbent_Pen.Length()+1]:=Gdip_CreatePen(New_Colour,Width)
  908.         return Hellbent_Pen[Hellbent_Pen.Length()]
  909.     }
  910. Gdip_DrawRectangle(pGraphics, pPen, x, y, w, h)
  911. {
  912.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  913.    
  914.     return DllCall("gdiplus\GdipDrawRectangle", Ptr, pGraphics, Ptr, pPen, "float", x, "float", y, "float", w, "float", h)
  915. }
  916. Gdip_FillRoundedRectangle(pGraphics, pBrush, x, y, w, h, r)
  917. {
  918.     Region := Gdip_GetClipRegion(pGraphics)
  919.     Gdip_SetClipRect(pGraphics, x-r, y-r, 2*r, 2*r, 4)
  920.     Gdip_SetClipRect(pGraphics, x+w-r, y-r, 2*r, 2*r, 4)
  921.     Gdip_SetClipRect(pGraphics, x-r, y+h-r, 2*r, 2*r, 4)
  922.     Gdip_SetClipRect(pGraphics, x+w-r, y+h-r, 2*r, 2*r, 4)
  923.     E := Gdip_FillRectangle(pGraphics, pBrush, x, y, w, h)
  924.     Gdip_SetClipRegion(pGraphics, Region, 0)
  925.     Gdip_SetClipRect(pGraphics, x-(2*r), y+r, w+(4*r), h-(2*r), 4)
  926.     Gdip_SetClipRect(pGraphics, x+r, y-(2*r), w-(2*r), h+(4*r), 4)
  927.     Gdip_FillEllipse(pGraphics, pBrush, x, y, 2*r, 2*r)
  928.     Gdip_FillEllipse(pGraphics, pBrush, x+w-(2*r), y, 2*r, 2*r)
  929.     Gdip_FillEllipse(pGraphics, pBrush, x, y+h-(2*r), 2*r, 2*r)
  930.     Gdip_FillEllipse(pGraphics, pBrush, x+w-(2*r), y+h-(2*r), 2*r, 2*r)
  931.     Gdip_SetClipRegion(pGraphics, Region, 0)
  932.     Gdip_DeleteRegion(Region)
  933.     return E
  934. }
  935. Gdip_DrawRoundedRectangle(pGraphics, pPen, x, y, w, h, r)
  936. {
  937.     Gdip_SetClipRect(pGraphics, x-r, y-r, 2*r, 2*r, 4)
  938.     Gdip_SetClipRect(pGraphics, x+w-r, y-r, 2*r, 2*r, 4)
  939.     Gdip_SetClipRect(pGraphics, x-r, y+h-r, 2*r, 2*r, 4)
  940.     Gdip_SetClipRect(pGraphics, x+w-r, y+h-r, 2*r, 2*r, 4)
  941.     E := Gdip_DrawRectangle(pGraphics, pPen, x, y, w, h)
  942.     Gdip_ResetClip(pGraphics)
  943.     Gdip_SetClipRect(pGraphics, x-(2*r), y+r, w+(4*r), h-(2*r), 4)
  944.     Gdip_SetClipRect(pGraphics, x+r, y-(2*r), w-(2*r), h+(4*r), 4)
  945.     Gdip_DrawEllipse(pGraphics, pPen, x, y, 2*r, 2*r)
  946.     Gdip_DrawEllipse(pGraphics, pPen, x+w-(2*r), y, 2*r, 2*r)
  947.     Gdip_DrawEllipse(pGraphics, pPen, x, y+h-(2*r), 2*r, 2*r)
  948.     Gdip_DrawEllipse(pGraphics, pPen, x+w-(2*r), y+h-(2*r), 2*r, 2*r)
  949.     Gdip_ResetClip(pGraphics)
  950.     return E
  951. }
  952. Gdip_FillEllipse(pGraphics, pBrush, x, y, w, h)
  953. {
  954.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  955.    
  956.     return DllCall("gdiplus\GdipFillEllipse", Ptr, pGraphics, Ptr, pBrush, "float", x, "float", y, "float", w, "float", h)
  957. }
  958. SelectObject(hdc, hgdiobj)
  959. {
  960.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  961.    
  962.     return DllCall("SelectObject", Ptr, hdc, Ptr, hgdiobj)
  963. }
  964. DeleteDC(hdc)
  965. {
  966.    return DllCall("DeleteDC", A_PtrSize ? "UPtr" : "UInt", hdc)
  967. }
  968. Gdip_Shutdown(pToken)
  969. {
  970.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  971.    
  972.     DllCall("gdiplus\GdiplusShutdown", Ptr, pToken)
  973.     if hModule := DllCall("GetModuleHandle", "str", "gdiplus", Ptr)
  974.         DllCall("FreeLibrary", Ptr, hModule)
  975.     return 0
  976. }
  977. Gdip_BrushCreateSolid(ARGB=0xff000000)
  978. {
  979.     DllCall("gdiplus\GdipCreateSolidFill", "UInt", ARGB, A_PtrSize ? "UPtr*" : "UInt*", pBrush)
  980.     return pBrush
  981. }
  982. CreateRectF(ByRef RectF, x, y, w, h)
  983. {
  984.    VarSetCapacity(RectF, 16)
  985.    NumPut(x, RectF, 0, "float"), NumPut(y, RectF, 4, "float"), NumPut(w, RectF, 8, "float"), NumPut(h, RectF, 12, "float")
  986. }
  987. Gdip_CloneBrush(pBrush)
  988. {
  989.     DllCall("gdiplus\GdipCloneBrush", A_PtrSize ? "UPtr" : "UInt", pBrush, A_PtrSize ? "UPtr*" : "UInt*", pBrushClone)
  990.     return pBrushClone
  991. }
  992. Gdip_FontFamilyCreate(Font)
  993. {
  994.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  995.    
  996.     if (!A_IsUnicode)
  997.     {
  998.         nSize := DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &Font, "int", -1, "uint", 0, "int", 0)
  999.         VarSetCapacity(wFont, nSize*2)
  1000.         DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &Font, "int", -1, Ptr, &wFont, "int", nSize)
  1001.     }
  1002.    
  1003.     DllCall("gdiplus\GdipCreateFontFamilyFromName"
  1004.                     , Ptr, A_IsUnicode ? &Font : &wFont
  1005.                     , "uint", 0
  1006.                     , A_PtrSize ? "UPtr*" : "UInt*", hFamily)
  1007.    
  1008.     return hFamily
  1009. }
  1010. Gdip_FontCreate(hFamily, Size, Style=0)
  1011. {
  1012.    DllCall("gdiplus\GdipCreateFont", A_PtrSize ? "UPtr" : "UInt", hFamily, "float", Size, "int", Style, "int", 0, A_PtrSize ? "UPtr*" : "UInt*", hFont)
  1013.    return hFont
  1014. }
  1015. Gdip_StringFormatCreate(Format=0, Lang=0)
  1016. {
  1017.    DllCall("gdiplus\GdipCreateStringFormat", "int", Format, "int", Lang, A_PtrSize ? "UPtr*" : "UInt*", hFormat)
  1018.    return hFormat
  1019. }
  1020. Gdip_SetStringFormatAlign(hFormat, Align)
  1021. {
  1022.    return DllCall("gdiplus\GdipSetStringFormatAlign", A_PtrSize ? "UPtr" : "UInt", hFormat, "int", Align)
  1023. }
  1024. Gdip_SetTextRenderingHint(pGraphics, RenderingHint)
  1025. {
  1026.     return DllCall("gdiplus\GdipSetTextRenderingHint", A_PtrSize ? "UPtr" : "UInt", pGraphics, "int", RenderingHint)
  1027. }
  1028. Gdip_MeasureString(pGraphics, sString, hFont, hFormat, ByRef RectF)
  1029. {
  1030.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  1031.    
  1032.     VarSetCapacity(RC, 16)
  1033.     if !A_IsUnicode
  1034.     {
  1035.         nSize := DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &sString, "int", -1, "uint", 0, "int", 0)
  1036.         VarSetCapacity(wString, nSize*2)  
  1037.         DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &sString, "int", -1, Ptr, &wString, "int", nSize)
  1038.     }
  1039.    
  1040.     DllCall("gdiplus\GdipMeasureString"
  1041.                     , Ptr, pGraphics
  1042.                     , Ptr, A_IsUnicode ? &sString : &wString
  1043.                     , "int", -1
  1044.                     , Ptr, hFont
  1045.                     , Ptr, &RectF
  1046.                     , Ptr, hFormat
  1047.                     , Ptr, &RC
  1048.                     , "uint*", Chars
  1049.                     , "uint*", Lines)
  1050.    
  1051.     return &RC ? NumGet(RC, 0, "float") "|" NumGet(RC, 4, "float") "|" NumGet(RC, 8, "float") "|" NumGet(RC, 12, "float") "|" Chars "|" Lines : 0
  1052. }
  1053. Gdip_DrawString(pGraphics, sString, hFont, hFormat, pBrush, ByRef RectF)
  1054. {
  1055.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  1056.    
  1057.     if (!A_IsUnicode)
  1058.     {
  1059.         nSize := DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &sString, "int", -1, Ptr, 0, "int", 0)
  1060.         VarSetCapacity(wString, nSize*2)
  1061.         DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &sString, "int", -1, Ptr, &wString, "int", nSize)
  1062.     }
  1063.    
  1064.     return DllCall("gdiplus\GdipDrawString"
  1065.                     , Ptr, pGraphics
  1066.                     , Ptr, A_IsUnicode ? &sString : &wString
  1067.                     , "int", -1
  1068.                     , Ptr, hFont
  1069.                     , Ptr, &RectF
  1070.                     , Ptr, hFormat
  1071.                     , Ptr, pBrush)
  1072. }
  1073. Gdip_DeleteStringFormat(hFormat)
  1074. {
  1075.    return DllCall("gdiplus\GdipDeleteStringFormat", A_PtrSize ? "UPtr" : "UInt", hFormat)
  1076. }
  1077. Gdip_DeleteFont(hFont)
  1078. {
  1079.    return DllCall("gdiplus\GdipDeleteFont", A_PtrSize ? "UPtr" : "UInt", hFont)
  1080. }
  1081. Gdip_DeleteFontFamily(hFamily)
  1082. {
  1083.    return DllCall("gdiplus\GdipDeleteFontFamily", A_PtrSize ? "UPtr" : "UInt", hFamily)
  1084. }
  1085. Gdip_SetImageAttributesColorMatrix(Matrix)
  1086. {
  1087.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  1088.    
  1089.     VarSetCapacity(ColourMatrix, 100, 0)
  1090.     Matrix := RegExReplace(RegExReplace(Matrix, "^[^\d-\.]+([\d\.])", "$1", "", 1), "[^\d-\.]+", "|")
  1091.     StringSplit, Matrix, Matrix, |
  1092.     Loop, 25
  1093.     {
  1094.         Matrix := (Matrix%A_Index% != "") ? Matrix%A_Index% : Mod(A_Index-1, 6) ? 0 : 1
  1095.         NumPut(Matrix, ColourMatrix, (A_Index-1)*4, "float")
  1096.     }
  1097.     DllCall("gdiplus\GdipCreateImageAttributes", A_PtrSize ? "UPtr*" : "uint*", ImageAttr)
  1098.     DllCall("gdiplus\GdipSetImageAttributesColorMatrix", Ptr, ImageAttr, "int", 1, "int", 1, Ptr, &ColourMatrix, Ptr, 0, "int", 0)
  1099.     return ImageAttr
  1100. }
  1101. Gdip_GetImageWidth(pBitmap)
  1102. {
  1103.    DllCall("gdiplus\GdipGetImageWidth", A_PtrSize ? "UPtr" : "UInt", pBitmap, "uint*", Width)
  1104.    return Width
  1105. }
  1106. Gdip_GetImageHeight(pBitmap)
  1107. {
  1108.    DllCall("gdiplus\GdipGetImageHeight", A_PtrSize ? "UPtr" : "UInt", pBitmap, "uint*", Height)
  1109.    return Height
  1110. }
  1111. Gdip_DisposeImageAttributes(ImageAttr)
  1112. {
  1113.     return DllCall("gdiplus\GdipDisposeImageAttributes", A_PtrSize ? "UPtr" : "UInt", ImageAttr)
  1114. }
  1115. Gdip_Startup()
  1116. {
  1117.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  1118.    
  1119.     if !DllCall("GetModuleHandle", "str", "gdiplus", Ptr)
  1120.         DllCall("LoadLibrary", "str", "gdiplus")
  1121.     VarSetCapacity(si, A_PtrSize = 8 ? 24 : 16, 0), si := Chr(1)
  1122.     DllCall("gdiplus\GdiplusStartup", A_PtrSize ? "UPtr*" : "uint*", pToken, Ptr, &si, Ptr, 0)
  1123.     return pToken
  1124. }
  1125. Create_Layered_GUI(Layered)
  1126.     {
  1127.         Gui,% Layered.Name ": +E0x80000 +LastFound " Layered.Options
  1128.         Gui,% Layered.Name ":Show",% "x" Layered.X " y" Layered.Y " w" Layered.W " h" Layered.H " NA"
  1129.     }
  1130. CreateDIBSection(w, h, hdc="", bpp=32, ByRef ppvBits=0)
  1131. {
  1132.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  1133.    
  1134.     hdc2 := hdc ? hdc : GetDC()
  1135.     VarSetCapacity(bi, 40, 0)
  1136.    
  1137.     NumPut(w, bi, 4, "uint")
  1138.     , NumPut(h, bi, 8, "uint")
  1139.     , NumPut(40, bi, 0, "uint")
  1140.     , NumPut(1, bi, 12, "ushort")
  1141.     , NumPut(0, bi, 16, "uInt")
  1142.     , NumPut(bpp, bi, 14, "ushort")
  1143.    
  1144.     hbm := DllCall("CreateDIBSection"
  1145.                     , Ptr, hdc2
  1146.                     , Ptr, &bi
  1147.                     , "uint", 0
  1148.                     , A_PtrSize ? "UPtr*" : "uint*", ppvBits
  1149.                     , Ptr, 0
  1150.                     , "uint", 0, Ptr)
  1151.  
  1152.     if !hdc
  1153.         ReleaseDC(hdc2)
  1154.     return hbm
  1155. }
  1156. CreateCompatibleDC(hdc=0)
  1157. {
  1158.    return DllCall("CreateCompatibleDC", A_PtrSize ? "UPtr" : "UInt", hdc)
  1159. }
  1160. Gdip_GraphicsFromHDC(hdc)
  1161. {
  1162.     DllCall("gdiplus\GdipCreateFromHDC", A_PtrSize ? "UPtr" : "UInt", hdc, A_PtrSize ? "UPtr*" : "UInt*", pGraphics)
  1163.     return pGraphics
  1164. }
  1165. Gdip_CreatePen(ARGB, w)
  1166. {
  1167.    DllCall("gdiplus\GdipCreatePen1", "UInt", ARGB, "float", w, "int", 2, A_PtrSize ? "UPtr*" : "UInt*", pPen)
  1168.    return pPen
  1169. }
  1170. Gdip_GetClipRegion(pGraphics)
  1171. {
  1172.     Region := Gdip_CreateRegion()
  1173.     DllCall("gdiplus\GdipGetClip", A_PtrSize ? "UPtr" : "UInt", pGraphics, "UInt*", Region)
  1174.     return Region
  1175. }
  1176. Gdip_SetClipRect(pGraphics, x, y, w, h, CombineMode=0)
  1177. {
  1178.    return DllCall("gdiplus\GdipSetClipRect",  A_PtrSize ? "UPtr" : "UInt", pGraphics, "float", x, "float", y, "float", w, "float", h, "int", CombineMode)
  1179. }
  1180. Gdip_FillRectangle(pGraphics, pBrush, x, y, w, h)
  1181. {
  1182.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  1183.    
  1184.     return DllCall("gdiplus\GdipFillRectangle"
  1185.                     , Ptr, pGraphics
  1186.                     , Ptr, pBrush
  1187.                     , "float", x
  1188.                     , "float", y
  1189.                     , "float", w
  1190.                     , "float", h)
  1191. }
  1192. Gdip_SetClipRegion(pGraphics, Region, CombineMode=0)
  1193. {
  1194.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  1195.    
  1196.     return DllCall("gdiplus\GdipSetClipRegion", Ptr, pGraphics, Ptr, Region, "int", CombineMode)
  1197. }
  1198. Gdip_DeleteRegion(Region)
  1199. {
  1200.     return DllCall("gdiplus\GdipDeleteRegion", A_PtrSize ? "UPtr" : "UInt", Region)
  1201. }
  1202. Gdip_ResetClip(pGraphics)
  1203. {
  1204.    return DllCall("gdiplus\GdipResetClip", A_PtrSize ? "UPtr" : "UInt", pGraphics)
  1205. }
  1206. Gdip_DrawEllipse(pGraphics, pPen, x, y, w, h)
  1207. {
  1208.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  1209.    
  1210.     return DllCall("gdiplus\GdipDrawEllipse", Ptr, pGraphics, Ptr, pPen, "float", x, "float", y, "float", w, "float", h)
  1211. }
  1212. GetDC(hwnd=0)
  1213. {
  1214.     return DllCall("GetDC", A_PtrSize ? "UPtr" : "UInt", hwnd)
  1215. }
  1216. ReleaseDC(hdc, hwnd=0)
  1217. {
  1218.     Ptr := A_PtrSize ? "UPtr" : "UInt"
  1219.    
  1220.     return DllCall("ReleaseDC", Ptr, hwnd, Ptr, hdc)
  1221. }
  1222. Gdip_CreateRegion()
  1223. {
  1224.     DllCall("gdiplus\GdipCreateRegion", "UInt*", Region)
  1225.     return Region
  1226. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement