Search found 110 matches

by ahcahc
31 Oct 2016, 06:31
Forum: Ask For Help
Topic: Converting Simple Batch file to AHK Code issue
Replies: 10
Views: 2402

Re: Converting Simple Batch file to AHK Code issue

@lexikos
If you include blank lines it will give an error.
by ahcahc
30 Oct 2016, 10:32
Forum: Ask For Help
Topic: Converting Simple Batch file to AHK Code issue
Replies: 10
Views: 2402

Re: Converting Simple Batch file to AHK Code issue

batch = ( @echo off cls echo. echo. Stopping Windows Update ping 1.1.1.1 -n 1 -w 1 > nul NET STOP wuauserv ping 1.1.1.1 -n 1 -w 1000 > nul echo. echo. Restarting Windows Update... ping 1.1.1.1 -n 1 -w 1 > nul NET START wuauserv ping 1.1.1.1 -n 1 -w 1000 > nul exit ) loop, parse, batch, `n if A_Loop...
by ahcahc
29 Oct 2016, 20:41
Forum: Ask For Help
Topic: Loop while a button is pressed, with breaks in between Topic is solved
Replies: 4
Views: 1174

Re: Loop while a button is pressed, with breaks in between Topic is solved

Code: Select all

RButton::
while GetKeyState("RButton", "P")
{
	Send,q
	sleep, 10
	start_time := A_TickCount
	while ( GetKeyState("RButton", "P") and (A_TickCount - start_time) <= 5000 )
	{
		sleep, 10
		ToolTip, % "Elapsed time: " A_TickCount - start_time "ms"
		send w
	}
}
ToolTip
return
by ahcahc
29 Oct 2016, 06:50
Forum: Ask For Help
Topic: Script is Pausing when I close "Laptop Lid"
Replies: 4
Views: 888

Re: Script is Pausing when I close "Laptop Lid"

Check what were the previously executed lines of the script, are they always the same when they get paused. Does closing the lid immediately pause the script? Do you have another scripts running in parallel with the paused script?
by ahcahc
28 Oct 2016, 08:50
Forum: Ask For Help
Topic: Stop a script Topic is solved
Replies: 4
Views: 1069

Re: Stop a script Topic is solved

Code: Select all

#Persistent
SetTitleMatchMode, 2
SetTimer, do_something, 1000
return

do_something:
IfWinExist, Hello
{
	;your codes here
	MsgBox World
}
;else
;	ExitApp
return
by ahcahc
27 Oct 2016, 06:14
Forum: Ask For Help
Topic: Repeat a line in a sequence Manually Topic is solved
Replies: 2
Views: 564

Re: Repeat a line in a sequence Manually Topic is solved

Code: Select all

Numpad1::
actionvar++
if actionvar = 1
	Send {A}
else if actionvar > 1
	Send {B}
return

Numpad2::actionvar:=0
by ahcahc
27 Oct 2016, 05:56
Forum: Ask For Help
Topic: Please help me with RegExMatch
Replies: 3
Views: 948

Re: Please help me with RegExMatch

What is wrong with my code? How to correct it? Thanks! RegExMatch only returns the position of the first match. In order to search the rest of the string you need to keep on changing the starting position (can be accomplished by doing loops). You can also do this with RegExReplace + StrSplit. Str =...
by ahcahc
25 Oct 2016, 05:47
Forum: Ask For Help
Topic: RegExReplace simple question
Replies: 2
Views: 753

Re: RegExReplace simple question

The needle to remove last 3 character ...$ using regexreplace.
by ahcahc
25 Oct 2016, 05:32
Forum: Ask For Help
Topic: Script is Pausing when I close "Laptop Lid"
Replies: 4
Views: 888

Re: Script is Pausing when I close "Laptop Lid"

Is the script in the VMs paused or the VMs are paused or you have another script running in the host that became paused? Also set "Turn off hard disk after" to never (zero). Did you also set the power options in the VMs? edit: Maybe somewhere in you code the conditions to pause the script is met or ...
by ahcahc
25 Oct 2016, 02:46
Forum: Ask For Help
Topic: Quick conversion multiple keys to scancodes
Replies: 4
Views: 1352

Re: Quick conversion multiple keys to scancodes

This will replace any single character inside the braces {} to its scancode equivalent. F2:: ;select text including braces {x} then press F2 cb_old := ClipboardAll Clipboard := send, ^{sc2e} ClipWait, 1 while pos := regexmatch(Clipboard,"(?<={).(?=})",m, a_index=1?1:pos+strlen(m)) Clipboard := RegEx...
by ahcahc
20 Oct 2016, 14:33
Forum: Ask For Help
Topic: Regex help...
Replies: 8
Views: 1865

Re: Regex help...

try ^[^:\\]+?:\\(?:[^:\\]+?(?:(?=;)|\\|$))*|(?<=;)[^:\\]+?:\\(?:[^:\\]+?(?:(?=;)|\\|$))* maybe needs more testing.
by ahcahc
20 Oct 2016, 13:44
Forum: Ask For Help
Topic: Regex help...
Replies: 8
Views: 1865

Re: Regex help...

try

Code: Select all

text = EED6-5BA8:\Us;e;rs;D:\Test;Storage:\A;B;C\
while pos := regexmatch(text,"m)(?:[[email protected]#$%^&()_+`\-=\[\]{}'\.,\w]+):\\(?:[[email protected]#$%^&()_+`;\-=\[\]{}'\., \w]+(?:(?=;)|\\|$))*",m,a_index=1?1:pos+strlen(m))
   MsgBox % m
