InGame v2.0

Post gaming related scripts
_3D_
Posts: 139
Joined: 29 Jan 2014, 14:40

NumpadDot-To-Dot

21 Jun 2017, 09:57

When multilingual keyboards in many cases need to remap NumpadDot to Dot.
For Example In Bulgarian keyboard layout NumpadDot is coded like , (coma) - it is STANDARD but all need . (dot) there.

There many programs that remap keys like KeyTweak and Sharp Keys but all works perfect only in US keyboard layout (and last Windows 10 ignored in other layouts).

Problems:
1. When totally remap NumpadDot (scan code) - we lose DEL functionality.
2. When remap NumpaDot to Dot - worked only in US layout.

Example that I find in internetrepresent problem 1 and 2.
In first I modify to that work perfect and with last Windows 10.

Of course there short codeIt remap button only when NUMPAD is active and work in nonUS keyboard layouts.
Tested on US, Bulgarian - BDS and Bulgarian - Phonetic.

Make NumpadDot-To-Dot.ahk

Code: [Select all] [Download] GeSHi © Codebox Plus

#SingleInstance, Force
;Copyright (c) D.Donchev

NumpadDot::.

Rename copy of AutohotkeyU64.exe (for 64Bit OS) or AutohotkeyU32.exe (for 32bit OS) to NumpadDot-To-Dot.exe
Put this 2 files together in some place and set Windows to start NumpadDot-To-Dot.exe at the begining.

So AHK the best choice ever!
Enjoy!
AHKv2.0 use the future now.
_3D_
Posts: 139
Joined: 29 Jan 2014, 14:40

TypeOf(this)

27 Aug 2017, 07:27

AutoHotkey_2.0-a081-cad307c
Function TypeOf(this) edited ultra compact

Code: [Select all] [Download] GeSHi © Codebox Plus

typeOf(this) {
__type:= __name:= type(this)
if isObject(this) {
__type:= "Object"
try if this.__Class && __name != (__type := "Class")
throw
catch
return __type "|" __name
}
return __type
}
Examples: https://autohotkey.com/boards/viewtopic.php?p=167373#p167373
Last edited by _3D_ on 28 Aug 2017, 23:41, edited 1 time in total.
AHKv2.0 use the future now.
_3D_
Posts: 139
Joined: 29 Jan 2014, 14:40

Gdip+ AutoHotkey_2.0-a081-cad307c

28 Aug 2017, 08:14

AutoHotkey_2.0-a081-cad307c
Correct syntax
    if expression, expression
    sysget
    sysget Monitor
    loop,
Attachments
Gdip-AHKv2.0-a081-cad307c.zip
(18.95 KiB) Downloaded 18 times
AHKv2.0 use the future now.
_3D_
Posts: 139
Joined: 29 Jan 2014, 14:40

DEREF back to AutoHotkey_2.0-a081-cad307c

01 Sep 2017, 00:19

AutoHotkey_2.0-a081-cad307c
Back deref to v2.0 - partial solution - next code replace variables with variables values.

Code: [Select all] [Download] GeSHi © Codebox Plus

__deref_Expression:= "" ; <<< expression string
__deref_LABEL: ; deref ---------------------------------- AutoHotkey_2.0-a081-cad307c
if RegExMatch(__deref_Expression, "i)[%][a-z_]\w*[%]", __deref_Variable) {
__deref_Expression:= RegExReplace(__deref_Expression
, "i)" __deref_Variable.Value
, %subStr(__deref_Variable.Value, 2, -1)% "")
goto __deref_LABEL
} ; ---------------------------------------------------------------------------------
This code work exactly as removed deref() function:
1. Code recognize only enclosed in %% names and replace with values ("%variable%")
2. Code must be stored at the place where variables must be deref. (Due to variable scope function impossible).
3. Code just replace variable names with there values - no EVALUATION.
4. Loop is implemented as LABEL \ goto LABEL to be visible A_Index and A_Loop... variables

EVALUATION by tidbit

Code: [Select all] [Download] GeSHi © Codebox Plus

