Results 1 to 5 of 5

Thread: Research: Morning Star Damage Type Frequency

  1. #1

    Default Research: Morning Star Damage Type Frequency

    I wrote a Ruby script to evaluate all my logs for Crush and Puncture criticals while wielding a morning star. Below are the results.

    No code has to be inserted here.

    I've updated the wiki page to reflect a 66.7% Crush Rate and 33.3% Puncture Rate.
    Last edited by Danical; 06-06-2015 at 04:38 AM.

  2. Default

    Ugh, can you write me a script that will search all 7,000 of my logs for ONE tell I can't remember when I got it in the last two years? That would be so awesome, I have no words.

  3. #3

    Default

    Below is what I threw together without the $critical_damage_data hash because it's thousands of lines long. It's not pretty, but it works. You could always use Notepad++ and search your log folder (recursively, if you need) for all lines that match whatever string the TELL has and then look at those. Probably a hell of a lot easier that way if you're not used to writing Ruby. You can use RegEx in the NP++ search if you need.

    Code:
    $data_output_array = Array.new
    $file_output_name = $script_dir + "critical_data_output_" + Time.now.strftime("%Y%m%d%H%M%S") + ".txt"
    files = f_files_collect(YOUR_FOLDER_PATH_STRING_HERE);
    
    def f_files_collect(folder_path)
    	if folder_path[-1, 1] != "/" then
    		folder_path = folder_path + "/"
    	end
    	return Dir[folder_path + "*.txt"]
    end
    
    def f_file_parse(file_path, string_start, string_end)
    	file = File.open(file_path, "r")
    	iterator = 0
    	line_start = 0
    	line_end = 0
    	lines = Array.new
    	begin_collect = false
    	begin_process = false
    	data_hash = Hash.new
    	file.each_line {
    		|line|
    		if line =~ /#{string_start}/ then
    			line_start = iterator
    			begin_collect = true
    		elsif line =~ /#{string_end}/ and line_start > line_end then
    			line_end = iterator
    			begin_collect = false
    			begin_process = true
    		end
    		if begin_collect == true then
    			lines.push(line)
    			next
    		end
    		if begin_process == true then
    			output_hash = Hash.new
    			if !lines.find { |l| l =~ /\.\.\. and hit/ }.nil? then
    				lines.each {
    					|l|
    					if l =~ /^You swing an? ([a-z\-\s]+) at an? ([a-z\-\s]+)/ then
    						output_hash["weapon"] = $1
    						output_hash["target"] = $2
    					elsif l =~ /^  AS\: \+([0-9]+) vs DS\: \+([0-9]+) with AvD\: \+([0-9]+) \+ d100 roll\: \+([0-9]+) \= \+([0-9]+)$/
    						output_hash["attack_strength"] = $1
    						output_hash["defense_strength"] = $2
    						output_hash["attack_vs_defense"] = $3
    						output_hash["die_roll"] = $4
    						output_hash["outcome"] = $5
    					elsif l =~ /\.\.\. and hit for ([0-9]+) points of damage!/
    						output_hash["total_damage"] = $1
    					elsif regex = $critical_damage_data.keys.find { |r| l =~ r }
    						output_hash["damage_type"] = $critical_damage_data[regex]["type"]
    						output_hash["damage_critical"] = $critical_damage_data[regex]["damage"]
    						output_hash["critical_rank"] = $critical_damage_data[regex]["rank"]
    						output_hash["wounds"] = $critical_damage_data[regex]["wounds"]
    					end
    				}
    				$data_output_array.push(output_hash)
    			end
    			begin_process = false
    			lines = Array.new
    		end
    		iterator += 1
    	}
    	file.close
    end
    
    files.each {
    	|file|
    	f_file_parse(file, "You swing", "Roundtime")
    }
    
    File.open($file_output_name, "w") {
    	|file|
    	# header
    	output_string = ""
    	$data_output_array[0].each_key {
    		|key|
    		output_string += key + "\t"
    	}
    	file.puts(output_string[0...-1])
    	# data
    	$data_output_array.each {
    		|data_hash|
    		output_string = ""
    		data_hash.each_value {
    			|val|
    			output_string += val + "\t"
    		}
    		file.puts(output_string[0...-1])
    	}
    }

  4. Default

    Everything I read was just........ Latin.

    If I can do it myself, omg do this please.

    Step 1: Stuff
    Step 2: Stuff
    ~
    ~
    ~
    ~
    ~
    Step 43: FOUND IT WOO!

    PLEASE! Will offer donuts and pie. Not cake. Fuck cake. Cake's a lie.

  5. #5

    Default

    Quote Originally Posted by JackWhisper View Post
    Everything I read was just........ Latin.

    If I can do it myself, omg do this please.

    Step 1: Stuff
    Step 2: Stuff
    ~
    ~
    ~
    ~
    ~
    Step 43: FOUND IT WOO!

    PLEASE! Will offer donuts and pie. Not cake. Fuck cake. Cake's a lie.
    I'm pretty sure we got you sorted out last night/this morning. Let me know if you need any additional help.

Similar Threads

  1. Replies: 8
    Last Post: 08-26-2021, 09:19 PM
  2. Replies: 0
    Last Post: 05-05-2017, 07:32 PM
  3. Replies: 3
    Last Post: 06-16-2013, 06:00 PM
  4. Replies: 2
    Last Post: 07-06-2012, 09:25 AM
  5. Damage Type?
    By Swami71 in forum Game Mechanics
    Replies: 56
    Last Post: 04-06-2009, 11:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •