Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (let i = 0; i < array.length; i++) {
- if (d === 0 && a === 0)
- obj[merc][b] = {
- "title": "",
- "thumbnail": "",
- "effects": "",
- "details": "",
- "exceptions": ""
- }
- if (array[i] === "" && d === 5) {
- obj[merc][b].exceptions = print.split(",")
- c = true
- print = ""
- }
- if (array[i] === "") {
- if (obj[merc][b]["exceptions"] === "")
- delete obj[merc][b]["exceptions"]
- d = 0
- a = -1
- if (c === false)
- obj[merc][b].effects = print.split(",")
- c = false
- b++
- print = ""
- }
- else if (array[i] != "" && d === 0 && a === 0) {
- print += array[i]
- obj[merc][b].title = print
- print = ""
- }
- else if (array[i] != "" && d === 0 && a < 5) {
- print += array[i]
- d = 1
- }
- else if (array[i] != "" && a < 5) {
- print += "," + array[i]
- }
- else if (array[i] != "" && a === 5) {
- d = 2
- obj[merc][b].details = print.split(",")
- print = ""
- }
- if (array[i] === "Exception") {
- if (c === false)
- obj[merc][b].effects = print.split(",")
- print = ""
- d = 4
- }
- else if (array[i] != "Exception" && d === 2) {
- print += array[i]
- d = 3
- }
- else if (array[i] != "Exception" && d === 3) {
- print += "," + array[i]
- }
- else if (array[i] != "Exception" && d === 4) {
- print += array[i]
- d = 5
- }
- else if (d === 5) {
- print += "," + array[i] + ""
- }
- a++
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement