SCRIPT_NAME = "habo"; SCRIPT_DESC = "Tracks harm body casting and success rate, along with fail to reach and burgle crit"; SCRIPT_OFF = false; /////////////////////////////////////////////////////////// // // *** IMPORTANT *** // Change the _Path variable below // // habo.bcs // // Written by Hair@BatMUD // 1 Febuary, 2018 // Revised 3 Febuary, 2018 to show 'Historical' 'Previous' // and 'Current' session information // // Born of an idle comment by a passing Ewige wondering how // hard it would be to use batclient to keep track of habo // cast stuff. As I had done something similar in TinyFugue // I thought 'How hard could it be?' .... yeah .... // // What I think are the interesting parts are the reading and // writing variables to an external file to allow tracking across // sessions. These are handled in the load_habo_vars() and the // write_habo_vars() methods below. // Of course, if you use batclient from multiple computers you'll // either need to link to some cloud service like dropbox to keep // at least the save file, or perhaps even your entire scripts // directory. If you don't do this then the data in the save // file will be missing information. // // Revised 17 January 2024 to automatically get path to client directory // and to support inline colors import java.util.regex.*; import java.text.DecimalFormat; // Variables to be able to use inline colors with clientGUI.printText String RESET = "\u001b[0m"; String BOLD = "\u001b[1m"; String BLACK = "\u001b[30m"; String RED = "\u001b[31m"; String GREEN = "\u001b[32m"; String YELLOW = "\u001b[33m"; String BLUE = "\u001b[34m"; String MAGENTA = "\u001b[35m"; String CYAN = "\u001b[36m"; String WHITE = "\u001b[37m"; String BGBLACK = "\u001b[40m"; String BGRED = "\u001b[41m"; String BGGREEN = "\u001b[42m"; String BGYELLOW = "\u001b[43m"; String BGBLUE = "\u001b[44m"; String BGMAGENTA = "\u001b[45m"; String BGCYAN = "\u001b[46m"; String BGWHITE = "\u001b[47m"; String HEADER = BOLD + YELLOW + "[" + RESET + YELLOW + "habo" + RESET + BOLD + YELLOW + "]: " + RESET; String _Path; int total_habo_cast; int fail_to_reach; int failed_habo; int burgle_crit; int burgle_crit_youth; int burgle_crit_ess; int Ptotal_habo_cast; int Pfail_to_reach; int Pfailed_habo; int Pburgle_crit; int Pburgle_crit_youth; int Pburgle_crit_ess; int Stotal_habo_cast; int Sfail_to_reach; int Sfailed_habo; int Sburgle_crit; int Sburgle_crit_youth; int Sburgle_crit_ess; boolean casting_habo = false; boolean habo_did_cast = false; boolean habo_did_crit = false; boolean habo_did_ess = false; // Big long statement containing all spell failure messages (I hope) String failmsg = "(You are disturbed by something, your spell misfires|Your concentration fails and so does your spell|Your concentration drifts away as you think you feel a malignant aura|poke yourself in the eye and your spell |You stumble and lose your concentration|Your spell just sputters|You lose touch with the magic and the spell fizzles|You fail miserably in your spell|You stutter the magic words and fail the spell|Your spell just sputters|Your mind plays a trick with you and you fail in your spell|Something touches you and spoils your concentration ruining the spell.|The spell fails)"; void bootup() { // Get local path _Path = clientGUI.getBaseDirectory() + "/scripts/"; // Change any '\' character in the path to '/' _Path = _Path.replace("\\", "/"); // Set casting_habo flag triggerManager.newTrigger("is_casting_habo", "^You clap your hands and whisper \'PAF PAF PAF!\'", "$"+SCRIPT_NAME+".is_casting_habo",false,false,false,null,Font.PLAIN); // Habo hit with damn armament weapon triggerManager.newTrigger("habo_hit1", "^The curse in your (.*) allows you to channel harmful power through it!$", "$"+SCRIPT_NAME+".habo_hit",false,false,false,null,Font.PLAIN); // Habo hit with empty hand triggerManager.newTrigger("habo_hit2", "^You use your (.*) for channeling harmful powers.$", "$"+SCRIPT_NAME+".habo_hit",false,false,false,null,Font.PLAIN); // Burgle crit! During testing I had to remove some limits from this regex // With checks in the habo_burgle function it should not return any false // positives. triggerManager.newTrigger("habo_burgle", "^ ..The power of Burglefloogah takes over you!!", "$"+SCRIPT_NAME+".habo_burgle",false,false,false,null,Font.PLAIN); // Fail to reach :( triggerManager.newTrigger("habo_reach", "^You fail to reach (.*)", "$"+SCRIPT_NAME+".habo_reach",false,false,false,null,Font.PLAIN); // Failed casting triggerManager.newTrigger("habo_failed", "^"+failmsg, "$"+SCRIPT_NAME+".habo_failed",false,false,false,null,Font.PLAIN); // Movement break triggerManager.newTrigger("habo_moved", "^Your movement prevents you from casting the spell.$", "$"+SCRIPT_NAME+".habo_moved",false,false,false,null,Font.PLAIN); // Track essence message triggerManager.newTrigger("habo_essence", "^You are envigorated by the stolen essence!$", "$"+SCRIPT_NAME+".habo_essence",false,false,false,null,Font.PLAIN); // Track youth message triggerManager.newTrigger("habo_youth", "^You feel younger!$", "$"+SCRIPT_NAME+".habo_youth",false,false,false,null,Font.PLAIN); // Get those hands empty, sailor! triggerManager.newTrigger("habo_nohands", "^Your limbs aren't free and you cannot touch anyone!$", "$"+SCRIPT_NAME+".habo_nohands",false,false,false,null,Font.PLAIN); // Load up variables from save file load_habo_vars(); // Show how to get help clientGUI.printText("general", "LOADED: habo ('$habo.help' for more info)\n", "ffff00"); } void is_casting_habo() { if(!casting_habo) { casting_habo = true; } } void habo_hit() { habo_did_cast = false; if(casting_habo) { ++total_habo_cast; ++Stotal_habo_cast; casting_habo = false; habo_did_cast = true; write_habo_vars(); } } void habo_burgle() { if(habo_did_cast) { ++burgle_crit; ++Sburgle_crit; write_habo_vars(); } } void habo_essence() { if(habo_did_cast) { ++burgle_crit_ess; ++Sburgle_crit_ess; write_habo_vars(); } } void habo_youth() { if(habo_did_cast) { ++burgle_crit_youth; ++Sburgle_crit_youth; write_habo_vars(); } } void habo_reach() { if(habo_did_cast) { ++fail_to_reach; ++Sfail_to_reach; casting_habo = false; write_habo_vars(); } } void habo_failed() { if(casting_habo) { ++failed_habo; ++total_habo_cast; ++Sfailed_habo; ++Stotal_habo_cast; casting_habo = false; write_habo_vars(); } } void habo_moved() { if(casting_habo) { casting_habo = false; } } void habo_nohands() { if(casting_habo) { ++total_habo_cast; ++Stotal_habo_cast; casting_habo = false; write_habo_vars(); } } void load_habo_vars() { load_history_data(); load_previous_data(); load_session_data(); } void load_history_data() { String _hLine; _hFile = new File(_Path + "/habo.dat"); if(!_hFile.exists()) { clientGUI.printText("general", HEADER + BOLD + YELLOW + "HABO History save file not found. Initializing HABO History variables to 0" + RESET + "\n", false); total_habo_cast = 0; fail_to_reach = 0; failed_habo = 0; burgle_crit = 0; burgle_crit_ess = 0; burgle_crit_youth = 0; } else { f = new FileReader(_Path + "habo.dat"); b = new BufferedReader(f); _hLine = b.readLine(); while(_hLine != null) { String reg = "([a-z_]*) ([0-9]*)"; Pattern haboPattern = Pattern.compile(reg, Pattern.DOTALL); Matcher haboMatcher = haboPattern.matcher(_hLine); boolean matched = haboMatcher.matches(); if(matched) { if(haboMatcher.group(1).equals("total_habo_cast")) { total_habo_cast = Integer.parseInt(haboMatcher.group(2)); } else if(haboMatcher.group(1).equals("fail_to_reach")) { fail_to_reach = Integer.parseInt(haboMatcher.group(2)); } else if(haboMatcher.group(1).equals("failed_habo")) { failed_habo = Integer.parseInt(haboMatcher.group(2)); } else if(haboMatcher.group(1).equals("burgle_crit")) { burgle_crit = Integer.parseInt(haboMatcher.group(2)); } else if(haboMatcher.group(1).equals("burgle_crit_ess")) { burgle_crit_ess = Integer.parseInt(haboMatcher.group(2)); } else if(haboMatcher.group(1).equals("burgle_crit_youth")) { burgle_crit_youth = Integer.parseInt(haboMatcher.group(2)); } } _hLine = b.readLine(); } f.close(); b.close(); } } void load_previous_data() { String _hLine; _hFile = new File(_Path + "/habo_previous.dat"); if(!_hFile.exists()) { clientGUI.printText("general", HEADER + BOLD + YELLOW + "HABO Previous Session save file not found. Initializing HABO Previous Session variables to 0" + RESET + "\n", false); Ptotal_habo_cast = 0; Pfail_to_reach = 0; Pfailed_habo = 0; Pburgle_crit = 0; Pburgle_crit_ess = 0; Pburgle_crit_youth = 0; } else { f = new FileReader(_Path + "/habo_previous.dat"); b = new BufferedReader(f); _hLine = b.readLine(); while(_hLine != null) { String reg = "([A-Za-z_]*) ([0-9]*)"; Pattern haboPattern = Pattern.compile(reg, Pattern.DOTALL); Matcher haboMatcher = haboPattern.matcher(_hLine); boolean matched = haboMatcher.matches(); if(matched) { if(haboMatcher.group(1).equals("Ptotal_habo_cast")) { Ptotal_habo_cast = Integer.parseInt(haboMatcher.group(2)); } else if(haboMatcher.group(1).equals("Pfail_to_reach")) { Pfail_to_reach = Integer.parseInt(haboMatcher.group(2)); } else if(haboMatcher.group(1).equals("Pfailed_habo")) { Pfailed_habo = Integer.parseInt(haboMatcher.group(2)); } else if(haboMatcher.group(1).equals("Pburgle_crit")) { Pburgle_crit = Integer.parseInt(haboMatcher.group(2)); } else if(haboMatcher.group(1).equals("Pburgle_crit_ess")) { Pburgle_crit_ess = Integer.parseInt(haboMatcher.group(2)); } else if(haboMatcher.group(1).equals("Pburgle_crit_youth")) { Pburgle_crit_youth = Integer.parseInt(haboMatcher.group(2)); } } _hLine = b.readLine(); } f.close(); b.close(); } } void load_session_data() { String _hLine; _hFile = new File(_Path + "/habo_session.dat"); if(!_hFile.exists()) { clientGUI.printText("general", HEADER + BOLD + YELLOW + "HABO Current Session save file not found. Initializing HABO Current Session variables to 0" + RESET + "\n", false); Ptotal_habo_cast = 0; Pfail_to_reach = 0; Pfailed_habo = 0; Pburgle_crit = 0; Pburgle_crit_ess = 0; Pburgle_crit_youth = 0; } else { f = new FileReader(_Path + "/habo_session.dat"); b = new BufferedReader(f); _hLine = b.readLine(); while(_hLine != null) { String reg = "([A-Za-z_]*) ([0-9]*)"; Pattern haboPattern = Pattern.compile(reg, Pattern.DOTALL); Matcher haboMatcher = haboPattern.matcher(_hLine); boolean matched = haboMatcher.matches(); if(matched) { if(haboMatcher.group(1).equals("Stotal_habo_cast")) { Stotal_habo_cast = Integer.parseInt(haboMatcher.group(2)); } else if(haboMatcher.group(1).equals("Sfail_to_reach")) { Sfail_to_reach = Integer.parseInt(haboMatcher.group(2)); } else if(haboMatcher.group(1).equals("Sfailed_habo")) { Sfailed_habo = Integer.parseInt(haboMatcher.group(2)); } else if(haboMatcher.group(1).equals("Sburgle_crit")) { Sburgle_crit = Integer.parseInt(haboMatcher.group(2)); } else if(haboMatcher.group(1).equals("Sburgle_crit_ess")) { Sburgle_crit_ess = Integer.parseInt(haboMatcher.group(2)); } else if(haboMatcher.group(1).equals("Sburgle_crit_youth")) { Sburgle_crit_youth = Integer.parseInt(haboMatcher.group(2)); } } _hLine = b.readLine(); } f.close(); b.close(); } } void write_habo_vars() { // false to overwrite file, true to append f = new FileOutputStream(_Path + "habo.dat", false); p = new PrintStream(f); p.println("total_habo_cast " + total_habo_cast); p.println("fail_to_reach " + fail_to_reach); p.println("failed_habo " + failed_habo); p.println("burgle_crit " + burgle_crit); p.println("burgle_crit_ess " + burgle_crit_ess); p.println("burgle_crit_youth " + burgle_crit_youth); p.close(); f.close(); f = new FileOutputStream(_Path + "/habo_session.dat", false); p = new PrintStream(f); p.println("Stotal_habo_cast " + Stotal_habo_cast); p.println("Sfail_to_reach " + Sfail_to_reach); p.println("Sfailed_habo " + Sfailed_habo); p.println("Sburgle_crit " + Sburgle_crit); p.println("Sburgle_crit_ess " + Sburgle_crit_ess); p.println("Sburgle_crit_youth " + Sburgle_crit_youth); p.close(); f.close(); } void stat() { // Do some math and string formatting and print information into a useful chart DecimalFormat df = new DecimalFormat("###.##"); // Total Casts line String STRtotal_habo_cast = String.format("%13d", new Object[] { new Integer(total_habo_cast) }); String STRPtotal_habo_cast = String.format("%13d", new Object[] { new Integer(Ptotal_habo_cast) }); String STRStotal_habo_cast = String.format("%13d", new Object[] { new Integer(Stotal_habo_cast) }); // Successful Casts line int INThabo_successful = total_habo_cast - failed_habo; String STRhabo_successful = String.format ("%13d", new Object[] { new Integer(INThabo_successful) }); int INTPhabo_successful = Ptotal_habo_cast - Pfailed_habo; String STRPhabo_successful = String.format ("%13d", new Object[] { new Integer(INTPhabo_successful) }); int INTShabo_successful = Stotal_habo_cast - Sfailed_habo; String STRShabo_successful = String.format ("%13d", new Object[] { new Integer (INTShabo_successful) }); // Failed Spells line (with percents) float FLfailed_habo_percent = ((failed_habo * 1.0) / (total_habo_cast * 1.0)) * 100.0; String STRfailed_habo_line = String.format("%13s", new Object[] { new String(String.valueOf(failed_habo) + "(" + df.format(FLfailed_habo_percent) + "%)") }); float FLPfailed_habo_percent = ((Pfailed_habo * 1.0) / (Ptotal_habo_cast * 1.0)) * 100.0; String STRPfailed_habo_line = String.format("%13s", new Object[] { new String(String.valueOf(Pfailed_habo) + "(" + df.format(FLPfailed_habo_percent) + "%)") }); float FLSfailed_habo_percent = ((Sfailed_habo * 1.0) / (Stotal_habo_cast * 1.0)) * 100.0; String STRSfailed_habo_line = String.format("%13s", new Object[] { new String(String.valueOf(Sfailed_habo) + "(" + df.format(FLSfailed_habo_percent) + "%)") }); // Fail to Reach line (with percents) float FLfail_to_reach_percent = ((fail_to_reach * 1.0) / (INThabo_successful * 1.0)) * 100.0; String STRfail_to_reach_line = String.format("%13s", new Object[] { new String(String.valueOf(fail_to_reach) + "(" + df.format(FLfail_to_reach_percent) + "%)") }); float FLPfail_to_reach_percent = ((Pfail_to_reach * 1.0) / (INTPhabo_successful * 1.0)) * 100.0; String STRPfail_to_reach_line = String.format("%13s", new Object[] { new String(String.valueOf(Pfail_to_reach) + "(" + df.format(FLPfail_to_reach_percent) + "%)") }); float FLSfail_to_reach_percent = ((Sfail_to_reach * 1.0) / (INTShabo_successful * 1.0)) * 100.0; String STRSfail_to_reach_line = String.format("%13s", new Object[] { new String(String.valueOf(Sfail_to_reach) + "(" + df.format(FLSfail_to_reach_percent) + "%)") }); // Burgle Crit line (with percents) float FLburgle_crit_percent = ((burgle_crit * 1.0) / (INThabo_successful * 1.0)) * 100.0; String STRburgle_crit_line = String.format("%13s", new Object[] { new String(String.valueOf(burgle_crit) + "(" + df.format(FLburgle_crit_percent) + "%)") }); float FLPburgle_crit_percent = ((Pburgle_crit * 1.0) / (INTPhabo_successful * 1.0)) * 100.0; String STRPburgle_crit_line = String.format("%13s", new Object[] { new String(String.valueOf(Pburgle_crit) + "(" + df.format(FLPburgle_crit_percent) + "%)") }); float FLSburgle_crit_percent = ((Sburgle_crit * 1.0) / (INTShabo_successful * 1.0)) * 100.0; String STRSburgle_crit_line = String.format("%13s", new Object[] { new String(String.valueOf(Sburgle_crit) + "(" + df.format(FLSburgle_crit_percent) + "%)") }); // HABO Essence line (with percents) float FLburgle_crit_ess_percent = ((burgle_crit_ess * 1.0) / (burgle_crit * 1.0)) * 100.0; String STRburgle_crit_ess_line = String.format("%13s", new Object[] { new String(String.valueOf(burgle_crit_ess) + "(" + df.format(FLburgle_crit_ess_percent) + "%)") }); float FLPburgle_crit_ess_percent = ((Pburgle_crit_ess * 1.0) / (Pburgle_crit * 1.0)) * 100.0; String STRPburgle_crit_ess_line = String.format("%13s", new Object[] { new String(String.valueOf(Pburgle_crit_ess) + "(" + df.format(FLPburgle_crit_ess_percent) + "%)") }); float FLSburgle_crit_ess_percent = ((Sburgle_crit_ess * 1.0) / (Sburgle_crit * 1.0)) * 100.0; String STRSburgle_crit_ess_line = String.format("%13s", new Object[] { new String(String.valueOf(Sburgle_crit_ess) + "(" + df.format(FLSburgle_crit_ess_percent) + "%)") }); // HABO Youth line (with percents) float FLburgle_crit_youth_percent = ((burgle_crit_youth * 1.0) / (burgle_crit * 1.0)) * 100.0; String STRburgle_crit_youth_line = String.format("%13s", new Object[] { new String(String.valueOf(burgle_crit_youth) + "(" + df.format(FLburgle_crit_youth_percent) + "%)") }); float FLPburgle_crit_youth_percent = ((Pburgle_crit_youth * 1.0) / (Pburgle_crit * 1.0)) * 100.0; String STRPburgle_crit_youth_line = String.format("%13s", new Object[] { new String(String.valueOf(Pburgle_crit_youth) + "(" + df.format(FLPburgle_crit_youth_percent) + "%)") }); float FLSburgle_crit_youth_percent = ((Sburgle_crit_youth * 1.0) / (Sburgle_crit * 1.0)) * 100.0; String STRSburgle_crit_youth_line = String.format("%13s", new Object[] { new String(String.valueOf(Sburgle_crit_youth) + "(" + df.format(FLSburgle_crit_youth_percent) + "%)") }); // Print the chart clientGUI.printText("general", YELLOW + "+------------------------------------------------------------------+" + RESET + "\n", false); clientGUI.printText("general", YELLOW + "|" + RESET + BOLD + YELLOW + " Harm Body Statistics " + RESET + YELLOW + "|" + RESET + "\n", false); clientGUI.printText("general", YELLOW + "|==================================================================|" + RESET + "\n", false); clientGUI.printText("general", YELLOW + "| |" + RESET + BOLD + YELLOW + " Historically " + RESET + YELLOW + "|" + RESET + BOLD + YELLOW + " Prev Session " + RESET + YELLOW + "|" + RESET + BOLD + YELLOW + " This Session " + RESET + YELLOW + "|" + RESET + "\n", false); clientGUI.printText("general", YELLOW + "|------------------+---------------+---------------+---------------|" + RESET + "\n", false); clientGUI.printText("general", YELLOW + "| " + RESET + BOLD + WHITE + "Total Casts " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRtotal_habo_cast + " " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRPtotal_habo_cast + " " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRStotal_habo_cast + " " + RESET + YELLOW + "|" + RESET + "\n", false); clientGUI.printText("general", YELLOW + "| " + RESET + BOLD + WHITE + "Successful Casts " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRhabo_successful + " " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRPhabo_successful + " " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRShabo_successful + " " + RESET + YELLOW + "|" + RESET + "\n", false); clientGUI.printText("general", YELLOW + "| " + RESET + BOLD + WHITE + "Failed Spells " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRfailed_habo_line + " " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRPfailed_habo_line + " " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRSfailed_habo_line + " " + RESET + YELLOW + "|" + RESET + "\n", false); clientGUI.printText("general", YELLOW + "|------------------+---------------+---------------+---------------|" + RESET + "\n", false); clientGUI.printText("general", YELLOW + "| " + RESET + BOLD + WHITE + "Fail to Reach " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRfail_to_reach_line + " " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRPfail_to_reach_line + " " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRSfail_to_reach_line + " " + RESET + YELLOW + "|" + RESET + "\n", false); clientGUI.printText("general", YELLOW + "| " + RESET + BOLD + WHITE + "Burgle Crit " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRburgle_crit_line + " " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRPburgle_crit_line + " " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRSburgle_crit_line + " " + RESET + YELLOW + "|" + RESET + "\n", false); clientGUI.printText("general", YELLOW + "| " + RESET + BOLD + WHITE + "HABO Essence " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRburgle_crit_ess_line + " " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRPburgle_crit_ess_line + " " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRSburgle_crit_ess_line + " " + RESET + YELLOW + "|" + RESET + "\n", false); clientGUI.printText("general", YELLOW + "| " + RESET + BOLD + WHITE + "HABO Youth " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRburgle_crit_youth_line + " " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRPburgle_crit_youth_line + " " + RESET + YELLOW + "| " + RESET + BOLD + WHITE + STRSburgle_crit_youth_line + " " + RESET + YELLOW + "|" + RESET + "\n", false); clientGUI.printText("general", YELLOW + "+------------------------------------------------------------------+" + RESET + "\n", false); } void help() { // Print a very brief help clientGUI.printText("general", HEADER + BOLD + WHITE + "USEAGE: " + RESET + BOLD + CYAN + "$habo " + RESET + BOLD + WHITE + "will display a chart of tracked HABOs" + RESET + "\n", false); clientGUI.printText("general", HEADER + BOLD + CYAN + " $habo.reset" + RESET + BOLD + WHITE + " will move data from 'This Session' to 'Prev Session'" + RESET + "\n\n", false); clientGUI.printText("general", HEADER + BOLD + WHITE + "The '" + RESET + BOLD + YELLOW + "Historically" + RESET + BOLD + WHITE + "' column is a grand total of all tracked HABOs." + RESET + "\n", false); clientGUI.printText("general", HEADER + BOLD + WHITE + "The '" + RESET + BOLD + YELLOW + "Prev Session" + RESET + BOLD + WHITE + "' column is your last stored session from " + RESET + BOLD + CYAN + "$habo.reset" + RESET + "\n", false); clientGUI.printText("general", HEADER + BOLD + WHITE + "The '" + RESET + BOLD + YELLOW + "This Session" + RESET + BOLD + WHITE + "' column is tracked data from the current session." + RESET + "\n", false); clientGUI.printText("general", HEADER + BOLD + WHITE + "To clear '" + RESET + BOLD + YELLOW + "This Session" + RESET + BOLD + WHITE + "' and move that data to '" + RESET + BOLD + YELLOW + "Prev Session" + RESET + BOLD + WHITE + "' enter " + RESET + BOLD + CYAN + "$habo.reset" + RESET + "\n\n", false); clientGUI.printText("general", HEADER + BOLD + WHITE + "'" + RESET + BOLD + YELLOW + "Failed Spells" + RESET + BOLD + WHITE + "' percentage is number of failed spells / number of total casts." + RESET + "\n", false); clientGUI.printText("general", HEADER + BOLD + WHITE + "'" + RESET + BOLD + YELLOW + "Fail to Reach" + RESET + BOLD + WHITE + "' percentage is number of fail to reach / number of successful casts." + RESET + "\n", false); clientGUI.printText("general", HEADER + BOLD + WHITE + "'" + RESET + BOLD + YELLOW + "Burgle Crit" + RESET + BOLD + WHITE + "' percentage is number of burgle crits / number of successful casts." + RESET + "\n", false); clientGUI.printText("general", HEADER + BOLD + WHITE + "'" + RESET + BOLD + YELLOW + "HABO Essence" + RESET + BOLD + WHITE + "' percentage is number of essence messages / number of burgle crits." + RESET + "\n", false); clientGUI.printText("general", HEADER + BOLD + WHITE + "'" + RESET + BOLD + YELLOW + "HABO Youth" + RESET + BOLD + WHITE + "' percentage is number of youth messages / number of burgle crits." + RESET + "\n", false); } void reset() { // Copy values for current session to previous session and reinitialize current session values clientGUI.printText("general", HEADER + BOLD + YELLOW + "Moving current session data to previous session data. Previous session data" + RESET + "\n", false); clientGUI.printText("general", HEADER + BOLD + YELLOW + "will be overwritten and current session data will be cleared." + RESET + "\n", false); Ptotal_habo_cast = Stotal_habo_cast; Pfail_to_reach = Sfail_to_reach; Pfailed_habo = Sfailed_habo; Pburgle_crit = Sburgle_crit; Pburgle_crit_youth = Sburgle_crit_youth; Pburgle_crit_ess = Sburgle_crit_ess; f = new FileOutputStream(_Path + "/habo_previous.dat", false); p = new PrintStream(f); p.println("Ptotal_habo_cast " + Ptotal_habo_cast); p.println("Pfail_to_reach " + Pfail_to_reach); p.println("Pfailed_habo " + Pfailed_habo); p.println("Pburgle_crit " + Pburgle_crit); p.println("Pburgle_crit_ess " + Pburgle_crit_ess); p.println("Pburgle_crit_youth " + Pburgle_crit_youth); p.close(); f.close(); write_habo_vars(); Stotal_habo_cast = 0; Sfail_to_reach = 0; Sfailed_habo = 0; Sburgle_crit = 0; Sburgle_crit_ess = 0; Sburgle_crit_youth = 0; write_habo_vars(); clientGUI.printText("general", HEADER + BOLD + YELLOW + "...Done" + RESET + "\n", false); } void run() { // Default function (method, I know, I know) that will save variables and call stat function to show chart write_habo_vars(); stat(); }