Post by Ash on Aug 15, 2015 11:21:10 GMT
I made this suggestion to stop AFK Trainers, this will be simple to implement because there is an fork of TWC newer version which allows everyone to use it.
If you don't know what this means, ask me in-game.
-Ash
proc
AFK_Train_Scan()
lastusedAFKCheck = world.realtime
var/mob/Player/list/readers = list()
for(var/mob/Player/M in world)
if(M.readbooks)
readers.Add(M)
sleep(3)
for(var/mob/Player/M in world)
if(M.readbooks)
readers.Remove(M)
readers.Add(M)
for(var/mob/Player/M in readers)
spawn()
M.Checking = 1
M.answered = 0
var/question/q = pick(questions)
M << "<u>50 seconds left to reply.</u>"
spawn(200)
if(!M)return
if(!M.answered) M << "<u>30 seconds left to reply.</u>"
sleep(200)
if(!M)return
if(!M.answered) M << "<u><b>10 seconds left to reply.</b></u>"
sleep(100)
if(M && IsInputOpen(M, "AFK"))
del M._input["AFK"]
var
Input/popup = new (M, "AFK")
list/answers = Shuffle(q.wrong + q.correct)
alrt
if(answers.len > 3)
alrt = popup.InputList(M, q.question, "Presence Check", answers[1], answers)
else
alrt = popup.Alert(M, q.question, "Presence Check", answers[1], answers[2], answers.len == 3 ? answers[3] : null)
M.answered=1
M.Checking = 0
if(alrt != q.correct)M.Checking=1
sleep(500)
for(var/mob/Player/M in readers)
if(M && !M.Checking)
M.presence = 1
M << infomsg("You read faster.")
else
M.presence = null
M << infomsg("You feel sleepy and start reading slower.")
If there is anything left undefined tell me, there might be some issues because there MIGHT be no EventScheduler/basecamp in your build.If you don't know what this means, ask me in-game.
-Ash