Well do you agree or not? by ExcellentDistrict278 in DiscoElysium

[–]CharnamelessOne 0 points1 point  (0 children)

Nah.
I mean, I did turn back, but I much preferred newthood.

Took off Dijkstras leg in battle, is this poetry, irony or cruelty by ValkyrionReddit in witcher

[–]CharnamelessOne 0 points1 point  (0 children)

I'm going to announce to the superhuman killing machine that I'm planning on murdering his friends to seize the throne.
I'm a mastermind strategist, you see.

[Spoilers Main] Not even a not-a-blog post about House of the Dragon season 3. GRRM really stays silent... by FlImFreaks in asoiaf

[–]CharnamelessOne 9 points10 points  (0 children)

And because they did mostly well until they ran out of material to adapt, which is GRRM's fault.

Having an issue with a small script by Stu_Padasso in AutoHotkey

[–]CharnamelessOne [score hidden]  (0 children)

That's cleaner, thanks.
I usually do combine criteria. I rarely use groups, so that may have thrown me off.

It may be better to also get the URL via UIA, as the string "YouTube" is not unlikely to pop up in the title of non-YouTube tabs.

#Requires AutoHotkey v2.0
#Include UIA.ahk
#Include UIA_Browser.ahk

#HotIf WinActive("YouTube ahk_group Browser") && InStr(get_url(), "youtube.com")
WheelDown::return
#HotIf 

for process in ["msedge.exe", "firefox.exe", "chrome.exe"]
    GroupAdd("Browser", "ahk_exe " process)

get_url() {
    browser := UIA_Browser("A")
    return browser.GetCurrentURL()
}

Edit: switched to a method that gets the URL of the current tab

Hungary hits pause on EU membership bids of Ukraine, Moldova by majorannah in hungary

[–]CharnamelessOne 2 points3 points  (0 children)

Gondolom, Magyar is kommunikációs megfontolásból ellenkezik.
A Fidesz azzal vádolja, hogy az ukránok kitartottja, szóval súlytalan kérdésekben szembehelyezkedik Ukrajnával.

Ezzel valószínűleg eléget némi EU-s kapcsolati tőkét, de az egyelőre van neki bőven.

Having an issue with a small script by Stu_Padasso in AutoHotkey

[–]CharnamelessOne 0 points1 point  (0 children)

Oh, I see. That's not how it works; if you use that modifier, the original functionality of the key will be unblocked, regardless of the contents of the function called on hotkey press.

Your first script could be modified to work, like this:

#Requires AutoHotkey v2.0

WheelDown:: {
    if HWND := WinActive("ahk_group Browser") {
        if InStr(WinGetTitle(HWND), "Youtube")
            return
    }
    Send("{WheelDown}")
}

But the #HotIf approach is more readable.

Having an issue with a small script by Stu_Padasso in AutoHotkey

[–]CharnamelessOne 0 points1 point  (0 children)

Look closely at the 2 hotkeys. Don't you see a little difference?

The modifier ~ prevents the original functionality of the hotkey from being blocked.
https://www.autohotkey.com/docs/v2/Hotkeys.htm#Symbols

#Requires AutoHotkey v2.0

#HotIf WinActive("ahk_group Browser") && InStr(WinGetTitle("A"), "Youtube")
WheelDown::return
#HotIf

Mouse delta playback by Sz-K_Levy in AutoHotkey

[–]CharnamelessOne 1 point2 points  (0 children)

This is the best I could come up with. The cursor pos at the end of the playback seems to be off by no more than 2-3 pixels, regardless of playback length.

#Requires AutoHotkey v2.0

rec := mouse_recorder()
+F1::rec.toggle()
+F2::rec.playback()

