Pink Hat
Pink Hat
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
#thanks
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
this.pattern = [
{
method: new Function('console.log("Counter: 1")'),
bulletDelay: 1000
} ,{
method: new Function('console.log("Counter: 2")'),
bulletDelay: 1000

} ,{
method: new Function('console.log("Counter: 3")'),
bulletDelay: 1000

}
]

for (this.i in this.pattern) {
await new Promise(
(resolve) => {
setTimeout(
() => {
this.pattern[this.i].method();
resolve();
},
function (i, j){
// stuff

return this.z;
}(this.i, 0)
)
console.log(this.pattern[this.i])
});
}
this.pattern = [
{
method: new Function('console.log("Counter: 1")'),
bulletDelay: 1000
} ,{
method: new Function('console.log("Counter: 2")'),
bulletDelay: 1000

} ,{
method: new Function('console.log("Counter: 3")'),
bulletDelay: 1000

}
]

for (this.i in this.pattern) {
await new Promise(
(resolve) => {
setTimeout(
() => {
this.pattern[this.i].method();
resolve();
},
function (i, j){
// stuff

return this.z;
}(this.i, 0)
)
console.log(this.pattern[this.i])
});
}
and now we can close this. thanks for the help @ScriptyChris
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
I found a piece of code that works (slightly waltered from yours)
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
it works
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
I want the promise to pass after a certain time. if I do
new Promise(resolve).then(() => console.log(/* stuff */)
new Promise(resolve).then(() => console.log(/* stuff */)
then what does that do
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
im confused as hell
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
what do u mean by this
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
huh?
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
it doesnt even wait the time it needs to
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
now it's worse
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
so
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
nvm that
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
ok.
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
because it seems the await doesnt have anything referencing it
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
and inside the .then you would put what exactly?
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
ok. I'll try it
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
would that work?
69 replies
RReactiflux
Created by Pink Hat on 2/15/2023 in #help-js
✅ – Pink Hat – 00-54 Feb 15
in the for function?
69 replies