ID:2342114
 
(See the best response by IainPeregrine.)
Code:
client
North()
..()
South()
..()
East()
..()
West()
..()
Northeast()
..()
Northwest()
..()
Southeast()
..()
Southwest()
..()
mob
var/tmp/speed=4
var/tmp/move_time = 0
Move()
if(!src.loc) return ..()
if(world.time < src.move_time) return 0
. = ..()
spawn src.NPCActivate()
spawn src.Regeneration()
spawn src.Quest_Cool()
if(.)
src.move_time = world.time + get_speed_delay(src.speed)
src.glide_size = get_glide_size(src.speed, src.dir)


Problem description:
Looking for a solution on how to add diagonal movements for arrow keys. I've tried using Keydown/KeyUp verbs, but holding down another macro +REP adds a latency or delay to movement commands. I'm wondering if it's possible to add a code for North(),South(),East() and West(). Not sure where to start.
Best response
You'll need to add an update loop that checks the client's key state. There are several libraries for this; I currently use Kaiochao.AnyMacro:

http://www.byond.com/developer/Kaiochao/AnyMacro

The basic idea is that the library tracks when a player presses down on a key, and then wait until they release it. Between those two events, that keystate is TRUE. Now imagine that you have a loop checking which keys are pressed down. As long as the player is pressing down the NORTH key, it'll move their mob NORTH. As long as the player is pressing the EAST key, it'll move their mob EAST. So if the player is pressing both NORTH and EAST, it'll move the player NORTH and EAST.