Jump to content
You need to play a total of 5 battles to post in this section.
keskparane

Keskparane's mods

33 comments in this topic

Recommended Posts

Member
2,254 posts
13,967 battles

kMods.1.0.1.zip

These are the mods that I use. I leave them here for public use.

  • The application only modifies the specific values required in the files and will revert them to default when uninstalled.
  • Very little chance of conflict with other mods. (Provided you don't clean the mods folder which would remove all other mods)
  • The application is readable as a text file if you want to see what is happening and what values get changed.
  • Support for Steam installations.
  • Support for public test installations.
  • Lightweight & lightning fast.

cv.png.30bdfd785084653e5c4e41e1ae5b4e72.png

 

  • CV view - For CV players who want a top down view.
    • Changes all CV views to directly overhead.

 

  • CV zoom - For CV players who want an increase in CV zoom out.
    • Reduces max zoom. (zoom in)
    • Increases min zoom. (zoom out)
    • Decreases zoom steps from 4 to 3.
    • Removes input lag when switching zooms.
    • Increases zoom scroll speeds.

 

  • Port view - For enthusiasts who like to gaze at ships.
    • Expands the zoom ranges in port view.

 

  • Replays - For reliving past glory, or defeat, and post match analysis.
    • Replay files are created each game.

 

  • Ship AA target - For easier AA target selection from ship.
    • Raises the maximum view angle to 89°

 

  • Ship guns - For better alignment of view angles to gun elevation.
    • Lowers some scope angles from -2° to -4°
    • Increases some scope angles from -45° to -40°

 

  • Ship zoom - For better zoom when targeting.
    • Increases maximum zoom.

KMOD_TIMESTAMP=1534405902

Edited by keskparane
Steam bug fix

Share this post


Link to post
Share on other sites
Member
2,254 posts
13,967 battles

version 0.1

- fixed replays which apparently can't be used in the mods folder

- added intro dialog

- improved mod descriptions

- improved scaling of cv zoom mod

Share this post


Link to post
Share on other sites
Member
2,254 posts
13,967 battles

version 0.1.1

- reduced the max zoom of CV Zoom mod

Spoiler

'@description: Keskparane's mods for World of Warships
'@author: keskparane@gmail.com
'@usage: Save this content as a *.vbs script (eg kMods.vbs) file and run.

'@ModCvZoomOut
'@ModReplays
'@ModTrainingRoom
'@ModViewAngles
'@ModMaxFPS

const SCRIPT_NAME = "kMods"
const SCRIPT_VERSION = "0.1.1"
const SCRIPT_TIMESTAMP = 1513398613
set fso = CreateObject("Scripting.FileSystemObject")
set xml = CreateObject("Msxml2.DOMDocument.6.0")
xml.Async = "False"
xml.validateOnParse = false
dim WOWS_ROOT, MODS_ROOT

function BrowseForFolder(message, options)
	set shell = CreateObject("Shell.Application")
	set dir = shell.BrowseForFolder(0, message, options, 0)	
	if dir is nothing then
		BrowseForFolder = ""		
	else 
		BrowseForFolder = dir.Self.Path
	end if	
end function

function Enable(modName, modDesc, modFile, originalFile)	
	response = MsgBox("Enable " & modName & " ?" & vbCrlf & vbCrlf & modDesc, vbYesNo, SCRIPT_NAME)	
	if response = vbYes then
		if not fso.FileExists(modFile) then
			fso.CopyFile originalFile, MODS_ROOT, true
		end if
		Enable = true
	else
		Enable = false
	end if	
end function

function Intro()
	msg = SCRIPT_NAME & " by Keskparane." & vbCrlf
	msg = msg & "Version " & SCRIPT_VERSION & vbCrlf & vbCrlf	
	msg = msg & CHR(149) & " This script will run you through the process of installing" & vbCrlf
	msg = msg & "selected modifications to your World of Warships installation."	
	response = MsgBox(msg, vbOKCancel, SCRIPT_NAME)
	if response <> vbOK then
		WScript.Quit
	end if	
end function

function ScriptExit(msg)
	response = MsgBox(msg, vbInformation, SCRIPT_NAME)
	WScript.Quit
end function

function WriteNonValidXml(filePath, nodePath, value)
	set file = fso.OpenTextFile(filePath, 1)
	lines = Split(file.ReadAll, vbNewLine)	
	file.Close	
	nodes = Split(nodePath, "/")
	parents = uBound(nodes)	
	numLines = uBound(lines)
	node = nodes(parents)	
	lineNum = parent = 0	
	indent = ""
	written = false
	set file = fso.OpenTextFile(filePath, 2)
	for each line in lines
		write = true
		if not written then
			if parent = parents then
				if InStr(line, "</" & nodes(parents - 1) & ">") or InStr(line, "</" & node & ">") then
					file.WriteLine (indent & "<" & node & ">" & value & "</" & node & ">")
					written = true
				end if
				if InStr(line, "<" & node & ">") then write = false			
			elseif InStr(line, "<" & nodes(parent) & ">") then
				parent = parent + 1
				indent = indent & vbTab
			end if
		end if
		if write then
			if lineNum < numLines then
				file.WriteLine line
			else
				file.Write line
			end if
		end if
		lineNum = lineNum + 1		
	next
	file.Close
end function

function LocateWowsRoot()
	do
		WOWS_ROOT = BrowseForFolder("Locate the World of Warships folder", &H200) & "\"
		filePath = WOWS_ROOT & "WorldOfWarships.exe"	
		if fso.FileExists(filePath) then
			exit do			
		else			
			response = MsgBox("Could not locate World Of Warships in " & WOWS_ROOT, vbRetryCancel, SCRIPT_NAME)
			if response <> vbRetry then ScriptExit("Exiting script.")
		end if		
	loop
end function

function LocateModsRoot()
	modsPath = WOWS_ROOT & "res_mods\"
	dim version
	for each folder in fso.GetFolder(modsPath).SubFolders
		version = folder.name
	next
	if not IsEmpty(version) then
		MODS_ROOT = modsPath & version & "\"
		msg = "Installing mods for version " & version
		set modsFolder = fso.GetFolder(modsPath & version)
		if modsFolder.Files.Count > 0 or modsFolder.SubFolders.Count > 0 then		
			response = MsgBox(msg & vbCrlf & "Clean the mods folder? (Recommended)", vbYesNoCancel, SCRIPT_NAME)
			if response = vbYes then 
				fso.DeleteFile(MODS_ROOT & "*"), true
				fso.DeleteFolder(MODS_ROOT & "*"), true
			end if
		else 
			response = MsgBox(msg, vbOKCancel, SCRIPT_NAME)
		end if
		if response = vbCancel then
			ScriptExit("Action canceled. Exiting script.")
		else
			exit function
		end if		
	end if
	ScriptExit("Unable to locate a mods folder. Exiting script.")
end function

function ModCvZoomOut()
	modName = "CV Zoom"
	modDesc = CHR(149) & " Increases the maximum CV zoom."
	modDesc = modDesc & vbCrlf & CHR(149) & " Changes the CV views to all look straight down."
	modDesc = modDesc & vbCrlf & CHR(149) & " Evens out the graduations between zoom steps."	
	modFile = "camerasConsumer.xml"
	modDir = WOWS_ROOT & "res\"		
	modNode = "//modes/airplane/states/state"
	modNode2 = "//modes/airplane/barrierKey"	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then
				set keyNode = node.selectSingleNode("key")		
				select case keyNode.text
					case 0						
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 100
						node.selectSingleNode("cursorSensitivityCoef").text = 4
						node.selectSingleNode("keysSensitivityCoef").text = 4
					case 30
						node.selectSingleNode("key").text = 33
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 160
						node.selectSingleNode("cursorSensitivityCoef").text = 5
						node.selectSingleNode("keysSensitivityCoef").text = 5
						set newNode = xml.createElement("ignoreTerrain")
						newNode.text = 1
						node.appendChild(newNode)
					case 70
						node.selectSingleNode("key").text = 66
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 270
						node.selectSingleNode("cursorSensitivityCoef").text = 7
						node.selectSingleNode("keysSensitivityCoef").text = 7
						set newNode = xml.createElement("ignoreTerrain")
						newNode.text = 1
						node.appendChild(newNode)
					case 100
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 510
						node.selectSingleNode("cursorSensitivityCoef").text = 7
						node.selectSingleNode("keysSensitivityCoef").text = 7
						set newNode = xml.createElement("ignoreTerrain")
						newNode.text = 1
						node.appendChild(newNode)
				end select
			end if
		next		
		set nodes = xml.selectNodes(modNode2)		
		for each node in nodes	
			select case node.text
				case 30
					node.text = 33
				case 70
					node.text = 66
			end select
		next		
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")			
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("pitch").text = -45
						node.selectSingleNode("lead").text = 60
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
					case 33
						node.selectSingleNode("key").text = 30
						node.selectSingleNode("pitch").text = -60
						node.selectSingleNode("lead").text = 102
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
						node.removeChild(node.selectSingleNode("ignoreTerrain"))
					case 66
						node.selectSingleNode("key").text = 70
						node.selectSingleNode("pitch").text = -80
						node.selectSingleNode("lead").text = 158
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
						node.removeChild(node.selectSingleNode("ignoreTerrain"))
					case 100
						node.selectSingleNode("pitch").text = -89
						node.selectSingleNode("lead").text = 200
						node.selectSingleNode("cursorSensitivityCoef").text = 3.5
						node.selectSingleNode("keysSensitivityCoef").text = 4.5
						set ignoreTerrain = node.selectSingleNode("ignoreTerrain")
						if not ignoreTerrain is nothing then node.removeChild(ignoreTerrain)
				end select
			end if
		next
		set nodes = xml.selectNodes(modNode2)		
		for each node in nodes	
			select case node.text
				case 33
					node.text = 30
				case 66
					node.text = 70
			end select
		next				
	end if
end function

function ModMaxFPS()
	modName = "Max FPS"
	modDesc = CHR(149) & " Set the maximum FPS value."
	modFile = "engine_config.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "maxFrameRate"
	modPrompt = "Enter FPS limit. [1 - 300]"
	invalidMsg = "Invalid entry. Try again."	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set maxFrameRate = xml.selectSingleNode("//" & modNode)
		input = InputBox(modPrompt, SCRIPT_NAME, maxFrameRate.text)
		do			
			if IsEmpty(input) then
				exit do
			elseif input > 0 and input < 301 then
				maxFrameRate.text = input
				xml.Save MODS_ROOT & modFile
				exit do
			else
				input = InputBox(invalidMsg & vbCrlf & vbCrlf & modPrompt, SCRIPT_NAME, maxFrameRate.text)							
			end if
		loop
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile
		xml.selectSingleNode("//" & modNode).text = 75
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModReplays()
	modName = "Replays"
	modDesc = CHR(149) & " When enabled replay files are created each game."	
	modFile = "preferences.xml"	
	modNode = "root/scriptsPreferences/isReplayEnabled"
	if Enable(modName, modDesc, WOWS_ROOT & modFile, WOWS_ROOT & modFile) then
		WriteNonValidXml WOWS_ROOT & modFile, modNode, "true"
	elseif fso.FileExists(WOWS_ROOT & modFile) then
		WriteNonValidXml WOWS_ROOT & modFile, modNode, "false"
	end if	
end function

function ModTrainingRoom()	
	modName = "Training Room"
	modDesc = CHR(149) & " Enables the training room as a battle type."	
	modFile = "scripts_config.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//disableTrainingRoom"
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		xml.selectSingleNode(modNode).text = "false"	
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile
		xml.selectSingleNode(modNode).text = "true"	
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModViewAngles()
	modName = "View Angles"
	modDesc = CHR(149) & " Lowers the min view angle when zoomed to -4" & Chr(176) & " so turret"
	modDesc = modDesc & vbCrlf & "aim is not restricted with close targets."
	modDesc = modDesc & vbCrlf & CHR(149) & " Increases the max view angle when not zoomed to 89" & Chr(176) & " to"
	modDesc = modDesc & vbCrlf & "make selecting an AA target a little easier."	
	modFile = "camerasConsumer.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//modes/snake_tail/states/state"	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then			
				select case keyNode.text
					case 0
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 25
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 65
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 100
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 120
						node.selectSingleNode("minPitch").text = -20
						node.selectSingleNode("maxPitch").text = 89
					case 180
						node.selectSingleNode("minPitch").text = -40
						node.selectSingleNode("maxPitch").text = 89
				end select
			end if
		next		
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")	
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("minPitch").text = -2
						node.selectSingleNode("maxPitch").text = 20
					case 25
						node.selectSingleNode("minPitch").text = -2
						node.selectSingleNode("maxPitch").text = 20
					case 65
						node.selectSingleNode("minPitch").text = -10
						node.selectSingleNode("maxPitch").text = 20
					case 100
						node.selectSingleNode("minPitch").text = -10
						node.selectSingleNode("maxPitch").text = 20
					case 120
						node.selectSingleNode("minPitch").text = -20
						node.selectSingleNode("maxPitch").text = 30
					case 180
						node.selectSingleNode("minPitch").text = -45
						node.selectSingleNode("maxPitch").text = 35
				end select
			end if
		next		
		xml.Save MODS_ROOT & modFile
	end if
end function

Intro()
LocateWowsRoot()
LocateModsRoot()
ModMaxFPS()
ModReplays()
ModTrainingRoom()
ModViewAngles()
ModCvZoomOut()
ScriptExit(SCRIPT_NAME & " finished.")

 

 

Edited by keskparane

Share this post


Link to post
Share on other sites
Member
2,254 posts
13,967 battles

version 0.1.2.0

- added port view mod

Spoiler

'@description: Keskparane's mods for World of Warships
'@author: keskparane@gmail.com
'@usage: Save this content as a *.vbs script (eg kMods.vbs) file and run.

'@ModCvZoomOut
'@ModReplays
'@ModTrainingRoom
'@ModViewAngles
'@ModPortViewAngles
'@ModMaxFPS

const SCRIPT_NAME = "kMods"
const SCRIPT_VERSION = "0.1.2.0"
const SCRIPT_TIMESTAMP = 1513722552
set fso = CreateObject("Scripting.FileSystemObject")
set xml = CreateObject("Msxml2.DOMDocument.6.0")
xml.Async = "False"
xml.validateOnParse = false
dim WOWS_ROOT, MODS_ROOT

function BrowseForFolder(message, options)
	set shell = CreateObject("Shell.Application")
	set dir = shell.BrowseForFolder(0, message, options, 0)	
	if dir is nothing then
		BrowseForFolder = ""		
	else 
		BrowseForFolder = dir.Self.Path
	end if	
end function

function Enable(modName, modDesc, modFile, originalFile)	
	response = MsgBox("Enable " & modName & " ?" & vbCrlf & vbCrlf & modDesc, vbYesNo, SCRIPT_NAME)	
	if response = vbYes then
		if not fso.FileExists(modFile) then
			fso.CopyFile originalFile, MODS_ROOT, true
		end if
		Enable = true
	else
		Enable = false
	end if	
end function

function Intro()
	msg = SCRIPT_NAME & " by Keskparane." & vbCrlf
	msg = msg & "Version " & SCRIPT_VERSION & vbCrlf & vbCrlf	
	msg = msg & CHR(149) & " This script will run you through the process of installing" & vbCrlf
	msg = msg & "selected modifications to your World of Warships installation."	
	response = MsgBox(msg, vbOKCancel, SCRIPT_NAME)
	if response <> vbOK then
		WScript.Quit
	end if	
end function

function ScriptExit(msg)
	response = MsgBox(msg, vbInformation, SCRIPT_NAME)
	WScript.Quit
end function

function WriteNonValidXml(filePath, nodePath, value)
	set file = fso.OpenTextFile(filePath, 1)
	lines = Split(file.ReadAll, vbNewLine)	
	file.Close	
	nodes = Split(nodePath, "/")
	parents = uBound(nodes)	
	numLines = uBound(lines)
	node = nodes(parents)	
	lineNum = parent = 0	
	indent = ""
	written = false
	set file = fso.OpenTextFile(filePath, 2)
	for each line in lines
		write = true
		if not written then
			if parent = parents then
				if InStr(line, "</" & nodes(parents - 1) & ">") or InStr(line, "</" & node & ">") then
					file.WriteLine (indent & "<" & node & ">" & value & "</" & node & ">")
					written = true
				end if
				if InStr(line, "<" & node & ">") then write = false			
			elseif InStr(line, "<" & nodes(parent) & ">") then
				parent = parent + 1
				indent = indent & vbTab
			end if
		end if
		if write then
			if lineNum < numLines then
				file.WriteLine line
			else
				file.Write line
			end if
		end if
		lineNum = lineNum + 1		
	next
	file.Close
end function

function LocateWowsRoot()
	do
		WOWS_ROOT = BrowseForFolder("Locate the World of Warships folder", &H200) & "\"
		filePath = WOWS_ROOT & "WorldOfWarships.exe"	
		if fso.FileExists(filePath) then
			exit do			
		else			
			response = MsgBox("Could not locate World Of Warships in " & WOWS_ROOT, vbRetryCancel, SCRIPT_NAME)
			if response <> vbRetry then ScriptExit("Exiting script.")
		end if		
	loop
end function

function LocateModsRoot()
	modsPath = WOWS_ROOT & "res_mods\"
	dim version
	for each folder in fso.GetFolder(modsPath).SubFolders
		version = folder.name
	next
	if not IsEmpty(version) then
		MODS_ROOT = modsPath & version & "\"
		msg = "Installing mods for version " & version
		set modsFolder = fso.GetFolder(modsPath & version)
		if modsFolder.Files.Count > 0 or modsFolder.SubFolders.Count > 0 then		
			response = MsgBox(msg & vbCrlf & "Clean the mods folder? (Recommended)", vbYesNoCancel, SCRIPT_NAME)
			if response = vbYes then 
				fso.DeleteFile(MODS_ROOT & "*"), true
				fso.DeleteFolder(MODS_ROOT & "*"), true
			end if
		else 
			response = MsgBox(msg, vbOKCancel, SCRIPT_NAME)
		end if
		if response = vbCancel then
			ScriptExit("Action canceled. Exiting script.")
		else
			exit function
		end if		
	end if
	ScriptExit("Unable to locate a mods folder. Exiting script.")
end function

function ModCvZoomOut()
	modName = "CV Zoom"
	modDesc = CHR(149) & " Increases the maximum CV zoom."
	modDesc = modDesc & vbCrlf & CHR(149) & " Changes the CV views to all look straight down."
	modDesc = modDesc & vbCrlf & CHR(149) & " Evens out the graduations between zoom steps."	
	modFile = "camerasConsumer.xml"
	modDir = WOWS_ROOT & "res\"		
	modNode = "//modes/airplane/states/state"
	modNode2 = "//modes/airplane/barrierKey"	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then
				set keyNode = node.selectSingleNode("key")		
				select case keyNode.text
					case 0						
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 100
						node.selectSingleNode("cursorSensitivityCoef").text = 4
						node.selectSingleNode("keysSensitivityCoef").text = 4
					case 30
						node.selectSingleNode("key").text = 33
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 160
						node.selectSingleNode("cursorSensitivityCoef").text = 5
						node.selectSingleNode("keysSensitivityCoef").text = 5
						set ignoreTerrain = xml.createElement("ignoreTerrain")
						ignoreTerrain.text = 1
						node.appendChild(ignoreTerrain)
					case 70
						node.selectSingleNode("key").text = 66
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 270
						node.selectSingleNode("cursorSensitivityCoef").text = 7
						node.selectSingleNode("keysSensitivityCoef").text = 7
						set ignoreTerrain = xml.createElement("ignoreTerrain")
						ignoreTerrain.text = 1
						node.appendChild(ignoreTerrain)
					case 100
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 510
						node.selectSingleNode("cursorSensitivityCoef").text = 7
						node.selectSingleNode("keysSensitivityCoef").text = 7
						set ignoreTerrain = xml.createElement("ignoreTerrain")
						ignoreTerrain.text = 1
						node.appendChild(ignoreTerrain)
				end select
			end if
		next		
		set nodes = xml.selectNodes(modNode2)		
		for each node in nodes	
			select case node.text
				case 30
					node.text = 33
				case 70
					node.text = 66
			end select
		next		
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")			
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("pitch").text = -45
						node.selectSingleNode("lead").text = 60
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
					case 33
						node.selectSingleNode("key").text = 30
						node.selectSingleNode("pitch").text = -60
						node.selectSingleNode("lead").text = 102
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
						node.removeChild(node.selectSingleNode("ignoreTerrain"))
					case 66
						node.selectSingleNode("key").text = 70
						node.selectSingleNode("pitch").text = -80
						node.selectSingleNode("lead").text = 158
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
						node.removeChild(node.selectSingleNode("ignoreTerrain"))
					case 100
						node.selectSingleNode("pitch").text = -89
						node.selectSingleNode("lead").text = 200
						node.selectSingleNode("cursorSensitivityCoef").text = 3.5
						node.selectSingleNode("keysSensitivityCoef").text = 4.5
						set ignoreTerrain = node.selectSingleNode("ignoreTerrain")
						if not ignoreTerrain is nothing then node.removeChild(ignoreTerrain)
				end select
			end if
		next
		set nodes = xml.selectNodes(modNode2)		
		for each node in nodes	
			select case node.text
				case 33
					node.text = 30
				case 66
					node.text = 70
			end select
		next				
	end if
end function

function ModMaxFPS()
	modName = "Max FPS"
	modDesc = CHR(149) & " Set the maximum FPS value."
	modFile = "engine_config.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "maxFrameRate"
	modPrompt = "Enter FPS limit. [1 - 300]"
	invalidMsg = "Invalid entry. Try again."	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set maxFrameRate = xml.selectSingleNode("//" & modNode)
		input = InputBox(modPrompt, SCRIPT_NAME, maxFrameRate.text)
		do			
			if IsEmpty(input) then
				exit do
			elseif input > 0 and input < 301 then
				maxFrameRate.text = input
				xml.Save MODS_ROOT & modFile
				exit do
			else
				input = InputBox(invalidMsg & vbCrlf & vbCrlf & modPrompt, SCRIPT_NAME, maxFrameRate.text)							
			end if
		loop
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile
		xml.selectSingleNode("//" & modNode).text = 75
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModReplays()
	modName = "Replays"
	modDesc = CHR(149) & " When enabled replay files are created each game."	
	modFile = "preferences.xml"	
	modNode = "root/scriptsPreferences/isReplayEnabled"
	if Enable(modName, modDesc, WOWS_ROOT & modFile, WOWS_ROOT & modFile) then
		WriteNonValidXml WOWS_ROOT & modFile, modNode, "true"
	elseif fso.FileExists(WOWS_ROOT & modFile) then
		WriteNonValidXml WOWS_ROOT & modFile, modNode, "false"
	end if	
end function

function ModTrainingRoom()	
	modName = "Training Room"
	modDesc = CHR(149) & " Enables the training room as a battle type."	
	modFile = "scripts_config.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//disableTrainingRoom"
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		xml.selectSingleNode(modNode).text = "false"	
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile
		xml.selectSingleNode(modNode).text = "true"	
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModViewAngles()
	modName = "View Angles"
	modDesc = CHR(149) & " Lowers the min view angle when zoomed to -4" & Chr(176) & " so turret"
	modDesc = modDesc & vbCrlf & "aim is not restricted with close targets."
	modDesc = modDesc & vbCrlf & CHR(149) & " Increases the max view angle when not zoomed to 89" & Chr(176) & " to"
	modDesc = modDesc & vbCrlf & "make selecting an AA target a little easier."	
	modFile = "camerasConsumer.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//modes/snake_tail/states/state"	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then			
				select case keyNode.text
					case 0
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 25
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 65
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 100
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 120
						node.selectSingleNode("minPitch").text = -20
						node.selectSingleNode("maxPitch").text = 89
					case 180
						node.selectSingleNode("minPitch").text = -40
						node.selectSingleNode("maxPitch").text = 89
				end select
			end if
		next		
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")	
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("minPitch").text = -2
						node.selectSingleNode("maxPitch").text = 20
					case 25
						node.selectSingleNode("minPitch").text = -2
						node.selectSingleNode("maxPitch").text = 20
					case 65
						node.selectSingleNode("minPitch").text = -10
						node.selectSingleNode("maxPitch").text = 20
					case 100
						node.selectSingleNode("minPitch").text = -10
						node.selectSingleNode("maxPitch").text = 20
					case 120
						node.selectSingleNode("minPitch").text = -20
						node.selectSingleNode("maxPitch").text = 30
					case 180
						node.selectSingleNode("minPitch").text = -45
						node.selectSingleNode("maxPitch").text = 35
				end select
			end if
		next		
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModPortViewAngles()
	modName = "Port View Angles"
	modDesc = CHR(149) & " Increases the zoom ranges in port view."
	modDesc = modDesc & vbCrlf & CHR(149) & " Increases the elevation ranges ranges in port view."
	modFile = "camerasConsumer.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//modes/dock/states/state"
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then			
				select case keyNode.text
					case 0
						node.selectSingleNode("lead").text = 0.4
						set maxPitch = node.selectSingleNode("maxPitch")
						if maxPitch is nothing then			
							set maxPitch = xml.createElement("maxPitch")
							node.appendChild(maxPitch)
						end if
						maxPitch.text = 15						
					case 100
						node.selectSingleNode("lead").text = 5
						set pitchInfluenceOnHeight = node.selectSingleNode("pitchInfluenceOnHeight")
						if pitchInfluenceOnHeight is nothing then			
							set pitchInfluenceOnHeight = xml.createElement("pitchInfluenceOnHeight")
							node.appendChild(pitchInfluenceOnHeight)
						end if
						pitchInfluenceOnHeight.text = 15
				end select
			end if
		next
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")	
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("lead").text = 1
						set maxPitch = node.selectSingleNode("maxPitch")
						if not maxPitch is nothing then node.removeChild(maxPitch)					
					case 100
						node.selectSingleNode("lead").text = 3.92
						set pitchInfluenceOnHeight = node.selectSingleNode("pitchInfluenceOnHeight")
						if not pitchInfluenceOnHeight is nothing then node.removeChild(pitchInfluenceOnHeight)
				end select
			end if
		next
		xml.Save MODS_ROOT & modFile
	end if
end function

Intro()
LocateWowsRoot()
LocateModsRoot()
ModMaxFPS()
ModReplays()
ModTrainingRoom()
ModViewAngles()
ModPortViewAngles()
ModCvZoomOut()
ScriptExit(SCRIPT_NAME & " finished.")

 

 

Share this post


Link to post
Share on other sites
Member
2,254 posts
13,967 battles

version 0.1.2.1

- tweaked port view mod so ship is less obscured by carousel

Spoiler

'@description: Keskparane's mods for World of Warships
'@author: keskparane@gmail.com
'@usage: Save this content as a *.vbs script (eg kMods.vbs) file and run.

'@ModCvZoomOut
'@ModReplays
'@ModTrainingRoom
'@ModViewAngles
'@ModPortViewAngles
'@ModMaxFPS

const SCRIPT_NAME = "kMods"
const SCRIPT_VERSION = "0.1.2.1"
const SCRIPT_TIMESTAMP = 1513733468
set fso = CreateObject("Scripting.FileSystemObject")
set xml = CreateObject("Msxml2.DOMDocument.6.0")
xml.Async = "False"
xml.validateOnParse = false
dim WOWS_ROOT, MODS_ROOT

function BrowseForFolder(message, options)
	set shell = CreateObject("Shell.Application")
	set dir = shell.BrowseForFolder(0, message, options, 0)	
	if dir is nothing then
		BrowseForFolder = ""		
	else 
		BrowseForFolder = dir.Self.Path
	end if	
end function

function Enable(modName, modDesc, modFile, originalFile)	
	response = MsgBox("Enable " & modName & " ?" & vbCrlf & vbCrlf & modDesc, vbYesNo, SCRIPT_NAME)	
	if response = vbYes then
		if not fso.FileExists(modFile) then
			fso.CopyFile originalFile, MODS_ROOT, true
		end if
		Enable = true
	else
		Enable = false
	end if	
end function

function Intro()
	msg = SCRIPT_NAME & " by Keskparane." & vbCrlf
	msg = msg & "Version " & SCRIPT_VERSION & vbCrlf & vbCrlf	
	msg = msg & CHR(149) & " This script will run you through the process of installing" & vbCrlf
	msg = msg & "selected modifications to your World of Warships installation."	
	response = MsgBox(msg, vbOKCancel, SCRIPT_NAME)
	if response <> vbOK then
		WScript.Quit
	end if	
end function

function ScriptExit(msg)
	response = MsgBox(msg, vbInformation, SCRIPT_NAME)
	WScript.Quit
end function

function WriteNonValidXml(filePath, nodePath, value)
	set file = fso.OpenTextFile(filePath, 1)
	lines = Split(file.ReadAll, vbNewLine)	
	file.Close	
	nodes = Split(nodePath, "/")
	parents = uBound(nodes)	
	numLines = uBound(lines)
	node = nodes(parents)	
	lineNum = parent = 0	
	indent = ""
	written = false
	set file = fso.OpenTextFile(filePath, 2)
	for each line in lines
		write = true
		if not written then
			if parent = parents then
				if InStr(line, "</" & nodes(parents - 1) & ">") or InStr(line, "</" & node & ">") then
					file.WriteLine (indent & "<" & node & ">" & value & "</" & node & ">")
					written = true
				end if
				if InStr(line, "<" & node & ">") then write = false			
			elseif InStr(line, "<" & nodes(parent) & ">") then
				parent = parent + 1
				indent = indent & vbTab
			end if
		end if
		if write then
			if lineNum < numLines then
				file.WriteLine line
			else
				file.Write line
			end if
		end if
		lineNum = lineNum + 1		
	next
	file.Close
end function

function LocateWowsRoot()
	do
		WOWS_ROOT = BrowseForFolder("Locate the World of Warships folder", &H200) & "\"
		filePath = WOWS_ROOT & "WorldOfWarships.exe"	
		if fso.FileExists(filePath) then
			exit do			
		else			
			response = MsgBox("Could not locate World Of Warships in " & WOWS_ROOT, vbRetryCancel, SCRIPT_NAME)
			if response <> vbRetry then ScriptExit("Exiting script.")
		end if		
	loop
end function

function LocateModsRoot()
	modsPath = WOWS_ROOT & "res_mods\"
	dim version
	for each folder in fso.GetFolder(modsPath).SubFolders
		version = folder.name
	next
	if not IsEmpty(version) then
		MODS_ROOT = modsPath & version & "\"
		msg = "Installing mods for version " & version
		set modsFolder = fso.GetFolder(modsPath & version)
		if modsFolder.Files.Count > 0 or modsFolder.SubFolders.Count > 0 then		
			response = MsgBox(msg & vbCrlf & "Clean the mods folder? (Recommended)", vbYesNoCancel, SCRIPT_NAME)
			if response = vbYes then 
				fso.DeleteFile(MODS_ROOT & "*"), true
				fso.DeleteFolder(MODS_ROOT & "*"), true
			end if
		else 
			response = MsgBox(msg, vbOKCancel, SCRIPT_NAME)
		end if
		if response = vbCancel then
			ScriptExit("Action canceled. Exiting script.")
		else
			exit function
		end if		
	end if
	ScriptExit("Unable to locate a mods folder. Exiting script.")
end function

function ModCvZoomOut()
	modName = "CV Zoom"
	modDesc = CHR(149) & " Increases the maximum CV zoom."
	modDesc = modDesc & vbCrlf & CHR(149) & " Changes the CV views to all look straight down."
	modDesc = modDesc & vbCrlf & CHR(149) & " Evens out the graduations between zoom steps."	
	modFile = "camerasConsumer.xml"
	modDir = WOWS_ROOT & "res\"		
	modNode = "//modes/airplane/states/state"
	modNode2 = "//modes/airplane/barrierKey"	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then
				set keyNode = node.selectSingleNode("key")		
				select case keyNode.text
					case 0						
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 100
						node.selectSingleNode("cursorSensitivityCoef").text = 4
						node.selectSingleNode("keysSensitivityCoef").text = 4
					case 30
						node.selectSingleNode("key").text = 33
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 160
						node.selectSingleNode("cursorSensitivityCoef").text = 5
						node.selectSingleNode("keysSensitivityCoef").text = 5
						set ignoreTerrain = xml.createElement("ignoreTerrain")
						ignoreTerrain.text = 1
						node.appendChild(ignoreTerrain)
					case 70
						node.selectSingleNode("key").text = 66
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 270
						node.selectSingleNode("cursorSensitivityCoef").text = 7
						node.selectSingleNode("keysSensitivityCoef").text = 7
						set ignoreTerrain = xml.createElement("ignoreTerrain")
						ignoreTerrain.text = 1
						node.appendChild(ignoreTerrain)
					case 100
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 510
						node.selectSingleNode("cursorSensitivityCoef").text = 7
						node.selectSingleNode("keysSensitivityCoef").text = 7
						set ignoreTerrain = xml.createElement("ignoreTerrain")
						ignoreTerrain.text = 1
						node.appendChild(ignoreTerrain)
				end select
			end if
		next		
		set nodes = xml.selectNodes(modNode2)		
		for each node in nodes	
			select case node.text
				case 30
					node.text = 33
				case 70
					node.text = 66
			end select
		next		
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")			
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("pitch").text = -45
						node.selectSingleNode("lead").text = 60
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
					case 33
						node.selectSingleNode("key").text = 30
						node.selectSingleNode("pitch").text = -60
						node.selectSingleNode("lead").text = 102
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
						node.removeChild(node.selectSingleNode("ignoreTerrain"))
					case 66
						node.selectSingleNode("key").text = 70
						node.selectSingleNode("pitch").text = -80
						node.selectSingleNode("lead").text = 158
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
						node.removeChild(node.selectSingleNode("ignoreTerrain"))
					case 100
						node.selectSingleNode("pitch").text = -89
						node.selectSingleNode("lead").text = 200
						node.selectSingleNode("cursorSensitivityCoef").text = 3.5
						node.selectSingleNode("keysSensitivityCoef").text = 4.5
						set ignoreTerrain = node.selectSingleNode("ignoreTerrain")
						if not ignoreTerrain is nothing then node.removeChild(ignoreTerrain)
				end select
			end if
		next
		set nodes = xml.selectNodes(modNode2)		
		for each node in nodes	
			select case node.text
				case 33
					node.text = 30
				case 66
					node.text = 70
			end select
		next				
	end if
end function

function ModMaxFPS()
	modName = "Max FPS"
	modDesc = CHR(149) & " Set the maximum FPS value."
	modFile = "engine_config.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "maxFrameRate"
	modPrompt = "Enter FPS limit. [1 - 300]"
	invalidMsg = "Invalid entry. Try again."	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set maxFrameRate = xml.selectSingleNode("//" & modNode)
		input = InputBox(modPrompt, SCRIPT_NAME, maxFrameRate.text)
		do			
			if IsEmpty(input) then
				exit do
			elseif input > 0 and input < 301 then
				maxFrameRate.text = input
				xml.Save MODS_ROOT & modFile
				exit do
			else
				input = InputBox(invalidMsg & vbCrlf & vbCrlf & modPrompt, SCRIPT_NAME, maxFrameRate.text)							
			end if
		loop
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile
		xml.selectSingleNode("//" & modNode).text = 75
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModReplays()
	modName = "Replays"
	modDesc = CHR(149) & " When enabled replay files are created each game."	
	modFile = "preferences.xml"	
	modNode = "root/scriptsPreferences/isReplayEnabled"
	if Enable(modName, modDesc, WOWS_ROOT & modFile, WOWS_ROOT & modFile) then
		WriteNonValidXml WOWS_ROOT & modFile, modNode, "true"
	elseif fso.FileExists(WOWS_ROOT & modFile) then
		WriteNonValidXml WOWS_ROOT & modFile, modNode, "false"
	end if	
end function

function ModTrainingRoom()	
	modName = "Training Room"
	modDesc = CHR(149) & " Enables the training room as a battle type."	
	modFile = "scripts_config.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//disableTrainingRoom"
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		xml.selectSingleNode(modNode).text = "false"	
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile
		xml.selectSingleNode(modNode).text = "true"	
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModViewAngles()
	modName = "View Angles"
	modDesc = CHR(149) & " Lowers the min view angle when zoomed to -4" & Chr(176) & " so turret"
	modDesc = modDesc & vbCrlf & "aim is not restricted with close targets."
	modDesc = modDesc & vbCrlf & CHR(149) & " Increases the max view angle when not zoomed to 89" & Chr(176) & " to"
	modDesc = modDesc & vbCrlf & "make selecting an AA target a little easier."	
	modFile = "camerasConsumer.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//modes/snake_tail/states/state"	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then			
				select case keyNode.text
					case 0
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 25
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 65
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 100
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 120
						node.selectSingleNode("minPitch").text = -20
						node.selectSingleNode("maxPitch").text = 89
					case 180
						node.selectSingleNode("minPitch").text = -40
						node.selectSingleNode("maxPitch").text = 89
				end select
			end if
		next		
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")	
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("minPitch").text = -2
						node.selectSingleNode("maxPitch").text = 20
					case 25
						node.selectSingleNode("minPitch").text = -2
						node.selectSingleNode("maxPitch").text = 20
					case 65
						node.selectSingleNode("minPitch").text = -10
						node.selectSingleNode("maxPitch").text = 20
					case 100
						node.selectSingleNode("minPitch").text = -10
						node.selectSingleNode("maxPitch").text = 20
					case 120
						node.selectSingleNode("minPitch").text = -20
						node.selectSingleNode("maxPitch").text = 30
					case 180
						node.selectSingleNode("minPitch").text = -45
						node.selectSingleNode("maxPitch").text = 35
				end select
			end if
		next		
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModPortViewAngles()
	modName = "Port View Angles"
	modDesc = CHR(149) & " Increases the zoom ranges in port view."
	modDesc = modDesc & vbCrlf & CHR(149) & " Increases the elevation ranges ranges in port view."
	modFile = "camerasConsumer.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//modes/dock/states/state"
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then			
				select case keyNode.text
					case 0
						node.selectSingleNode("lead").text = 0.4
						set maxPitch = node.selectSingleNode("maxPitch")
						if maxPitch is nothing then			
							set maxPitch = xml.createElement("maxPitch")
							node.appendChild(maxPitch)
						end if
						maxPitch.text = 15						
					case 100
						node.selectSingleNode("lead").text = 10
						set pitchInfluenceOnHeight = node.selectSingleNode("pitchInfluenceOnHeight")
						if pitchInfluenceOnHeight is nothing then			
							set pitchInfluenceOnHeight = xml.createElement("pitchInfluenceOnHeight")
							node.appendChild(pitchInfluenceOnHeight)
						end if
						pitchInfluenceOnHeight.text = 15
				end select
			end if
		next
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")	
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("lead").text = 1
						set maxPitch = node.selectSingleNode("maxPitch")
						if not maxPitch is nothing then node.removeChild(maxPitch)					
					case 100
						node.selectSingleNode("lead").text = 3.92
						set pitchInfluenceOnHeight = node.selectSingleNode("pitchInfluenceOnHeight")
						if not pitchInfluenceOnHeight is nothing then node.removeChild(pitchInfluenceOnHeight)
				end select
			end if
		next
		xml.Save MODS_ROOT & modFile
	end if
end function

Intro()
LocateWowsRoot()
LocateModsRoot()
ModMaxFPS()
ModReplays()
ModTrainingRoom()
ModViewAngles()
ModPortViewAngles()
ModCvZoomOut()
ScriptExit(SCRIPT_NAME & " finished.")

 

 

Edited by keskparane
formatting

Share this post


Link to post
Share on other sites
Member
2,254 posts
13,967 battles

version 0.1.3.0

- added ability to check for updates

Spoiler

'@description: Keskparane's mods for World of Warships
'@author: keskparane@gmail.com
'@usage: Save this content as a *.vbs script (eg kMods.vbs) file and run.

'@ModCvZoomOut
'@ModReplays
'@ModTrainingRoom
'@ModViewAngles
'@ModPortViewAngles
'@ModMaxFPS

const SCRIPT_NAME = "kMods"
const SCRIPT_VERSION = "0.1.3.0"
const KMOD_TIMESTAMP = 1513741686
set fso = CreateObject("Scripting.FileSystemObject")
set xml = CreateObject("Msxml2.DOMDocument.6.0")
xml.Async = "False"
xml.validateOnParse = false
dim WOWS_ROOT, MODS_ROOT

function BrowseForFolder(message, options)	
	set shell = CreateObject("Shell.Application")
	set dir = shell.BrowseForFolder(0, message, options, 0)	
	if dir is nothing then
		BrowseForFolder = ""		
	else 
		BrowseForFolder = dir.Self.Path
	end if	
end function

function Enable(modName, modDesc, modFile, originalFile)	
	response = MsgBox("Enable " & modName & " ?" & vbCrlf & vbCrlf & modDesc, vbYesNo, SCRIPT_NAME)	
	if response = vbYes then
		if not fso.FileExists(modFile) then
			fso.CopyFile originalFile, MODS_ROOT, true
		end if
		Enable = true
	else
		Enable = false
	end if	
end function

function Intro()
	msg = SCRIPT_NAME & " by Keskparane." & vbCrlf
	msg = msg & "Version " & SCRIPT_VERSION & vbCrlf & vbCrlf	
	msg = msg & CHR(149) & " This script will run you through the process of installing" & vbCrlf
	msg = msg & "selected modifications to your World of Warships installation." & vbCrlf & vbCrlf
	msg = msg & "Would you like to check for updates?"	
	response = MsgBox(msg, vbYesNoCancel, SCRIPT_NAME)
	if response = vbYes then
		Update()
	elseif response = vbCancel then
		WScript.Quit
	end if	
end function

function Update()
	set http = CreateObject("Msxml2.XmlHttp.6.0")
	modUrl = "https://forum.worldofwarships.asia/topic/29350-keskparanes-mods/"
	http.Open "GET", modUrl, False
	http.Send
	if http.status = "200" then	
		set search = new RegExp
		search.pattern = "KMOD_TIMESTAMP = ([0-9]{10})"
		set matches = search.Execute(http.responseText)
		for each match in matches
			tempstamp = CLng(Right(match, 10))
			if tempstamp > timestamp then timestamp = tempstamp
		next
		if timestamp = KMOD_TIMESTAMP then			
			msg = "You are running the current version."
			response = MsgBox(msg, vbOK, SCRIPT_NAME)
		elseif timestamp > KMOD_TIMESTAMP then			
			msg = "Update available. Would you like to update?" & vbCrlf & vbCrlf
			msg = msg & CHR(149) & " Update will direct your browser to the new script."
			response = MsgBox(msg, vbYesNo, SCRIPT_NAME)
			if response = vbYes then
				set wShell = CreateObject("WScript.Shell")
				wShell.Run modUrl, 9
				WScript.Quit
			end if
		end if
	end if
end function

function ScriptExit(msg)
	response = MsgBox(msg, vbInformation, SCRIPT_NAME)
	WScript.Quit
end function

function WriteNonValidXml(filePath, nodePath, value)
	set file = fso.OpenTextFile(filePath, 1)
	lines = Split(file.ReadAll, vbNewLine)	
	file.Close	
	nodes = Split(nodePath, "/")
	parents = uBound(nodes)	
	numLines = uBound(lines)
	node = nodes(parents)	
	lineNum = parent = 0	
	indent = ""
	written = false
	set file = fso.OpenTextFile(filePath, 2)
	for each line in lines
		write = true
		if not written then
			if parent = parents then
				if InStr(line, "</" & nodes(parents - 1) & ">") or InStr(line, "</" & node & ">") then
					file.WriteLine (indent & "<" & node & ">" & value & "</" & node & ">")
					written = true
				end if
				if InStr(line, "<" & node & ">") then write = false			
			elseif InStr(line, "<" & nodes(parent) & ">") then
				parent = parent + 1
				indent = indent & vbTab
			end if
		end if
		if write then
			if lineNum < numLines then
				file.WriteLine line
			else
				file.Write line
			end if
		end if
		lineNum = lineNum + 1		
	next
	file.Close
end function

function LocateWowsRoot()
	do
		WOWS_ROOT = BrowseForFolder("Locate the World of Warships folder", &H200) & "\"
		filePath = WOWS_ROOT & "WorldOfWarships.exe"	
		if fso.FileExists(filePath) then
			exit do			
		else			
			response = MsgBox("Could not locate World Of Warships in " & WOWS_ROOT, vbRetryCancel, SCRIPT_NAME)
			if response <> vbRetry then ScriptExit("Exiting script.")
		end if		
	loop
end function

function LocateModsRoot()
	modsPath = WOWS_ROOT & "res_mods\"
	dim version
	for each folder in fso.GetFolder(modsPath).SubFolders
		version = folder.name
	next
	if not IsEmpty(version) then
		MODS_ROOT = modsPath & version & "\"
		msg = "Installing mods for version " & version
		set modsFolder = fso.GetFolder(modsPath & version)
		if modsFolder.Files.Count > 0 or modsFolder.SubFolders.Count > 0 then		
			response = MsgBox(msg & vbCrlf & "Clean the mods folder? (Recommended)", vbYesNoCancel, SCRIPT_NAME)
			if response = vbYes then 
				fso.DeleteFile(MODS_ROOT & "*"), true
				fso.DeleteFolder(MODS_ROOT & "*"), true
			end if
		else 
			response = MsgBox(msg, vbOKCancel, SCRIPT_NAME)
		end if
		if response = vbCancel then
			ScriptExit("Action canceled. Exiting script.")
		else
			exit function
		end if		
	end if
	ScriptExit("Unable to locate a mods folder. Exiting script.")
end function

function ModCvZoomOut()
	modName = "CV Zoom"
	modDesc = CHR(149) & " Increases the maximum CV zoom."
	modDesc = modDesc & vbCrlf & CHR(149) & " Changes the CV views to all look straight down."
	modDesc = modDesc & vbCrlf & CHR(149) & " Evens out the graduations between zoom steps."	
	modFile = "camerasConsumer.xml"
	modDir = WOWS_ROOT & "res\"		
	modNode = "//modes/airplane/states/state"
	modNode2 = "//modes/airplane/barrierKey"	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then
				set keyNode = node.selectSingleNode("key")		
				select case keyNode.text
					case 0						
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 100
						node.selectSingleNode("cursorSensitivityCoef").text = 4
						node.selectSingleNode("keysSensitivityCoef").text = 4
					case 30
						node.selectSingleNode("key").text = 33
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 160
						node.selectSingleNode("cursorSensitivityCoef").text = 5
						node.selectSingleNode("keysSensitivityCoef").text = 5
						set ignoreTerrain = xml.createElement("ignoreTerrain")
						ignoreTerrain.text = 1
						node.appendChild(ignoreTerrain)
					case 70
						node.selectSingleNode("key").text = 66
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 270
						node.selectSingleNode("cursorSensitivityCoef").text = 7
						node.selectSingleNode("keysSensitivityCoef").text = 7
						set ignoreTerrain = xml.createElement("ignoreTerrain")
						ignoreTerrain.text = 1
						node.appendChild(ignoreTerrain)
					case 100
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 510
						node.selectSingleNode("cursorSensitivityCoef").text = 7
						node.selectSingleNode("keysSensitivityCoef").text = 7
						set ignoreTerrain = xml.createElement("ignoreTerrain")
						ignoreTerrain.text = 1
						node.appendChild(ignoreTerrain)
				end select
			end if
		next		
		set nodes = xml.selectNodes(modNode2)		
		for each node in nodes	
			select case node.text
				case 30
					node.text = 33
				case 70
					node.text = 66
			end select
		next		
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")			
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("pitch").text = -45
						node.selectSingleNode("lead").text = 60
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
					case 33
						node.selectSingleNode("key").text = 30
						node.selectSingleNode("pitch").text = -60
						node.selectSingleNode("lead").text = 102
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
						node.removeChild(node.selectSingleNode("ignoreTerrain"))
					case 66
						node.selectSingleNode("key").text = 70
						node.selectSingleNode("pitch").text = -80
						node.selectSingleNode("lead").text = 158
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
						node.removeChild(node.selectSingleNode("ignoreTerrain"))
					case 100
						node.selectSingleNode("pitch").text = -89
						node.selectSingleNode("lead").text = 200
						node.selectSingleNode("cursorSensitivityCoef").text = 3.5
						node.selectSingleNode("keysSensitivityCoef").text = 4.5
						set ignoreTerrain = node.selectSingleNode("ignoreTerrain")
						if not ignoreTerrain is nothing then node.removeChild(ignoreTerrain)
				end select
			end if
		next
		set nodes = xml.selectNodes(modNode2)		
		for each node in nodes	
			select case node.text
				case 33
					node.text = 30
				case 66
					node.text = 70
			end select
		next				
	end if
end function

function ModMaxFPS()
	modName = "Max FPS"
	modDesc = CHR(149) & " Set the maximum FPS value."
	modFile = "engine_config.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "maxFrameRate"
	modPrompt = "Enter FPS limit. [1 - 300]"
	invalidMsg = "Invalid entry. Try again."	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set maxFrameRate = xml.selectSingleNode("//" & modNode)
		input = InputBox(modPrompt, SCRIPT_NAME, maxFrameRate.text)
		do			
			if IsEmpty(input) then
				exit do
			elseif input > 0 and input < 301 then
				maxFrameRate.text = input
				xml.Save MODS_ROOT & modFile
				exit do
			else
				input = InputBox(invalidMsg & vbCrlf & vbCrlf & modPrompt, SCRIPT_NAME, maxFrameRate.text)							
			end if
		loop
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile
		xml.selectSingleNode("//" & modNode).text = 75
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModReplays()
	modName = "Replays"
	modDesc = CHR(149) & " When enabled replay files are created each game."	
	modFile = "preferences.xml"	
	modNode = "root/scriptsPreferences/isReplayEnabled"
	if Enable(modName, modDesc, WOWS_ROOT & modFile, WOWS_ROOT & modFile) then
		WriteNonValidXml WOWS_ROOT & modFile, modNode, "true"
	elseif fso.FileExists(WOWS_ROOT & modFile) then
		WriteNonValidXml WOWS_ROOT & modFile, modNode, "false"
	end if	
end function

function ModTrainingRoom()	
	modName = "Training Room"
	modDesc = CHR(149) & " Enables the training room as a battle type."	
	modFile = "scripts_config.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//disableTrainingRoom"
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		xml.selectSingleNode(modNode).text = "false"	
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile
		xml.selectSingleNode(modNode).text = "true"	
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModViewAngles()
	modName = "View Angles"
	modDesc = CHR(149) & " Lowers the min view angle when zoomed to -4" & Chr(176) & " so turret"
	modDesc = modDesc & vbCrlf & "aim is not restricted with close targets."
	modDesc = modDesc & vbCrlf & CHR(149) & " Increases the max view angle when not zoomed to 89" & Chr(176) & " to"
	modDesc = modDesc & vbCrlf & "make selecting an AA target a little easier."	
	modFile = "camerasConsumer.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//modes/snake_tail/states/state"	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then			
				select case keyNode.text
					case 0
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 25
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 65
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 100
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 120
						node.selectSingleNode("minPitch").text = -20
						node.selectSingleNode("maxPitch").text = 89
					case 180
						node.selectSingleNode("minPitch").text = -40
						node.selectSingleNode("maxPitch").text = 89
				end select
			end if
		next		
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")	
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("minPitch").text = -2
						node.selectSingleNode("maxPitch").text = 20
					case 25
						node.selectSingleNode("minPitch").text = -2
						node.selectSingleNode("maxPitch").text = 20
					case 65
						node.selectSingleNode("minPitch").text = -10
						node.selectSingleNode("maxPitch").text = 20
					case 100
						node.selectSingleNode("minPitch").text = -10
						node.selectSingleNode("maxPitch").text = 20
					case 120
						node.selectSingleNode("minPitch").text = -20
						node.selectSingleNode("maxPitch").text = 30
					case 180
						node.selectSingleNode("minPitch").text = -45
						node.selectSingleNode("maxPitch").text = 35
				end select
			end if
		next		
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModPortViewAngles()
	modName = "Port View Angles"
	modDesc = CHR(149) & " Increases the zoom ranges in port view."
	modDesc = modDesc & vbCrlf & CHR(149) & " Increases the elevation ranges ranges in port view."
	modFile = "camerasConsumer.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//modes/dock/states/state"
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then			
				select case keyNode.text
					case 0
						node.selectSingleNode("lead").text = 0.4
						set maxPitch = node.selectSingleNode("maxPitch")
						if maxPitch is nothing then			
							set maxPitch = xml.createElement("maxPitch")
							node.appendChild(maxPitch)
						end if
						maxPitch.text = 15						
					case 100
						node.selectSingleNode("lead").text = 10
						set pitchInfluenceOnHeight = node.selectSingleNode("pitchInfluenceOnHeight")
						if pitchInfluenceOnHeight is nothing then			
							set pitchInfluenceOnHeight = xml.createElement("pitchInfluenceOnHeight")
							node.appendChild(pitchInfluenceOnHeight)
						end if
						pitchInfluenceOnHeight.text = 15
				end select
			end if
		next
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")	
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("lead").text = 1
						set maxPitch = node.selectSingleNode("maxPitch")
						if not maxPitch is nothing then node.removeChild(maxPitch)					
					case 100
						node.selectSingleNode("lead").text = 3.92
						set pitchInfluenceOnHeight = node.selectSingleNode("pitchInfluenceOnHeight")
						if not pitchInfluenceOnHeight is nothing then node.removeChild(pitchInfluenceOnHeight)
				end select
			end if
		next
		xml.Save MODS_ROOT & modFile
	end if
end function

Intro()
LocateWowsRoot()
LocateModsRoot()
ModMaxFPS()
ModReplays()
ModTrainingRoom()
ModViewAngles()
ModPortViewAngles()
ModCvZoomOut()
ScriptExit(SCRIPT_NAME & " finished.")

 

 

Edited by keskparane

Share this post


Link to post
Share on other sites
Member
2,254 posts
13,967 battles

version 0.1.3.1

- further tweaks to port view

Spoiler

'@description: Keskparane's mods for World of Warships
'@author: keskparane@gmail.com
'@usage: Save this content as a *.vbs script (eg kMods.vbs) file and run.

'@ModCvZoomOut
'@ModReplays
'@ModTrainingRoom
'@ModViewAngles
'@ModPortViewAngles
'@ModMaxFPS

const SCRIPT_NAME = "kMods"
const SCRIPT_VERSION = "0.1.3.1"
const KMOD_TIMESTAMP = 1513756826
set fso = CreateObject("Scripting.FileSystemObject")
set xml = CreateObject("Msxml2.DOMDocument.6.0")
xml.Async = "False"
xml.validateOnParse = false
dim WOWS_ROOT, MODS_ROOT

function BrowseForFolder(message, options)	
	set shell = CreateObject("Shell.Application")
	set dir = shell.BrowseForFolder(0, message, options, 0)	
	if dir is nothing then
		BrowseForFolder = ""		
	else 
		BrowseForFolder = dir.Self.Path
	end if	
end function

function Enable(modName, modDesc, modFile, originalFile)	
	response = MsgBox("Enable " & modName & " ?" & vbCrlf & vbCrlf & modDesc, vbYesNo, SCRIPT_NAME)	
	if response = vbYes then
		if not fso.FileExists(modFile) then
			fso.CopyFile originalFile, MODS_ROOT, true
		end if
		Enable = true
	else
		Enable = false
	end if	
end function

function Intro()
	msg = SCRIPT_NAME & " by Keskparane." & vbCrlf
	msg = msg & "Version " & SCRIPT_VERSION & vbCrlf & vbCrlf	
	msg = msg & CHR(149) & " This script will run you through the process of installing" & vbCrlf
	msg = msg & "selected modifications to your World of Warships installation." & vbCrlf & vbCrlf
	msg = msg & "Would you like to check for updates?"	
	response = MsgBox(msg, vbYesNoCancel, SCRIPT_NAME)
	if response = vbYes then
		Update()
	elseif response = vbCancel then
		WScript.Quit
	end if	
end function

function Update()
	set http = CreateObject("Msxml2.XmlHttp.6.0")
	modUrl = "https://forum.worldofwarships.asia/topic/29350-keskparanes-mods/"
	http.Open "GET", modUrl, False
	http.Send
	if http.status = "200" then	
		set search = new RegExp
		search.pattern = "KMOD_TIMESTAMP = ([0-9]{10})"
		set matches = search.Execute(http.responseText)
		for each match in matches
			tempstamp = CLng(Right(match, 10))
			if tempstamp > timestamp then timestamp = tempstamp
		next
		if timestamp = KMOD_TIMESTAMP then			
			msg = "You are running the current version."
			response = MsgBox(msg, vbOK, SCRIPT_NAME)
		elseif timestamp > KMOD_TIMESTAMP then			
			msg = "Update available. Would you like to update?" & vbCrlf & vbCrlf
			msg = msg & CHR(149) & " Update will direct your browser to the new script."
			response = MsgBox(msg, vbYesNo, SCRIPT_NAME)
			if response = vbYes then
				set wShell = CreateObject("WScript.Shell")
				wShell.Run modUrl, 9
				WScript.Quit
			end if
		end if
	end if
end function

function ScriptExit(msg)
	response = MsgBox(msg, vbInformation, SCRIPT_NAME)
	WScript.Quit
end function

function WriteNonValidXml(filePath, nodePath, value)
	set file = fso.OpenTextFile(filePath, 1)
	lines = Split(file.ReadAll, vbNewLine)	
	file.Close	
	nodes = Split(nodePath, "/")
	parents = uBound(nodes)	
	numLines = uBound(lines)
	node = nodes(parents)	
	lineNum = parent = 0	
	indent = ""
	written = false
	set file = fso.OpenTextFile(filePath, 2)
	for each line in lines
		write = true
		if not written then
			if parent = parents then
				if InStr(line, "</" & nodes(parents - 1) & ">") or InStr(line, "</" & node & ">") then
					file.WriteLine (indent & "<" & node & ">" & value & "</" & node & ">")
					written = true
				end if
				if InStr(line, "<" & node & ">") then write = false			
			elseif InStr(line, "<" & nodes(parent) & ">") then
				parent = parent + 1
				indent = indent & vbTab
			end if
		end if
		if write then
			if lineNum < numLines then
				file.WriteLine line
			else
				file.Write line
			end if
		end if
		lineNum = lineNum + 1		
	next
	file.Close
end function

function LocateWowsRoot()
	do
		WOWS_ROOT = BrowseForFolder("Locate the World of Warships folder", &H200) & "\"
		filePath = WOWS_ROOT & "WorldOfWarships.exe"	
		if fso.FileExists(filePath) then
			exit do			
		else			
			response = MsgBox("Could not locate World Of Warships in " & WOWS_ROOT, vbRetryCancel, SCRIPT_NAME)
			if response <> vbRetry then ScriptExit("Exiting script.")
		end if		
	loop
end function

function LocateModsRoot()
	modsPath = WOWS_ROOT & "res_mods\"
	dim version
	for each folder in fso.GetFolder(modsPath).SubFolders
		version = folder.name
	next
	if not IsEmpty(version) then
		MODS_ROOT = modsPath & version & "\"
		msg = "Installing mods for version " & version
		set modsFolder = fso.GetFolder(modsPath & version)
		if modsFolder.Files.Count > 0 or modsFolder.SubFolders.Count > 0 then		
			response = MsgBox(msg & vbCrlf & "Clean the mods folder? (Recommended)", vbYesNoCancel, SCRIPT_NAME)
			if response = vbYes then 
				fso.DeleteFile(MODS_ROOT & "*"), true
				fso.DeleteFolder(MODS_ROOT & "*"), true
			end if
		else 
			response = MsgBox(msg, vbOKCancel, SCRIPT_NAME)
		end if
		if response = vbCancel then
			ScriptExit("Action canceled. Exiting script.")
		else
			exit function
		end if		
	end if
	ScriptExit("Unable to locate a mods folder. Exiting script.")
end function

function ModCvZoomOut()
	modName = "CV Zoom"
	modDesc = CHR(149) & " Increases the maximum CV zoom."
	modDesc = modDesc & vbCrlf & CHR(149) & " Changes the CV views to all look straight down."
	modDesc = modDesc & vbCrlf & CHR(149) & " Evens out the graduations between zoom steps."	
	modFile = "camerasConsumer.xml"
	modDir = WOWS_ROOT & "res\"		
	modNode = "//modes/airplane/states/state"
	modNode2 = "//modes/airplane/barrierKey"	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then
				set keyNode = node.selectSingleNode("key")		
				select case keyNode.text
					case 0						
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 100
						node.selectSingleNode("cursorSensitivityCoef").text = 4
						node.selectSingleNode("keysSensitivityCoef").text = 4
					case 30
						node.selectSingleNode("key").text = 33
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 160
						node.selectSingleNode("cursorSensitivityCoef").text = 5
						node.selectSingleNode("keysSensitivityCoef").text = 5
						set ignoreTerrain = xml.createElement("ignoreTerrain")
						ignoreTerrain.text = 1
						node.appendChild(ignoreTerrain)
					case 70
						node.selectSingleNode("key").text = 66
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 270
						node.selectSingleNode("cursorSensitivityCoef").text = 7
						node.selectSingleNode("keysSensitivityCoef").text = 7
						set ignoreTerrain = xml.createElement("ignoreTerrain")
						ignoreTerrain.text = 1
						node.appendChild(ignoreTerrain)
					case 100
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 510
						node.selectSingleNode("cursorSensitivityCoef").text = 7
						node.selectSingleNode("keysSensitivityCoef").text = 7
						set ignoreTerrain = xml.createElement("ignoreTerrain")
						ignoreTerrain.text = 1
						node.appendChild(ignoreTerrain)
				end select
			end if
		next		
		set nodes = xml.selectNodes(modNode2)		
		for each node in nodes	
			select case node.text
				case 30
					node.text = 33
				case 70
					node.text = 66
			end select
		next		
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")			
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("pitch").text = -45
						node.selectSingleNode("lead").text = 60
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
					case 33
						node.selectSingleNode("key").text = 30
						node.selectSingleNode("pitch").text = -60
						node.selectSingleNode("lead").text = 102
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
						node.removeChild(node.selectSingleNode("ignoreTerrain"))
					case 66
						node.selectSingleNode("key").text = 70
						node.selectSingleNode("pitch").text = -80
						node.selectSingleNode("lead").text = 158
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
						node.removeChild(node.selectSingleNode("ignoreTerrain"))
					case 100
						node.selectSingleNode("pitch").text = -89
						node.selectSingleNode("lead").text = 200
						node.selectSingleNode("cursorSensitivityCoef").text = 3.5
						node.selectSingleNode("keysSensitivityCoef").text = 4.5
						set ignoreTerrain = node.selectSingleNode("ignoreTerrain")
						if not ignoreTerrain is nothing then node.removeChild(ignoreTerrain)
				end select
			end if
		next
		set nodes = xml.selectNodes(modNode2)		
		for each node in nodes	
			select case node.text
				case 33
					node.text = 30
				case 66
					node.text = 70
			end select
		next				
	end if
end function

function ModMaxFPS()
	modName = "Max FPS"
	modDesc = CHR(149) & " Set the maximum FPS value."
	modFile = "engine_config.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "maxFrameRate"
	modPrompt = "Enter FPS limit. [1 - 300]"
	invalidMsg = "Invalid entry. Try again."	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set maxFrameRate = xml.selectSingleNode("//" & modNode)
		input = InputBox(modPrompt, SCRIPT_NAME, maxFrameRate.text)
		do			
			if IsEmpty(input) then
				exit do
			elseif input > 0 and input < 301 then
				maxFrameRate.text = input
				xml.Save MODS_ROOT & modFile
				exit do
			else
				input = InputBox(invalidMsg & vbCrlf & vbCrlf & modPrompt, SCRIPT_NAME, maxFrameRate.text)							
			end if
		loop
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile
		xml.selectSingleNode("//" & modNode).text = 75
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModReplays()
	modName = "Replays"
	modDesc = CHR(149) & " When enabled replay files are created each game."	
	modFile = "preferences.xml"	
	modNode = "root/scriptsPreferences/isReplayEnabled"
	if Enable(modName, modDesc, WOWS_ROOT & modFile, WOWS_ROOT & modFile) then
		WriteNonValidXml WOWS_ROOT & modFile, modNode, "true"
	elseif fso.FileExists(WOWS_ROOT & modFile) then
		WriteNonValidXml WOWS_ROOT & modFile, modNode, "false"
	end if	
end function

function ModTrainingRoom()	
	modName = "Training Room"
	modDesc = CHR(149) & " Enables the training room as a battle type."	
	modFile = "scripts_config.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//disableTrainingRoom"
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		xml.selectSingleNode(modNode).text = "false"	
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile
		xml.selectSingleNode(modNode).text = "true"	
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModViewAngles()
	modName = "View Angles"
	modDesc = CHR(149) & " Lowers the min view angle when zoomed to -4" & Chr(176) & " so turret"
	modDesc = modDesc & vbCrlf & "aim is not restricted with close targets."
	modDesc = modDesc & vbCrlf & CHR(149) & " Increases the max view angle when not zoomed to 89" & Chr(176) & " to"
	modDesc = modDesc & vbCrlf & "make selecting an AA target a little easier."	
	modFile = "camerasConsumer.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//modes/snake_tail/states/state"	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then			
				select case keyNode.text
					case 0
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 25
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 65
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 100
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 120
						node.selectSingleNode("minPitch").text = -20
						node.selectSingleNode("maxPitch").text = 89
					case 180
						node.selectSingleNode("minPitch").text = -40
						node.selectSingleNode("maxPitch").text = 89
				end select
			end if
		next		
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")	
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("minPitch").text = -2
						node.selectSingleNode("maxPitch").text = 20
					case 25
						node.selectSingleNode("minPitch").text = -2
						node.selectSingleNode("maxPitch").text = 20
					case 65
						node.selectSingleNode("minPitch").text = -10
						node.selectSingleNode("maxPitch").text = 20
					case 100
						node.selectSingleNode("minPitch").text = -10
						node.selectSingleNode("maxPitch").text = 20
					case 120
						node.selectSingleNode("minPitch").text = -20
						node.selectSingleNode("maxPitch").text = 30
					case 180
						node.selectSingleNode("minPitch").text = -45
						node.selectSingleNode("maxPitch").text = 35
				end select
			end if
		next		
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModPortViewAngles()
	modName = "Port View Angles"
	modDesc = CHR(149) & " Increases the zoom ranges in port view."
	modDesc = modDesc & vbCrlf & CHR(149) & " Increases the elevation ranges ranges in port view."
	modFile = "camerasConsumer.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//modes/dock/states/state"
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then			
				select case keyNode.text
					case 0
						node.selectSingleNode("lead").text = 0.35
						set maxPitch = node.selectSingleNode("maxPitch")
						if maxPitch is nothing then			
							set maxPitch = xml.createElement("maxPitch")
							node.appendChild(maxPitch)
						end if
						maxPitch.text = 15						
					case 100
						node.selectSingleNode("lead").text = 5
						set pitchInfluenceOnHeight = node.selectSingleNode("pitchInfluenceOnHeight")
						if pitchInfluenceOnHeight is nothing then			
							set pitchInfluenceOnHeight = xml.createElement("pitchInfluenceOnHeight")
							node.appendChild(pitchInfluenceOnHeight)
						end if
						pitchInfluenceOnHeight.text = 9
				end select
			end if
		next
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")	
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("lead").text = 1
						set maxPitch = node.selectSingleNode("maxPitch")
						if not maxPitch is nothing then node.removeChild(maxPitch)					
					case 100
						node.selectSingleNode("lead").text = 3.92
						set pitchInfluenceOnHeight = node.selectSingleNode("pitchInfluenceOnHeight")
						if not pitchInfluenceOnHeight is nothing then node.removeChild(pitchInfluenceOnHeight)
				end select
			end if
		next
		xml.Save MODS_ROOT & modFile
	end if
end function

Intro()
LocateWowsRoot()
LocateModsRoot()
ModMaxFPS()
ModReplays()
ModTrainingRoom()
ModViewAngles()
ModPortViewAngles()
ModCvZoomOut()
ScriptExit(SCRIPT_NAME & " finished.")

 

 

Share this post


Link to post
Share on other sites
[LBAS]
Member
4,590 posts
26,024 battles

checked for camera

How to install: copy code above and paste to note pad and save as Kmod.txt and rename as "Kmod.vbs" << and run

 

CV zoom completely vertical zoom

shot-18.01.06_12.14.53-0595.jpg

shot-18.01.06_12.14.59-0817.jpg

shot-18.01.06_12.17.15-0407.jpg

shot-18.01.06_12.19.46-0962.jpg

shot-18.01.06_12.20.03-0760.jpg

shot-18.01.06_12.20.52-0785.jpg

In port

shot-18.01.06_12.08.24-0100.jpg

shot-18.01.06_12.32.19-0235.jpg

shot-18.01.06_12.09.10-0687.jpg

shot-18.01.06_12.09.44-0295.jpg

shot-18.01.06_12.10.43-0712.jpg

shot-18.01.06_12.11.18-0892.jpg

shot-18.01.06_12.11.44-0950.jpg

shot-18.01.06_12.13.28-0860.jpg

shot-18.01.06_12.12.25-0252.jpg

shot-18.01.06_12.12.41-0472.jpg

shot-18.01.06_12.12.45-0387.jpg

shot-18.01.06_12.12.47-0005.jpg

shot-18.01.06_12.12.51-0230.jpg

shot-18.01.06_12.12.53-0927.jpg

Edited by MatterCore

Share this post


Link to post
Share on other sites
Member
2,254 posts
13,967 battles

Cheers @MatterCore for posting those pics.

I would like your opinion on something. With the upcoming port view changes in 0.7.0 I was wondering if I should remove my port view mod or leave it in. What do you think?

Share this post


Link to post
Share on other sites
[LBAS]
Member
4,590 posts
26,024 battles
2 minutes ago, keskparane said:

Cheers @MatterCore for posting those pics.

I would like your opinion on something. With the upcoming port view changes in 0.7.0 I was wondering if I should remove my port view mod or leave it in. What do you think?

Port camera: some how better than default but I am obessed by Homeworld 2 and Supreme commander's camera

CV OK<< more than a month I didnt touch CV :fish_palm:

ship with guns<< cant tell, just 1 battle, need more to feel

0.7.0 << about 2 weeks just wait and see how good it is

Share this post


Link to post
Share on other sites
Member
2,254 posts
13,967 battles
2 minutes ago, MatterCore said:

Port camera: some how better than default but I am obessed by Homeworld 2 and Supreme commander's camera

CV OK<< more than a month I didnt touch CV :fish_palm:

ship with guns<< cant tell, just 1 battle, need more to feel

0.7.0 << about 2 weeks just wait and see how good it is

  • A note on port camera. Check out how much closer your can zoom in as well. That was one of my main reasons for adding it, I like to look at my botes.
  • Ships guns is useful on 2 occasions. 1/ In CQC when trying to hit waterline. Standard view can't look down as far as guns can aim. Mod fixes that. 2/ When looking up to select an enemy plane. Without mod if plane directly overhead you can't see him.
  • 0.7.0. I tried PTS and the port view felt really weird. I expect that's probably just because change often feels that way and that it wouldn't take too long to adjust which is why I was going to remove my port view mod.

 

Share this post


Link to post
Share on other sites
[LBAS]
Member
4,590 posts
26,024 battles
20 minutes ago, keskparane said:
  • A note on port camera. Check out how much closer your can zoom in as well. That was one of my main reasons for adding it, I like to look at my botes.
  • Ships guns is useful on 2 occasions. 1/ In CQC when trying to hit waterline. Standard view can't look down as far as guns can aim. Mod fixes that. 2/ When looking up to select an enemy plane. Without mod if plane directly overhead you can't see him.
  • 0.7.0. I tried PTS and the port view felt really weird. I expect that's probably just because change often feels that way and that it wouldn't take too long to adjust which is why I was going to remove my port view mod.

 

PTS << I dont join, so leave a side

Ship with guns >> wait....

Max zoom in << pretty ok

 

shot-18.01.06_13.15.10-0092.jpg

shot-18.01.06_13.15.14-0165.jpg

shot-18.01.06_13.15.19-0115.jpg

shot-18.01.06_13.19.10-0410.jpg

Share this post


Link to post
Share on other sites
Member
2,254 posts
13,967 battles

version 0.1.3.2

- improved handling of unknown version in update

Spoiler

'@description: Keskparane's mods for World of Warships
'@author: keskparane@gmail.com
'@usage: Save this content as a *.vbs script (eg kMods.vbs) file and run.

const SCRIPT_NAME = "kMods"
const SCRIPT_VERSION = "0.1.3.2"
const KMOD_TIMESTAMP = 1515219493
set fso = CreateObject("Scripting.FileSystemObject")
set xml = CreateObject("Msxml2.DOMDocument.6.0")
xml.Async = "False"
xml.validateOnParse = false
dim WOWS_ROOT, MODS_ROOT

function BrowseForFolder(message, options)	
	set shell = CreateObject("Shell.Application")
	set dir = shell.BrowseForFolder(0, message, options, 0)	
	if dir is nothing then
		BrowseForFolder = ""		
	else 
		BrowseForFolder = dir.Self.Path
	end if	
end function

function Enable(modName, modDesc, modFile, originalFile)	
	response = MsgBox("Enable " & modName & " ?" & vbCrlf & vbCrlf & modDesc, vbYesNo, SCRIPT_NAME)	
	if response = vbYes then
		if not fso.FileExists(modFile) then
			fso.CopyFile originalFile, MODS_ROOT, true
		end if
		Enable = true
	else
		Enable = false
	end if	
end function

function Intro()
	msg = SCRIPT_NAME & " by Keskparane." & vbCrlf
	msg = msg & "Version " & SCRIPT_VERSION & vbCrlf & vbCrlf	
	msg = msg & CHR(149) & " This script will run you through the process of installing" & vbCrlf
	msg = msg & "selected modifications to your World of Warships installation." & vbCrlf & vbCrlf
	msg = msg & "Would you like to check for updates?"	
	response = MsgBox(msg, vbYesNoCancel, SCRIPT_NAME)
	if response = vbYes then
		Update()
	elseif response = vbCancel then
		WScript.Quit
	end if	
end function

function Update()
	set http = CreateObject("Msxml2.XmlHttp.6.0")
	modUrl = "https://forum.worldofwarships.asia/topic/29350-keskparanes-mods/"
	http.Open "GET", modUrl, False
	http.Send
	if http.status = "200" then	
		set search = new RegExp
		search.pattern = "KMOD_TIMESTAMP(\s)*=(\s)*([0-9]{10})"
		set matches = search.Execute(http.responseText)
		for each match in matches
			tempstamp = CLng(Right(match, 10))
			if tempstamp > timestamp then timestamp = tempstamp
		next
		if timestamp = KMOD_TIMESTAMP then			
			msg = "You are running the current version."
			response = MsgBox(msg, vbInformation, SCRIPT_NAME)
		elseif timestamp > KMOD_TIMESTAMP then			
			msg = "Update available. Would you like to update?" & vbCrlf & vbCrlf
			msg = msg & CHR(149) & " Update will direct your browser to the new script."
			response = MsgBox(msg, vbYesNo, SCRIPT_NAME)
			if response = vbYes then
				set wShell = CreateObject("WScript.Shell")
				wShell.Run modUrl, 9
				WScript.Quit
			end if
		else
			unknownVersion = True
		end if
	end if
	if not http.status = "200" or unknownVersion then
		msg = "Version unknown." & vbCrlf & vbCrlf
		msg = msg & CHR(149) & " Update will direct your browser to check for new script."
		response = MsgBox(msg, vbOKCancel, SCRIPT_NAME)
		if response = vbOk then
			set wShell = CreateObject("WScript.Shell")
			wShell.Run modUrl, 9
			WScript.Quit
		end if		
	end if
end function

function ScriptExit(msg)
	response = MsgBox(msg, vbInformation, SCRIPT_NAME)
	WScript.Quit
end function

function WriteNonValidXml(filePath, nodePath, value)
	set file = fso.OpenTextFile(filePath, 1)
	lines = Split(file.ReadAll, vbNewLine)	
	file.Close	
	nodes = Split(nodePath, "/")
	parents = uBound(nodes)	
	numLines = uBound(lines)
	node = nodes(parents)	
	lineNum = parent = 0	
	indent = ""
	written = false
	set file = fso.OpenTextFile(filePath, 2)
	for each line in lines
		write = true
		if not written then
			if parent = parents then
				if InStr(line, "</" & nodes(parents - 1) & ">") or InStr(line, "</" & node & ">") then
					file.WriteLine (indent & "<" & node & ">" & value & "</" & node & ">")
					written = true
				end if
				if InStr(line, "<" & node & ">") then write = false			
			elseif InStr(line, "<" & nodes(parent) & ">") then
				parent = parent + 1
				indent = indent & vbTab
			end if
		end if
		if write then
			if lineNum < numLines then
				file.WriteLine line
			else
				file.Write line
			end if
		end if
		lineNum = lineNum + 1		
	next
	file.Close
end function

function LocateWowsRoot()
	do
		WOWS_ROOT = BrowseForFolder("Locate the World of Warships folder", &H200) & "\"
		filePath = WOWS_ROOT & "WorldOfWarships.exe"	
		if fso.FileExists(filePath) then
			exit do			
		elseif WOWS_ROOT = "\" then
			ScriptExit("Action canceled. Exiting script.")
		else		
			response = MsgBox("Could not locate World Of Warships in " & WOWS_ROOT, vbRetryCancel, SCRIPT_NAME)
			if response <> vbRetry then ScriptExit("Action canceled. Exiting script.")
		end if		
	loop
end function

function LocateModsRoot()
	modsPath = WOWS_ROOT & "res_mods\"
	dim version
	for each folder in fso.GetFolder(modsPath).SubFolders
		version = folder.name
	next
	if not IsEmpty(version) then
		MODS_ROOT = modsPath & version & "\"
		msg = "Installing mods for version " & version
		set modsFolder = fso.GetFolder(modsPath & version)
		if modsFolder.Files.Count > 0 or modsFolder.SubFolders.Count > 0 then		
			response = MsgBox(msg & vbCrlf & "Remove any existing mods?", vbYesNoCancel, SCRIPT_NAME)
			if response = vbYes then 
				fso.DeleteFile(MODS_ROOT & "*"), true
				fso.DeleteFolder(MODS_ROOT & "*"), true
			end if
		else 
			response = MsgBox(msg, vbOKCancel, SCRIPT_NAME)
		end if
		if response = vbCancel then
			ScriptExit("Action canceled. Exiting script.")
		else
			exit function
		end if		
	end if
	ScriptExit("Unable to locate a mods folder. Exiting script.")
end function

function ModCvZoomOut()
	modName = "CV Zoom"
	modDesc = CHR(149) & " Increases the maximum CV zoom."
	modDesc = modDesc & vbCrlf & CHR(149) & " Changes the CV views to all look straight down."
	modDesc = modDesc & vbCrlf & CHR(149) & " Evens out the graduations between zoom steps."	
	modFile = "camerasConsumer.xml"
	modDir = WOWS_ROOT & "res\"		
	modNode = "//modes/airplane/states/state"
	modNode2 = "//modes/airplane/barrierKey"	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then
				set keyNode = node.selectSingleNode("key")		
				select case keyNode.text
					case 0						
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 100
						node.selectSingleNode("cursorSensitivityCoef").text = 4
						node.selectSingleNode("keysSensitivityCoef").text = 4
					case 30
						node.selectSingleNode("key").text = 33
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 160
						node.selectSingleNode("cursorSensitivityCoef").text = 5
						node.selectSingleNode("keysSensitivityCoef").text = 5
						set ignoreTerrain = xml.createElement("ignoreTerrain")
						ignoreTerrain.text = 1
						node.appendChild(ignoreTerrain)
					case 70
						node.selectSingleNode("key").text = 66
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 270
						node.selectSingleNode("cursorSensitivityCoef").text = 7
						node.selectSingleNode("keysSensitivityCoef").text = 7
						set ignoreTerrain = xml.createElement("ignoreTerrain")
						ignoreTerrain.text = 1
						node.appendChild(ignoreTerrain)
					case 100
						node.selectSingleNode("pitch").text = -90
						node.selectSingleNode("lead").text = 510
						node.selectSingleNode("cursorSensitivityCoef").text = 7
						node.selectSingleNode("keysSensitivityCoef").text = 7
						set ignoreTerrain = xml.createElement("ignoreTerrain")
						ignoreTerrain.text = 1
						node.appendChild(ignoreTerrain)
				end select
			end if
		next		
		set nodes = xml.selectNodes(modNode2)		
		for each node in nodes	
			select case node.text
				case 30
					node.text = 33
				case 70
					node.text = 66
			end select
		next		
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")			
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("pitch").text = -45
						node.selectSingleNode("lead").text = 60
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
					case 33
						node.selectSingleNode("key").text = 30
						node.selectSingleNode("pitch").text = -60
						node.selectSingleNode("lead").text = 102
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
						node.removeChild(node.selectSingleNode("ignoreTerrain"))
					case 66
						node.selectSingleNode("key").text = 70
						node.selectSingleNode("pitch").text = -80
						node.selectSingleNode("lead").text = 158
						node.selectSingleNode("cursorSensitivityCoef").text = 1.75
						node.selectSingleNode("keysSensitivityCoef").text = 1.75
						node.removeChild(node.selectSingleNode("ignoreTerrain"))
					case 100
						node.selectSingleNode("pitch").text = -89
						node.selectSingleNode("lead").text = 200
						node.selectSingleNode("cursorSensitivityCoef").text = 3.5
						node.selectSingleNode("keysSensitivityCoef").text = 4.5
						set ignoreTerrain = node.selectSingleNode("ignoreTerrain")
						if not ignoreTerrain is nothing then node.removeChild(ignoreTerrain)
				end select
			end if
		next
		set nodes = xml.selectNodes(modNode2)		
		for each node in nodes	
			select case node.text
				case 33
					node.text = 30
				case 66
					node.text = 70
			end select
		next				
	end if
end function

function ModMaxFPS()
	modName = "Max FPS"
	modDesc = CHR(149) & " Set the maximum FPS value."
	modFile = "engine_config.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "maxFrameRate"
	modPrompt = "Enter FPS limit. [1 - 300]"
	invalidMsg = "Invalid entry. Try again."	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set maxFrameRate = xml.selectSingleNode("//" & modNode)
		input = InputBox(modPrompt, SCRIPT_NAME, maxFrameRate.text)
		do			
			if IsEmpty(input) then
				exit do
			elseif input > 0 and input < 301 then
				maxFrameRate.text = input
				xml.Save MODS_ROOT & modFile
				exit do
			else
				input = InputBox(invalidMsg & vbCrlf & vbCrlf & modPrompt, SCRIPT_NAME, maxFrameRate.text)							
			end if
		loop
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile
		xml.selectSingleNode("//" & modNode).text = 75
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModReplays()
	modName = "Replays"
	modDesc = CHR(149) & " When enabled replay files are created each game."	
	modFile = "preferences.xml"	
	modNode = "root/scriptsPreferences/isReplayEnabled"
	if Enable(modName, modDesc, WOWS_ROOT & modFile, WOWS_ROOT & modFile) then
		WriteNonValidXml WOWS_ROOT & modFile, modNode, "true"
	elseif fso.FileExists(WOWS_ROOT & modFile) then
		WriteNonValidXml WOWS_ROOT & modFile, modNode, "false"
	end if	
end function

function ModViewAngles()
	modName = "View Angles"
	modDesc = CHR(149) & " Lowers the min view angle when zoomed to -4" & Chr(176) & " so turret"
	modDesc = modDesc & vbCrlf & "aim is not restricted with close targets."
	modDesc = modDesc & vbCrlf & CHR(149) & " Increases the max view angle when not zoomed to 89" & Chr(176) & " to"
	modDesc = modDesc & vbCrlf & "make selecting an AA target a little easier."	
	modFile = "camerasConsumer.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//modes/snake_tail/states/state"	
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then			
				select case keyNode.text
					case 0
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 25
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 65
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 100
						node.selectSingleNode("minPitch").text = -4
						node.selectSingleNode("maxPitch").text = 89
					case 120
						node.selectSingleNode("minPitch").text = -20
						node.selectSingleNode("maxPitch").text = 89
					case 180
						node.selectSingleNode("minPitch").text = -40
						node.selectSingleNode("maxPitch").text = 89
				end select
			end if
		next		
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")	
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("minPitch").text = -2
						node.selectSingleNode("maxPitch").text = 20
					case 25
						node.selectSingleNode("minPitch").text = -2
						node.selectSingleNode("maxPitch").text = 20
					case 65
						node.selectSingleNode("minPitch").text = -10
						node.selectSingleNode("maxPitch").text = 20
					case 100
						node.selectSingleNode("minPitch").text = -10
						node.selectSingleNode("maxPitch").text = 20
					case 120
						node.selectSingleNode("minPitch").text = -20
						node.selectSingleNode("maxPitch").text = 30
					case 180
						node.selectSingleNode("minPitch").text = -45
						node.selectSingleNode("maxPitch").text = 35
				end select
			end if
		next		
		xml.Save MODS_ROOT & modFile
	end if
end function

function ModPortViewAngles()
	modName = "Port View Angles"
	modDesc = CHR(149) & " Increases the zoom ranges in port view."
	modDesc = modDesc & vbCrlf & CHR(149) & " Increases the elevation ranges ranges in port view."
	modFile = "camerasConsumer.xml"	
	modDir = WOWS_ROOT & "res\"
	modNode = "//modes/dock/states/state"
	if Enable(modName, modDesc, MODS_ROOT & modFile, modDir & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")		
			if not keyNode is nothing then			
				select case keyNode.text
					case 0
						node.selectSingleNode("lead").text = 0.35
						set maxPitch = node.selectSingleNode("maxPitch")
						if maxPitch is nothing then			
							set maxPitch = xml.createElement("maxPitch")
							node.appendChild(maxPitch)
						end if
						maxPitch.text = 15						
					case 100
						node.selectSingleNode("lead").text = 5
						set pitchInfluenceOnHeight = node.selectSingleNode("pitchInfluenceOnHeight")
						if pitchInfluenceOnHeight is nothing then			
							set pitchInfluenceOnHeight = xml.createElement("pitchInfluenceOnHeight")
							node.appendChild(pitchInfluenceOnHeight)
						end if
						pitchInfluenceOnHeight.text = 9
				end select
			end if
		next
		xml.Save MODS_ROOT & modFile
	elseif fso.FileExists(MODS_ROOT & modFile) then
		xml.Load MODS_ROOT & modFile		
		set nodes = xml.selectNodes(modNode)		
		for each node in nodes
			set keyNode = node.selectSingleNode("key")	
			if not keyNode is nothing then
				select case keyNode.text
					case 0
						node.selectSingleNode("lead").text = 1
						set maxPitch = node.selectSingleNode("maxPitch")
						if not maxPitch is nothing then node.removeChild(maxPitch)					
					case 100
						node.selectSingleNode("lead").text = 3.92
						set pitchInfluenceOnHeight = node.selectSingleNode("pitchInfluenceOnHeight")
						if not pitchInfluenceOnHeight is nothing then node.removeChild(pitchInfluenceOnHeight)
				end select
			end if
		next
		xml.Save MODS_ROOT & modFile
	end if
end function

Intro()
LocateWowsRoot()
LocateModsRoot()
ModMaxFPS()
ModReplays()
ModTrainingRoom()
ModViewAngles()
ModPortViewAngles()
ModCvZoomOut()
ScriptExit(SCRIPT_NAME & " finished.")

 

 

Share this post


Link to post
Share on other sites
[LBAS]
Member
4,590 posts
26,024 battles
On 1/22/2018 at 10:04 PM, keskparane said:

version 0.7.0.0

- packaged as hta file to add a html gui

- added a config file to save settings

 

kMods.0.7.0.0.zip

cant download "kMods.0.7.0.0.zip" << Opera/Firefox/IE

you should upload *.vbs file or use mediafire.com for better

Edited by MatterCore

Share this post


Link to post
Share on other sites
Member
2,254 posts
13,967 battles
1 hour ago, MatterCore said:

cant download "" << Opera/Firefox/IE

It's coz forum broken. So

On 12/13/2017 at 8:21 PM, keskparane said:

.....

  * right click on link and choose "Save link as..."

Edit. Ok I just discovered that now broken to. I thought I tested it when I uploaded, maybe not. Fortunately all the code is there so it's easy to copy paste and create the file yourself. *.hta files can be edited as plain text.

----------------------------------------------------------------------------------------

1 hour ago, MatterCore said:

.......

you should upload *.vbs file or use mediafire.com for better

Can't use *.vbs with new version because it's *.hta file. An hta file is a self executable html page.

 

 

Edited by keskparane

Share this post


Link to post
Share on other sites
[LBAS]
Member
4,590 posts
26,024 battles

Camera in port >>

11 hours ago, keskparane said:

version 0.7.0.1

- minor ineffectual change to some ship zoom settings

kMods.0.7.0.1.zip

Normal view << feel like old camera

Spoiler

shot-18.01.28_11.37.12-0127.jpgshot-18.01.28_11.37.26-0710.jpgshot-18.01.28_11.37.39-0395.jpgshot-18.01.28_11.37.54-0482.jpgshot-18.01.28_11.38.03-0007.jpg

Max Zoom in<< better than WG

Spoiler

shot-18.01.28_11.38.47-0265.jpgshot-18.01.28_11.38.34-0362.jpgshot-18.01.28_11.38.15-0060.jpg

Max Zoom out<< can see a whole port

Spoiler

shot-18.01.28_11.39.38-0795.jpgshot-18.01.28_11.39.57-0685.jpgshot-18.01.28_11.40.12-0580.jpgshot-18.01.28_11.40.28-0782.jpg

Edited by MatterCore

Share this post


Link to post
Share on other sites
Member
2,254 posts
13,967 battles

version 0.7.1.0

- decided not to mess with cv zoom levels atm so thought I would make cv view & cv zoom separate mods.

- removed the cv zoom mod for further development.

- added cv view mod. makes all cv views look straight down.

kMods.0.7.1.0.zip

Share this post


Link to post
Share on other sites
Member
2,254 posts
13,967 battles

Version 0.7.1.1

- Cv zoom levels has returned, and it's vastly improved. Quick scroll between zoom levels. 3 levels instead of 4.

- Ship zoom was reduced a little. It is built specifically for 3440 width monitors using dynamic zoom.

kMods0.7.1.1.zip

Known issues

  • Bug in "Ship view angles" means it will not uninstall. To remove installed mod either click "Delete existing" button, or delete file "World_of_Warships\res_mods\0.7.1.1\camerasConsumer.xml"
Edited by keskparane

Share this post


Link to post
Share on other sites
Member
2,254 posts
13,967 battles

Version 0.7.2.0

- Removed Ship view angles mod (to separate it's 2 features).

- Added Ship AA target mod. For easier AA target selection from ship.

- Added Ship guns mod. For better alignment of view angles to gun elevation.

kMods.0.7.2.0.zip

Edited by keskparane

Share this post


Link to post
Share on other sites

×