From 3047c3e0726694b625ad24cffb001bbdf506fba0 Mon Sep 17 00:00:00 2001 From: Joshua Sigona Date: Wed, 10 Jun 2020 02:53:57 +0900 Subject: [PATCH] Add a debug mode checkbox --- autocraft.ahk | 19 +++++++++++++++++-- autocraft.exe | Bin 1128960 -> 1128960 bytes 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/autocraft.ahk b/autocraft.ahk index 2d0904d..09b5895 100644 --- a/autocraft.ahk +++ b/autocraft.ahk @@ -1,10 +1,12 @@ Stdout(output:="", sciteCheck := true){ ;output to console - sciteCheck reduces Stdout/Stdin performance,so where performance is necessary disable it accordingly - Global ___console___ + Global ___console___, DEBUGMODE If (sciteCheck && ProcessExist("SciTE.exe") && GetScriptParentProcess() = "SciTE.exe"){ ;if script parent is scite,output to scite console & return FileAppend, %output%`n, * Return } ;CONOUT$ is a special file windows uses to expose attached console output - ( output ? ( !___console___? (DllCall("AttachConsole", "int", -1) || DllCall("AllocConsole")) & (___console___:= true) : "" ) & FileAppend(output . "`n","CONOUT$") : DllCall("FreeConsole") & (___console___:= false) & StdExit() ) + if (DEBUGMODE) { + ( output ? ( !___console___? (DllCall("AttachConsole", "int", -1) || DllCall("AllocConsole")) & (___console___:= true) : "" ) & FileAppend(output . "`n","CONOUT$") : DllCall("FreeConsole") & (___console___:= false) & StdExit() ) + } } Stdin(output:="", sciteCheck := true){ ;output to console & wait for input & return input @@ -833,6 +835,9 @@ scriptSelectionBox := null buttonstart := null buttonstop := null cpBox := null +debugBox := null + +DEBUGMODE := false scriptName := "" @@ -850,10 +855,20 @@ Gui, Add, Button,vbuttonstop gStopCraftingScript w90 ys, Stop Gui, Add, Text,section, CP: Gui, Add, Edit,gmodifyCP ys w75 Gui, Add, UpDown,vcpBox ys Range1-1000, %CPBASE% +Gui, Add, Text,xp+100 ys, Debug +Gui, Add, Checkbox,ys vdebugBox gmodifyDebug Gui, Show GuiControl, Disable, buttonstop +modifyDebug() { + global debugBox, DEBUGMODE + debug := false + GuiControlGet, debug,,debugBox + DEBUGMODE := debug + Stdout("Set DEBUGMODE to " . DEBUGMODE) +} + modifyCP() { global cpBox, CPBASE boxcp := 0 diff --git a/autocraft.exe b/autocraft.exe index acf31f8cf283de6212e756a622388166b3bd31d9..cc40415543c01842b1b7a47190d8aa2db282c33d 100644 GIT binary patch delta 559 zcmZqp;?nTNWy2aqrjCW1*D+dw=;l{U?XQ>^ffz(H12GE_vjQ<25VHd@2M}`tF&7YX z12GQ}^8zs+5c6+;#UyZQM*TVu28Jgr3}7H}OOU|;$b#`bfP4`oeheDF0FB>*#-9P? z|6xR!H|35X!xx}kF!O~O?6w=v5$N*e)=_YAbqaO&^>=ZdzW1d-jX-9af(BejQ=xjg z#Vdgq+vQ#hRNE`3q$ZW7JLOj>SlKG%mFDDd!4-l;(h_ruQ@7915@ccubWBOnQ3y$` zDAB1X&^9zMP^c^h+62^ffz(H12GE_vjQ<25VHd@2M}`tF&7YX z12GQ}^8zs+5c6+;#UyZQMt!F{1H%&*1~B+?Ly*A$$b#`zZVEDpAn`5G_&#X-1T=mL zkpG7fVP3&)L543tyI|%EGuUl6o+HrZyS?(YfCA(6pRWX*x7)oIsI=dHTT76UX}YGa dp!W7xx`KKvj4sPhVgun1D*K005?jP;vkO