Search found 61 matches

by Onimuru
16 Apr 2020, 05:25
Forum: Ask For Help
Topic: Hide/show explorer.exe (taskbar)
Replies: 8
Views: 410

Re: Hide/show explorer.exe (taskbar)

I think this is what you're after:

Code: Select all

if (WinActive("ahk_exe Explorer.EXE") && !vID) {
	WinHide, % "ahk_id" . vID := WinExist("A")
}
else {
	WinShow, % "ahk_id" . vID

	vID := ""
}
Return
by Onimuru
16 Apr 2020, 05:11
Forum: Ask For Help
Topic: Random function in AHK
Replies: 15
Views: 1123

Re: Random function in AHK

I have to say, this is an incredibly uninteresting issue, your initial post sounded quite interesting by contrast. Modify() { this.currentSkill := Random(Max(1, this.originalSkill - 2), this.originalSkill) ;* Random number between this.skill - 2 (or 1 if greater) and this.skill. this.isModified:= Tr...
by Onimuru
16 Apr 2020, 01:25
Forum: Ask For Help
Topic: Extracting from first set of quotation marks
Replies: 7
Views: 586

Re: Extracting from first set of quotation marks

If the contents are always numbers you can simply RegEx for "(?<text>\d+)".
by Onimuru
15 Apr 2020, 09:33
Forum: Ask For Help
Topic: Make gui semi-transparent Topic is solved
Replies: 11
Views: 714

Re: Make gui semi-transparent Topic is solved

You misunderstand how Transcolor works, to fade red you would use:

Code: Select all

WinSet, TransColor, 0xF00000 80
by Onimuru
15 Apr 2020, 09:20
Forum: Ask For Help
Topic: Make gui semi-transparent Topic is solved
Replies: 11
Views: 714

Re: Make gui semi-transparent Topic is solved

That color is predominantly red:

Code: Select all

WinSet, TransColor, 0xFF0000 100
by Onimuru
15 Apr 2020, 08:54
Forum: Ask For Help
Topic: Make gui semi-transparent Topic is solved
Replies: 11
Views: 714

Re: Make gui semi-transparent Topic is solved

Gui, 1: Add, Text,, This is GUI 1 Gui, 1: Add, Text,x160 y150, Text behind GUI 2 Gui, 1: Show, W400 H200, First_GUI Gui, 2: +Owner1 +Parent1 -Caption -Border +LastFound Gui, 2: Color, 0xEEAA99 WinSet, TransColor, 0xEEAA99 100 Gui, 2: Add, Text,, This is GUI 2 Gui, 2: Show, W400 H100 x0 y100, Second...
by Onimuru
15 Apr 2020, 08:40
Forum: Ask For Help
Topic: Random function in AHK
Replies: 15
Views: 1123

Re: Random function in AHK

Here is a skeleton you can modify: #Persistent vAINumber := 24 ;* Number of AI. vMinSkill := 2 ;* Minimum skill level. vMaxSkill := 5 ;* Maximum skill level. global oAI := [] Loop, % vAINumber { oAI.Push(new AI(Random(vMinSkill, vMaxSkill), A_Index)) } SetTimer, Modify, % -Random(2000, 30000) return...
by Onimuru
15 Apr 2020, 02:40
Forum: Ask For Help
Topic: Random function in AHK
Replies: 15
Views: 1123

Re: Random function in AHK

I recently spent some time researching random number generation, specifically uniform vs normal (Gaussian) and it's pretty interesting stuff. If I you wanted to do that properly you would use normal instead of uniform which is what the random command gives you. Mechanically it would be quite easy to...
by Onimuru
09 Apr 2020, 07:38
Forum: Ask For Help
Topic: GetMousePos Help
Replies: 9
Views: 578

Re: GetMousePos Help

You can only perform an assignment with functions. Commands don't return anything and you need to use := global $x1 := 98 global $y1 := 214 global $x2 := 381 global $y2 := 307 Gui, Add, text, , Enter number of times to fish: Gui, Add, Edit, vNum Gui, Add, Button, default, OK Gui, Show Return GuiClos...
by Onimuru
09 Apr 2020, 04:17
Forum: Ask For Help
Topic: ^RButton:: and +^RButton::
Replies: 2
Views: 199

Re: ^RButton:: and +^RButton::

Hotkeys (read labels) have no inherent return, the thread just keeps going so you need to tell it to stop:

Code: Select all

^RButton::
	send ^c
	return

+^RButton::
	send ^x
	return
Also note that if it's only one line, you can use this shorthand:

Code: Select all

^RButton::send ^c  ;Implied return

+^RButton::send ^x
by Onimuru
07 Apr 2020, 19:16
Forum: Ask For Help
Topic: I need help to solve a ahk crashing issue
Replies: 2
Views: 307

Re: I need help to solve a ahk crashing issue

You don't ever end any of those loops which leads to an inevitable overflow. Structure your code like this:

Code: Select all

function() {
	If (thing) {
		otherfunction()
	}
	Else {
		SetTimer, % A_ThisFunction, -1  ;Allow another thread time if needed.
	}
}
by Onimuru
07 Apr 2020, 00:56
Forum: Ask For Help
Topic: RegEx match string of any consecutive characters from character set Topic is solved
Replies: 4
Views: 380

Re: RegEx match string of any consecutive characters from character set Topic is solved

I think this is what you're after: "[<>^!+#~]*(.*)", "$1"

Here is a function if all you're interested in is stripping modifiers:

Code: Select all

KeyGet(vKeyName := "") {
	Return, (RegExReplace(vKeyName, "[~*$+^#! &]|AppsKey"))
}
by Onimuru
06 Apr 2020, 18:45
Forum: Ask For Help
Topic: Separate toggle spams are clunky
Replies: 4
Views: 334

Re: Separate toggle spams are clunky

Here's an alternative: RepeatKey(vKey := "") { Static __Keys := "" If (vKey) If (SubStr(vKey, 1, 2) == "--") { Loop, Parse, % SubStr(vKey, 3), % "{}", % "{}" If (A_LoopField) __Keys := StrReplace(__Keys, "{" . A_LoopField . "}") } Else Loop, Parse, % vKey, % "{}", % "{}" If (A_LoopField && !InStr(__...
by Onimuru
06 Apr 2020, 05:48
Forum: Ask For Help
Topic: Randomised Click in Area
Replies: 2
Views: 239

Re: Randomised Click in Area

You are confusing commands with functions, do it like this: $F9:: ImageSearch, FoundX2, FoundY2, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 %A_WorkingDir%\Rod.PNG if (!ErrorLevel) { MouseMove, foundX2, foundY2, 1 MouseClick, Right Sleep, 200 MouseMove, Random(603, 1362), Random(76, 359), 0 MouseCl...
by Onimuru
05 Apr 2020, 12:48
Forum: Scripts and Functions
Topic: [Gdip] How to draw shapes and lines with the mouse
Replies: 12
Views: 2776

Re: [Gdip] How to draw shapes and lines with the mouse

This is simply a more elegant and hands-free way of changing properties of a brush/pen. Please consider this example: a := new Pen() MsgBox(a.Alpha) ;FF a.Alpha := "80" MsgBox(a.Alpha) ;80 MsgBox(a.Color) ;FFFFFF a.Color := "00FF80" MsgBox(a.Color) ;00FF80 MsgBox(a.Width) ;1 a.Width := 3 MsgBox(a.Wi...
by Onimuru
05 Apr 2020, 11:47
Forum: Scripts and Functions
Topic: [Gdip] How to draw shapes and lines with the mouse
Replies: 12
Views: 2776

Re: [Gdip] How to draw shapes and lines with the mouse

@Hellbent

I am very sorry sir, I didn't mean to get personal. I'd have been grateful if someone pointed that out to me.
by Onimuru
05 Apr 2020, 02:48
Forum: Scripts and Functions
Topic: [Gdip] How to draw shapes and lines with the mouse
Replies: 12
Views: 2776

Re: [Gdip] How to draw shapes and lines with the mouse

@SpeedMaster Well done :thumbup: Here is a slightly altered version with the ability to change the color, alpha, and pen thickness on the fly. ;================================================================================================================================ ; Subject: Gdip Draw shape...
by Onimuru
25 Mar 2020, 16:07
Forum: Scripts and Functions
Topic: Online MCode Generator(Beta, Tool)
Replies: 22
Views: 3358

Re: Online MCode Generator(Beta, Tool)

Do you know of a way to include math.h?
by Onimuru
28 Dec 2019, 23:05
Forum: Scripts and Functions
Topic: Collection of useful libraries
Replies: 9
Views: 3347

Re: Collection of useful libraries

Here's a some additional array methods that you can use for your array library, just be aware they're written with the same functionality as JS array.prototype in mind as well as 0 base indexing. I actually dropped this on Reddit awhile ago but no one was overly interested.

Go to advanced search