• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

EN [FIXED] setTimeout()

Brok3nmind

Member
My Problem was i did'nt know how to set timeouts.
I fixed it myself and I hope you can do something with it.

Code:
JavaScript:
function (sinusbot, config) {
    var event = require('event');
    var engine = require('engine');
    event.on('clientMove', function (ev) {
        if (ev.fromChannel == undefined) {
            setTimeout(function () {
                ev.client.chat("Your Text");
            }, 1000);
        }
    });
});
Or link: https://pastebin.com/h51cxV4c
 
Last edited:
Please check the official mozilla docs on how to use setTimeout
 
The setTimeout method calls the function which has been given as first parameter after the set milliseconds which should be the 2nd parameter of the setTimeout function

JavaScript:
//sends "hello world" after 2 seconds
setTimeout(() => console.log("hello world"), 2000)
 
He didn't post you the exact code, he just told you how does it work.

Replace console.log with thing you want there.
 
Then please update to the insider version which you can find under resources
 
Paste the code here again, and please re-check your version in "Settings" - "Info" - "About".

PS: Check logs for errors..
 
I dont have errors but i fixed the problem myself
Wouldn't be too bad, if you post the solution, so if someone else has such a problem in the future, can just look it up here.

EDIT: Nevermind, you even purged your initial post. Well played! 🙈
 
Back
Top Bottom