Random rnd = new Random(); while(Run) { if(Self?.Location == null) { Delay(100); continue; } int x = Self.Location.X + rnd.Next(-1, 2); int y = Self.Location.Y + rnd.Next(-1, 2); Move(x, y); Delay(100); }