private byte[] getElements(String str) {
		byte[] elements = null;
		boolean found = false;
		Matcher matcher = RANGE.matcher(str);
		if (matcher.find()) {
			found = true;
			String[] s = str.substring(0, matcher.end()).split("-");
			byte start, end;
			try {
				start = Byte.valueOf(s[0].trim()).byteValue();
				end = Byte.valueOf(s[1].trim()).byteValue();
			} catch (NumberFormatException e) {
				out(ScriptEvent.FAILED, "Element limits must be integers (<256): " + str);
				return null;
			}
			if (end < start) {
				out(ScriptEvent.FAILED, "The second number of a range must be greater than the first: " + str);
				return null;
			}
			elements = new byte[end - start + 1];
			for (byte i = start; i <= end; i++)
				elements[i - start] = i;
		}
		if (!found) {
			matcher = INTEGER_GROUP.matcher(str);
			if (matcher.find()) {
				found = true;
				String[] s = str.split(REGEX_SEPARATOR + "+");
				elements = new byte[s.length];
				try {
					for (int i = 0; i < s.length; i++)
						elements[i] = Byte.valueOf(s[i].trim()).byteValue();
				} catch (NumberFormatException e) {
					out(ScriptEvent.FAILED, "Element types must be integers (<256): " + str);
					return null;
				}
			}
		}
		if (!found) {
			matcher = INDEX.matcher(str);
			if (matcher.find()) {
				found = true;
				byte id = 0;
				try {
					id = Byte.valueOf(str.substring(0, matcher.end()).trim()).byteValue();
				} catch (NumberFormatException e) {
					out(ScriptEvent.FAILED, "Element type must be an integer (<256): " + str);
					return null;
				}
				elements = new byte[] { id };
			}
		}
		if (!found)
			return null;
		return elements;
	}