#General help with script, I am learning

10 messages · Page 1 of 1 (latest)

fossil sierraBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

limpid moth
#

Here is an example script with click cooldown, try to learn from it :>

compact thistleBOT
#

Paste version of example.js from @limpid moth

limpid moth
#

you first initialize the last interaction variable (here it is called "lastClickTime")

#

then once the function is called make a variable storing current time (here it is called "currentTime")

#

and lastly on "accepted" interaction set lastClickTime to current time

#

for the cooldown you use currentTime - lastClickTime and it is in miliseconds

limpid moth
#

hmm give me a second

#

Date().getTime doesn't return time in ms

#

no problem :D