Hypnotix
Members-
Posts
13 -
Joined
-
Last visited
Hypnotix's Achievements
Seeker (1/7)
0
Reputation
-
for some reason it says Duplicate function name.: Func _WinAPI_SetLayeredWindowAttributes($hWnd, $i_transcolor, $Transparency = 255, $dwFlags = 0x03, $isColorRef = False) well i realized that scause i included the Winapi file. but when i remove that then i get the error ==> Can not redeclare a constant.: Global Const $WS_POPUP = 0x80000000
-
The create hud function is actually your unmodified hud creation (ended up sticking with it ) the remove hud is just GUIdelete(NAME). nothing that you dont already have. ill post um though Func Createhud() $logo1=_JustTheText('WPM',@DesktopWidth/2+30,@DesktopHeight/2-25,0,0,1,500,500000,'Arial',16) $logo2=_JustTheText($counter,@DesktopWidth/2,@DesktopHeight/2,0,0,1,500) GUiSetState(@SW_SHOWNOACTIVATE) Endfunc Func Removehud() GUIDelete($logo1) GUIDelete($logo2) endfunc
-
I am trying to make a script that draws a hud on top of my software when its active and then removes it when the window isnt active. ***some of the functions used aren't built in to autoit, but function fully fine in their normal purpose, its only under these conditions i reach a problem*** What i have is: while 1 If WinActive("Psycalc", "" ) Then Createhud() Else Removehud() endif wend So heres how it excutes this. I open up Psycalc and it draws my hud. I minimize Psycalc it deletes the hud (as intended) if i reopen it, it draws the hud again, BUT at this point it stops doing anything further. If i minimize again the hud stays, and nothing effects it besides closing the script. What is this loop missing to gain the consistency i need?
-
All the extra stuff you added to it made implementation impossible into what i was doing (Made an issue i already had even worse) I most likely wont bother proceeding attempting to use your code. Thanks for the help though x.x
-
This is impressively strong for how much more simple the programing is. Nice. Uhh first question, Can i make the text draggable? I defined $WS_EX_CONTROLPARENT in the GUI create but it didnt actually do anything for some reason
-
Hello again guys. I originally posted this in the standard forums, but realized there was a section for just GUI. I originally explained the whole story, but the jist of it is. I was using this floating text code I found in the forums: Opt("OnExitFunc", "endscript") #include <GUIConstants.au3> #include <WindowsConstants.au3> $hwnd = GUICreate("Text Region", @DesktopWidth, @DesktopHeight, @DesktopWidth / 2 - 250, @DesktopHeight / 2 - 150, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) GUISetBkColor(0x00FF01) GUISetState() $hwnd2 = GUICreate("Text Region", @DesktopWidth, @DesktopHeight, @DesktopWidth / 2 - 200, @DesktopHeight / 2 - 100, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) GUISetBkColor(0x00FF01) GUISetState() While 1 $rgn = CreateTextRgn($hwnd, "rawr", 20, "Times New Roman", 2000) $rgn2 = CreateTextRgn($hwnd2, "rawr5", 20, "Times New Roman", 2000) SetWindowRgn($hwnd, $rgn) SetWindowRgn($hwnd2, $rgn2) Sleep(500) WEnd Func endscript() ControlShow("Program Manager", "", "[CLASSNN:SHELLDLL_DefView1]") EndFunc ;==>endscript Func SetWindowRgn($h_win, $rgn) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1) EndFunc ;==>SetWindowRgn Func CreateTextRgn(ByRef $CTR_hwnd, $CTR_Text, $CTR_height, $CTR_font = "Times New Roman", $CTR_weight = 1000) Local Const $ANSI_CHARSET = 0 Local Const $OUT_CHARACTER_PRECIS = 2 Local Const $CLIP_DEFAULT_PRECIS = 0 Local Const $PROOF_QUALITY = 2 Local Const $FIXED_PITCH = 1 Local Const $RGN_XOR = 3 If $CTR_font = "" Then $CTR_font = "Microsoft Sans Serif" If $CTR_weight = -1 Then $CTR_weight = 1000 Local $gdi_dll = DllOpen("gdi32.dll") Local $CTR_hDC = DllCall("user32.dll", "int", "GetDC", "hwnd", $CTR_hwnd) Local $CTR_hMyFont = DllCall($gdi_dll, "hwnd", "CreateFont", "int", $CTR_height, "int", 0, "int", 0, "int", 0, _ "int", $CTR_weight, "int", 0, "int", 0, "int", 0, "int", $ANSI_CHARSET, "int", $OUT_CHARACTER_PRECIS, _ "int", $CLIP_DEFAULT_PRECIS, "int", $PROOF_QUALITY, "int", $FIXED_PITCH, "str", $CTR_font) Local $CTR_hOldFont = DllCall($gdi_dll, "hwnd", "SelectObject", "int", $CTR_hDC[0], "hwnd", $CTR_hMyFont[0]) DllCall($gdi_dll, "int", "BeginPath", "int", $CTR_hDC[0]) DllCall($gdi_dll, "int", "TextOut", "int", $CTR_hDC[0], "int", 0, "int", 0, "str", $CTR_Text, "int", StringLen($CTR_Text)) DllCall($gdi_dll, "int", "EndPath", "int", $CTR_hDC[0]) Local $CTR_hRgn1 = DllCall($gdi_dll, "hwnd", "PathToRegion", "int", $CTR_hDC[0]) Local $CTR_rc = DllStructCreate("int;int;int;int") DllCall($gdi_dll, "int", "GetRgnBox", "hwnd", $CTR_hRgn1[0], "ptr", DllStructGetPtr($CTR_rc)) Local $CTR_hRgn2 = DllCall($gdi_dll, "hwnd", "CreateRectRgnIndirect", "ptr", DllStructGetPtr($CTR_rc)) DllCall($gdi_dll, "int", "CombineRgn", "hwnd", $CTR_hRgn2[0], "hwnd", $CTR_hRgn2[0], "hwnd", $CTR_hRgn1[0], "int", $RGN_XOR) DllCall($gdi_dll, "int", "DeleteObject", "hwnd", $CTR_hRgn1[0]) DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $CTR_hwnd, "int", $CTR_hDC[0]) DllCall($gdi_dll, "int", "SelectObject", "int", $CTR_hDC[0], "hwnd", $CTR_hOldFont[0]) DllClose($gdi_dll) Return $CTR_hRgn2[0] EndFunc ;==>CreateTextRgn I wanted to know how I could modify it to make Multi lined text in one GUI (I tried @CR, but that didnt work) I do not have any idea how I would modify this to achieve that. Any help would be appreciated. Bottom line: I would like to know how to (In this example) take $rgn = CreateTextRgn($hwnd, "rawr", 20, "Times New Roman", 2000) and add multiple text lines to it (Im making a program that has multiple displayed timers floating, but I don't want 10000 GUIs being drawn and managed.)
-
hmm i just realized this was the wrong forums. Perhaps thats why the thread has so many views and no responses, I guess you guys can delete this if yo uwant ima take it over to the GUI forums since i cant get help here x.x
-
Hello everybody. Recently I started doing a project which served as a utility for a game on a platform called byond (Not sure if you guys have heard of it, but that is irrelevent) My goal was to show the cooldowns of skills on the screen as a tooltip. Being a beginner at best i started off with the basic tooltip function. When I realized i could only use one at a time, I decided to look up floating text which led me to this code Opt("OnExitFunc", "endscript") #include <GUIConstants.au3> #include <WindowsConstants.au3> $hwnd = GUICreate("Text Region", @DesktopWidth, @DesktopHeight, @DesktopWidth / 2 - 250, @DesktopHeight / 2 - 150, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) GUISetBkColor(0x00FF01) GUISetState() $hwnd2 = GUICreate("Text Region", @DesktopWidth, @DesktopHeight, @DesktopWidth / 2 - 200, @DesktopHeight / 2 - 100, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) GUISetBkColor(0x00FF01) GUISetState() While 1 $rgn = CreateTextRgn($hwnd, "rawr", 20, "Times New Roman", 2000) $rgn2 = CreateTextRgn($hwnd2, "rawr5", 20, "Times New Roman", 2000) SetWindowRgn($hwnd, $rgn) SetWindowRgn($hwnd2, $rgn2) Sleep(500) WEnd Func endscript() ControlShow("Program Manager", "", "[CLASSNN:SHELLDLL_DefView1]") EndFunc ;==>endscript Func SetWindowRgn($h_win, $rgn) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1) EndFunc ;==>SetWindowRgn Func CreateTextRgn(ByRef $CTR_hwnd, $CTR_Text, $CTR_height, $CTR_font = "Times New Roman", $CTR_weight = 1000) Local Const $ANSI_CHARSET = 0 Local Const $OUT_CHARACTER_PRECIS = 2 Local Const $CLIP_DEFAULT_PRECIS = 0 Local Const $PROOF_QUALITY = 2 Local Const $FIXED_PITCH = 1 Local Const $RGN_XOR = 3 If $CTR_font = "" Then $CTR_font = "Microsoft Sans Serif" If $CTR_weight = -1 Then $CTR_weight = 1000 Local $gdi_dll = DllOpen("gdi32.dll") Local $CTR_hDC = DllCall("user32.dll", "int", "GetDC", "hwnd", $CTR_hwnd) Local $CTR_hMyFont = DllCall($gdi_dll, "hwnd", "CreateFont", "int", $CTR_height, "int", 0, "int", 0, "int", 0, _ "int", $CTR_weight, "int", 0, "int", 0, "int", 0, "int", $ANSI_CHARSET, "int", $OUT_CHARACTER_PRECIS, _ "int", $CLIP_DEFAULT_PRECIS, "int", $PROOF_QUALITY, "int", $FIXED_PITCH, "str", $CTR_font) Local $CTR_hOldFont = DllCall($gdi_dll, "hwnd", "SelectObject", "int", $CTR_hDC[0], "hwnd", $CTR_hMyFont[0]) DllCall($gdi_dll, "int", "BeginPath", "int", $CTR_hDC[0]) DllCall($gdi_dll, "int", "TextOut", "int", $CTR_hDC[0], "int", 0, "int", 0, "str", $CTR_Text, "int", StringLen($CTR_Text)) DllCall($gdi_dll, "int", "EndPath", "int", $CTR_hDC[0]) Local $CTR_hRgn1 = DllCall($gdi_dll, "hwnd", "PathToRegion", "int", $CTR_hDC[0]) Local $CTR_rc = DllStructCreate("int;int;int;int") DllCall($gdi_dll, "int", "GetRgnBox", "hwnd", $CTR_hRgn1[0], "ptr", DllStructGetPtr($CTR_rc)) Local $CTR_hRgn2 = DllCall($gdi_dll, "hwnd", "CreateRectRgnIndirect", "ptr", DllStructGetPtr($CTR_rc)) DllCall($gdi_dll, "int", "CombineRgn", "hwnd", $CTR_hRgn2[0], "hwnd", $CTR_hRgn2[0], "hwnd", $CTR_hRgn1[0], "int", $RGN_XOR) DllCall($gdi_dll, "int", "DeleteObject", "hwnd", $CTR_hRgn1[0]) DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $CTR_hwnd, "int", $CTR_hDC[0]) DllCall($gdi_dll, "int", "SelectObject", "int", $CTR_hDC[0], "hwnd", $CTR_hOldFont[0]) DllClose($gdi_dll) Return $CTR_hRgn2[0] EndFunc ;==>CreateTextRgn which is apparently pretty popular around here. After much testing and tinkering I was able to figure out how to actually make the tooltips work (never messed with guis before) and i managed to Put each skill into their own tooltip and using a loop I was able to make it display the cooldowns actively. The next problem I came across was that it only wanted to let one timer go at a time, so i managed to Form it into a loop to where it checks them all at once. Now what i would like to do is, even though my program is functional, I would like to try to modify this to where I can combine them all into one multi lined Gui/tooltip, but I have no grasp of how these dlls work or how to modify the innate function that was provided without ruining it. I tried adding a basic @cr into the text field, but it seems like that function is disabled by default. Anybody know how i can do this? (Sorry for the huge post, I just wanted to explain the concept/evolution of my project so perhaps you guys can better help me help myself)
-
What I am aiming to do with my new project is to be able to press a key while the script is running and it will output it into a notepad type file with the key converted into an autoit format. As in if the script is running and I press tab. itll put Send("{TAB}") to the file. I basically wanna be able to make a list. Can anybody guide me to the best way of achieving this? Thanks in advance!
-
Thank you for your help!
-
It is obvious that you can send a key using the basic Send("{DOWN}") I also know that you can do Send("{DOWN 123123123}") to send that key multiple times. My question is, is it possible to have it send a key based on a variable amount? I tried something to the effect of Send("{DOWN $MenuPosition}") with no luck.
-
Very interesting. Stupid me did see the thread on that right after I made the post though. I still thank you for your support.
-
Well I am going to start off my first post on this forum with a question,(Yeah thats typical I know) Please accommodate me though. I am using pixelsearch to find colors. (Im keeping this question as general as possible) When i use pixelsearch, it finds the color i want it to, but It fixates on that same instance of the color every time it is called (I want it to find unique instances of the color each time) Is this possible? Thanks in advance!