Commit 6c4b02dd authored by Imran Hussain's avatar Imran Hussain

Based the replay fix on time instead of a flag

Makes it so when you join -> .restart -> .replay (that covers your join) you
don't get your .replay and then the scripts .replay after
parent 25766d8d
......@@ -339,12 +339,14 @@ function handleEvent(event) {
mw.print("DEBUG: tje.channel: " + tje.channel);
}
//if it's us, then do a auto replay but not in debugmode or if it's
// a replayed event
if (tje.user == mw.whoami() && !debugmode >= 1 && !replayed) {
// if it's us, then do a auto replay but not in
// debugmode or if it's a replayed event check by
// comparing the time of event to current time
// also set a flag for use later on
if (tje.user == mw.whoami() && !debugmode >= 1 && tje.unixtime == Math.floor(Date.now()/1000)) {
mw.exec("replay count 50");
// set the replayed flag so this if doesn't trigger again
replayed = true;
// set the replayed flag
replayed = true;
}
//stop talker_join handling
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment