InGame v2.0

Post gaming related scripts
_3D_
Posts: 165
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: 165
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: 165
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 32 times
AHKv2.0 use the future now.
_3D_
Posts: 165
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: 165
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: 165
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: 2836
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: 165
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: 165
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: 165
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.
_3D_
Posts: 165
Joined: 29 Jan 2014, 14:40

class Task (Task.List:= [])

04 Jan 2018, 06:16

As I see that no ALL task forced closed
https://lexikos.github.io/v2/docs/commands/For.htm
Existing key-value pairs may be modified during the loop, but inserting or removing keys may cause some items to be skipped or enumerated multiple times. One workaround is to build a list of keys to remove, then use a second loop to remove the keys after the first loop completes.
I start investigate why and result:
https://autohotkey.com/boards/viewtopic.php?p=192392#p192392
https://autohotkey.com/boards/viewtopic.php?p=192750#p192750
Revised class Task
:

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

It is completely compatible with early version.
Last edit 11.Jan.2018
AHKv2.0 use the future now.
_3D_
Posts: 165
Joined: 29 Jan 2014, 14:40

Xerox Counters [Out of InGame v2.0]

13 Jan 2018, 07:32

This is a small out of course InGame project.
The idea is to get counters for given Xerox machines with web interface.

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

It is needed INI file with name AHKscript.ahk.ini
Next is example ini file

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

wc232.xcc.cs | http://wc232.xcc.cs/properties/billing/billingCounters.dhtml
gAllMarkedImages
gBlackCopyImages
gBlackCopySheets

m55.xcc.cs | http://m55.xcc.cs/properties/billingCounters.dhtml
markedBWandColorImages
markedBWCopyImages
markedBWPrintImages
Output:

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

wc232.xcc.cs,269606,173481,139125
m55.xcc.cs,1845940,1343841,501892
Syntax:

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

machine | machine/web/page/that_contain/counters
counterName
Limitations:
• counterName can be right before counterDigits (mean no any other digits between).
• missed download links take about 30 seconds each till ErrorLevel be set.
It is Saturday small project - but very useful for copy centers with Xerox machines.
Enjoy!
AHKv2.0 use the future now.
_3D_
Posts: 165
Joined: 29 Jan 2014, 14:40

Universal Communications

01 Mar 2018, 08:45

This days I completely down the games and work on communicate to kitchen printers wire and wireless (esp8266).
There is a working set - but still in test mode. So I first will post some functions then complete project.
[FUNCTION] Tip - it is a simple function that combine toolTip and trayTip together.
Classic mode:

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

Tip(text:= "", what:= "tray") {
if inStr(what, "tray") {
traytip(text,,0x10)
return
}
if inStr(what, "tool") {
tooltip(text)
return
} }
Switch mode:

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

Tip(text:= "", what:= "tray") {
try {
goto(what)
tray:
traytip(text,,0x10)
return
tool:
tooltip(text)
return
} }
And Usage:

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

Tip("Tray tip to test")
sleep(1000)
Tip()
Tip("Done the tray up the tool", "tool")
sleep(1000)
Enjoy!
AHKv2.0 use the future now.
_3D_
Posts: 165
Joined: 29 Jan 2014, 14:40

Universal Communications

04 Mar 2018, 03:06

[FUNCTION] encoding().
AHK have brilliant system for changing encoding, unfortunately Bulgarian DOS code page never supported by Microsoft https://en.wikipedia.org/wiki/MIK_(character_set) and Bulgarian WIN code page is CP1251.
Function convert data buffer from to CP1251 and CPMIK (no standard number, in some documentations CP856).

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

encoding(byRef addr, size, enco) {
if enco:= inStr(enco, "WIN")? +64: inStr(enco, "DOS")? -64: 0 {
loop size
if (char:= numGet(addr, A_Index-1, "UChar")) >= 0x80
numPut(char + enco, addr, A_Index-1, "UChar")
} }
Usage:

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

file:= "c:\path\file.txt"
data:= FileRead(file, "RAW")
size:= FileGetSize(file)
encoding(data, size, "WIN") ;convert CPMIK to CP1251
encoding(data, size, "DOS") ;convert CP1251 to CPMIK
As I use object to put data into:

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

encoding(byRef port, enco) {
if enco:= inStr(enco, "WIN")? +64: inStr(enco, "DOS")? -64: 0 {
addr:= port.getAddress("data") ;Helgef
loop port.size
if (char:= numGet(addr, A_Index-1, "UChar")) >= 0x80
numPut(char + enco, addr, A_Index-1, "UChar")
} }

Enjoy!
AHKv2.0 use the future now.

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 5 guests