;CyTube Emoji JSON Generator, for mass emoji import. ;Example File: https://pink.pony.cx/EmoteList.txt #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. ;================================================================================================================= InputFile := "EmoteList.txt" ;name of the file you made that contains the direct urls of the hosted emotes. ;================================================================================================================= ;if you make the above InputFile := "" blank, it'll let you select the file. if (InputFile = "") { FileSelectFile,InputFile } if (InputFile = "") { msgbox, you didnt select shit. ExitApp } q := chr(0x22) ;qoute symbol, am lazy. colon := ":" ;colon symbol, make it blank if you dont want your emoji names to be wrapped with colons like :emoji: FileDelete, ImportEmotes.json ;remove json first, to avoid confliction FileAppend,[`n,ImportEmotes.json ;add [ to beginning ;get amount of emotes Loop, read, %InputFile% { count := A_Index } List := A_WorkingDir . "/" . InputFile Loop, read, %List% { newcount := A_Index Loop, parse, A_LoopReadLine, %A_Tab% { SplitPath,A_LoopField,,,,FileName ;omit comma at the end, on the last emote in list. if (newcount = count) { Emote := "{" . q . "name" . q . ":" . q . colon . FileName . colon . q . "," . q . "image" . q . ":" . q . A_LoopField . q "}" . "`n" FileAppend, %Emote%,ImportEmotes.json break } Emote := "{" . q . "name" . q . ":" . q . colon . FileName . colon . q . "," . q . "image" . q . ":" . q . A_LoopField . q "}," . "`n" FileAppend, %Emote%,ImportEmotes.json } } FileAppend,],ImportEmotes.json ;add [ to end msgbox, Done /) ExitApp