Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Expression:
- ^\"[a-z]+(\d+)\"\s+([A-Za-z ]*).*?(\[[A-Za-z]*\])? (PARASITE!)?$
- Sample matches:
- "grid69637" the empathic grid 100% / no damage [Draylor]
- "turret112775" a battle turret 100% / light damage [Nydekion] PARASITE!
- "collector63478" an energy collector 100% / critical damage [Malicia]
- "orb29874" a shield orb 100% / no damage
- "cube9235" a cloaking cube 100% / no damage PARASITE!
- What I am basically looking to do is create a table with the id numbers of the modules as keys. To each module, I hope to store its full name. (a cloaking cube) also if it has damage, followed by the other data. (person manning it and if it is infected)
- --ok, I'll leave writing the trigger to you. But if we assume matches[2] is the numeric id, matches[3] is full name, and matches[4] is the damage, and matches[5] is the other information you hope to capture, you would write the assignment out thusly
- aetherModules[matches[2]] = {name = matches[3], damage = matches[4], info = matches[5],}
- --for the grid then, you could access the information using aetherModules.69637.name would return "the empathic grid", aetherModules.69637.damage would return "no damage", and aetherModules.69637.info would return something like "[Draylor]"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement