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
Search found 6220 matches
- 03 Jun 2023, 23:00
- Forum: Ask for Help (v2)
- Topic: How to use "global" inside IF statements ? Topic is solved
- Replies: 2
- Views: 538
- 03 Jun 2023, 22:56
- Forum: Ask for Help (v2)
- Topic: Switch bug, CaseSense is invalid. Topic is solved
- Replies: 3
- Views: 653
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
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
- 03 Jun 2023, 13:17
- Forum: Ask for Help (v2)
- Topic: Switch bug, CaseSense is invalid. Topic is solved
- Replies: 3
- Views: 653
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
- 28 May 2023, 07:18
- Forum: Ask for Help (v2)
- Topic: If WinActive works not as intended on AHK v2
- Replies: 2
- Views: 880
Re: If WinActive works not as intended on AHK v2
the problem is ure not using #HotIf
- 28 May 2023, 07:16
- Forum: Ask for Help (v2)
- Topic: Don't work ImageSearch
- Replies: 4
- Views: 473
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...
- 28 May 2023, 07:05
- Forum: Ask for Help (v2)
- Topic: How to pass array parameter to dllcall? Topic is solved
- Replies: 2
- Views: 515
Re: How to pass array parameter to dllcall? Topic is solved
the ahk code checks out. the problem is in ur C function
- 27 May 2023, 03:49
- Forum: Ask for Help (v2)
- Topic: Question on closure Topic is solved
- Replies: 2
- Views: 461
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()
u cant use closures inside a loop like that, they capture variables, not the variables' values. u have to use .Bind()
- 19 May 2023, 11:42
- Forum: Ask for Help (v2)
- Topic: Best practices for obscuring sensitive information Topic is solved
- Replies: 5
- Views: 578
Re: Best practices for obscuring sensitive information Topic is solved
create and query Environment Variables on ur computer
- 16 May 2023, 00:00
- Forum: Ask for Help (v2)
- Topic: Help in understand byRef Functions
- Replies: 2
- Views: 389
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
post the full nonworking code, then i can tell u what u did wrong
- 14 May 2023, 06:17
- Forum: Gaming Help (v1)
- Topic: Act when certain words detected in Roblox
- Replies: 15
- Views: 1285
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
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
- 14 May 2023, 06:10
- Forum: Scripts and Functions (v2)
- Topic: mpv.dll perfect picture/video control
- Replies: 13
- Views: 2241
Re: mpv.dll perfect picture/video control
probably was meant to be StrPtr, not buf
- 14 May 2023, 06:03
- Forum: Ask for Help (v2)
- Topic: How to make a script for a specific device
- Replies: 1
- Views: 619
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
my suggestion would be to look at how rawinput gui is implemented and copypaste from there
- 13 May 2023, 08:50
- Forum: Gaming Help (v1)
- Topic: Locate a photo in the game Mu Online
- Replies: 27
- Views: 1690
Re: Locate a photo in the game Mu Online
pixelsearch for one of the dark grey background pixels instead
- 13 May 2023, 07:24
- Forum: Ask for Help (v2)
- Topic: Cannot Install AutoHotKey
- Replies: 2
- Views: 412
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
theyre old and the installer cant overwrite them for whatever reason. the rerun the installer
- 13 May 2023, 07:22
- Forum: Gaming
- Topic: Read/Write memory functions for AutoHotkey v2?
- Replies: 2
- Views: 670
Re: Read/Write memory functions for AutoHotkey v2?
the solution is literally one link away in the thread ure referring to
- 11 May 2023, 14:57
- Forum: Ask for Help (v2)
- Topic: Modifier key gets stuck on wireless keyboard
- Replies: 1
- Views: 262
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
- 11 May 2023, 06:47
- Forum: Gaming Help (v1)
- Topic: Locate a photo in the game Mu Online
- Replies: 27
- Views: 1690
Re: Locate a photo in the game Mu Online
dont save ur needle images in lossy formats(eg jpg)
- 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: 584
Re: Pass the command line to the program and get the return value
if u want speed, use the dll or WM_COPYDATA
- 07 May 2023, 08:53
- Forum: Ask for Help (v1)
- Topic: DllCall no return any value
- Replies: 2
- Views: 290
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...
- 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: 326
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?
in any case, the correct byref usage is explained in the docs, so maybe read them?