Search found 699 matches

by songdg
06 Aug 2024, 04:46
Forum: Ask for Help (v2)
Topic: Is there a better way to get a list of chosen color Topic is solved
Replies: 8
Views: 995

Is there a better way to get a list of chosen color Topic is solved

This is teadrinker's code, I add a Map ChosenColor to store the Y coordinate of the chosen color, base on the order of the Y coordinates I could tell which button select what color. However this method is not reliable, when the gui been moved to a different location and reselect a different color, t...
by songdg
01 Aug 2024, 04:15
Forum: Ask for Help (v2)
Topic: A question relate to DateDiff Topic is solved
Replies: 2
Views: 287

Re: A question relate to DateDiff Topic is solved

Datapoint wrote:
31 Jul 2024, 23:12
It looks like you can use DateAdd if you want to calculate a date based on a known time and a known time difference.

MsgBox DateAdd(A_Now, -54321, "H")
Thanks for helping me :thumbup:
by songdg
31 Jul 2024, 21:47
Forum: Ask for Help (v2)
Topic: A question relate to DateDiff Topic is solved
Replies: 2
Views: 287

A question relate to DateDiff Topic is solved

DateDiff(var1, var2, "hours") can returns the hours difference, what if the hours difference is known and want to calculate the var2? Is there an easy answer, especially when the period across two month. #Requires AutoHotkey v2.0 var1 := A_Now var2 := "202407311730" MsgBox DateDiff(var1, var2, "hou...
by songdg
19 Jul 2024, 23:39
Forum: Ask for Help (v2)
Topic: WebSockets: can the server send a message to the client actively
Replies: 0
Views: 230

WebSockets: can the server send a message to the client actively

In thqby's WebSockets library only the client can use sendText method directly, while the server just passively respond to the client's message. I wonder if it's possible for the server to actively send a message to the client.
by songdg
19 Jul 2024, 04:07
Forum: Ask for Help (v2)
Topic: How to write these function in traditional way
Replies: 2
Views: 298

Re: How to write these function in traditional way

This may help. https://www.autohotkey.com/docs/v2/Variables.htm#fat-arrow Thanks, I came up with this. clientMessage(c, msg) { c.SendText(msg) } clientData(c, buf) { c.SendData(buf) } ClientConnect(ws, c) { c.onMessage := clientMessage c.onData := clientData } ws.onClientConnect := ClientConnect
by songdg
18 Jul 2024, 01:23
Forum: Ask for Help (v2)
Topic: How to write these function in traditional way
Replies: 2
Views: 298

How to write these function in traditional way

ws.onClientConnect := (ws, c) => (c.onMessage := (c, msg)=>c.SendText(msg), c.onData := (c, buf)=>s.SendData(buf)) ws.onMessage := (ws, msg) => MsgBox(msg) /************************************************************************ * @description The Websocket server and client realized by Socket, do...
by songdg
17 Jul 2024, 02:33
Forum: Ask for Help (v2)
Topic: What kind of data can WebSockets send
Replies: 4
Views: 355

Re: What kind of data can WebSockets send

That's a lot, thank you very much.
by songdg
14 Jul 2024, 22:25
Forum: Ask for Help (v2)
Topic: What kind of data can WebSockets send
Replies: 4
Views: 355

Re: What kind of data can WebSockets send

thqby wrote:
14 Jul 2024, 00:39
buffer-like object
Thanks for the answer, another question, sometime I need to send a very very very long message, I want to know is there a limit on the length of the text message?
by songdg
13 Jul 2024, 23:38
Forum: Ask for Help (v2)
Topic: What kind of data can WebSockets send
Replies: 4
Views: 355

What kind of data can WebSockets send

I notice there's a SendData function in thqby's WebSockets library, I want to know what kind of data( an array or a map? ) WebSockets can send and how?
by songdg
13 Jul 2024, 12:26
Forum: Ask for Help (v2)
Topic: Error(10061): websocket conmmunication between PCs Topic is solved
Replies: 4
Views: 368

Re: Error(10061): websocket conmmunication between PCs Topic is solved

thqby wrote:
13 Jul 2024, 08:13
Are you kidding me? 127.0.0.1 Is the local loopback address, not the target computer IP.
Thanks, your help is much appreciated. :bravo:
by songdg
13 Jul 2024, 04:48
Forum: Ask for Help (v2)
Topic: Error(10061): websocket conmmunication between PCs Topic is solved
Replies: 4
Views: 368

Error(10061): websocket conmmunication between PCs Topic is solved

It works fine on the same PC, but when I run the WebSockets_server on one PC, WebSockets_client on another it always throw this error, No connection could be made because the target machine actively refused it. Both PC on the same network and can ping each other, even turn off the firewall completel...
by songdg
11 Jul 2024, 01:35
Forum: Ask for Help (v2)
Topic: Is there any HTTP server V2 script? Topic is solved
Replies: 15
Views: 1316

Re: Is there any HTTP server V2 script? Topic is solved

thqby wrote:
11 Jul 2024, 00:36
The websocket completes the handshake over http and establishes a persistent two-way connection. What do you think?
Thanks for the answer. So, websocket is a better choice in terms of two-way connection.
by songdg
10 Jul 2024, 11:24
Forum: Ask for Help (v2)
Topic: Is there any HTTP server V2 script? Topic is solved
Replies: 15
Views: 1316

Re: Is there any HTTP server V2 script? Topic is solved

Can I use HTTP server to communicate between computers like websocket?
by songdg
06 Jul 2024, 02:53
Forum: Ask for Help (v2)
Topic: How to access intranet shared file
Replies: 3
Views: 285

Re: How to access intranet shared file

Hello, This worked here using an IP address. The script needs access to that directory and file. If putting your file path into a Windows Run line works, then this might be a problem with the file's or directory's access rights in Windows. I tested with my home LAN. "Corporate Intranet" and the lik...
by songdg
03 Jul 2024, 22:50
Forum: Ask for Help (v2)
Topic: How to access intranet shared file
Replies: 3
Views: 285

How to access intranet shared file

Say I want to read a txt file on my_path := "\\1*.1*.1*6.1*6\myfolder\myfile.txt", but use Contents := FileRead(my_path) gives a The System Cannot Find the File Specified error.
by songdg
28 Jun 2024, 05:03
Forum: Ask for Help (v2)
Topic: A problem of using WebSockets
Replies: 2
Views: 180

Re: A problem of using WebSockets

@william_ahk
Thank you so much indeed :dance:
by songdg
27 Jun 2024, 22:34
Forum: Ask for Help (v2)
Topic: A problem of using WebSockets
Replies: 2
Views: 180

A problem of using WebSockets

Is this a new feature of V2.1 or a problem of the example?
by songdg
25 Jun 2024, 22:40
Forum: Ask for Help (v2)
Topic: How to implement Named pipe as a progress indicator
Replies: 8
Views: 992

Re: How to implement Named pipe as a progress indicator

x ??= y is shorthand for x := x ?? y . To make the library compatible with v2.0, use the long form. Thank you very much, but there's another problem. Warning: This local variable appears to never be assigned a value. Specifically: s 011: } 011: { ▶ 011: Return s.SendData(buf) 011: } 011: Return (c....
by songdg
25 Jun 2024, 04:16
Forum: Ask for Help (v2)
Topic: How to implement Named pipe as a progress indicator
Replies: 8
Views: 992

Re: How to implement Named pipe as a progress indicator

ntepa wrote:
24 Jun 2024, 15:16
The maybe-assign operator (??=) requires AutoHotkey v2.1-alpha.2+
In order to use this library, is v2.1 necessary?

Go to advanced search