Search found 849 matches

by swagfag
Today, 13:21
Forum: Offtopic
Topic: Return from function - True or 1?
Replies: 20
Views: 156

Re: Return from function - True or 1?

for ur particular example, the following constitutes best practice by my book:

Code: [Select all]GeSHi © Codebox Plus

checkIfDirExists(DirName) {
return InStr(FileExist(DirName), "D")
}
by swagfag
Today, 08:23
Forum: Ask For Help
Topic: check for pixel color on a region
Replies: 4
Views: 45

Re: check for pixel color on a region

FFFFFF in the context of your if-statement is an unitialized variable, and not a hexadecimal number. u need:

Code: [Select all]GeSHi © Codebox Plus

if (color = 0xFFFFFF)
by swagfag
Today, 03:51
Forum: Ask For Help
Topic: Cant exit script, now im screwed
Replies: 5
Views: 50

Re: Cant exit script, now im screwed

reboot ur pc to clear any running scripts. reboot into safe mode if uve somehow managed to shove the script in ur starup folder, then delete it from there.
by swagfag
Today, 03:43
Forum: Ask For Help
Topic: check for pixel color on a region
Replies: 4
Views: 45

Re: check for pixel color on a region

if u wanna check if a region contains a pixel of a specified color use PixelSearch if u wanna check if the entirety of a region is of a specified color u figure out its width and height, set up 2 nested loops and check each pixel within, individually, using PixelGetColor or other means(gdip_getlockb...
by swagfag
Today, 03:37
Forum: Wish List
Topic: one line IF command
Replies: 4
Views: 84

Re: one line IF command

in v1 i sometimes use: <condition> ? <expression> u cant do that in v2 and have to explicitly add the else branch, i wish u didnt have to: <condition> ? <expression> : "" u can stuff multiple functions in an expression separated by commas as demonstrated by jeeswg. whether u should is a di...
by swagfag
Yesterday, 06:59
Forum: Ask For Help
Topic: Parsing loop. Same line is repeated twice ?
Replies: 3
Views: 55

Re: Parsing loop. Same line is repeated twice ?

from the docs on the legacy version of StringSplit For example, if MyArray is specified, the command will put the number of substrings produced (0 if none) into MyArray0, the first substring into MyArray1, the second into MyArray2, and so on. in your script u check against data1 being empty. When St...
by swagfag
Yesterday, 06:30
Forum: Ask For Help
Topic: Getting color of a pixel and then clicking on it
Replies: 2
Views: 41

Re: Getting color of a pixel and then clicking on it

what exactly doesnt work? the clicking? the pixelfinding? the looping?
your coordinates are likely messed up. ud probably want CoordMode, Screen enabled for both Mouse and Pixel
also, RGB: 0xAF1A34 is not BGR: 0x3419AF, but rather BGR: 0x341AAF
by swagfag
15 Jul 2018, 11:21
Forum: Ask For Help
Topic: Imagesearch aimbot?
Replies: 2
Views: 59

Re: Imagesearch aimbot?

i dont think it is

disregarding the fact that imagesearch would be way too slow for this task to begin with, i dont see how youd cope with perspective distortions and translating the coordinates reported by imagesearch to accurate ingame mouse movement
by swagfag
15 Jul 2018, 11:09
Forum: Ask For Help
Topic: Using regex to remove body of text between non-static and static boundaries?
Replies: 2
Views: 60

Re: Using regex to remove body of text between non-static and static boundaries?

nonregex solution: sample = (Join`r`n non-static duplicate line #1 non-static duplicate line #1 non-static body of text about 100 lines or so #1 non-static body of text about 100 lines or so #1 non-static body of text about 100 lines or so #1 non-static body of text about 100 lines or so #1 non-stat...
by swagfag
13 Jul 2018, 08:12
Forum: Ask For Help
Topic: Very new user trying to make a script
Replies: 2
Views: 67

Re: Very new user trying to make a script

arr := ["w", "a", "s", "d", "c"] F7:: Toggle := !Toggle while (Toggle) { key := arr[rand(1, arr.Length())] sendinput % "{" key " Down}" sleep % rand(100, 3000) sendinput % "{" key " Up}" } return rand(min, max...
by swagfag
13 Jul 2018, 07:57
Forum: Ask For Help
Topic: Is it possible to customize a remap?
Replies: 2
Views: 50

Re: Is it possible to customize a remap?

u can use an Input box and or a custom gui(with an Edit control most likely) to prompt the user for input, then define the hotkey using the Hotkey command
by swagfag
13 Jul 2018, 07:48
Forum: Ask For Help
Topic: Key & any key?
Replies: 6
Views: 143

Re: Key & any key?

#NoEnv #SingleInstance Force SendMode Input SetBatchLines -1 pressed := false ; we introduce a layer of hotkeys which will become active while '>' is being held down GenerateCombinationHotkeys() Return #If !pressed *VKBE:: ; '>' pressed := true Send {Blind}{LButton Down} Return #If *VKBE Up:: ; '>'...
by swagfag
13 Jul 2018, 02:37
Forum: Ask For Help
Topic: HELP ME TO EDIT THIS SCRIPT PLEASE
Replies: 3
Views: 66

Re: HELP ME TO EDIT THIS SCRIPT PLEASE

First of there's no reason for set batch lines to be constantly redefined within the loop, so pull it out towards the top and place it in the auto execute section. You can put a sleep in your loop instead, so as to introduce a delay.
by swagfag
12 Jul 2018, 07:07
Forum: Ask For Help
Topic: Until-loop in one line?
Replies: 3
Views: 68

Re: Until-loop in one line?

put the loop in a function then, and call it instead
by swagfag
12 Jul 2018, 05:23
Forum: Ask For Help
Topic: Combining an array with labels into an already existing array
Replies: 7
Views: 149

Re: Combining an array with labels into an already existing array

this construct here MasterIndex[1] := {(Category[1]): Info[1]} means the following: ⋅ take the object { doesnt_rly_matter_whats_in_here } ⋅ assign := it to the key in masterindex with an index of 1 [1] when u copy paste it 3 times, youll overwrite all previous assignments save fo...
by swagfag
12 Jul 2018, 05:16
Forum: Ask For Help
Topic: Alternative to loop script Topic is solved
Replies: 4
Views: 55

Re: Alternative to loop script Topic is solved

theres no reason for it to perform the check that often, add a delay of 500 ms, or 1s. see Sleep
by swagfag
11 Jul 2018, 11:08
Forum: Ask For Help
Topic: if check not working as intended
Replies: 7
Views: 131

Re: if check not working as intended

maybe flux doesnt possess any detectable windows, try #DetectHiddenWindows On. Failing that, you can replace winexist with Process Exist, ur_process_name and check the ErrorLevel
by swagfag
10 Jul 2018, 18:44
Forum: Ask For Help
Topic: Combining an array with labels into an already existing array
Replies: 7
Views: 149

Re: Combining an array with labels into an already existing array

this is how to declare a key thats contained in a variable. u use a pair of () https://autohotkey.com/docs/Objects.htm#Usage_Associative_Arrays Categories := ["Movies", "Books", "Magazines"] MovieIndex := ["Terminator", "Batman"] MasterIndex ...
by swagfag
10 Jul 2018, 15:23
Forum: Ask For Help
Topic: CoordMode not working as expected
Replies: 4
Views: 67

Re: CoordMode not working as expected

why not? it can yield negative values despite Screen being enabled, in a multi-monitor setup. do u only have a single monitor?

Go to advanced search