Search found 277 matches

by _3D_
16 Dec 2019, 04:52
Forum: AutoHotkey Development
Topic: ARRAY[INDEX] throw exception instead to return "" Topic is solved
Replies: 9
Views: 3712

Re: ARRAY[INDEX] throw exception instead to return "" Topic is solved

OK! The example not met the problem. I will write other. array:= [] MsgBox(array.Has(1)? array[1]: "") ; this code produce the same functionality MsgBox( array[1]) ; this code throw exception 1. There 1 more "search" or "catch" inside array indexing (just to prevent "bad" code). 2. If code "must" ke...
by _3D_
16 Dec 2019, 04:31
Forum: AutoHotkey Development
Topic: ARRAY[INDEX] throw exception instead to return "" Topic is solved
Replies: 9
Views: 3712

ARRAY[INDEX] throw exception instead to return "" Topic is solved

Test with AutoHotkey_2.0-a108-a2fa0498 The result: array:= [] MsgBox(array[1]) ;<<< throw exception WHY ??? It must work like this: getArrayItem(arr, ind) { try arr[ind] catch return "" } Let see what happens: class Window { __New(params*) { this.win:= GuiCreate(params[1], params[2], params[3]) ;1. ...
by _3D_
14 Dec 2019, 07:37
Forum: Ask for Help (v2)
Topic: [SOLVED] GUI OnClose()
Replies: 2
Views: 1888

Re: [SOLVED] GUI OnClose()

by _3D_
14 Dec 2019, 03:27
Forum: Ask for Help (v2)
Topic: [SOLVED] GUI OnClose()
Replies: 2
Views: 1888

[SOLVED] GUI OnClose()

First a simple code: (gui:= GuiCreate()) .OnEvent("Close", "gui_OnClose") gui.Add("Text",, "Press Enter") gui.Add("Button","Default w0 h0") .OnEvent("Click", "btn_OnClick") gui.Show() gui_OnClose(*) { return MsgBox("Enter for Close",, "OC") == "Cancel" } btn_OnClick(*) { global gui.Hide() ; <<< Clos...
by _3D_
10 Dec 2019, 14:11
Forum: Gaming
Topic: InGame v2.0
Replies: 101
Views: 103587

SetTimer() - Simple Example

A Simple example about SetTimer() with fat arrow. #SingleInstance Force 1::caller(()=>(MouseGetPos(mX, mY) tooltip(mC:=PixelGetColor(mX, mY)))) 2::caller(()=>tooltip(mC)) 3::caller() #!Q::ExitApp caller(arg:="") { static ref:= "" try SetTimer(ref, "OFF") tooltip() try SetTimer(ref:=arg,100) } This C...
by _3D_
02 Dec 2019, 12:00
Forum: Gaming
Topic: InGame v2.0
Replies: 101
Views: 103587

Callback creator

Hi there 7 mounts later. Optimizing last code $Tab:: Send("~") SetTimer(()=>(Send("{7 3}")), when:=-500) SetTimer(()=>(Send("{9 3}")), when-=1500) SetTimer(()=>(Send("{5 3}")), when-=1500) return Here we have 3 identical callback arguments. BUT what if there a callback creator? snd(n)=>()=>Send("{" ...
by _3D_
24 Jun 2019, 10:59
Forum: Ask for Help (v2)
Topic: [a103] - MsgBox [BUG] Topic is solved
Replies: 2
Views: 1435

Re: [a103] - MsgBox [BUG] Topic is solved

In other words using MsgBox without options is not recommended because no deference in answers.
by _3D_
24 Jun 2019, 10:43
Forum: Ask for Help (v2)
Topic: [a103] - MsgBox [BUG] Topic is solved
Replies: 2
Views: 1435

[a103] - MsgBox [BUG] Topic is solved

The BUG res:= MsgBox("Press Esc!") MsgBox("User pressed : " res) User pressed "Esc" but MsgBox return "OK". Actually in this case MsgBox return only "OK". In this case MsgBox must return "" (nothing) when pressed "Esc" or clicked on "X". res:= MsgBox("Press Esc!",,"OC") MsgBox("User pressed : " res)...
by _3D_
16 Jun 2019, 23:57
Forum: Ask for Help (v2)
Topic: [a103] - SendMessage [BUG] Topic is solved
Replies: 1
Views: 1534

[a103] - SendMessage [BUG] Topic is solved

AutoHotkey_2.0-a103-56441b52 Working example till [a103] DetectHiddenWindows("ON") OnMessage(0x2000, ()=>(MsgBox("ASD"))) 1::SendMessage(0x2000,,,,"ahk_id " A_ScriptHWND) Q::ExitApp Now: --------------------------- ahk-test-code.ahk --------------------------- Error: Too many parameters passed to fu...
by _3D_
06 May 2019, 12:45
Forum: Gaming Scripts (v1)
Topic: i need healp Macro
Replies: 1
Views: 2125

Re: i need healp Macro

I understand next:
while RButton is pressed
send C
send C
send P
end while
send R

Code: Select all

$RButton::
	while(GetKeyState("RButton")) 
		Send("{c 2}p")
	Send("r")	
return
If else please explain in details.
by _3D_
05 May 2019, 00:23
Forum: Gaming Scripts (v1)
Topic: ImageSearchList Count
Replies: 1
Views: 2409

Re: ImageSearchList Count

increment:= 0 ;your function add delimiter after each found item glob_List:= "1`n2`n" ;it mean 1 2 and "" ;when N delimiters then N+1 items Loop Parse glob_List, "`n" ;if(A_LoopField) ;if increment (skip "") { increment += 1 ;increment += (A_LoopField != "") ;alternative if increment MsgBox(A_LoopF...
by _3D_
04 May 2019, 02:11
Forum: Gaming
Topic: InGame v2.0
Replies: 101
Views: 103587

Stuck in Sleep.

Let see an ordinary code: $Tab:: Send("~") ;select Sleep( 500) Send("{7 3}") ;Bloody Arc Sleep(1500) Send("{9 3}") ;Divine Burst Sleep(1500) Send("{5 3}") ;Hell's Claw return It is usually used code to produce skill chain in game. It work perfect but what if script have more than one skill chain? I ...
by _3D_
20 Mar 2019, 18:28
Forum: Gaming
Topic: InGame v2.0
Replies: 101
Views: 103587

Auto-Kill-GRB version 3

The idea was to write a mechanism that can cover many different cases to activate and control main buffs in my game. Lets see one examle: When gamer press Numpad1 script send Numpad1 5 times and repeat send Numpad1 5 times any given timed period When gamer press Numpad2 script send Numpad2 5 times a...
by _3D_
05 Mar 2019, 01:54
Forum: Ask for Help (v2)
Topic: Hotkey call BUG Topic is solved
Replies: 2
Views: 1520

Re: Hotkey call BUG Topic is solved

Thanks Helgef.
In other words I can't access list of hotkeys, created with Hotkey(), and call its corresponding actions.
by _3D_
04 Mar 2019, 13:25
Forum: Ask for Help (v2)
Topic: Hotkey call BUG Topic is solved
Replies: 2
Views: 1520

Hotkey call BUG Topic is solved

The main code that work: Gosub("T") T::tooltip("T") BUT let see the next code: function("T", ()=>tooltip("T")) function(h, f) { Hotkey(h, f) } Gosub("T") A function that create Hotkey. --------------------------- ahk-test-code-2.ahk --------------------------- Error: Target label does not exist. Spe...
by _3D_
01 Mar 2019, 15:34
Forum: Gaming
Topic: InGame v2.0
Replies: 101
Views: 103587

Crazy Class - alpha

This is a side effect from class Buff and class Flag. And as result most complicated method to do something simple. class Ahk2 class Ahk2 { ahkTrig:= 0 __New(ahkHkey, ahkFunc, ahkView) { try Hotkey(ahkHkey[1], ()=>ahkFunc[1].call(this)) try Hotkey(ahkHkey[2], ()=>ahkFunc[2].call(this)) (this.ahkView...
by _3D_
28 Feb 2019, 02:13
Forum: Gaming Help (v1)
Topic: How to achieve the lowest level of access to keys?
Replies: 5
Views: 3844

Re: How to achieve the lowest level of access to keys?

Your problem must be separated in 2 parts: 1. Catch hotkey F1:: 2. Send method Send 1 Pre. First of all you need to check: 1 Windows 32/64 2 Game 32/64 3 AutoHotkey.exe 32/64 The worst combination W32 + G32 + A32. This case will torch you. The best combination W64 + G32 + A64. Game is encapsulated i...
by _3D_
27 Feb 2019, 13:15
Forum: Gaming Help (v1)
Topic: AHK script issue when using combined mouse clicks Topic is solved
Replies: 2
Views: 1058

Re: AHK script issue when using combined mouse clicks Topic is solved

Actually I don`t understand what is the idea of script, so I post methods that can trigger mouse buttons. #SingleInstance force ;Copyright (c) D.Donchev ; method 1 - pooling ---------------------------------------------------------- loop { state:= getKeyState("LButton", "P")? "L": "-" state.= getKey...
by _3D_
25 Feb 2019, 06:39
Forum: Ask for Help (v2)
Topic: I want Class For SQLite v2, thanks!!
Replies: 1
Views: 1380

Re: I want Class For SQLite v2, thanks!!

It is well written code, I think you can use it in AHKv2.0 with small syntax corrections.
For example: <> replace with !=

And in additions youll become v2 developer :P
by _3D_
25 Feb 2019, 06:30
Forum: AutoHotkey Development
Topic: Bug: StrSplit Topic is solved
Replies: 5
Views: 3641

Re: Bug: StrSplit Topic is solved

As jeeswg wrote you compare string to string.
If you need to compare separated elements as integer: (spl[<index>] + 0) <comparison> (spl[<index>] + 0) - it is forced conversion to integer if possible or exception.

Go to advanced search