Add a debug mode checkbox

master
Joshua Sigona 5 years ago
parent d9f33a420b
commit 3047c3e072
  1. 19
      autocraft.ahk
  2. BIN
      autocraft.exe

@ -1,10 +1,12 @@
Stdout(output:="", sciteCheck := true){ ;output to console - sciteCheck reduces Stdout/Stdin performance,so where performance is necessary disable it accordingly 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 If (sciteCheck && ProcessExist("SciTE.exe") && GetScriptParentProcess() = "SciTE.exe"){ ;if script parent is scite,output to scite console & return
FileAppend, %output%`n, * FileAppend, %output%`n, *
Return Return
} ;CONOUT$ is a special file windows uses to expose attached console output } ;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 Stdin(output:="", sciteCheck := true){ ;output to console & wait for input & return input
@ -833,6 +835,9 @@ scriptSelectionBox := null
buttonstart := null buttonstart := null
buttonstop := null buttonstop := null
cpBox := null cpBox := null
debugBox := null
DEBUGMODE := false
scriptName := "" scriptName := ""
@ -850,10 +855,20 @@ Gui, Add, Button,vbuttonstop gStopCraftingScript w90 ys, Stop
Gui, Add, Text,section, CP: Gui, Add, Text,section, CP:
Gui, Add, Edit,gmodifyCP ys w75 Gui, Add, Edit,gmodifyCP ys w75
Gui, Add, UpDown,vcpBox ys Range1-1000, %CPBASE% Gui, Add, UpDown,vcpBox ys Range1-1000, %CPBASE%
Gui, Add, Text,xp+100 ys, Debug
Gui, Add, Checkbox,ys vdebugBox gmodifyDebug
Gui, Show Gui, Show
GuiControl, Disable, buttonstop GuiControl, Disable, buttonstop
modifyDebug() {
global debugBox, DEBUGMODE
debug := false
GuiControlGet, debug,,debugBox
DEBUGMODE := debug
Stdout("Set DEBUGMODE to " . DEBUGMODE)
}
modifyCP() { modifyCP() {
global cpBox, CPBASE global cpBox, CPBASE
boxcp := 0 boxcp := 0

Binary file not shown.
Loading…
Cancel
Save