WebSocket.ahk

Post your working scripts, libraries and tools
GeekDude
Posts: 739
Joined: 02 Oct 2013, 22:13

WebSocket.ahk

28 Jul 2017, 08:00

WebSocket.ahk

Connect to a WebSocket server using AutoHotkey by taking advantage of a hidden ActiveX control.
Note that it does not garbage collect until disconnected.


Usage

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




Related Projects




Download
egocarib
Posts: 67
Joined: 21 May 2015, 18:21

Re: WebSocket.ahk

14 Oct 2017, 11:46

Thanks! Much easier to use than some of the other WebSocket examples I found. The code is very simple and it works great. :)

I'm using AHKv2 and I only had to switch the + to a . here to make it work for me. I think that change should be better cross-compatible across AHK versions, yes? If so, might be worth making on your master.

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

	; Called by the JS in response to WS events
_Event(EventName, Event)
{
this["On" + EventName](Event)
}
GeekDude
Posts: 739
Joined: 02 Oct 2013, 22:13

Re: WebSocket.ahk

15 Oct 2017, 14:36

I got my AHK and JS mixed up, haha! Does it work in v2 if you use ["On" EventName] or is the . required?
egocarib
Posts: 67
Joined: 21 May 2015, 18:21

Re: WebSocket.ahk

15 Oct 2017, 14:45

It also works without the dot, yes. (I just tend to use it for personal preference)

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Delta Pythagorean, SpeedMaster, Spikea, teadrinker and 21 guests