Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Here is the code i used. Feel free to run that code but u have to install autoit to run it.
I cant post executable files here, so....
#include <File.au3>
#include <GUIConstantsEx.au3>
$GUI = GUICreate ("program",200,200)
GUICtrlCreateGroup ("Select INI file",5,5,190,40)
$fileinput = GUICtrlCreateInput ("",10,20,140,20)
$browse = GUICtrlCreateButton ("Browse",150,20,40,20)
GUICtrlCreateGroup ("Chose operation to perform",5,50,190,90)
$substract = GUICtrlCreateRadio ("substract",10,65,60)
$multiply = GUICtrlCreateRadio ("multiply",110,65,60)
GUICtrlCreateLabel ("That many times" ,10,92,90)
$amount = GUICtrlCreateInput ("10",90,90,30,20)
$size = GUICtrlCreateCheckbox ("Effect Size",10,110,80,20)
$weight = GUICtrlCreateCheckbox ("Effect Weight",110,110,80,20)
$start = GUICtrlCreateButton ("start",0,160,200,40)
GUISetState(@SW_SHOW, $GUI)
While 1
$msg = GUIGetMsg()
if $msg = $GUI_EVENT_CLOSE then Exit
if $msg = $browse Then
$FileOpen = FileOpenDialog ("Select INI file","", "INI (*.ini)")
If $FileOpen > "" Then GUICtrlSetData ($fileinput,$FileOpen)
EndIf
if $msg = $start Then _goforit()
WEnd
Func _goforit()
$INI = GUICtrlRead ($fileinput)
$LastLine = _FileCountLines ($INI)
$num = GUICtrlRead ($amount)
For $i = 1 to $LastLine
$ReadLiine = FileReadLine ($INI,$i)
If GUICtrlRead ($size) = $GUI_CHECKED Then
if StringInStr ($ReadLiine,"Size=") > 0 Then
$Value = StringTrimLeft ($ReadLiine,StringInStr ($ReadLiine,"="))
If GUICtrlRead ($substract) = $GUI_CHECKED Then
$NewString = StringReplace ($ReadLiine,$Value,$Value/$num)
_FileWriteToLine($INI,$i,$NewString,True)
EndIf
If GUICtrlRead($multiply) = $GUI_CHECKED Then
$action = "*"&$num
$NewString = StringReplace ($ReadLiine,$Value,$Value*$num)
_FileWriteToLine($INI,$i,$NewString,True)
EndIf
EndIf
EndIf
If GUICtrlRead ($weight) = $GUI_CHECKED Then
if StringInStr ($ReadLiine,"Weight=") > 0 Then
$Value = StringTrimLeft ($ReadLiine,StringInStr ($ReadLiine,"="))
If GUICtrlRead ($substract) = $GUI_CHECKED Then
$NewString = StringReplace ($ReadLiine,$Value,$Value/$num)
_FileWriteToLine($INI,$i,$NewString,True)
EndIf
If GUICtrlRead($multiply) = $GUI_CHECKED Then
$action = "*"&$num
$NewString = StringReplace ($ReadLiine,$Value,$Value*$num)
_FileWriteToLine($INI,$i,$NewString,True)
EndIf
EndIf
EndIf
Next
MsgBox (0,'','done','',$GUI)
EndFunc