ID:267431
 
Is it possible to see if the person has held a certain Key like 'A' as a macro for so much time? How ever if they dont hold it for that long then it wount do what ever statments its suppose to.
Green Lime wrote:
Is it possible to see if the person has held a certain Key like 'A' as a macro for so much time? How ever if they dont hold it for that long then it wount do what ever statments its suppose to.

Nope.

Lummox JR
Not very effectively, you might be have a tick that checks to see if the player has used that macro's verb within the last tick, but this would prevent people from doing anything other than hold their macro key down, and really and truly, they could just sit there hitting it really fast if they felt like it.

Thats how I see it anyways, perhaps someone else has more insight to this.
Green Lime wrote:
Is it possible to see if the person has held a certain Key like 'A' as a macro for so much time? How ever if they dont hold it for that long then it wount do what ever statments its suppose to.

var
Players[]

client
var
centertime = 0
centerflag = 0

Center()
centerflag = 1

mob
Login()
. = ..()
Players += src
Logout()
Players -= src
return ..()

world
proc
KeyCheck()
var/mob/M
for(M in players)
if(M.client.centerflag)
M.client.centertime++
else
M.client.centertime = 0
M.client.centerflag = 0
spawn(1)
world.KeyCheck()

New()
Players = new()
spawn()
KeyCheck()
return ..()


Over a good network that should allow you to see how long a person has held down the center key in 1/10th seconds. Just check the client.centertime.