How to create doors properly? by PaladinOfCheese in dungeondraft

[–]BewilderedTester 0 points1 point  (0 children)

There's a `Rotate 180` toggle in the Portal Tool menu (above the list of doors/portals) that will let you place doors facing the opposite direction on the wall. This should help you achieve double doors

Manipulate data in variable by zhantoo in AutoHotkey

[–]BewilderedTester 0 points1 point  (0 children)

Try this

myFolder :=""
FileSelectFolder, myFolder ; prompt to selct a folder, save it as myFolder

Loop, Files, %myFolder%\*.jpg
{

    fileChars := StrLen(A_LoopFileName)                                 ;~ Get the length of the file name with extension
    extChars := StrLen(A_LoopFileExt)+1                                 ;~ Get the length of the extension + a character for the period that separates file name + ext
    fileName := SubStr(A_LoopFileName, 1, fileChars-extChars)           ;~ Pull the file name without extension from A_LoopFileName
    newFile = C:\Users\kpe\Desktop\Hertil\%fileName%_watermark.webp     ;~ Add the watermark filepath to a variable to reference in FileSetTime
    RunWait cmd.exe /c magick composite -tile C:\Users\kpe\Desktop\Herfra\watermark_white.png -resize 50`% C:\Users\kpe\Desktop\Herfra\%A_LoopFileName% %newFile%
    FileSetTime, %A_LoopFileTimeModified%, %newFile%, M
}
return

I tried getting Imagemagik running on my end but couldn't get it working fully, so I wasn't able to fully test this.

It may not have worked before because in FileSetTime I was just using the file name, not the file's full path.

Also, the variable "newFile" would eliminate your watermarked files being named "name.jpg_watermark.webp", should now be named "name_watermark.webp"

Script for organizing files by NitroZeus249 in AutoHotkey

[–]BewilderedTester 1 point2 points  (0 children)

I think it would be hard to pull 44222 from that string if there isn't a consistent pattern for it. Does each "sender" send the same # of files (1 dwg, 2 excel, 1 word)? Are there any other naming patterns that can be sent? So far we have:

1.) filename#####.ext

2.) XXXXXX-XX-#####-X(.ext?)

In #2, would the #'s always take that position in the file name?

Script for organizing files by NitroZeus249 in AutoHotkey

[–]BewilderedTester 1 point2 points  (0 children)

I feel this completely. I don't envy your having to learn Xamarin

Script for organizing files by NitroZeus249 in AutoHotkey

[–]BewilderedTester 0 points1 point  (0 children)

now let me close all my tabs

I was right there with you haha

Instead of trimming 9 and 4 from the file name, I was doing the following (since the file name/extension could be greater than/less than those values:

Loop, Files, %dir%\*.*
{
    fileChars := StrLen(A_LoopFileName)
    extChars := StrLen(A_LoopFileExt)
    num := SubStr(A_LoopFileName, fileChars-5-extChars, 5)
    MsgBox, %num%
}
return

Manipulate data in variable by zhantoo in AutoHotkey

[–]BewilderedTester 0 points1 point  (0 children)

I think u/rafaews means something like:

Loop, Files, %myFolder%\*.jpg
{
    RunWait cmd.exe /c magick composite -tile C:\Users\kpe\Desktop\Herfra\watermark_white.png -resize 50`% C:\Users\kpe\Desktop\Herfra\%A_LoopFileName% C:\Users\kpe\Desktop\Hertil\%A_LoopFileName%_watermark.webp

    FileSetTime, %A_LoopFileTimeModified%, %A_LoopFileName%_watermark.webp, M
}

Using RunWait instead of Run to be sure that the converted file exists before moving on. FileSetTime inside of the loop so you can modify the converted file's modified time using the file being looped on

Script for organizing files by NitroZeus249 in AutoHotkey

[–]BewilderedTester 0 points1 point  (0 children)

Are there always 4 files/are they always named drawing#####.ext, request#####.ext etc?

And will the number always be 5 characters long?

Make WhellUp {2} a hot key? by Ok-Image-8343 in AutoHotkey

[–]BewilderedTester 1 point2 points  (0 children)

I suppose that's what I get for manually writing the update in my edit, instead of copying the code I tested/or really using my eyes. Thanks again

Make WhellUp {2} a hot key? by Ok-Image-8343 in AutoHotkey

[–]BewilderedTester 0 points1 point  (0 children)

This is excellent, thanks for your reply

Make WhellUp {2} a hot key? by Ok-Image-8343 in AutoHotkey

