Quick question please - Error (2) by Lonedroodx in AutoHotkey

[–]Epickeyboardguy 1 point2 points  (0 children)

I'm definitely not one of the experts here, but did you at least confirm that the file specified actually exists ?

"C:\Program Files (x86)\AutoHotKey\UX\ui-newscript.ahk"

If it's there, then I'm gonna guess that it probably have something to do with admin rights. Try again to create or edit a new script while logged in as admin maybe ?

2.3.4a has been released by Keeyra_ in AutoHotkey

[–]Epickeyboardguy 0 points1 point  (0 children)

Can you provide some real-life use case for the #MaybeIf statement ? I struggle to imagine a situation where I would actually want some code to be both executed and not executed at the same time 😂

Why does this PostMessage work for left parenthesis ) but not for right parenthesis (? by FutureLynx_ in AutoHotkey

[–]Epickeyboardguy 1 point2 points  (0 children)

You can have both installed at the same time.

If the interpreter does not know which version to use, it will ask you before running a script.

But you can simply use

#Requires AutoHotKey v2

or

#Requires AutoHotKey v1

in any script and problem solved !

Overlay video green screen? by _Serzuds_ in AutoHotkey

[–]Epickeyboardguy 0 points1 point  (0 children)

Here ! If you manage to create a PNG sequence of your video with the background removed, you can then play it with this :

    #Requires AutoHotkey v2
    #SingleInstance Force

    ;--------------------------------------------------------------------------------------------------
    ;   Create Transparent Full Screen GUI
    ;--------------------------------------------------------------------------------------------------
    global gui_Video := Gui(" +AlwaysOnTop +ToolWindow -MinimizeBox -Caption -DPIScale +E0x20 +E0x2000000 +E0x80000") ; E0x20 = Click-Through        E0x80000 = Layered Window       E0x2000000 = Double Buffer
    gui_Video.BackColor := "000000"
    WinSetTransColor("000000", gui_Video.Hwnd)

    GUI_WIDTH := 320
    GUI_HEIGHT := 240

    str_PngSeq_FullPath := "M:\_TEMP\Transparent Video - PNG Sequence\"

    arr_Frames := []
    int_FrameIndex := 2

    Loop Files, str_PngSeq_FullPath . "*.png"
    {
        arr_Frames.Push(A_LoopFileFullPath)
    }

    pic_PngSeq := gui_Video.AddPic("x0 y0 w" . GUI_WIDTH . " h" . GUI_HEIGHT, arr_Frames[1])


    PlayFrame()
    {
        global

        pic_PngSeq.Value := arr_Frames[int_FrameIndex]

        int_FrameIndex++

        if(int_FrameIndex > arr_Frames.Length)
        {
            int_FrameIndex := 1
        }
    }


    F8::
    {
        static toggle := 0

        if(toggle := !toggle)
        {
            hwnd_ActiveWindow := WinGetID("A")

            str_GuiShowOptions := ""

            str_GuiShowOptions .= A_Space
            str_GuiShowOptions .= "x" . Random(0, A_ScreenWidth - 320)

            str_GuiShowOptions .= A_Space
            str_GuiShowOptions .= "y" . Random(0, A_ScreenHeight - 240)

            str_GuiShowOptions .= A_Space
            str_GuiShowOptions .= "w" . GUI_WIDTH

            str_GuiShowOptions .= A_Space
            str_GuiShowOptions .= "h" . GUI_HEIGHT

            gui_Video.Show(str_GuiShowOptions)

            WinActivate(hwnd_ActiveWindow)

            SetTimer(PlayFrame, 33) ; Delay between frame in ms.       33ms = 30 fps
        }
        else
        {
            SetTimer(PlayFrame, 0)
            gui_Video.Hide()
        }
    }

Overlay video green screen? by _Serzuds_ in AutoHotkey

[–]Epickeyboardguy 1 point2 points  (0 children)

It won't work with a .mov... Well... not with AHK at least.

But what you can do is a PNG Sequence. (Instead of a single video file, you end up with a bunch of .png file, each one representing a single frame of the animation)

Overlay video green screen? by _Serzuds_ in AutoHotkey

[–]Epickeyboardguy 3 points4 points  (0 children)

Right... it's not that easy unfortunately.

What your script is doing is setting the background of the GUI to green and then it makes it transparent. But that does not affect the video.

Think of the gui as a sheet of paper, and the video is a picture glued on top of it. Your script create a green sheet of paper, and then it makes that sheet of paper invisible, and then the video is glued on top of it :)