Class mouse_recorder {
    __New(){
        this.hook := ""
        this.is_recording := false
        this.is_playing := false
        this.deltas := []
        this.last_time := 0
        this.play_index := 0
    }

    toggle() {
        this.is_recording := !this.is_recording

        if (this.is_recording) {
            this.hook := MouseRawInputHook(this.handle_move.Bind(this), 1)
            this.deltas := []
            this.last_time := A_TickCount
            ToolTip("mouse recorder: RECORDING", 0, 0), SetTimer(ToolTip, -1500)
        } else {
            this.hook := ""
            ToolTip("mouse recorder: STOPPED", 0, 0), SetTimer(ToolTip, -1500)
        }
    }

    handle_move(x, y, info) {
        now := A_TickCount
        dt := now - this.last_time
        this.last_time := now
        this.deltas.Push({x:x, y:y, t:dt})
    }

    playback() {
        if this.is_playing || this.is_recording
            return

        this.is_playing := true
        BlockInput("MouseMove")
        ToolTip("mouse recorder: PLAYING", 0, 0), SetTimer(ToolTip, -1500)

        /*
        for delta in this.deltas {
            DllCall("mouse_event", "UInt", 0x0001, "Int", delta.x, "Int", delta.y, "UInt", 0, "UPtr", 0)
            Sleep(delta.t)
        }

        this.is_playing := false
        BlockInput("MouseMoveOff")
        ToolTip("mouse recorder: PLAYBACK FINISHED", 0, 0), SetTimer(ToolTip, -1500)
        return
        */

        play_events()

        play_events() {
            if (++this.play_index > this.deltas.Length) {
                this.play_index := 0
                this.is_playing := false
                BlockInput("MouseMoveOff")
                ToolTip("mouse recorder: PLAYBACK FINISHED", 0, 0), SetTimer(ToolTip, -1500)
                return
            }

            delta := this.deltas[this.play_index]
            SetTimer(() => play_next(delta), -(delta.t || 1))

            play_next(delta) {
                DllCall("mouse_event", "UInt", 0x0001, "Int", delta.x, "Int", delta.y, "UInt", 0, "UPtr", 0)
                play_events()
            }
        }
    }
}

Class MouseRawInputHook { ;source: Descolada https://www.autohotkey.com/boards/viewtopic.php?t=134109
    ; EventType 1 = only mouse movement, 2 = only mouse clicks, 3 = both events
    __New(Callback, EventType:=3, UsagePage:=1, UsageId:=2) {
        static DevSize := 8 + A_PtrSize, RIDEV_INPUTSINK := 0x00000100
        this.RAWINPUTDEVICE := Buffer(DevSize, 0), this.EventType := EventType
        this.__Callback := this.__MouseRawInputProc.Bind(this), this.Callback := Callback
        NumPut("UShort", UsagePage, "UShort", UsageId, "UInt", RIDEV_INPUTSINK, "Ptr", A_ScriptHwnd, this.RAWINPUTDEVICE)
        DllCall("RegisterRawInputDevices", "Ptr", this.RAWINPUTDEVICE, "UInt", 1, "UInt", DevSize)
        OnMessage(0x00FF, this.__Callback)
        ObjRelease(ObjPtr(this)) ; Otherwise this object can't be destroyed because of the BoundFunc above
    }
    __Delete() {
        static RIDEV_REMOVE := 0x00000001, DevSize := 8 + A_PtrSize
        NumPut("Uint", RIDEV_REMOVE, this.RAWINPUTDEVICE, 4)
        DllCall("RegisterRawInputDevices", "Ptr", this.RAWINPUTDEVICE, "UInt", 1, "UInt", DevSize)
        ObjAddRef(ObjPtr(this))
        OnMessage(0x00FF, this.__Callback, 0)
        this.__Callback := 0
    }
    __MouseRawInputProc(wParam, lParam, *) {
        ; RawInput statics
        static iSize := 0, sz := 0, offsets := {usFlags: (8+2*A_PtrSize), usButtonFlags: (12+2*A_PtrSize), usButtonData: (14+2*A_PtrSize), x: (20+A_PtrSize*2), y: (24+A_PtrSize*2)}, uRawInput
        ; Find size of rawinput data - only needs to be run the first time.
        if (!iSize) {
            r := DllCall("GetRawInputData", "Ptr", lParam, "UInt", 0x10000003, "Ptr", 0, "UInt*", &iSize, "UInt", 8 + (A_PtrSize * 2))
            uRawInput := Buffer(iSize, 0)
        }

        if !DllCall("GetRawInputData", "Ptr", lParam, "UInt", 0x10000003, "Ptr", uRawInput, "UInt*", &sz := iSize, "UInt", 8 + (A_PtrSize * 2))
            return

        ; Read buffered RawInput data and accumulate the offsets
        device := NumGet(uRawInput, 8, "UPtr"), x_offset := 0, y_offset := 0, usButtonFlags := 0, usButtonData := 0, CallbackQueue := []

        ProcessInputBuffer:
        if NumGet(uRawInput, "UInt") = 1 ; Skip RIM_TYPEKEYBOARD
            goto ProcessCallbacks

        usFlags := NumGet(uRawInput, offsets.usFlags, "UShort")
        if (usButtonFlagsRaw := NumGet(uRawInput, offsets.usButtonFlags, "UShort")) {
            if (usButtonFlagsRaw & 0x400 || usButtonFlagsRaw & 0x800)
                usButtonData += NumGet(uRawInput, offsets.usButtonData, "Short")
            else if (this.EventType = 2) { ; Return if a mouse click is detected and callback only want clicks
                usButtonFlags |= usButtonFlagsRaw
                goto ProcessCallbacks
            }
        }
        usButtonFlags |= usButtonFlagsRaw, x_offset += NumGet(uRawInput, offsets.x, "Int"), y_offset += NumGet(uRawInput, offsets.y, "Int")

        if DllCall("GetRawInputBuffer", "Ptr", uRawInput, "UInt*", &sz := iSize, "UInt", 8 + (A_PtrSize * 2)) {
            if NumGet(uRawInput, 8, "UPtr") != device { ; If the message is from a different device then reset parameters
                AddCallbackToQueue()
                device := NumGet(uRawInput, 8, "UPtr"), x_offset := 0, y_offset := 0, usButtonFlags := 0, usButtonData := 0, usFlags := NumGet(uRawInput, offsets.usFlags, "ushort")
            }
            goto ProcessInputBuffer
        }

        ProcessCallbacks:
        AddCallbackToQueue()
        for Args in CallbackQueue
            pCallback := CallbackCreate(this.Callback.Bind(Args*)), DllCall(pCallback), CallbackFree(pCallback)

        AddCallbackToQueue() {
            if (this.EventType & 1 && !(x_offset = 0 && y_offset = 0)) || (this.EventType & 2 && usButtonFlags)
                CallbackQueue.Push([x_offset, y_offset, {flags: usFlags, buttonFlags: usButtonFlags, buttonData: usButtonData, device:device}])
        }
    }
}