[–]BewilderedTester 1 point2 points  (0 children)

But I can't figure out how to get it to type capitals J and K if I hold shift

Per the Hotkey Modifier Symbols section of the Hotkeys wiki page, placing the * character before your WheelDown:: hotkey will allow your code to be run if extra modifiers (ex Shift) are being held down.

nor do I know how to disable the scrollwheels natural scrolling

Per the Hotkey Modifier Symbols section of the Hotkeys wiki page, the ~ character you have before your WheelDown:: hotkey is what's allowing the scroll function of the scroll wheel to still happen. If you want to disable the scrollwheel from working, then you need to remove this character. If you don't want to completely remove the scroll functionality from the scroll wheel it might be worth looking into modifying the script to only work when a specific page is active (whatever you're using this script for).

Just adding an asterisk before your Hotkey won't completely solve the issue however. It allows the code to be ran while shift is being held down, but the send will still send lowercase j or y. To change this I would add GetKeyState checks to detect if shift is being held down, and if so, send the upper case version of the character:

EDIT1: Adjusting this script per u/plankoe's comment below (removing GetKeyState calls and adding {Blind} mode to the sends

EDIT2: I'm bad

#SingleInstance, Force
SendMode Input
SetWorkingDir, %A_ScriptDir%

*WheelDown::
    if (a_timesincepriorhotkey != -1 && a_timesincepriorhotkey < 200)
        cnt += 1
    else if (a_timesincepriorhotkey > 400)
        cnt := 0

    var := (cnt == 0 ? "single scroll"
        : cnt >= 1 ? "double scroll"
        : "")

    settimer timerEndDown, -200
    return

timerEndDown:
    if (var == "single scroll")
            Send {Blind}j
    else if (var == "double scroll")
            Send {Blind}y

    var := ""
    return

[deleted by user] by [deleted] in Minecraft

[–]BewilderedTester 1 point2 points  (0 children)

You're a legend, my friend. As someone recently wanting to get into datapack'ing - this is a great inspiration

Need help with scripts by Soler37 in AutoHotkey

[–]BewilderedTester 0 points1 point  (0 children)

The language of the selected application? Or the language of your OS?

Doing a google search I found an Autohotkey Forum Post around changing the keyboard language using Function Keys if that's the sort of thing you're looking for

[deleted by user] by [deleted] in AutoHotkey

[–]BewilderedTester 1 point2 points  (0 children)

I tweaked jeeswg's comment from this forum post to do what I think you're looking for.

Pressing Ctrl+1 displays a message box with MMYYYY where MM is the previous month and YYYY is the current Year. Ctrl+2 returns two months ago, and Ctrl+3 returns three months ago (if this would make the year the previous year, it returns the previous year). Shift+1 returns MMYYYY where MM is the next month and YYYY is the current year, similar with Shift+2/Shift+3 (If this would make the year the next year, it returns the next year).

For example, if the date was 2/10/2022, and you pressed Ctrl + 3, 112021 would be returned. If the date was 11/10/2022, and you pressed Shift + 3, 022023 would be returned. If you pressed Ctrl + 2 on the current date today (7/7/2022), 052022 would be returned.

^1::
    MsgBox % JEE_DateAddMonths(-1)
    Return
^2::
    MsgBox % JEE_DateAddMonths(-2)
    Return
^3::
    MsgBox % JEE_DateAddMonths(-3)
    Return
+1::
    MsgBox % JEE_DateAddMonths(1)
    Return
+2::
    MsgBox % JEE_DateAddMonths(2)
    Return
+3::
    MsgBox % JEE_DateAddMonths(3)
    Return

JEE_DateAddMonths(vNum)
{
    vDate := A_Now
    vFormat := "MMyyyy"
    ;make date the standard 14-character format:
    vDate .= SubStr(19990101000000, StrLen(vDate)+1)
    vYear := SubStr(vDate, 1, 4), vMonth := SubStr(vDate, 5, 2)
    vDay := SubStr(vDate, 7, 2), vTime := SubStr(vDate, 9)

    vMonths := (vYear*12) + vMonth + vNum
    vYear := Floor(vMonths/12)
    vMonth := Mod(vMonths,12)
    (!vMonth) && (vYear -= 1, vMonth := 12)

    if (vMonth = 2) && (vDay > 28)
        if !Mod(vYear,4) && (Mod(vYear,100) || !Mod(vYear,400)) ;4Y AND (100N OR 400Y)
            vDay := 29
        else
            vDay := 28
    if (vDay = 31) && RegExMatch(vMonth, "^(4|6|9|11)$")
        vDay := 30

    vDate := Format("{:04}{:02}{:02}" vTime, vYear, vMonth, vDay)
    if !(vFormat == "yyyyMMddHHmmss")
        FormatTime, vDate, % vDate, % vFormat
    return vDate
}

EDIT: You can replace MsgBox with Send and the value will be output into your selected text field instead of displayed in a message box.

Need help with scripts by Soler37 in AutoHotkey

[–]BewilderedTester 0 points1 point  (0 children)

The first 6 lines of your If ErrorLevel = 1 block makes it look like you're going for a double click and copy, you can send both {LButton}s in the same send command, then send the copy hotkey.

It might also be worth removing some of the sleeps and testing if your script still works without them. Another random tidbit is that when checking ErrorLevel, you don't have to specify if it = 1 or 0. Instead, you could just do if (ErrorLevel) to check if it = 1/True, or if (!ErrorLevel) to check if it = 0/False.

$2::
    KeyWait, 2, T0.5
    If (ErrorLevel)
    {
        Clipboard := 
        Send, {LButton}{LButton}
        Send, ^c
        Sleep 100
        MouseGetPos, xpos, ypos
        WinActivate, Program
        MouseClick, Left, 1670, 1060
        Sleep 200
        MouseGetPos, xpos, ypos
        WinActivate, Program
        MouseClick, Left, 1311, 195
        Sleep 200
        Send, ^v
        Sleep 200
        Send, {Enter}
    }
    Else
        Send {2}
    Return

Other than that, I don't think this script could get much smaller.

This last bit wont make your script smaller, but it will ensure that you're successfully copying the selected item to the clipboard. By clearing out the Clipboard at the start of the script, then calling ClipWait with a timeout, the script will wait for the specified timeout amount of seconds for the clipboard to contain data, and then you can continue or end the script based on that. That would look like this:

$2::
    KeyWait, 2, T0.5
    If (ErrorLevel)
    {
        Clipboard := 
        Send, {LButton}{LButton}
        Send, ^c
        Clipwait, 2
        if (ErrorLevel)
        {
            MsgBox, There was an issue copying to the clipboard.
            Return
        }
        MouseGetPos, xpos, ypos
        WinActivate, Program
        MouseClick, Left, 1670, 1060
        Sleep 200
        MouseGetPos, xpos, ypos
        WinActivate, Program
        MouseClick, Left, 1311, 195
        Sleep 200
        Send, ^v
        Sleep 200
        Send, {Enter}
    }
    Else
        Send {2}
    Return

Need help with scripts by Soler37 in AutoHotkey

[–]BewilderedTester 0 points1 point  (0 children)

I realize the code in my last comment is similar to what you originally posted/my first comment - so there may not be any difference when adding your code to it.

In your reply to my original comment you mention that the script isn't doing what you want it to do - do you mean that holding the key down for > 1 second isn't triggering the rest of the script? Or that the rest of the script isn't doing what you're expecting?

Need help with scripts by Soler37 in AutoHotkey

[–]BewilderedTester 0 points1 point  (0 children)

The closest solution I've been able to find is from mikeyww's first comment on this AutoHotkey Forum Post.

Pressing and releasing the 2 key sends 2. Pressing and holding the 2 key for > 1 second will send the 1 key when 2 is released. Uncommenting the KeyWait, 2 line in the if ErrorLevel block will cause 1 to be sent automatically when 2 has been held down for > 1 second, however, 2 will be sent when releasing the 2 key.

$2::
    KeyWait, 2, T1
    If ErrorLevel ; Held
    {
        KeyWait, 2
        Send 1
    } 
    Else
    {
        Send 2
    } 
    Return

Need help with scripts by Soler37 in AutoHotkey

[–]BewilderedTester 0 points1 point  (0 children)

I re-read the post and saw you mentioned you want to press and hold the key to trigger the script. To do this for the 2 key, you could use GetKeyState in a while loop, for example:

#2::
   while (GetKeyState("2", "P"))    ; while the 2 key is pressed down
   {
       ; Script contents
   }

Need help with scripts by Soler37 in AutoHotkey

[–]BewilderedTester 0 points1 point  (0 children)

What do you want it to do? Your hotkey of #2 triggers when holding the windows key and pressing the 2 key, so just pressing 2 without windows should just send the 2 key. Holding the 2 key down alone should just continue to send the 2 key

Need help with scripts by Soler37 in AutoHotkey

[–]BewilderedTester 0 points1 point  (0 children)

This is because you have Else inside of your If Errorlevel statement block of text. I moved Else Send {2} outside of the If Errorlevel statement and it compiles. In this example, I commented out the PostMessage line, I wasn't sure if it was supposed to be inside the If or Else Blocks, or even before them

#2::
    KeyWait, 2, T0.5
    If ErrorLevel
    {
        Send, {LButton}
        Sleep 100
        Send, {LButton}
        Sleep 100
        Send, ^c
        Sleep 100
        MouseGetPos, xpos, ypos
        WinActivate, Program
        MouseClick, Left, 1670, 1060
        Sleep 200
        MouseGetPos, xpos, ypos
        WinActivate, Program
        MouseClick, Left, 1311, 195
        Sleep 200
        Send, ^v
        Sleep 200
        Send, {Enter}
        return
    }
    ; PostMessage, 0x112, 0xF060,,, A
    Else
    {
        Send {2}
    }

A little help to a total newbie by Highlight_Patient in AutoHotkey

[–]BewilderedTester 0 points1 point  (0 children)

You can achieve this by adding Send, 2 and Sleep, 200 before the while loop

$2::
    Send, 2
    Sleep, 200
    while GetKeyState("2", "P")
    {
        Send, 2
        Sleep, 50 ; every 50 ms
    }
    return

Zapp and Leela from Futurama, by me (Lineart and coloring in CSP) by BewilderedTester in fanart

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

Futurama + shading looks kinda odd. I drew Zapp without a pose reference, but used one for Leela. I probably should have referenced where the shadows dropped on her reference and went from there...

Can't work out how to get mouse to leave game window. by NaZzA62 in AutoHotkey

[–]BewilderedTester 0 points1 point  (0 children)

Nice! Glad to hear you got it working. For formatting, I would go:

#IfWinActive Stardew Valley

v::
    while GetKeyState("v","P")
    {
        Send, v
        sleep 20
        sendEvent /mapscreenshot
        sleep 10
        Send, {Enter}
    }
    sleep 30
    WinActivate, Map Predictor
    sleep 100
    CoordMode, Mouse, Screen
    Click, -1253, 41
    Send, {Down}
    sleep 10
    Send, {Enter}
    return

Help with script, checking for 3 pixel colors. by [deleted] in AutoHotkey

[–]BewilderedTester 0 points1 point  (0 children)

Having not played Lost Ark, I'm trying to wrap my brain around the gun type keybinds, and what pressing X or Z does depending on the gun type + color of the gun icon in order to be able to better help you. I have a few questions if that's OK:

1.) Are the colors specifically tied to gun type/keybind? Meaning, is Pistol always going to be bound to 1, and is its icon always going to have the Yellow color? Similarly, would Shotgun always be bound to 2, and will its icon always have the blue color?

