Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[DEV] -[AutoIt] Problem with reading mobname.lod

Status
Not open for further replies.
Newbie Spellweaver
Joined
Apr 23, 2011
Messages
84
Reaction score
5
hey,
i have a problem with reading the mobname.lod file...
Only the first 4 Mobnames are correctly readed, the rest is bugged.

Script:
PHP:
#include <array.au3>

Dim $MobName[1]
$number = 1

	$File = FileOpen(@ScriptDir & '\data\mobname_ger.lod', 16)
    $Read = FileRead($File)
    FileClose($File)
$result = StringTrimLeft($Read, 18)

Do
$num = StringLeft($result, 2) //Reading the Mobname size
$result = StringTrimLeft($result, 8) //removing the mobname size
	_ArrayAdd($MobName, BinaryToString("0x" & StringLeft($result, $num*2))) //Reading mobname
$result = StringTrimLeft($result, $num *2 +8) //removing mobname + Monster ID
$number = $number +1
Until $number = 500

_ArrayDisplay($MobName)

This is the Result:

fabi202cool - [DEV] -[AutoIt] Problem with reading mobname.lod - RaGEZONE Forums


Can someone help me to fix that?
Fabi
 
Banned
Banned
Joined
Apr 29, 2008
Messages
713
Reaction score
264
Re: [AutoIt] Problem with reading mobname.lod

You have to filter by more then just bytes in between. There isn't exactly 8 bytes in between each name. I would recommend first filtering out all the bytes in between each name that isn't a character, giving you a raw list of names in the end. You can use as a reference. Also there are better ways to code this. I will look at it later.

PHP:
#include <Array.au3>

Local $MobName[1]

$File = FileOpen('mobname_usa.lod', 16)
$Read = FileRead($File)
FileClose($File)

$Result = StringTrimLeft($Read, 4)

For $x = 1 To 500
	$ReadByte = StringLeft($Result, 2) ;~ Read Each Byte
	$Result = StringTrimLeft($Result, 8) ;~ Remove 8 Garbage Bytes
	_ArrayAdd($MobName, BinaryToString('0x' & StringLeft($Result, $ReadByte*2)))
Next

_ArrayDisplay($MobName)
 
Status
Not open for further replies.
Back
Top