I made a PHP/MySQL database site for the sandbox MMO Earthrise (www.play-earthrise.com) but manually entering hundreds of items/quests/NPCs would take an insane amount of time. What I would like to do is write a script, or otherwise extract the data, then put it all into a database automatically. This is a project that was OK'd by the makers of Earthrise, so it's not an attempt to get help with an exploit or other illegal thing. I know it would involve regular expressions, but I have no experience using them or automatically entering large amount of data into a DB.
Here is one example of the LUA file, for the Parts. Parts can be recycled into raw resources, and each part turns into the set amount of each resource listed. The columns in the table are partname, description, r1, r2, r3, r4, r5, r6, c1, c2, c3, c4, c5, c6. r1-r6 are resource name (example: zirconium) and c1-c6 are the count or number of that resource you get (example: 39). Some parts only give 1 type of resource, while others give 6, so it needs to identify how many resources it gives instead of looking for 6 every time. I would also need a way to replace underscores "_" with a space " " and remove the escape slashes "\" from the descriptions.
This is one entry from the Parts file. r1 would be zirconium, r2=nanoplastic, and r3=regenerative plasteel. c1=39, c2=14, c3=5.
item_part 'Servo-Control'
||
pretty_name 'Servo-Control'
cost 81
weight 297
max_stack_size 5
resources
||
object 'Items\\Ingredients\\Ingredients.lua?Zirconium'
count 39
end
||
object 'Items\\Ingredients\\Ingredients.lua?Nanoplastic'
count 14
end
||
object 'Items\\Ingredients\\Ingredients.lua?Regenerative_Plasteel'
count 5
end
icon 'Icons\\Items\\Parts\\Part_Servo-Control'
description 'Complex control mechanism used to maintain the battlesuit\'s auxiliary movements.'
end
Any help would be greatly appreciated. I would prefer to be shown how to do it myself so I can set this up for each type of entry, but I wouldn't refuse if someone wrote some code .