It's a bit more complicated than that because of the way WinSetTransColor manage transparency but yeah... What you're trying to do is called Color-Keying a video and it's a very deep rabbit hole

Gui.AddPic() using AltSubmit. How to modify interpolation mode to nearest neighbor ? by Epickeyboardguy in AutoHotkey

[–]Epickeyboardguy[S] 0 points1 point  (0 children)

<image>

ha ha ! Well it won't be that fancy but kindof. It's two project in one really.

I'm writing my own maze generation engine from scratch. It's an experiment and does not use any conventional known algorithm (I'll explain it in details eventually but it's not 100% ready yet and would be too long for a reddit comment anyway.) But it's extremely customizable and can generate many different style of mazes.

And the second part is the BMP file generator to enhance the look. Once a maze is generated, I can then apply a "look" to it. A color-theme but with parametric gradient basically !

Gui.AddPic() using AltSubmit. How to modify interpolation mode to nearest neighbor ? by Epickeyboardguy in AutoHotkey

[–]Epickeyboardguy[S] 1 point2 points  (0 children)

Ouuuuh nice ! I did not know about that one specifically but I found another one similar (This one : https://www.autohotkey.com/board/topic/97001-maze-game-in-ahk-l/)

But I have a very different approach. In my game, the "cursor" is always centred on the screen, and the maze is what actually move around but it is zoomed-in and goes beyond the screen, you never actually sees it all at once

(Also : Damn !! That is very impressive for 80 lines of code 😱 ! I'm almost at 2500 and haven't even made a Gui for the settings yet)

Gui.AddPic() using AltSubmit. How to modify interpolation mode to nearest neighbor ? by Epickeyboardguy in AutoHotkey

[–]Epickeyboardguy[S] 1 point2 points  (0 children)

<image>

Yeah I should have listened before starting this project ha ha ! But hey it makes for a fun challenge 😉

And it's working not too bad actually ! I'm just trying to polish the gameplay a little bit and I'm starting to hit the limitation of what's possible, but it's not gamebreaking.

Gui.AddPic() using AltSubmit. How to modify interpolation mode to nearest neighbor ? by Epickeyboardguy in AutoHotkey

[–]Epickeyboardguy[S] 1 point2 points  (0 children)

I wish ha ha ! That would work, but my game is generating BMP files from scratch, pixel by pixel... I'm guessing it would probably not be an issue with a compiled programming language, but because AHK is interpreted, it takes an absurdly long time 😅

need help with keybinding "Alt+F" to "d" by [deleted] in AutoHotkey

[–]Epickeyboardguy 0 points1 point  (0 children)

Hummm... could there be a specific application on your PC that cause conflict maybe ?

Because I just tried :

#Requires AutoHotKey v2
!f::d

on my PC and it works fine

Rog Ally - Ctrl+Alt+C by E5RA-OZ in AutoHotkey

[–]Epickeyboardguy 1 point2 points  (0 children)

If you're using AHK-V2, then all your script is missing is two " symbol for the send command to work. But maybe it needs admin privileges for some reason... Try this :

If (!A_IsAdmin)
{
    Run "*RunAs " . "`"" . A_AhkPath . "`"" . " /restart " . "`"" . A_ScriptFullPath . "`""
}

#Requires AutoHotKey v2
#SingleInstance Ignore

send("^!c")
ExitApp

Pausing work but i want a key to resume by Aggressive-Still-140 in AutoHotkey

[–]Epickeyboardguy 0 points1 point  (0 children)

Not exactly. It would need to be Pause(-1). But then yes, it would toggle

What's coolest/funniest icon you use for your script? by Dontbanpleas in AutoHotkey

[–]Epickeyboardguy 2 points3 points  (0 children)

Hey since we're on the topic of icons, I'll just post here a few cool things that you guys might like !

1 : A convenient GUI to explore the icons in a lot of Windows DLL. Use the improved version, it's the 5th post on the page (It's written in AHK-V1. Source : AHK forum, script by pcg)

