From 3bf758dd5b9bdd14fe10c65c7a89d5bcf6821c31 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 19:11:02 -0400 Subject: [PATCH 01/34] Add tele config options --- submacros/natro_macro.ahk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/submacros/natro_macro.ahk b/submacros/natro_macro.ahk index 8d7cf53..a907fdc 100644 --- a/submacros/natro_macro.ahk +++ b/submacros/natro_macro.ahk @@ -364,6 +364,8 @@ nm_importConfig() , "DiscordCheck", 0 , "Webhook", "" , "BotToken", "" + , "TeleBotToken", "" + , "TeleChatID" , "MainChannelCheck", 1 , "MainChannelID", "" , "ReportChannelCheck", 1 From 388634a6297a845b8cf6391abe5817dc603a77a4 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 19:28:37 -0400 Subject: [PATCH 02/34] forgot to add value pair to telechatid --- submacros/natro_macro.ahk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submacros/natro_macro.ahk b/submacros/natro_macro.ahk index a907fdc..45b7e60 100644 --- a/submacros/natro_macro.ahk +++ b/submacros/natro_macro.ahk @@ -365,7 +365,7 @@ nm_importConfig() , "Webhook", "" , "BotToken", "" , "TeleBotToken", "" - , "TeleChatID" + , "TeleChatID", "" , "MainChannelCheck", 1 , "MainChannelID", "" , "ReportChannelCheck", 1 From 364ae42e7d615f22f6bf451848aff3f86d4f248c Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 19:29:01 -0400 Subject: [PATCH 03/34] add telemode --- submacros/natro_macro.ahk | 1 + 1 file changed, 1 insertion(+) diff --git a/submacros/natro_macro.ahk b/submacros/natro_macro.ahk index 45b7e60..7a339bd 100644 --- a/submacros/natro_macro.ahk +++ b/submacros/natro_macro.ahk @@ -364,6 +364,7 @@ nm_importConfig() , "DiscordCheck", 0 , "Webhook", "" , "BotToken", "" + , "TeleMode", "" , "TeleBotToken", "" , "TeleChatID", "" , "MainChannelCheck", 1 From f4d2d7114dc89321ea0d8c72d33d4bb544eef8f0 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 19:33:43 -0400 Subject: [PATCH 04/34] add comment + change default to off --- submacros/natro_macro.ahk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submacros/natro_macro.ahk b/submacros/natro_macro.ahk index 7a339bd..4fe4c98 100644 --- a/submacros/natro_macro.ahk +++ b/submacros/natro_macro.ahk @@ -364,7 +364,7 @@ nm_importConfig() , "DiscordCheck", 0 , "Webhook", "" , "BotToken", "" - , "TeleMode", "" + , "TeleMode", 0 ; 0 = Disabled ; 1 = Enabled , "TeleBotToken", "" , "TeleChatID", "" , "MainChannelCheck", 1 From 95e9b330e4838573e15367b93d5f2de0086f4f83 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 19:36:41 -0400 Subject: [PATCH 05/34] start creating tele_sendembed --- submacros/Status.ahk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index 39c2e9a..3fbf32d 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2446,6 +2446,11 @@ class discord { static baseURL := "https://discord.com/api/v10/" + static Tele_sendEmbed(message, color, content, pBitmap, channel, replyID) + { + + } + static SendEmbed(message, color:=3223350, content:="", pBitmap:=0, channel:="", replyID:=0) { payload_json := From 6ca22fa26effc42d5c528d152bee175c5a7268b9 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 19:38:24 -0400 Subject: [PATCH 06/34] create rough if statement --- submacros/Status.ahk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index 3fbf32d..c336f01 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2448,11 +2448,14 @@ class discord static Tele_sendEmbed(message, color, content, pBitmap, channel, replyID) { - + } static SendEmbed(message, color:=3223350, content:="", pBitmap:=0, channel:="", replyID:=0) { + if (TeleMode = 1) { + return Tele_sendEmbed(message, color, content, pBitmap, channel, replyID) + } payload_json := ( ' From 6b0c46f50d4a631c4127c2c189342b7e33a5354b Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 19:46:00 -0400 Subject: [PATCH 07/34] add telemode arg --- submacros/Status.ahk | 2 ++ submacros/natro_macro.ahk | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index c336f01..d4e82fd 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -83,6 +83,8 @@ MonsterRespawnTime := A_Args[35] HoneyUpdateSSCheck := A_Args[36] +TeleMode := A_Args[37] + pToken := Gdip_Startup() OnExit(ExitFunc) OnMessage(0x004A, nm_sendPostData, 255) diff --git a/submacros/natro_macro.ahk b/submacros/natro_macro.ahk index 4fe4c98..7b93621 100644 --- a/submacros/natro_macro.ahk +++ b/submacros/natro_macro.ahk @@ -2021,7 +2021,7 @@ Run '"' WebhookEasterEgg '" "' ssCheck '" "' ssDebugging '" "' CriticalSSCheck '" "' AmuletSSCheck '" "' MachineSSCheck '" "' BalloonSSCheck '" "' ViciousSSCheck '" ' '"' DeathSSCheck '" "' PlanterSSCheck '" "' HoneySSCheck '" "' criticalCheck '" "' discordUID '" "' CriticalErrorPingCheck '" "' DisconnectPingCheck '" "' GameFrozenPingCheck '" ' '"' PhantomPingCheck '" "' UnexpectedDeathPingCheck '" "' EmergencyBalloonPingCheck '" "' commandPrefix '" "' NightAnnouncementCheck '" "' NightAnnouncementName '" ' -'"' NightAnnouncementPingID '" "' NightAnnouncementWebhook '" "' PrivServer '" "' DebugLogEnabled '" "' MonsterRespawnTime '" "' HoneyUpdateSSCheck '"' +'"' NightAnnouncementPingID '" "' NightAnnouncementWebhook '" "' PrivServer '" "' DebugLogEnabled '" "' MonsterRespawnTime '" "' HoneyUpdateSSCheck '" "' TeleMode '"' ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; From c7e3fced5aba1f46ffe54a09a5af47c431c42af5 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 19:47:53 -0400 Subject: [PATCH 08/34] fix function not in scope --- submacros/Status.ahk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index d4e82fd..73a00a3 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2456,7 +2456,7 @@ class discord static SendEmbed(message, color:=3223350, content:="", pBitmap:=0, channel:="", replyID:=0) { if (TeleMode = 1) { - return Tele_sendEmbed(message, color, content, pBitmap, channel, replyID) + return discord.Tele_sendEmbed(message, color, content, pBitmap, channel, replyID) } payload_json := ( From 9cd170f645f93ee61741c300807f3fa9ce693f20 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 19:51:11 -0400 Subject: [PATCH 09/34] add bot token arg and smth else i forgot --- submacros/Status.ahk | 2 ++ submacros/natro_macro.ahk | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index 73a00a3..dd6a442 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -84,6 +84,7 @@ MonsterRespawnTime := A_Args[35] HoneyUpdateSSCheck := A_Args[36] TeleMode := A_Args[37] +TeleBotToken := A_Args[38] pToken := Gdip_Startup() OnExit(ExitFunc) @@ -2447,6 +2448,7 @@ nm_command(command) class discord { static baseURL := "https://discord.com/api/v10/" + static baseTele := "https://api.telegram.org/bot/" static Tele_sendEmbed(message, color, content, pBitmap, channel, replyID) { diff --git a/submacros/natro_macro.ahk b/submacros/natro_macro.ahk index 7b93621..db635a3 100644 --- a/submacros/natro_macro.ahk +++ b/submacros/natro_macro.ahk @@ -2021,7 +2021,7 @@ Run '"' WebhookEasterEgg '" "' ssCheck '" "' ssDebugging '" "' CriticalSSCheck '" "' AmuletSSCheck '" "' MachineSSCheck '" "' BalloonSSCheck '" "' ViciousSSCheck '" ' '"' DeathSSCheck '" "' PlanterSSCheck '" "' HoneySSCheck '" "' criticalCheck '" "' discordUID '" "' CriticalErrorPingCheck '" "' DisconnectPingCheck '" "' GameFrozenPingCheck '" ' '"' PhantomPingCheck '" "' UnexpectedDeathPingCheck '" "' EmergencyBalloonPingCheck '" "' commandPrefix '" "' NightAnnouncementCheck '" "' NightAnnouncementName '" ' -'"' NightAnnouncementPingID '" "' NightAnnouncementWebhook '" "' PrivServer '" "' DebugLogEnabled '" "' MonsterRespawnTime '" "' HoneyUpdateSSCheck '" "' TeleMode '"' +'"' NightAnnouncementPingID '" "' NightAnnouncementWebhook '" "' PrivServer '" "' DebugLogEnabled '" "' MonsterRespawnTime '" "' HoneyUpdateSSCheck '" "' TeleMode '" "' TeleBotToken '"' ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; From 104211e8595ac3c5e588267eed96b957705384e2 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 19:54:22 -0400 Subject: [PATCH 10/34] whoops, forgot to fill in the --- submacros/Status.ahk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index dd6a442..6d20517 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2448,7 +2448,7 @@ nm_command(command) class discord { static baseURL := "https://discord.com/api/v10/" - static baseTele := "https://api.telegram.org/bot/" + static baseTele := "https://api.telegram.org/bot" TeleBotToken "/" static Tele_sendEmbed(message, color, content, pBitmap, channel, replyID) { From cc91063fb653af57984a09efcb3b173d3e49d4fa Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 19:58:58 -0400 Subject: [PATCH 11/34] create url utils class --- submacros/Status.ahk | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index 6d20517..8c45ba3 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2445,6 +2445,32 @@ nm_command(command) } } + +class URL { ; im not even gonna lie, chatgpt clutched, i dont care enough to actually make this myself + static ParseQueryString(qs) { + result := {} + if (qs = "") + return result + + for pair in StrSplit(qs, "&") { + kv := StrSplit(pair, "=") + key := kv[1] + value := kv.Length() > 1 ? kv[2] : "" + result[key] := value + } + return result + } + + ; Build a query string from an object + static BuildQueryString(obj) { + qs := "" + for key, value in obj { + qs .= (qs != "" ? "&" : "") . key . "=" . value + } + return qs + } +} + class discord { static baseURL := "https://discord.com/api/v10/" @@ -2452,7 +2478,7 @@ class discord static Tele_sendEmbed(message, color, content, pBitmap, channel, replyID) { - + } static SendEmbed(message, color:=3223350, content:="", pBitmap:=0, channel:="", replyID:=0) From 71ac35241e8ca80dc20ebc977fe9f07354453493 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 20:06:45 -0400 Subject: [PATCH 12/34] start creating the tele_sendembed method --- submacros/Status.ahk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index 8c45ba3..edaa65d 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2478,7 +2478,14 @@ class discord static Tele_sendEmbed(message, color, content, pBitmap, channel, replyID) { - + wr := ComObject("WinHttp.WinHttpRequest.5.1") + wr.Option[9] := 2720 + + url := discord.baseTele "sendMessage?" + url .= URL.BuildQueryString({text: message, chat_id: 123}) ; fill in chat id later + + wr.Open("POST", url, true) + } static SendEmbed(message, color:=3223350, content:="", pBitmap:=0, channel:="", replyID:=0) From 195b496386f47382f932f2dc1bc8ddc57413aded Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 20:08:48 -0400 Subject: [PATCH 13/34] create tele chat id arg --- submacros/Status.ahk | 1 + submacros/natro_macro.ahk | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index edaa65d..5e3982a 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -85,6 +85,7 @@ HoneyUpdateSSCheck := A_Args[36] TeleMode := A_Args[37] TeleBotToken := A_Args[38] +TeleChatID := A_Args[39] pToken := Gdip_Startup() OnExit(ExitFunc) diff --git a/submacros/natro_macro.ahk b/submacros/natro_macro.ahk index db635a3..27048c2 100644 --- a/submacros/natro_macro.ahk +++ b/submacros/natro_macro.ahk @@ -2021,7 +2021,7 @@ Run '"' WebhookEasterEgg '" "' ssCheck '" "' ssDebugging '" "' CriticalSSCheck '" "' AmuletSSCheck '" "' MachineSSCheck '" "' BalloonSSCheck '" "' ViciousSSCheck '" ' '"' DeathSSCheck '" "' PlanterSSCheck '" "' HoneySSCheck '" "' criticalCheck '" "' discordUID '" "' CriticalErrorPingCheck '" "' DisconnectPingCheck '" "' GameFrozenPingCheck '" ' '"' PhantomPingCheck '" "' UnexpectedDeathPingCheck '" "' EmergencyBalloonPingCheck '" "' commandPrefix '" "' NightAnnouncementCheck '" "' NightAnnouncementName '" ' -'"' NightAnnouncementPingID '" "' NightAnnouncementWebhook '" "' PrivServer '" "' DebugLogEnabled '" "' MonsterRespawnTime '" "' HoneyUpdateSSCheck '" "' TeleMode '" "' TeleBotToken '"' +'"' NightAnnouncementPingID '" "' NightAnnouncementWebhook '" "' PrivServer '" "' DebugLogEnabled '" "' MonsterRespawnTime '" "' HoneyUpdateSSCheck '" "' TeleMode '" "' TeleBotToken '" "' TeleChatID '"' ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; From d30d1f3b6343a33ddfd7a5e45a3aeb8af9f56491 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 20:12:25 -0400 Subject: [PATCH 14/34] fill in chat id arg --- submacros/Status.ahk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index 5e3982a..d734279 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2483,7 +2483,8 @@ class discord wr.Option[9] := 2720 url := discord.baseTele "sendMessage?" - url .= URL.BuildQueryString({text: message, chat_id: 123}) ; fill in chat id later + TeleChatID + 0 ; Convert telechatid to int + url .= URL.BuildQueryString({text: message, chat_id: TeleChatID}) wr.Open("POST", url, true) From e75e6c012307be4e549955d946a70c5e13750656 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 20:15:19 -0400 Subject: [PATCH 15/34] finish rough tele_sendembed + add todo --- submacros/Status.ahk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index d734279..3138f49 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2479,6 +2479,7 @@ class discord static Tele_sendEmbed(message, color, content, pBitmap, channel, replyID) { + ; TODO: add color support for tele wr := ComObject("WinHttp.WinHttpRequest.5.1") wr.Option[9] := 2720 @@ -2487,7 +2488,10 @@ class discord url .= URL.BuildQueryString({text: message, chat_id: TeleChatID}) wr.Open("POST", url, true) - + wr.SetTimeouts(0, 60000, 120000, 30000) + wr.Send() + wr.WaitForResponse() + return wr.ResponseText } static SendEmbed(message, color:=3223350, content:="", pBitmap:=0, channel:="", replyID:=0) From 3b9ddd6f65bc69fafb4b4429a398010a1bd8d733 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 20:40:51 -0400 Subject: [PATCH 16/34] fix int conversion --- submacros/Status.ahk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index 3138f49..4d18aa3 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2484,7 +2484,7 @@ class discord wr.Option[9] := 2720 url := discord.baseTele "sendMessage?" - TeleChatID + 0 ; Convert telechatid to int + TeleChatID := TeleChatID + 0 ; Convert telechatid to int url .= URL.BuildQueryString({text: message, chat_id: TeleChatID}) wr.Open("POST", url, true) From ad66424531e2db858e2a8b49e258e5fd418e4fb8 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 20:43:22 -0400 Subject: [PATCH 17/34] remove unused func --- submacros/Status.ahk | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index 4d18aa3..ed1ab51 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2448,21 +2448,6 @@ nm_command(command) class URL { ; im not even gonna lie, chatgpt clutched, i dont care enough to actually make this myself - static ParseQueryString(qs) { - result := {} - if (qs = "") - return result - - for pair in StrSplit(qs, "&") { - kv := StrSplit(pair, "=") - key := kv[1] - value := kv.Length() > 1 ? kv[2] : "" - result[key] := value - } - return result - } - - ; Build a query string from an object static BuildQueryString(obj) { qs := "" for key, value in obj { From 16bdd3476080a4224cfd31cbb52e2b17fae6b9bd Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 20:46:41 -0400 Subject: [PATCH 18/34] change func syntax --- submacros/Status.ahk | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index ed1ab51..1eed2e9 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2446,15 +2446,12 @@ nm_command(command) } } - -class URL { ; im not even gonna lie, chatgpt clutched, i dont care enough to actually make this myself - static BuildQueryString(obj) { - qs := "" - for key, value in obj { - qs .= (qs != "" ? "&" : "") . key . "=" . value - } - return qs +QueryString(obj) { + qs := "" + for key, value in obj { + qs .= (qs != "" ? "&" : "") . key . "=" . value } + return qs } class discord @@ -2470,7 +2467,7 @@ class discord url := discord.baseTele "sendMessage?" TeleChatID := TeleChatID + 0 ; Convert telechatid to int - url .= URL.BuildQueryString({text: message, chat_id: TeleChatID}) + url .= QueryString({text: message, chat_id: TeleChatID}) wr.Open("POST", url, true) wr.SetTimeouts(0, 60000, 120000, 30000) From 8c504f99bf36d414ea593ff578da54c81a3032f0 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 20:51:35 -0400 Subject: [PATCH 19/34] dont ask me how this fixed it --- submacros/Status.ahk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index 1eed2e9..fdd587f 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2467,7 +2467,11 @@ class discord url := discord.baseTele "sendMessage?" TeleChatID := TeleChatID + 0 ; Convert telechatid to int - url .= QueryString({text: message, chat_id: TeleChatID}) + + qs_args := {} + qs_args.text := message + qs_args.chat_id := TeleChatID + url .= QueryString(qs_args) wr.Open("POST", url, true) wr.SetTimeouts(0, 60000, 120000, 30000) From 967e14e414c177fd999883cccd34ded478c5f1e6 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 20:53:20 -0400 Subject: [PATCH 20/34] sometimes you just have to take the loss and code it yourself --- submacros/Status.ahk | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index fdd587f..4e7ec42 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2447,10 +2447,27 @@ nm_command(command) } QueryString(obj) { - qs := "" - for key, value in obj { - qs .= (qs != "" ? "&" : "") . key . "=" . value + qs := "" + + if !HasMethod(obj, "__Enum") { + throw ValueError("Object is not enumerable") } + + if (obj is Map) { + for key, value in obj { + qs .= (qs != "" ? "&" : "") . key . "=" . value + } + } + else if (obj is Object) { + for key in obj.OwnProps() { + value := obj.%key% + qs .= (qs != "" ? "&" : "") . key . "=" . value + } + } + else { + throw TypeError("Expected Map or Object, got " . Type(obj)) + } + return qs } From a9ca3f494b70d1174e656f15efa2aab0520425b9 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 21:12:41 -0400 Subject: [PATCH 21/34] dont try to convert the str --- submacros/Status.ahk | 5 ----- 1 file changed, 5 deletions(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index 4e7ec42..ed12089 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2449,10 +2449,6 @@ nm_command(command) QueryString(obj) { qs := "" - if !HasMethod(obj, "__Enum") { - throw ValueError("Object is not enumerable") - } - if (obj is Map) { for key, value in obj { qs .= (qs != "" ? "&" : "") . key . "=" . value @@ -2483,7 +2479,6 @@ class discord wr.Option[9] := 2720 url := discord.baseTele "sendMessage?" - TeleChatID := TeleChatID + 0 ; Convert telechatid to int qs_args := {} qs_args.text := message From 4de33f43dcbb8b4f93d2925ea52fe64c79dee48a Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 21:22:03 -0400 Subject: [PATCH 22/34] add some formatting --- submacros/Status.ahk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index ed12089..a147c0e 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2480,15 +2480,19 @@ class discord url := discord.baseTele "sendMessage?" + text := "Title: " content "
" message "" + qs_args := {} - qs_args.text := message + qs_args.text := text qs_args.chat_id := TeleChatID + qs_args.parse_mode := "HTML" url .= QueryString(qs_args) wr.Open("POST", url, true) wr.SetTimeouts(0, 60000, 120000, 30000) wr.Send() wr.WaitForResponse() + return wr.ResponseText } From 8e2ea4cc749189880492a5e7dac5c254ef037dc6 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 21:24:57 -0400 Subject: [PATCH 23/34] add error handling --- submacros/Status.ahk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index a147c0e..4a95d4d 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2492,7 +2492,11 @@ class discord wr.SetTimeouts(0, 60000, 120000, 30000) wr.Send() wr.WaitForResponse() - + + if (wr.Status != 200) { + throw Error("HTTP Error: " wr.Status " - " wr.StatusText) + } + return wr.ResponseText } From f6b0ce63bc526c3f1d30ade5da4fae9911869df5 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 21:33:55 -0400 Subject: [PATCH 24/34] change error handling --- submacros/Status.ahk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index 4a95d4d..653a396 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2480,7 +2480,7 @@ class discord url := discord.baseTele "sendMessage?" - text := "Title: " content "
" message "" + text := "Title: " content "`r" message "" qs_args := {} qs_args.text := text @@ -2494,7 +2494,7 @@ class discord wr.WaitForResponse() if (wr.Status != 200) { - throw Error("HTTP Error: " wr.Status " - " wr.StatusText) + throw Error("HTTP Error: " wr.Status " - " wr.StatusText) } return wr.ResponseText From 2ade1a591b40e1f9bfae8470aa43fe6e3a449cfd Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 21:35:24 -0400 Subject: [PATCH 25/34] Create uri encode func --- submacros/Status.ahk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index 653a396..3260279 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2467,6 +2467,14 @@ QueryString(obj) { return qs } +URIEncode(Url, Flags := 0x000C3000) { + Local CC := 4096, Esc := "", Result := "" + Loop + VarSetStrCapacity(&Esc, CC), Result := DllCall("Shlwapi.dll\UrlEscapeW", "Str", Url, "Str", &Esc, "UIntP", &CC, "UInt", Flags, "UInt") + Until Result != 0x80004003 ; E_POINTER + Return Esc +} + class discord { static baseURL := "https://discord.com/api/v10/" From 24d1fa3026df05efab9a10eb41c21aef5ec85e8f Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 21:35:54 -0400 Subject: [PATCH 26/34] uri encode text before sending it --- submacros/Status.ahk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index 3260279..ca12b9d 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -2488,7 +2488,8 @@ class discord url := discord.baseTele "sendMessage?" - text := "Title: " content "`r" message "" + text := "Title: " content "`n" message "" + text := URIEncode(text) qs_args := {} qs_args.text := text From c20a8346f8b70e333aa55da09dead76ed2be78a8 Mon Sep 17 00:00:00 2001 From: Fin M Date: Tue, 19 Aug 2025 21:41:02 -0400 Subject: [PATCH 27/34] start creating telegram gui integration --- submacros/natro_macro.ahk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/submacros/natro_macro.ahk b/submacros/natro_macro.ahk index 27048c2..a6258a7 100644 --- a/submacros/natro_macro.ahk +++ b/submacros/natro_macro.ahk @@ -2540,7 +2540,8 @@ MainGui.SetFont("s8 cDefault Norm", "Tahoma") MainGui.Add("Text", "x255 y55 w119 h120 -Wrap vTotalStats") MainGui.Add("Text", "x375 y55 w119 h120 -Wrap vSessionStats") MainGui.Add("Button", "x290 y39 w50 h15 vResetTotalStats Disabled", "Reset").OnEvent("Click", nm_ResetTotalStats) -MainGui.Add("Button", "x265 y202 w215 h24 vWebhookGUI Disabled", "Change Discord Settings").OnEvent("Click", nm_WebhookGUI) +MainGui.Add("Button", "x318 y202 w161 h24 vWebhookGUI Disabled", "Change Discord").OnEvent("Click", nm_WebhookGUI) +MainGui.Add("Button", "x265 y202 w53 h24 vTeleWebhookGUI Disabled", "Telegram").OnEvent("Click", nm_TeleGUI) nm_setStats() SetLoadingProgress(28) @@ -7194,6 +7195,10 @@ nm_WebhookGUI(*){ return (WGUIPID := exec.ProcessID) } +nm_TeleGUI(*){ + MsgBox "hewo" +} + ; SETTINGS TAB ; ------------------------ nm_guiThemeSelect(*){ From 49f9d44e57b0d20a932b2f1c0828f4a354fcdd7f Mon Sep 17 00:00:00 2001 From: Fin M Date: Wed, 20 Aug 2025 17:25:38 -0400 Subject: [PATCH 28/34] start creating tele gui --- submacros/natro_macro.ahk | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/submacros/natro_macro.ahk b/submacros/natro_macro.ahk index a6258a7..d6b0087 100644 --- a/submacros/natro_macro.ahk +++ b/submacros/natro_macro.ahk @@ -3932,11 +3932,13 @@ nm_TabStatusLock(){ MainGui["StatusLogReverse"].Enabled := 0 MainGui["ResetTotalStats"].Enabled := 0 MainGui["WebhookGUI"].Enabled := 0 + MainGui["TeleWebhookGUI"].Enabled := 0 } nm_TabStatusUnLock(){ MainGui["StatusLogReverse"].Enabled := 1 MainGui["ResetTotalStats"].Enabled := 1 MainGui["WebhookGUI"].Enabled := 1 + MainGui["TeleWebhookGUI"].Enabled := 1 } nm_TabSettingsLock(){ global @@ -7196,7 +7198,15 @@ nm_WebhookGUI(*){ } nm_TeleGUI(*){ - MsgBox "hewo" + TeleGUI := Gui("", "Change Telegram Settings") + TeleGUI.BackColor := "b0b0b0" + TeleGUI.MarginX := 10 + TeleGUI.MarginY := 10 + TeleGUI.SetFont("s9", "Segoe UI") + + TeleGUI.Add("GroupBox", "w360 h120", "Telegram Settings") + + TeleGUI.Show("w380 h220") } ; SETTINGS TAB From d1bc05e0f86aafd003fcb2157858ba93928f2e7c Mon Sep 17 00:00:00 2001 From: Fin M Date: Wed, 20 Aug 2025 17:29:51 -0400 Subject: [PATCH 29/34] rename from Discord Integration to Integration --- submacros/natro_macro.ahk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submacros/natro_macro.ahk b/submacros/natro_macro.ahk index d6b0087..47c4809 100644 --- a/submacros/natro_macro.ahk +++ b/submacros/natro_macro.ahk @@ -2526,7 +2526,7 @@ TabCtrl.UseTab("Status") MainGui.SetFont("w700") MainGui.Add("GroupBox", "x5 y23 w240 h210", "Status Log") MainGui.Add("GroupBox", "x250 y23 w245 h160", "Stats") -MainGui.Add("GroupBox", "x250 y185 w245 h48", "Discord Integration") +MainGui.Add("GroupBox", "x250 y185 w245 h48", "Integration") MainGui.SetFont("s8 cDefault Norm", "Tahoma") MainGui.Add("CheckBox", "x85 y23 Disabled vStatusLogReverse Checked" StatusLogReverse, "Reverse Order").OnEvent("Click", nm_StatusLogReverseCheck) From 5aac27f0710b2b49079cf984d9d79fb903f2587b Mon Sep 17 00:00:00 2001 From: Fin M Date: Wed, 20 Aug 2025 17:32:45 -0400 Subject: [PATCH 30/34] start creating gui widgets --- submacros/natro_macro.ahk | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/submacros/natro_macro.ahk b/submacros/natro_macro.ahk index 47c4809..f999aec 100644 --- a/submacros/natro_macro.ahk +++ b/submacros/natro_macro.ahk @@ -7197,18 +7197,23 @@ nm_WebhookGUI(*){ return (WGUIPID := exec.ProcessID) } -nm_TeleGUI(*){ - TeleGUI := Gui("", "Change Telegram Settings") - TeleGUI.BackColor := "b0b0b0" - TeleGUI.MarginX := 10 +nm_TeleGUI(*) { + TeleGUI := Gui("", "Change Telegram Settings") + TeleGUI.BackColor := "b0b0b0" + TeleGUI.MarginX := 10 TeleGUI.MarginY := 10 - TeleGUI.SetFont("s9", "Segoe UI") + TeleGUI.SetFont("s9", "Segoe UI") - TeleGUI.Add("GroupBox", "w360 h120", "Telegram Settings") + TeleGUI.Add("GroupBox", "w360 h120", "Telegram Settings") - TeleGUI.Show("w380 h220") + TeleGUI.Add("Button", "x20 y40 w80 h25", "Click") + TeleGUI.Add("Edit", "x110 y40 w220 h25 vShortBox") + TeleGUI.Add("Edit", "x20 y80 w310 h25 vLongBox") + + TeleGUI.Show("w380 h220") } + ; SETTINGS TAB ; ------------------------ nm_guiThemeSelect(*){ From 9ee8c0ccfa7f6d6c3f22e02cd48254ff69abd1b4 Mon Sep 17 00:00:00 2001 From: Fin M Date: Wed, 20 Aug 2025 17:35:26 -0400 Subject: [PATCH 31/34] add placeholders --- submacros/natro_macro.ahk | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/submacros/natro_macro.ahk b/submacros/natro_macro.ahk index f999aec..fafedc9 100644 --- a/submacros/natro_macro.ahk +++ b/submacros/natro_macro.ahk @@ -7206,14 +7206,22 @@ nm_TeleGUI(*) { TeleGUI.Add("GroupBox", "w360 h120", "Telegram Settings") - TeleGUI.Add("Button", "x20 y40 w80 h25", "Click") - TeleGUI.Add("Edit", "x110 y40 w220 h25 vShortBox") - TeleGUI.Add("Edit", "x20 y80 w310 h25 vLongBox") + TeleGUI.Add("Button", "x20 y40 w80 h25", "Enable") ; todo: make dynamic + + ShortBox := TeleGUI.Add("Edit", "x110 y40 w220 h25 vShortBox", "Chat ID") + LongBox := TeleGUI.Add("Edit", "x20 y80 w310 h25 vLongBox", "Bot Token") + + ShortBox.OnEvent("Focus", (*) => (ShortBox.Text = "Chat ID" ? ShortBox.Text := "" : 0)) + ShortBox.OnEvent("LoseFocus", (*) => (ShortBox.Text = "" ? ShortBox.Text := "Chat ID" : 0)) + + LongBox.OnEvent("Focus", (*) => (LongBox.Text = "Bot Token" ? LongBox.Text := "" : 0)) + LongBox.OnEvent("LoseFocus", (*) => (LongBox.Text = "" ? LongBox.Text := "Bot Token" : 0)) TeleGUI.Show("w380 h220") } + ; SETTINGS TAB ; ------------------------ nm_guiThemeSelect(*){ From e40ed10acbbedf885105b1c546d5cd549105aad3 Mon Sep 17 00:00:00 2001 From: Fin M Date: Wed, 20 Aug 2025 17:44:27 -0400 Subject: [PATCH 32/34] start creating dynamic button --- submacros/natro_macro.ahk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/submacros/natro_macro.ahk b/submacros/natro_macro.ahk index fafedc9..a44780f 100644 --- a/submacros/natro_macro.ahk +++ b/submacros/natro_macro.ahk @@ -7206,7 +7206,8 @@ nm_TeleGUI(*) { TeleGUI.Add("GroupBox", "w360 h120", "Telegram Settings") - TeleGUI.Add("Button", "x20 y40 w80 h25", "Enable") ; todo: make dynamic + BtnText := (TeleMode = 1 ? "Disable" : "Enable") + TeleGUI.Add("Button", "x20 y40 w80 h25 vTeleBtn", BtnText) ShortBox := TeleGUI.Add("Edit", "x110 y40 w220 h25 vShortBox", "Chat ID") LongBox := TeleGUI.Add("Edit", "x20 y80 w310 h25 vLongBox", "Bot Token") From 3b677b6ba7c0bd25ab207f5d69c3e2b764983a8b Mon Sep 17 00:00:00 2001 From: Fin M Date: Wed, 20 Aug 2025 17:51:14 -0400 Subject: [PATCH 33/34] add sm sh idk --- submacros/Status.ahk | 6 ++++++ submacros/natro_macro.ahk | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/submacros/Status.ahk b/submacros/Status.ahk index ca12b9d..a15a07b 100644 --- a/submacros/Status.ahk +++ b/submacros/Status.ahk @@ -95,6 +95,7 @@ OnMessage(0x5552, nm_setGlobalInt, 255) OnMessage(0x5553, nm_setGlobalStr, 255) OnMessage(0x5556, nm_sendHeartbeat) OnMessage(0x5559, nm_sendItemPicture) +OnMessage(0x5560, nm_updateTele) discord.SendEmbed("Connected to Discord!", 5066239) @@ -2475,6 +2476,11 @@ URIEncode(Url, Flags := 0x000C3000) { Return Esc } +nm_updateTele(*) { + global TeleMode + +} + class discord { static baseURL := "https://discord.com/api/v10/" diff --git a/submacros/natro_macro.ahk b/submacros/natro_macro.ahk index a44780f..2192f45 100644 --- a/submacros/natro_macro.ahk +++ b/submacros/natro_macro.ahk @@ -7207,11 +7207,17 @@ nm_TeleGUI(*) { TeleGUI.Add("GroupBox", "w360 h120", "Telegram Settings") BtnText := (TeleMode = 1 ? "Disable" : "Enable") - TeleGUI.Add("Button", "x20 y40 w80 h25 vTeleBtn", BtnText) + ToggleBtn := TeleGUI.Add("Button", "x20 y40 w80 h25 vTeleBtn", BtnText) ShortBox := TeleGUI.Add("Edit", "x110 y40 w220 h25 vShortBox", "Chat ID") LongBox := TeleGUI.Add("Edit", "x20 y80 w310 h25 vLongBox", "Bot Token") + ToggleTeleMode() { + TeleMode := !TeleMode + ToggleBtn.Text := (TeleMode = 1 ? "Disable" : "Enable") + } + ToggleBtn.OnEvent("Click", (*) => (TeleMode := !TeleMode)) + ShortBox.OnEvent("Focus", (*) => (ShortBox.Text = "Chat ID" ? ShortBox.Text := "" : 0)) ShortBox.OnEvent("LoseFocus", (*) => (ShortBox.Text = "" ? ShortBox.Text := "Chat ID" : 0)) From 50a24b0021673b27bb8e3dbe5daa185c2b29dec3 Mon Sep 17 00:00:00 2001 From: Fin M Date: Wed, 20 Aug 2025 17:52:15 -0400 Subject: [PATCH 34/34] im ashamed i made this mistake --- submacros/natro_macro.ahk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submacros/natro_macro.ahk b/submacros/natro_macro.ahk index 2192f45..714dc86 100644 --- a/submacros/natro_macro.ahk +++ b/submacros/natro_macro.ahk @@ -7216,7 +7216,7 @@ nm_TeleGUI(*) { TeleMode := !TeleMode ToggleBtn.Text := (TeleMode = 1 ? "Disable" : "Enable") } - ToggleBtn.OnEvent("Click", (*) => (TeleMode := !TeleMode)) + ToggleBtn.OnEvent("Click", ToggleTeleMode) ShortBox.OnEvent("Focus", (*) => (ShortBox.Text = "Chat ID" ? ShortBox.Text := "" : 0)) ShortBox.OnEvent("LoseFocus", (*) => (ShortBox.Text = "" ? ShortBox.Text := "Chat ID" : 0))