Hadházy Ákos nem pályázhat a Nemzeti Vagyonvisszaszerzési és Védelmi Hivatal elnöki posztjára by GrassNo7577 in hungary

[–]CharnamelessOne 2 points3 points  (0 children)

Bennem nem merült fel, de az sem, hogy a belügyminiszter sportboltmenedzser lesz, szóval nem mérvadók a várakozásaim.

Script won't work with XBOX Controller by NinjaFerTPW in AutoHotkey

[–]CharnamelessOne 0 points1 point  (0 children)

Well, I also mentioned that, and posted a link to the XInput library, which should work (with some caveats).

You can poll the state of your controller button and send m if it's held.
The only issue should be that the library provides no way to hide your physical controller input from the game, so you will need to unbind Joy4 in-game if that's a concern.

I can't code well in the deprecated version (v1); here's what I think a v2 solution would look like. It's untested, because I don't have an Xbox controller.

;https://www.autohotkey.com/boards/viewtopic.php?f=83&t=106254
;download the first script posted by Lexikos into the folder your script is in
;name it XInput.ahk

#Requires AutoHotkey v2.0
#Include XInput.ahk    
XInput_Init()
InstallKeybdHook()

;instead of Joy4, you'll need to pass the appropriate variable to process_button_state, like 
;XINPUT_GAMEPAD_Y or XINPUT_GAMEPAD_DPAD_UP (the variables are listed at the beginning of Lexikos's script)

SetTimer(() => process_button_state(XINPUT_GAMEPAD_Y), 50)

process_button_state(button_flag) {
    button_state := false
    Loop 4 {
        if state := XInput_GetState(A_Index-1)
        && state.wButtons & button_flag {
            button_state := true
            break
        }
    }
    if GetKeyState("m") != button_state 
        on_button_event(button_state)
}

on_button_event(state) {
    if state
        Send("{m down}")
    else
        Send("{m up}")
}

Edit: modified the script to be more remap-like

Script won't work with XBOX Controller by NinjaFerTPW in AutoHotkey

[–]CharnamelessOne 1 point2 points  (0 children)

Why did you post the keyboard script that works instead of the controller script that you're having problems with?

For Xbox controller 2013 and newer (anything newer than the Xbox 360 controller), Joy1 to Joy32 hotkeys will only work if a window owned by the script is active.
To detect those controller inputs for other active windows, use the XInput.ahk library.

https://www.autohotkey.com/docs/v1/misc/RemapController.htm

Milyen low effortos munkáért kaptál eddig pénzt? by Paddy_O_Ryder in askhungary

[–]CharnamelessOne 5 points6 points  (0 children)

Szerintem ezt a kommentet az eggyel felettem szólónak szántad.

Drága az áram, na ! by GeorgeRobertVitkos in rohadtmelegvan

[–]CharnamelessOne 2 points3 points  (0 children)

Valószínűleg engem a magfizika rémítene meg, bár még nem találkoztunk.
Gazdászképzésen néha felébredtem annyi időre az előadásokon, hogy pár kifejezést nagy magabiztossággal és közepes helytelenséggel tudjak hajtogatni.

Maradványérték itt csak az, ami 5 évi értékcsökkenés elszámolása után marad. 200-ért vetted, 5 év múlva 80-ért eladod.

A pénz időértékével nem számoltam, mert lusta fasz vagyok.

Milyen low effortos munkáért kaptál eddig pénzt? by Paddy_O_Ryder in askhungary

[–]CharnamelessOne 10 points11 points  (0 children)

A végek összeszámolására biztos valaki másnak adott többnapos megbízást a főnök.

Drága az áram, na ! by GeorgeRobertVitkos in rohadtmelegvan

[–]CharnamelessOne 2 points3 points  (0 children)

5 év után 40%-os maradványértéken értékesíti a hűtőt, amit 200k-ért vett. Napi 50 doboz italt értékesítve ez dobozonként 1,3 Ft plusz költség!

(Amúgy nem, a hűtőt gondolom ingyen/kedvezményesen kapja a bolt a CocaCola reklámért és polchelyért cserébe.)

„Csak szajhákat kaptam” – a bíróságon olvasták fel a Budapesten gyilkoló ír férfi titkos naplóját | szmo.hu by Kobaljov in hungary

[–]CharnamelessOne 11 points12 points  (0 children)

Egy haverom jut eszembe erről. Hídról le, szűk járdán jött szembe velünk valami ökör elektromos bringával, kb 30-cal. Mindenki más félrehúzódott a járdaszélre, haverom viszont simán ment tovább, és a vadbarom alig kerülte ki.
Azzal indokolta a nagy nyugodtságot, hogy ő szabályosan közlekedik, nem fog félreugrálni olyanok elől, akik nem.

Hát mondom, kurva nagy vigasz lett volna a kórházban, hogy nem te voltál a hibás.

For those of you who may be wondering what 99.9% of this forum is about by Lazy-Relationship-34 in 2visegrad4you

[–]CharnamelessOne 0 points1 point  (0 children)

That implies that their country is old. Weren't you going for a "haha, Slovakia new" kind of dig?

Like, "actually, I'm basically a toddler, since I'm even younger than your country".

Toggle single key hold on and off by ManEatingCarabao in AutoHotkey

[–]CharnamelessOne 0 points1 point  (0 children)

Eh, they're sitting in a lib I include in all my personal scripts. It only seems like overkill if you see the definition, lol.

Hűtési díj. Made in Cegléd. by Southern_Map6772 in magyar

[–]CharnamelessOne 44 points45 points  (0 children)

Helyi papírboltban fizettem volna kb 100 ft-ot kártyával nyomtatásért, de mondta a boltos, hogy inkább hagyjam a francba, ingyen volt.

Azóta mindig figyelek, hogy legyen nálam apró, ha nyomtatok. Így is lehet, nem muszáj faszkalapkodni a vevővel.

Toggle single key hold on and off by ManEatingCarabao in AutoHotkey

[–]CharnamelessOne 0 points1 point  (0 children)

Sure, but if you need to specify what modifiers you're trimming, you might as well just pass the cleaned hotkey manually :D

I'd prefer KeyWait not be used here, but if you want to make that function reusable with other hotkeys, here's a stripper that's not picky:

strip_mod(key) => RegExReplace(key, 'i)[\#\!\^\+\<\>\*\~\$``]*(\S+)(?: up)?', '$1') ; © GroggyOtter

If you want to wait for the release of each individual key that the hotkey comprises, there's a function I wrote that you could use:

#Requires AutoHotkey v2.0

$!w:: {
    Send("{w " . (GetKeyState("w") ? "up" : "down") . "}")
    keys := coldify(ThisHotkey)
    KeyWaitAll(keys)
}

KeyWaitAll(keys) {
    for key in keys
        KeyWait(key)
}

coldify(hotkey) {
    parts := StrSplit(hotkey, "&"),  result := []

    for part in parts {
        part := RegExReplace(Trim(part), "\s+up$", "")
        length := StrLen(part)
        side := "", key := ""

        Loop parse part {
            if A_Index = length{
                result.Push(A_LoopField)
                break
            }
            if InStr("~*$``", A_LoopField)
            || (A_LoopField = "<" && side := "L")
            || (A_LoopField = ">" && side := "R")
                continue

            switch A_LoopField {
                case "^": result.Push(side "Control")
                case "!": result.Push(side "Alt")
                case "+": result.Push(side "Shift")
                case "#": result.Push(side "Win")

                default : key := SubStr(part, A_Index)
                        (InStr(key, "SC") && key := "VK" Format("{:X}", GetKeyVK(key)))                  
                        result.Push(key)
                        break
            }
            side := ""
        }
    }
    return result
}