Search found 444 matches

by Nwb
10 Apr 2018, 09:43
Forum: Ask For Help
Topic: Split lines into separate strings using stringsplit `n?
Replies: 21
Views: 1220

Re: Split lines into separate strings using stringsplit `n?

gregster wrote:Array.1 should probably be Apple, and not cat?!?
Well, anyway, `n is a string:

Code: Select all

TestText = 
(
Apple
Ball
Cat
)
Array := StrSplit(TestText, "`n")
msgbox % array.1 "  " array.2 "  " array.3
Oh ok thanks. :shock:

Do you have any idea if my second question is possible btw?
by Nwb
10 Apr 2018, 09:36
Forum: Ask For Help
Topic: Split lines into separate strings using stringsplit `n?
Replies: 21
Views: 1220

Split lines into separate strings using stringsplit `n?

TestText = ( Apple Ball Cat ) Array := StrSplit(TestText, `n) `n does not work for me. I want Array.1 to be cat, Array.2 to be ball, Array.3 to be cat. Also how do I do this? RandomSelector := PersonName %PersonName% := Attribute It is the wrong syntax but I want something like that. Because I want...
by Nwb
10 Apr 2018, 02:19
Forum: Ask For Help
Topic: Display current EDT time?
Replies: 1
Views: 203

Display current EDT time?

I need the current EDT time in the form of M/D/YYYY stored in a variable. How would I do this?
by Nwb
09 Apr 2018, 12:41
Forum: Ask For Help
Topic: How to use variables in FileExit() function? Topic is solved
Replies: 7
Views: 893

Re: How to use variables in FileExit() function? Topic is solved

Out of curiosity, how can you say this works ? If FileExist(C:\Discord\logs\lol.txt) it should give you this error message: ==> The leftmost character above is illegal in an expression. Specifically: \Discord\logs\lol.txt Anyway those three works: b1 := "lol" bon1 := FileExist("C:\Discord\logs\" b1...
by Nwb
09 Apr 2018, 12:34
Forum: Ask For Help
Topic: How to use variables in FileExit() function? Topic is solved
Replies: 7
Views: 893

Re: How to use variables in FileExit() function? Topic is solved

Edit:

The fault was that I unknowingly put the variable after a return. Thank you everybody who replied.
by Nwb
09 Apr 2018, 12:29
Forum: Ask For Help
Topic: How to use variables in FileExit() function? Topic is solved
Replies: 7
Views: 893

Re: How to use variables in FileExit() function? Topic is solved

You have to have a space in between the double quotation marks and the variable bon so that Autohotkey recognizes which of the text inside the () -parentheses is meant to be a string; bon := "lol" y:: If FileExist("C:\Discord\logs\" bon ".txt") ; Space between bon and "" MsgBox, Yes else MsgBox, No...
by Nwb
09 Apr 2018, 12:04
Forum: Ask For Help
Topic: How to use variables in FileExit() function? Topic is solved
Replies: 7
Views: 893

How to use variables in FileExit() function? Topic is solved

Notice the examples bon := "lol" y:: If FileExist("C:\Discord\logs\"bon".txt") Msgbox Yes else Msgbox No return bon := "C:\Discord\logs\lol.txt" If FileExist(bon) They do not work. While this works. If FileExist("C:\Discord\logs\lol.txt") it does? How do I use variables inside FileExit's function?
by Nwb
09 Apr 2018, 11:53
Forum: Ask For Help
Topic: IfMsgbox invalid parameter?
Replies: 3
Views: 380

Re: IfMsgbox invalid parameter?

The opening { on the same line is only allowed with if in expression syntax, for example if(x = 2) { ... so, put in on the next line. Thanks gregster! IfMsgBox is a command, which means that you can't use {} -brackets in the same line as the command. Instead, place the {} -brackets under the comman...
by Nwb
09 Apr 2018, 11:29
Forum: Ask For Help
Topic: IfMsgbox invalid parameter?
Replies: 3
Views: 380

IfMsgbox invalid parameter?

I have been breaking my head on this for so long I'm not able to understand this..

When I run this:

Code: Select all

IfMsgBox, OK {
	Var := 0
	Send, %Retrieved%
	return
}
return
It says parameter #1 for IfMsgBox is invalid.

But when I run:

Code: Select all

IfMsgBox, OK 
	Var := 0
There is no error?

There was no #warn either.
by Nwb
09 Apr 2018, 10:09
Forum: Ask For Help
Topic: Need help with RegExMatch please
Replies: 2
Views: 235

Re: Need help with RegExMatch please

AlphaBravo wrote:

Code: Select all

RegExReplace(ClipBoard, "`am)^(\V+?)(\d+)\V+(\(\d+\/\d+\))", "$1$2 - $3")
Thanks a lot. :shock:
by Nwb
09 Apr 2018, 08:47
Forum: Ask For Help
Topic: Need help with RegExMatch please
Replies: 2
Views: 235

Need help with RegExMatch please

Clipboard = ( Streetnameone LocationValue 4 -ad (462/462) ) I want Streetnameone LocationValue 4 -ad (462/462) to be changed to Streetnameone LocationValue 4 - (462/462) 1) A number always follows LocationValue 2) I want everything in between the Number after LocationValue and ( to be deleted and re...
by Nwb
09 Apr 2018, 05:59
Forum: Gaming
Topic: Key press getting stuck Topic is solved
Replies: 14
Views: 1226

Re: Key press getting stuck Topic is solved

FYI, Send {W down} sends Shift+w Also, this sleep is pointless, it does nothing: ToggleFarmClickTimer: Click Sleep 60 As is the final sleep in ToggleAutoGatherTimer Plus sleep 5 will not sleep for 5 - minimum sleep in AHK is between 10-15, depending on system. And don't set your timers to run at a ...
by Nwb
08 Apr 2018, 04:09
Forum: Gaming
Topic: Cursor movements get no stuck
Replies: 6
Views: 701

Re: Cursor movements get no stuck

Please use WinGetPos and tell us your width and height (of the emulator or application), this might be possible. Or is this for your WHOLE screen?? Or run this script when game is open and it is in screen and active. Also tell us your emulator's wintitle if you want this script to work only in the e...
by Nwb
08 Apr 2018, 02:42
Forum: Gaming
Topic: Help with script for RTS Topic is solved
Replies: 5
Views: 638

Re: Help with script for RTS Topic is solved

BoBo wrote:

Code: Select all

SetTitleMatchMode,2
#IfWinActive, Dawn of War
w::Send {up}
a::Send {left}
#IfWinActive
Not tested.
But why won't w:: Up work? Key::Key should work for remapping right? I guess it doesn't matter for keyboard keys but that's not the point.
https://autohotkey.com/docs/misc/Remap.htm
by Nwb
08 Apr 2018, 02:38
Forum: Gaming
Topic: ImageSearch Without Background
Replies: 7
Views: 565

Re: ImageSearch Without Background

Have you tried narrowing down the picture to only the frog and not the background? If the frog is not completely opaque then imagesearch is not your option. Or maybe you can classify them as two different pictures and have two separate imagesearches for them and use If conditions to decide which ima...
by Nwb
08 Apr 2018, 02:37
Forum: Gaming
Topic: Key press getting stuck Topic is solved
Replies: 14
Views: 1226

Re: Key press getting stuck Topic is solved

Avoid using more than one while {} loops. They tend to malfunction because of threading. #MaxThreadsPerHotkey 2 F1:: ToggleFarmClick := !ToggleFarmClick If ToggleFarmClick SetTimer, ToggleFarmClickTimer, 0 Else SetTimer, ToggleFarmClickTimer, Off return ToggleFarmClickTimer: Click Sleep 60 return F2...
by Nwb
08 Apr 2018, 02:22
Forum: Gaming
Topic: Stop {"key" Down} after loop? Topic is solved
Replies: 2
Views: 264

Re: Stop {"key" Down} after loop? Topic is solved

Write Send, {Ctrl Up} right after the loop. So When the space is up and the loop is broken, ctrl up is sent.

Code: Select all

$*SPACE::
	Send, {SPACE}
	keyWait, SPACE, t0.4
	Loop
	{
		GetKeyState, selfJump, SPACE, P
		IF selfJump=U
		Break
		Send, {Ctrl Down}{Space}
		sleep 1.5
	}
Send, {Ctrl Up}
return
by Nwb
07 Apr 2018, 14:07
Forum: Ask For Help
Topic: copy and paste Topic is solved
Replies: 14
Views: 1059

Re: copy and paste Topic is solved

Alright sir....There is a game in which they will give you words (eg autohotkey world) then as the game continues they will add more words eg (autohotkey world Hd) so now the words are more.....so ill open my anagrammer then type the words there.....then it will provide more words than when it was ...
by Nwb
07 Apr 2018, 07:43
Forum: Ask For Help
Topic: Thread: Interrupt Topic is solved
Replies: 8
Views: 530

Re: Thread: Interrupt Topic is solved

- Yes, what you're saying is true, I had considered adding a condition to reduce the number of times Sleep is used, and I wouldn't use it in a real script. - I wanted to be able to confirm that the Duration and LineCount parameters were having the stated effect, i.e. that I was using them correctly...
by Nwb
07 Apr 2018, 07:33
Forum: Ask For Help
Topic: Can controlsend {blind} misbehave with ctrl and shift keys?
Replies: 0
Views: 134

Can controlsend {blind} misbehave with ctrl and shift keys?

I was thinking about this I had an old script that used controlsend to a window. It had {Blind} and sometimes not all, it would press ctrl or shift without any reason to. Nothing in my send includes them nor was I holding these keys when the decided to be held down. So is it possible that it's becau...

Go to advanced search