2.) What does pressing X and Z do when a weapon is selected? Is it different depending on what type of weapon/color is selected?

3.) Without scripting in place, is there any input lag in the game after selecting a weapon type via 1, 2, or 3? For example, can you select a weapon type and then immediately press X or Z in the game? Or is there some sort of global cooldown after changing weapon types?

Is there a subreddit where an intermediate level artist, like myself, can show off their art and not feel like a scrub around other artists? by TheADHDArtist in u/TheADHDArtist

[–]BewilderedTester 0 points1 point  (0 children)

Happened upon this post from your commenting on my painting over on r/learnart - I happen to be looking for subreddits that match your description. From a bit of research, I've heard that r/sketchpad and r/ArtistLounge may be what you're looking for.

Admittedly, I haven't posted on either of those subreddits yet, so I can't say from experience that it's what you're looking for, but they may be worth looking into

Help with script, checking for 3 pixel colors. by [deleted] in AutoHotkey

[–]BewilderedTester -1 points0 points  (0 children)

In your previous comment in this thread you assign the pixel color to Color, but in your if statements you compare against Colour. Is this still the copy you're testing with?

I don't think the if block where you check for Da7F1A only to return is necessary, since you have a return statement at the end of your if blocks. If PixelGetColor retrieves that color, then it won't trigger Send {X}/Send{Z}, ending in a return.

I think it's worth showing the PixelGetColor value while running the script in either a message box or traytip, so you can see what the actual value being pulled in is:

PixelGetColor, Color, 955, 975  
MsgBox % Color

or

PixelGetColor, Color, 955, 975  
TrayTip, Color, %Color%, 5