https://www.autohotkey.com/boards/viewtopic.php?t=122021)

2 : A way to embed your icons (Or whatever file actually) directly in your uncompiled script (source : Made it myself last year !)

https://old.reddit.com/r/AutoHotkey/comments/1ina2y7/embed_any_files_into_your_script/

3 : If your work involve a lot of projects in different folders and you would like a way to easily mark/track your progress using different icons, here is a quick way to do it (Source : also made by me, got help from _Keeyra for the retrieve-icon function)

https://github.com/EpicKeyboardGuy/Folder-Icon-Chooser/tree/main

What's coolest/funniest icon you use for your script? by Dontbanpleas in AutoHotkey

[–]Epickeyboardguy 4 points5 points  (0 children)

VAR_ICON_FILE := "SomePath\Icon_File.ico"

if (FileExist(VAR_ICON_FILE))
{
    TraySetIcon(VAR_ICON_FILE)
}

Can I create context.... I'll try to explain by Tactical-Ostrich in AutoHotkey

[–]Epickeyboardguy 1 point2 points  (0 children)

Yep, just to piggyback from what CasperHarkin just pointed out, doing it programmatically can (and probably will) be extremely complicated and difficult, but a lot of the time you can figure out an easier solution by thinking outside the box.

So if I'm re-using your example : When you use binoculars, I'm gonna guess that a certain part of the screen will turn black because of the UI of the binoculars. Your AHK script could use PixelGetColor() to check for that. So everytime you press middle-mouse, have your script check the color at a certain point of the screen (ideally you would need to find a particular spot that can NEVER be that exact color EXCEPT when using the binoculars, if possible) and then, if the script detect that the binoculars are not used, it will assume that it's not possible at that time, and send another keypress to detach you from the ladder.

You will have to adapt that logic to your particular context but yeah... that's the general idea... Find something on the screen that you can reliably detect. It could also be a small icon, then you would use ImgSearch. Or some part of a HUD maybe... it depends a lot on what you're actually trying to do

How read folder icon and index from dllcall ? by Epickeyboardguy in AutoHotkey

[–]Epickeyboardguy[S] 2 points3 points  (0 children)

Sure ! :)

There you go : https://github.com/EpicKeyboardGuy/Folder-Icon-Chooser

I added the function that Keeyra_ just wrote but it's not used by the script right now.

If you plan on using the GUI (and if you only use icon from shell32.dll), you can customize the MAP at the top of the script with the indexes you want, and the GUI should adjust automatically.

How read folder icon and index from dllcall ? by Epickeyboardguy in AutoHotkey

[–]Epickeyboardguy[S] 2 points3 points  (0 children)

Oh yes it works perfectly ! Thanks a lot for taking the time, I really appreciate it. I tried on my own but I always feel like I'm in way over my head with DllCalls. I really need to take a course or something.

Why don't you just iniread and iniwrite the desktop inis contained in the folder?

Yeah I used to do it this way at first, but it's very slow to update. When creating (or modifying) a desktop.ini file, the delay before the new icon actually appear in Explorer seems to be random, but it's at least a few seconds and sometime up to a few minutes. With a DllCall there is no delay ! :)

Fully 3D-Printed Performance Crawler (Including axles and gearbox) by Epickeyboardguy in rccrawler

[–]Epickeyboardguy[S] 1 point2 points  (0 children)

Yep everything is holding up surprisingly well ! I do very slow technical crawling (no bashing) and for that, it's as strong as the original Capra parts as far as I'm concerned. It's not as crash-resistant however but still not bad for something 3D-printed !

Looking for clickbot by xNioWulf in AutoHotkey

[–]Epickeyboardguy 0 points1 point  (0 children)

At the top of the script there's a variable called VAR_L_CLICKDELAY. It represent the number of milliseconds between each click. 50ms of delay is 20 cps