dd_tidbitEval(expression) { ; 
obj:=ComObjCreate("HTMLfile") ;tidbit code -------------------------------------------
obj.write("<body><script>document.body.innerText=eval('" expression "');</script>") ;--
return obj.body.innerText
}
Functions not allowed (it is HTML evaluation). I can`t experiment with AutoHotkey.dll due to user defined functions limitation.
User can put functions values as variables in expression string and then evaluate.

Enjoy!
AHKv2.0 use the future now.
_3D_
Posts: 139
Joined: 29 Jan 2014, 14:40

Timers inGame

17 Oct 2017, 03:45

There many things that player must check and use. It is example howto keep bufs and auto select nearest mob.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

CapsLock activate/deactivate killing state.
Numpad buttons activates bufs and reset timers - so player can forced bufs timer independently.

Enjoy!
AHKv2.0 use the future now.
_3D_
Posts: 139
Joined: 29 Jan 2014, 14:40

[FUNCTION] contain(this, needle)

18 Oct 2017, 08:48

FIRST try to create function that can return result if this contain needle.
First of all we need strong criterion what we need to find and how to represent it? In most cases we have VALUE and in some cases KEY:VALUE, but in both we have stronger division VALUE or KEY. So let say that this two things we need to search in complete order (mean KEY == NEDDLE or VAL == NEEDLE) and let say that we need sign where KEY/VAL begin and where KEY/VAL ended. If we know that we can convert any AHK type to string and in last to search with InStr().
I chose "|" for begin and "|" for end in this case:
KEY become |KEY|
VAL become |VAL|

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Code extremely small but check if this exactly contain needle. Due to same converting algorithm we have strong equal for the equal objects.
disadvantage - no difference what we found KEY or VAL but it exist into this.
disadvantage - [1:1, 2:2] is equal to [12:1, 23:2] - if key integer key not present in string.

Enjoy!
Last edited by _3D_ on 20 Oct 2017, 03:19, edited 2 times in total.
AHKv2.0 use the future now.
Helgef
Posts: 2420
Joined: 17 Jul 2016, 01:02
Contact:

Re: InGame v2.0

18 Oct 2017, 12:24

You have some interesting stuff here. I only
browsed the first page for now. The switch is nifty . I think you need a table of contents though ;)
Thanks for sharing, cheers :thumbup:
_3D_
Posts: 139
Joined: 29 Jan 2014, 14:40

Helgef

19 Oct 2017, 03:12

Thanks Helgef for the great idea.
Cheers. :beer:
AHKv2.0 use the future now.
_3D_
Posts: 139
Joined: 29 Jan 2014, 14:40

[FUNCTION] ColorIs() - revized

30 Oct 2017, 08:41

In https://autohotkey.com/boards/viewtopic.php?f=19&t=2400&start=40#p112863
I describe function that check for given colors and do defined for that colors actions. Now without for.

Code: [Select all] [Download] GeSHi © Codebox Plus

ColorIs(sec, byRef pix:="", mis:= 998) {
loop sec {
tooltip(sec--) ;
if dd_varExist(pix[pix.c:= PixelGetColor(pix.x, pix.y)]) ;add c to pix
return pix[pix.c]
sleep(mis)
}
return "" ;return "" instead of 0
}
Now function check if is there "key" that is equal to current color and if true return defined value.

Code: [Select all] [Download] GeSHi © Codebox Plus

dd_varExist(ByRef v) { ;check if v exist
return !(&v == &_)
} ;==========
Enjoy!
[Edit] And revision without external functions:

Code: [Select all] [Download] GeSHi © Codebox Plus

ColorIs(sec, byRef pix:="", txt:= "", mis:= 998) {
loop sec {
tooltip(txt sec--)
if pix[pix.c:= PixelGetColor(pix.x, pix.y)] != "" ;add c to pix
return pix[pix.c]
sleep(mis)
}
return ""
}
In this case when value is "" then variable don`t exist. (I prefer to check if variable exist).
AHKv2.0 use the future now.
_3D_
Posts: 139
Joined: 29 Jan 2014, 14:40

IniReadPixel() and ColorIs()

07 Nov 2017, 08:34

I made and revision of IniReadPixel() and little revision of ColorIs()

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

This is working example that will wait 10 seconds to become pixel(645:354) 0xFFFFF1 or 0xC9CED4 and will return result and pixel object.
[Edit] I add try catch return"" if pix argument is not Object.
Enjoy!
AHKv2.0 use the future now.

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 4 guests