-
Notifications
You must be signed in to change notification settings - Fork 0
Scripts & Utilities
Hedera edited this page Dec 2, 2025
·
4 revisions
By Enchantingnova
This script will take a file and insert line breaks after semicolons so that code becomes somewhat more readable.
import sys
if len(sys.argv) > 1:
fileName = sys.argv[1]
else:
fileName = input("What file to read?")
outputFile = open("output.js", "w")
outputFile.write("")
outputFile.close()
outputFile = open("output.js", "a")
file = open(fileName, "r")
for char in file.readline():
outputFile.write(char)
if char == ";":
outputFile.write("\n")
file.close()
outputFile.close()By Hedera, original by Enchantingnova
Modified version of above to make events in code0.js print to console when triggered. Best used with a base copy of code0 somewhere safe as argument 1 and the active code0 in the app.asar as argument 2 for quick edits
import sys
if len(sys.argv) > 1:
fileName = sys.argv[1]
else:
fileName = input("What file to read?")
targetFile = "output.js"
if len(sys.argv) > 2 and sys.argv[2] != sys.argv[1]:
targetFile = sys.argv[2]
outputFile = open(targetFile, "w")
outputFile.write("")
outputFile.close()
outputFile = open(targetFile, "a")
file = open(fileName, "r")
func_count = 0
blacklist = [264,549,434,435,282,283,284,285,14561,14579,14580,3801,3800,14608,14610,14622,14625,14661,14709,14712,14714,14715,14718,14720,14723,14726,14733,14736,14737,14738,13019,13021,14744,13053,14757,14760,13289,14761,13310,13308,13303,13309,13306,14765,14766,14767,14769,13654,13387,13388,13389,14770,13677,13678,13661,13663,13679,13667,14546,14555,547,548,13302,13655]
#these bastards run every frame and make it unreadable
for line in file:
outputFile.write(line)
if "if (isConditionTrue_0) {" in line:
if func_count not in blacklist:
outputFile.write("console.log('Event Tag " + str(func_count) + "'); \n")
func_count += 1
file.close()
outputFile.close()