Discuss Scratch

Niltoz
Scratcher
14 posts

AFK Checker

How do I make an AFK checker for my game.

Project Link: Online test

Last edited by Niltoz (June 2, 2021 14:00:18)

JaCreatot
Scratcher
100+ posts

AFK Checker

All you need is to check if nothing changes, make a timer variable, when it reaches a certain time in seconds have it activate the afk code. The check could check x&y, cursor position, clicks in a certain time, many things, they just have to be something common.

If you find my responses helpful, please consider following me! My Alternate Accounts Are:@JaCrealtot, @AtlasKone, @OfNoNames//Front Page Curated Projects:1

Niltoz
Scratcher
14 posts

AFK Checker

Hmm thanks for the help
Niltoz
Scratcher
14 posts

AFK Checker

I am having trouble with making it.. Any Help
The_Imaginarium
Scratcher
1000+ posts

AFK Checker

forever
set [Old mouse x v] to (mouse x)
set [Old mouse y v] to (mouse y)
if <<key [any v] pressed?> or <mouse down?>> then
reset timer // the user did something
end
if <<not <(mouse x) = (Old mouse x)>> or <not <(mouse y) = (Old mouse y)>>> then
reset timer // the moused moved
end
if <(timer) > [10]> then // replace 10 with the time you want
afk :: #969696
end
end
Niltoz
Scratcher
14 posts

AFK Checker

The_Imaginarium wrote:

forever
set [Old mouse x v] to (mouse x)
set [Old mouse y v] to (mouse y)
if <<key [any v] pressed?> or <mouse down?>> then
reset timer // the user did something
end
if <<not <(mouse x) = (Old mouse x)>> or <not <(mouse y) = (Old mouse y)>>> then
reset timer // the moused moved
end
if <(timer) > [10]> then // replace 10 with the time you want
afk :: #969696
end
end
ks

thanks
Binary-Logic
Scratcher
100+ posts

AFK Checker

I made one here if you need it.

The greatest glory in living lies not in never falling, but in rising every time we fall.

-Nelson Mandela
___lol__---
Scratcher
2 posts

AFK Checker

hey, idk how to make the afk button
satyasundar
Scratcher
19 posts

AFK Checker

___lol__--- wrote:

hey, idk how to make the afk button

The AFK button? Well it's quite easy, click the “My Blocks” category (the last category), and then click “Make a Block” then, name the block AFK and add in the following functions as stated above, or add your own functions to it.

Hope this helps!

Last edited by satyasundar (March 31, 2024 08:55:44)

Unithlees3
Scratcher
1000+ posts

AFK Checker

___lol__--- wrote:

hey, idk how to make the afk button
why did you bring up a topic from 3 years ago
it was already resolved

Last edited by Unithlees3 (March 31, 2024 11:09:45)


this is a signature, it goes beneath my posts and a link here isn't considered advertising

meh youtube channel is here
___lol__---
Scratcher
2 posts

AFK Checker

The_Imaginarium wrote:

forever
set [Old mouse x v] to (mouse x)
set [Old mouse y v] to (mouse y)
if <<key [any v] pressed?> or <mouse down?>> then
reset timer // the user did something
end
if <<not <(mouse x) = (Old mouse x)>> or <not <(mouse y) = (Old mouse y)>>> then
reset timer // the moused moved
end
if <(timer) > [10]> then // replace 10 with the time you want
afk :: #969696
end
end
/scratchblocks][/quote]

Powered by DjangoBB