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!

merge inititem and message

Newbie Spellweaver
Joined
Mar 17, 2007
Messages
74
Reaction score
0
hello guys,

is there any programm which puts the name of an item on top of the item?
e.g:
inititem.txt:
Code:
(item    (name 256)        (Index 1)    (Image "Wea001")    (Action 1 1)        (class weapon sword)    (code 1 1 1 1)    (country 0 1 2)    (level 1)    (wear 1)                                    (limit knight 1)    (range 16)    (buy 4)    (sell 1)    (endurance 4)                (specialty    (aspeed 700)                        (Attack 3 10)                    (hit 15)                                                                                                    )                                )
(item    (name 257)        (Index 2)    (Image "Wea002")    (Action 2 1)        (class weapon sword)    (code 1 1 1 1)    (country 0 1 2)    (level 5)    (wear 1)                                    (limit knight 1)    (range 16)    (buy 180)    (sell 45)    (endurance 6)                (specialty    (aspeed 700)                        (Attack 16 24)                    (hit 18)                                                                                                    )                                )
(item    (name 258)        (Index 3)    (Image "Wea003")    (Action 2 2)        (class weapon sword)    (code 1 1 1 1)    (country 0 1 2)    (level 9)    (wear 1)                                    (limit knight 1)    (range 24)    (buy 1650)    (sell 412)    (endurance 12)                (specialty    (aspeed 700)                        (Attack 25 37)                    (hit 21)                                                                                                    )                                )

message:
Code:
( itemname 256 "Short Iron Sword")
( itemname 257 "Short Steel Sword")
( itemname 258 "Small Steel Sword")

result:
Code:
;Short Iron Sword
(item    (name 256)        (Index 1)    (Image "Wea001")     (Action 1 1)        (class weapon sword)    (code 1 1 1 1)    (country 0  1 2)    (level 1)    (wear 1)                                    (limit  knight 1)    (range 16)    (buy 4)    (sell 1)    (endurance 4)                 (specialty    (aspeed 700)                        (Attack 3  10)                    (hit 15)                                                                                                     )                                 )
;Short Steel Sword
(item    (name 257)        (Index 2)     (Image "Wea002")    (Action 2 1)        (class weapon sword)    (code 1  1 1 1)    (country 0 1 2)    (level 5)    (wear 1)                                     (limit knight 1)    (range 16)    (buy 180)    (sell  45)    (endurance 6)                (specialty    (aspeed 700)                         (Attack 16 24)                    (hit 18)                                                                                                      )                                )
;Small Steel Sword
(item    (name 258)         (Index 3)    (Image "Wea003")    (Action 2 2)        (class weapon  sword)    (code 1 1 1 1)    (country 0 1 2)    (level 9)    (wear 1)                                     (limit knight 1)    (range 24)    (buy  1650)    (sell 412)    (endurance 12)                (specialty     (aspeed 700)                        (Attack 25 37)                     (hit 21)                                                                                                     )                                )

I hope you understand my problem :)

thanks !


ps: I would need it for initmonster as well :D
 
Junior Spellweaver
Joined
Jan 6, 2016
Messages
184
Reaction score
55
excel? paste all the inititems in sheet 1 paste all the messages in sheet 2 and combine them in sheet 3
 
Upvote 0
Joined
Sep 30, 2006
Messages
735
Reaction score
207
Here, I'll be nice for once... Thrown together very roughly
Code:
Get-Content "inititem.txt" | foreach {
     if ($_ -match "name (\d+)") {
          $Num = $Matches[1]
          Get-Content "message.txt" | foreach {
               if ($_ -match "itemname $Num .([ a-zA-Z0-9]+).") {
                    Add-Content "merged.txt" (";" + [string]$Matches[1])
               }
          } 
         Add-Content "merged.txt" $_ 
    }
}
 
Upvote 0
Back
Top