well I'm not going to fix all of it now (mainly bc it's something that your working on) but i focused on what you said wasn't working, and it should be fixed hopefully, if not I'm sure you'll figure it out
timedLoop(3000, function() {
i = list[i+2] === undefined ? 0: i; // not testing ahead of time will be your downfall
var T = list[i++];
var TA = list[i++];
var TAB = list[i];
var rawID = getColumn(T, "id");
ID = rawID[c++];
//c++;
var rawID2 = getColumn(TA, "id") || "";
ID2 = rawID2[o++];
//o++;
var rawID3 = getColumn(TAB, "id");
ID3 = rawID3[u++];
console.log(ID);
console.log(ID2);
console.log(ID3);
//i += 2;
// GARBAGE?
//Delete protection (under heavy development)
if (1 == 2) { // I NEED SOME BLEACH AFTER THIS
if (ID != ID2 || (ID != ID3 || ID2 != ID3)) {
if (ID == ID3) {
readRecords(T, {id:ID}, function(records) {
createRecord(TA, records);
});
} else {
if (ID == ID2) {
readRecords(TA, {id:ID2}, function(records) {
createRecord(TAB, records);
});
}
if (ID2 == ID3) {
readRecords(TAB, {id:ID3}, function(records) {
updateRecord(T, records );
});
}
}
}
}
//edit protection
if (Gate) {
console.log(Gate);
Gate = false;
if (ID != undefined) {
readRecords(T, {id:ID}, function(r1) {
for (var i =0; i < r1.length; i++) {
x = JSON.stringify(r1[0]);
}
readRecords(TA, {id:ID2}, function(r2) {
for (var i =0; i < r2.length; i++) {
y = JSON.stringify(r2[0]);
}
readRecords(TAB, {id:ID3}, function(r3) { // callback has not closed, varriable records would be in scope
for (var i =0; i < r3.length; i++) {
z = JSON.stringify(r3[0]);
}
setTimeout(function() {
if (x != z || y != z || x != y) {//this is not working correctly
console.log(x + " | " + y + " | " + z);
if (x != z && x != y) {//this is not working correctly
one = 1;
console.log("1");
updateRecord(T, JSON.parse(y));
} else if ((y != x && y != z)) {//this is not working correctly
n = 10;
console.log("2");
updateRecord(TA, JSON.parse(z));
} else if ((z != x && z != y)) {//this is not working correctly
e = 100;
console.log("3");
updateRecord(TAB, JSON.parse(x));
}
//console.log("4");
dataline = one + ((n + e) || 0);
console.log(dataline);
}
Gate = true;
}, 2000);
});
});
});
} else {
Gate = true;
c = 0;
o = 0;
u = 0;
}
}
});