Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. Expression:
  2.  
  3. ^\"[a-z]+(\d+)\"\s+([A-Za-z ]*).*?(\[[A-Za-z]*\])? (PARASITE!)?$
  4.  
  5. Sample matches:
  6.  
  7. "grid69637" the empathic grid 100% / no damage [Draylor]
  8. "turret112775" a battle turret 100% / light damage [Nydekion] PARASITE!
  9. "collector63478" an energy collector 100% / critical damage [Malicia]
  10. "orb29874" a shield orb 100% / no damage
  11. "cube9235" a cloaking cube 100% / no damage PARASITE!
  12.  
  13.  
  14. 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)
  15.  
  16. --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
  17.  
  18. aetherModules[matches[2]] = {name = matches[3], damage = matches[4], info = matches[5],}
  19.  
  20. --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