by ahcahc
20 Oct 2016, 13:35
Forum: Ask For Help
Topic: Need tweak to a RegExMatch
Replies: 15
Views: 1971

Re: Need tweak to a RegExMatch

Instead of doing multiple regexmatch for each pattern, you can combine all the patterns using verticals bars | in to one giant pattern. The same as saying search for pattern1 and pattern2 and pattern3 and so on.
by ahcahc
20 Oct 2016, 09:27
Forum: Ask For Help
Topic: can't find file, but it does exist
Replies: 5
Views: 1100

Re: can't find file, but it does exist

Can you go inside the folder using windows explorer? Are you sure you change the permission of your account? Can you show a screenshot of the security tab.
by ahcahc
20 Oct 2016, 09:07
Forum: Ask For Help
Topic: can't find file, but it does exist
Replies: 5
Views: 1100

Re: can't find file, but it does exist

click security tab, check what permissions do you have.

Can you navigate inside the folder? Have you tried running the script as admin?
by ahcahc
20 Oct 2016, 08:03
Forum: Ask For Help
Topic: can't find file, but it does exist
Replies: 5
Views: 1100

Re: can't find file, but it does exist

Most likely permission problem.
by ahcahc
19 Oct 2016, 22:07
Forum: Ask For Help
Topic: Need tweak to a RegExMatch
Replies: 15
Views: 1971

Re: Need tweak to a RegExMatch

\$?\b[@.,\w'’-]+\b - to also search for patterns like $1,000 \$? - the dollar sign $ is used by regex as the end of string/line indicator. In order to use the literal dollar sign we need to escape it using backslash \ , thus \$ . The question mark ? makes the previous character optional, the previo...
by ahcahc
19 Oct 2016, 15:00
Forum: Ask For Help
Topic: Need tweak to a RegExMatch
Replies: 15
Views: 1971

Re: Need tweak to a RegExMatch

Yes, you combined them correctly.

I think the only reliable way to capture file patterns is to not allow spaces in the filenames. try [[:alpha:]]:[[email protected]#$%^&()_+=-`~\[\]{};', \w]*\\[[email protected]#$%^&()_+=-`~\[\]{};',\w]*(?:\.[[email protected]#$%^&()_+=-`~\[\]{};',\w]*)*
by ahcahc
19 Oct 2016, 11:20
Forum: Ask For Help
Topic: Need tweak to a RegExMatch
Replies: 15
Views: 1971

Re: Need tweak to a RegExMatch

You could start by familiarizing with its symbols and syntax . web address (?:https?:\/\/)?\w+(?:\.\w+)+ I've tweaked the pattern for filepath now it includes root drives (X:\) and only allow file extensions that dont have spaces in them. So that it will capture only the filepath and not include eve...
by ahcahc
19 Oct 2016, 10:00
Forum: Ask For Help
Topic: regular expressions Topic is solved
Replies: 4
Views: 998

Re: regular expressions Topic is solved

The default pcre (php).

Go to advanced search