Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. for (let i = 0; i < array.length; i++) {
  2. if (d === 0 && a === 0)
  3. obj[merc][b] = {
  4. "title": "",
  5. "thumbnail": "",
  6. "effects": "",
  7. "details": "",
  8. "exceptions": ""
  9. }
  10.  
  11. if (array[i] === "" && d === 5) {
  12. obj[merc][b].exceptions = print.split(",")
  13. c = true
  14. print = ""
  15. }
  16.  
  17. if (array[i] === "") {
  18. if (obj[merc][b]["exceptions"] === "")
  19. delete obj[merc][b]["exceptions"]
  20. d = 0
  21. a = -1
  22. if (c === false)
  23. obj[merc][b].effects = print.split(",")
  24. c = false
  25. b++
  26. print = ""
  27. }
  28. else if (array[i] != "" && d === 0 && a === 0) {
  29. print += array[i]
  30. obj[merc][b].title = print
  31. print = ""
  32. }
  33. else if (array[i] != "" && d === 0 && a < 5) {
  34. print += array[i]
  35. d = 1
  36. }
  37. else if (array[i] != "" && a < 5) {
  38. print += "," + array[i]
  39. }
  40. else if (array[i] != "" && a === 5) {
  41. d = 2
  42. obj[merc][b].details = print.split(",")
  43. print = ""
  44. }
  45.  
  46. if (array[i] === "Exception") {
  47. if (c === false)
  48. obj[merc][b].effects = print.split(",")
  49. print = ""
  50. d = 4
  51. }
  52. else if (array[i] != "Exception" && d === 2) {
  53. print += array[i]
  54. d = 3
  55. }
  56. else if (array[i] != "Exception" && d === 3) {
  57. print += "," + array[i]
  58. }
  59. else if (array[i] != "Exception" && d === 4) {
  60. print += array[i]
  61. d = 5
  62. }
  63. else if (d === 5) {
  64. print += "," + array[i] + ""
  65. }
  66. a++
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement