Deprecated: Use of "parent" in callables is deprecated in /var/www/html/forum/src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php on line 431
  • 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:

Multivitamin

Well-Known Member
Tier III
is awesome!
V.I.P.
is uber awesome!
Contributor
Insider
Please check the official mozilla docs on how to use setTimeout
 

Multivitamin

Well-Known Member
Tier III
is awesome!
V.I.P.
is uber awesome!
Contributor
Insider
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)
 

DrWarpMan

Well-Known Member
Contributor
Insider
He didn't post you the exact code, he just told you how does it work.

Replace console.log with thing you want there.
 

Multivitamin

Well-Known Member
Tier III
is awesome!
V.I.P.
is uber awesome!
Contributor
Insider
Then please update to the insider version which you can find under resources
 

DrWarpMan

Well-Known Member
Contributor
Insider
Paste the code here again, and please re-check your version in "Settings" - "Info" - "About".

PS: Check logs for errors..
 

TwentyFour

BinusSot Junkie
V.I.P.
Contributor
Insider
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! 🙈
 

flyth

is reticulating splines
Staff member
Developer
Contributor
You guys didn't helped me lol
Dude, are you serious? These guys DID help you - maybe it wasn't the solution for you, but they invested time in your issue and you should be more thankful for that...
Simply deleting stuff is not how a forum works: it's supposed to help others who might run into the same problem.
 
Top