Hab mal n Tool gescriptet das die item_proto dumps von tims archiver in .sql dateien umwandelt
Source:
Ist in Autoit geschrieben
bin grad zu müde ne .exe hochzuladen
Scheint zu gehen habs nich genau getestet weil zu müde
gn8 und hf damit
Source:
PHP Code:
#include <String.au3>
#include <File.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)
Global $ScriptDir = @ScriptDir
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("item_proto .xml zu .sql converter by iMer", 353, 156, 193, 125)
GUISetOnEvent($GUI_EVENT_CLOSE, "_close")
$input = GUICtrlCreateInput("item_proto_dump.xml", 80, 16, 129, 21)
$Button1 = GUICtrlCreateButton("Durchsuchen...", 216, 16, 83, 25, 0)
GUICtrlSetOnEvent($Button1, "_input")
$Label1 = GUICtrlCreateLabel("Source:", 32, 16, 41, 17)
$Label2 = GUICtrlCreateLabel("Output:", 32, 56, 39, 17)
$output = GUICtrlCreateInput("item_proto.sql", 80, 56, 129, 21)
$Button2 = GUICtrlCreateButton("Durchsuchen...", 216, 56, 81, 25, 0)
GUICtrlSetOnEvent($Button2, "_output")
$Button3 = GUICtrlCreateButton("Start", 104, 96, 75, 25, 0)
GUICtrlSetOnEvent($Button3, "_con")
GUISetState(@SW_SHOW)
$Form2 = GUICreate("item_proto .xml zu .sql converter by iMer", 264, 156, 194, 128)
GUISetOnEvent($GUI_EVENT_CLOSE, "_close")
$t1we = GUICtrlCreateLabel("Zeilen:", 16, 16, 36, 17)
$insgzeilen = GUICtrlCreateLabel("loading...", 56, 16, 65, 17)
$dsv = GUICtrlCreateLabel("Aktuell:", 16, 56, 39, 17)
$aktuellzeilen = GUICtrlCreateLabel("loading...", 56, 56, 70, 17)
$Progress1 = GUICtrlCreateProgress(16, 96, 230, 17)
$Cancel = GUICtrlCreateButton("Cancel", 184, 128, 75, 25, 0)
GUICtrlSetOnEvent($Cancel, "_close")
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###
;$string=_StringBetween($sString,$start,$ende)
while 1
sleep (100)
WEnd
Func _con ()
$lin = 0
GUISetState(@SW_HIDE,$Form1)
GUISetState(@SW_SHOW,$Form2)
$outfile = GUICtrlRead($output)
$file = GUICtrlRead($input)
if $file = "" Then
MsgBox(48,"Fehler","Keine .xml Datei angegeben!")
_input()
EndIf
if $outfile = "" Then
if FileExists($ScriptDir&"item_proto.sql") then
_output ()
Else
$outfile = "item_proto.sql"
EndIf
EndIf
$lines = _FileCountLines($file) - 1
$ges = _FileCountLines($file) - 2
$start = '"'
$ende = '"'
While $lines-1 >= 1
$lin = $lin+1
$sString= FileReadLine($file,$lines)
$string=_StringBetween($sString,$start,$ende)
FileWrite($outfile,"INSERT INTO `item_proto` (`vnum`,`name`,`gb2312name`,`type`,`subtype`,`weight`,`size`,`antiflag`,`flag`,`wearflag`,`immuneflag`,`gold`,`shop_buy_price`,`limittype0`,`limitvalue0`,`limittype1`,`limitvalue1`,`applytype0`,`applyvalue0`,`applytype1`,`applyvalue1`,`applytype2`,`applyvalue2`,`value0`,`value1`,`value2`,`value3`,`value4`,`value5`,`socket0`,`socket1`,`socket2`,`socket3`,`socket4`,`socket5`,`refined_vnum`,`refine_set`,`magic_pct`,`specular`,`socket_pct`) VALUES (")
FileWrite($outfile,"'"&$string[0]&"',")
FileWrite($outfile,$string[1]&",")
For $a = 2 to 38 Step 1
FileWrite($outfile,"'"&$string[$a]&"',")
Next
FileWrite($outfile,"'"&$string[39]&"'")
FileWrite($outfile,");"&@CRLF)
Local $perc = Round($lin/$ges*100)
GUICtrlSetData($Progress1,$perc)
GUICtrlSetData($insgzeilen,$ges)
GUICtrlSetData($aktuellzeilen,$lin)
$lines=$lines-1
WEnd
MsgBox(64,"Fertig!","xml erfolgreich in sql umgewandelt!")
_ende ()
EndFunc
Func _input ()
$in = FileOpenDialog('Dateiauswahl',"",'xml-Datein(*.xml)')
GUICtrlSetData($input,$in)
EndFunc
Func _output ()
$out = FileOpenDialog('Dateiauswahl',"",'sql-Datein(*.sql)')
GUICtrlSetData($output,$out)
EndFunc
Func _ende ()
Exit
EndFunc
Func _close ()
Exit
EndFunc
bin grad zu müde ne .exe hochzuladen
Scheint zu gehen habs nich genau getestet weil zu müde
gn8 und hf damit