Skip to content

Commit

Permalink
move keep to .autohack
Browse files Browse the repository at this point in the history
  • Loading branch information
gi-b716 committed Dec 6, 2024
1 parent b7c39a4 commit f1c2f09
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 4 additions & 0 deletions autoHack.infinite.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
os.system("echo off")
os.system("cls")

if not os.path.isdir(".autohack"):
os.mkdir(".autohack")
os.system("attrib +h .autohack")

if config.compileBeforeRun==True:
print("Compile program(s)")
logger.info("Compile program(s)")
Expand Down
17 changes: 10 additions & 7 deletions autoHack.random.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
os.system("echo off")
os.system("cls")

if not os.path.isdir(".autohack"):
os.mkdir(".autohack")
os.system("attrib +h .autohack")

if config.compileBeforeRun==True:
print("Compile program(s)")
logger.info("Compile program(s)")
Expand All @@ -48,11 +52,11 @@
md5Obj.update(fileData)
md5Result = md5Obj.hexdigest()

if os.path.exists("KEEP"):
keepFile = open("KEEP", "r")
if os.path.exists(".\\.autohack\\keep"):
keepFile = open(".\\.autohack\\keep", "r")
keepFileContent = keepFile.readlines()
keepFile.close()
os.remove("KEEP")
os.remove(".\\.autohack\\keep")
if md5Result == keepFileContent[0].strip():
askRes = input("Detected unfinished tasks, do you want to restore them? (y/[n]): ")
if askRes == "y":
Expand All @@ -68,8 +72,7 @@
time.sleep(config.previewHackDataTime)
logger.info("Preview hack data.")

keepFileObj = open("KEEP", "w")
os.system("attrib +h KEEP")
keepFileObj = open(".\\.autohack\\keep", "w")
keepFileObj.write("{0}\n".format(md5Result))

# Generate hack data
Expand Down Expand Up @@ -160,12 +163,12 @@

if diffCount == config.wrongLimits:
keepFileObj.close()
os.remove("KEEP")
os.remove(".\\.autohack\\keep")
sys.exit(0)
logger.info("Catch {0} diff".format(diffCount))
else:
logger.info("Skip judge")

logger.info("Done.")
keepFileObj.close()
os.remove("KEEP")
os.remove(".\\.autohack\\keep")
2 changes: 1 addition & 1 deletion dataGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def mainPage(self):
self.mainPage()

class Meta:
_version = "6.3.0"
_version = "6.3.1"


if __name__ == "__main__":
Expand Down

0 comments on commit f1c2f09

Please sign in to comment.