Search found 6220 matches

by swagfag
03 Jun 2023, 23:00
Forum: Ask for Help (v2)
Topic: How to use "global" inside IF statements ? Topic is solved
Replies: 2
Views: 507

Re: How to use "global" inside IF statements ? Topic is solved

if ure only ever gonna read the variable(as seems to be the case based on the code uve shown so far), then u dont need to declare anything global

otherwise, write global aa somewhere before the beginning of ur if-elif-else block
by swagfag
03 Jun 2023, 22:56
Forum: Ask for Help (v2)
Topic: Switch bug, CaseSense is invalid. Topic is solved
Replies: 3
Views: 592

Re: Switch bug, CaseSense is invalid. Topic is solved

it uses whatever syntax is documented, which clearly isnt the one u seem to be thinking of

switch is a built-in keyword, a control-flow statement. not a function, not a command nor anything else u might have thought it was

the interpreter cant report an error, because this usage is not erroneous
by swagfag
03 Jun 2023, 13:17
Forum: Ask for Help (v2)
Topic: Switch bug, CaseSense is invalid. Topic is solved
Replies: 3
Views: 592

Re: Switch bug, CaseSense is invalid. Topic is solved

ure misusing the parentheses, passing the value of whichever rightmost sub-expression gets evaluated last to switch's first parameter. get rid of them
by swagfag
28 May 2023, 07:18
Forum: Ask for Help (v2)
Topic: If WinActive works not as intended on AHK v2
Replies: 2
Views: 827

Re: If WinActive works not as intended on AHK v2

the problem is ure not using #HotIf
by swagfag
28 May 2023, 07:16
Forum: Ask for Help (v2)
Topic: Don't work ImageSearch
Replies: 4
Views: 449

Re: Don't work ImageSearch

the problem is in ur "program" (game really, lets not kid ourselves) maybe ure doing something with it that changes the sword's graphic(eg resizing the window, this changing the target image's dimensions) or maybe uve captured an antialiased image that would change every time its placed somewhere el...
by swagfag
28 May 2023, 07:05
Forum: Ask for Help (v2)
Topic: How to pass array parameter to dllcall? Topic is solved
Replies: 2
Views: 482

Re: How to pass array parameter to dllcall? Topic is solved

the ahk code checks out. the problem is in ur C function
by swagfag
27 May 2023, 03:49
Forum: Ask for Help (v2)
Topic: Question on closure Topic is solved
Replies: 2
Views: 414

Re: Question on closure Topic is solved

also the defined hotkeys wont do what u would expect them to: "i" will be set to whatever value it last had

u cant use closures inside a loop like that, they capture variables, not the variables' values. u have to use .Bind()
by swagfag
19 May 2023, 11:42
Forum: Ask for Help (v2)
Topic: Best practices for obscuring sensitive information Topic is solved
Replies: 5
Views: 531

Re: Best practices for obscuring sensitive information Topic is solved

create and query Environment Variables on ur computer
by swagfag
16 May 2023, 00:00
Forum: Ask for Help (v2)
Topic: Help in understand byRef Functions
Replies: 2
Views: 367

Re: Help in understand byRef Functions

ur issues have less(in fact, nothing) to do with ByRef and everything to do with the way ur code is structured/scoping

post the full nonworking code, then i can tell u what u did wrong
by swagfag
14 May 2023, 06:17
Forum: Gaming Help (v1)
Topic: Act when certain words detected in Roblox
Replies: 15
Views: 1117

Re: Act when certain words detected in Roblox

press Esc
PixelGetColor one of the dark grey background pixels of where the topmost "View" button would normally appear
if the color was actually dark grey, bail out of the game

u can do this urself after spending 1 hour writing ahk, assuming u had never done so before
by swagfag
14 May 2023, 06:10
Forum: Scripts and Functions (v2)
Topic: mpv.dll perfect picture/video control
Replies: 13
Views: 2067

Re: mpv.dll perfect picture/video control

probably was meant to be StrPtr, not buf
by swagfag
14 May 2023, 06:03
Forum: Ask for Help (v2)
Topic: How to make a script for a specific device
Replies: 1
Views: 530

Re: How to make a script for a specific device

looks like uve had chatgpt fart some random nonsense out. there is nothing to fix, except deleting everything and starting over

my suggestion would be to look at how rawinput gui is implemented and copypaste from there
by swagfag
13 May 2023, 08:50
Forum: Gaming Help (v1)
Topic: Locate a photo in the game Mu Online
Replies: 27
Views: 1515

Re: Locate a photo in the game Mu Online

pixelsearch for one of the dark grey background pixels instead
by swagfag
13 May 2023, 07:24
Forum: Ask for Help (v2)
Topic: Cannot Install AutoHotKey
Replies: 2
Views: 375

Re: Cannot Install AutoHotKey

delete every autohotkey related certificate u can find in certmgr.msc

theyre old and the installer cant overwrite them for whatever reason. the rerun the installer
by swagfag
13 May 2023, 07:22
Forum: Gaming
Topic: Read/Write memory functions for AutoHotkey v2?
Replies: 2
Views: 606

Re: Read/Write memory functions for AutoHotkey v2?

the solution is literally one link away in the thread ure referring to
by swagfag
11 May 2023, 14:57
Forum: Ask for Help (v2)
Topic: Modifier key gets stuck on wireless keyboard
Replies: 1
Views: 239

Re: Modifier key gets stuck on wireless keyboard

id imagine not. for all windows / ahk / the keyboard cares, ure still physically holding down CapsLock. get a better keyboard, or physically retap CapsLock every time it gets stuck(which should hopefully unstuck it), or rely on a different key combination that doesnt manifest such hardware limitations
by swagfag
11 May 2023, 06:47
Forum: Gaming Help (v1)
Topic: Locate a photo in the game Mu Online
Replies: 27
Views: 1515

Re: Locate a photo in the game Mu Online

dont save ur needle images in lossy formats(eg jpg)
by swagfag
07 May 2023, 09:01
Forum: Ask for Help (v2)
Topic: Pass the command line to the program and get the return value
Replies: 5
Views: 539

Re: Pass the command line to the program and get the return value

if u want speed, use the dll or WM_COPYDATA
by swagfag
07 May 2023, 08:53
Forum: Ask for Help (v1)
Topic: DllCall no return any value
Replies: 2
Views: 263

Re: DllCall no return any value

u dont need to call this function per se because autohotkey has already called it internally once as part of OleInitialize anyway, u can read the DllCall docs to figure out why the call is failing. check ErrorLevel, then reread in the docs what implications passing just a plain function name to call...
by swagfag
03 May 2023, 05:47
Forum: Ask for Help (v2)
Topic: Error: Parameter #1 of rrrequires a variable reference, but received a ComObject. Topic is solved
Replies: 1
Views: 301

Re: Error: Parameter #1 of rrrequires a variable reference, but received a ComObject. Topic is solved

prepend an & at the callsite as well

in any case, the correct byref usage is explained in the docs, so maybe read them?

Go to advanced search