Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3bf758d
Add tele config options
fin-github Aug 19, 2025
388634a
forgot to add value pair to telechatid
fin-github Aug 19, 2025
364ae42
add telemode
fin-github Aug 19, 2025
f4d2d71
add comment + change default to off
fin-github Aug 19, 2025
95e9b33
start creating tele_sendembed
fin-github Aug 19, 2025
6ca22fa
create rough if statement
fin-github Aug 19, 2025
6b0c46f
add telemode arg
fin-github Aug 19, 2025
c7e3fce
fix function not in scope
fin-github Aug 19, 2025
9cd170f
add bot token arg and smth else i forgot
fin-github Aug 19, 2025
104211e
whoops, forgot to fill in the <token>
fin-github Aug 19, 2025
cc91063
create url utils class
fin-github Aug 19, 2025
71ac352
start creating the tele_sendembed method
fin-github Aug 20, 2025
195b496
create tele chat id arg
fin-github Aug 20, 2025
d30d1f3
fill in chat id arg
fin-github Aug 20, 2025
e75e6c0
finish rough tele_sendembed + add todo
fin-github Aug 20, 2025
3b9ddd6
fix int conversion
fin-github Aug 20, 2025
ad66424
remove unused func
fin-github Aug 20, 2025
16bdd34
change func syntax
fin-github Aug 20, 2025
8c504f9
dont ask me how this fixed it
fin-github Aug 20, 2025
967e14e
sometimes you just have to take the loss and code it yourself
fin-github Aug 20, 2025
a9ca3f4
dont try to convert the str
fin-github Aug 20, 2025
4de33f4
add some formatting
fin-github Aug 20, 2025
8e2ea4c
add error handling
fin-github Aug 20, 2025
f6b0ce6
change error handling
fin-github Aug 20, 2025
2ade1a5
Create uri encode func
fin-github Aug 20, 2025
24d1fa3
uri encode text before sending it
fin-github Aug 20, 2025
c20a834
start creating telegram gui integration
fin-github Aug 20, 2025
49f9d44
start creating tele gui
fin-github Aug 20, 2025
d1bc05e
rename from Discord Integration to Integration
fin-github Aug 20, 2025
5aac27f
start creating gui widgets
fin-github Aug 20, 2025
9ee8c0c
add placeholders
fin-github Aug 20, 2025
e40ed10
start creating dynamic button
fin-github Aug 20, 2025
3b677b6
add sm sh idk
fin-github Aug 20, 2025
50a24b0
im ashamed i made this mistake
fin-github Aug 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions submacros/Status.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ MonsterRespawnTime := A_Args[35]

HoneyUpdateSSCheck := A_Args[36]

TeleMode := A_Args[37]
TeleBotToken := A_Args[38]
TeleChatID := A_Args[39]

pToken := Gdip_Startup()
OnExit(ExitFunc)
OnMessage(0x004A, nm_sendPostData, 255)
Expand All @@ -91,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)

Expand Down Expand Up @@ -2442,12 +2447,79 @@ nm_command(command)
}
}

QueryString(obj) {
qs := ""

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
}

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
}

nm_updateTele(*) {
global TeleMode

}

class discord
{
static baseURL := "https://discord.com/api/v10/"
static baseTele := "https://api.telegram.org/bot" TeleBotToken "/"

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

url := discord.baseTele "sendMessage?"

text := "<b>Title:</b> " content "`n<code>" message "</code>"
text := URIEncode(text)

qs_args := {}
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()

if (wr.Status != 200) {
throw Error("HTTP Error: " wr.Status " - " wr.StatusText)
}

return wr.ResponseText
}

static SendEmbed(message, color:=3223350, content:="", pBitmap:=0, channel:="", replyID:=0)
{
if (TeleMode = 1) {
return discord.Tele_sendEmbed(message, color, content, pBitmap, channel, replyID)
}
payload_json :=
(
'
Expand Down
44 changes: 41 additions & 3 deletions submacros/natro_macro.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ nm_importConfig()
, "DiscordCheck", 0
, "Webhook", ""
, "BotToken", ""
, "TeleMode", 0 ; 0 = Disabled ; 1 = Enabled
, "TeleBotToken", ""
, "TeleChatID", ""
, "MainChannelCheck", 1
, "MainChannelID", ""
, "ReportChannelCheck", 1
Expand Down Expand Up @@ -2018,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 '" "' TeleBotToken '" "' TeleChatID '"'
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -2523,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)
Expand All @@ -2537,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)

Expand Down Expand Up @@ -3928,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
Expand Down Expand Up @@ -7191,6 +7197,38 @@ nm_WebhookGUI(*){
return (WGUIPID := exec.ProcessID)
}

nm_TeleGUI(*) {
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")

BtnText := (TeleMode = 1 ? "Disable" : "Enable")
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", ToggleTeleMode)

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(*){
Expand Down