Kolorwanie:
Status:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
function check()

	result = 0

	if (not(CONFIG)) then
	return true
	end

	------------------------------------------------

	-- check stamina

	------------------------------------------------

	if (CONFIG.CAP) then

		local current = (Self.Cap() + 1)
		local minimum = CONFIG.CAP

		if (current <= CONFIG.CAP) then

			print("check: cap [" .. (current - 1) .. "/" .. minimum .. "]")
			result = (result + 1)

		end

	end

	------------------------------------------------

	if (CONFIG.SUPPLIES) then

		------------------------------------------------

		if (CONFIG.SUPPLIES.HP) then

			for i = 1, #CONFIG.SUPPLIES.HP do

				local name = CONFIG.SUPPLIES.HP[i][1]
				local id = getItemInfo(name, "id")
				local current = Self.ItemCount(id)
				local minimum = CONFIG.SUPPLIES.HP[i][3]
				local maximum = CONFIG.SUPPLIES.HP[i][2]

				if (current <= minimum)  then

					print("check: " .. name .. " [" .. current .. "/" .. maximum .. "]")
					result = (result + 1)

				end

			end

		end

		------------------------------------------------

		if (CONFIG.SUPPLIES.MP) then

			for i = 1, #CONFIG.SUPPLIES.MP do

				local name = CONFIG.SUPPLIES.MP[i][1]
				local id = getItemInfo(name, "id")
				local current = Self.ItemCount(id)
				local minimum = CONFIG.SUPPLIES.MP[i][3]
				local maximum = CONFIG.SUPPLIES.MP[i][2]

				if (current <= minimum)  then

					print("check: " .. name .. " [" .. current .. "/" .. maximum .. "]")
					result = (result + 1)

				end

			end

		end

		------------------------------------------------

		if (CONFIG.SUPPLIES.RUNE) then

			for i = 1, #CONFIG.SUPPLIES.RUNE do

				local name = CONFIG.SUPPLIES.RUNE[i][1]
				local id = getItemInfo(name, "id")
				local current = Self.ItemCount(id)
				local minimum = CONFIG.SUPPLIES.RUNE[i][3]
				local maximum = CONFIG.SUPPLIES.RUNE[i][2]

				if (current <= minimum)  then

					print("check: " .. name .. " [" .. current .. "/" .. maximum .. "]")
					result = (result + 1)

				end

			end

		end

		------------------------------------------------

		if (CONFIG.SUPPLIES.AMMUNITION) then

			for i = 1, #CONFIG.SUPPLIES.AMMUNITION do

				local name = CONFIG.SUPPLIES.AMMUNITION[i][1]
				local id = getItemInfo(name, "id")
				local current = Self.ItemCount(id)
				local minimum = CONFIG.SUPPLIES.AMMUNITION[i][3]
				local maximum = CONFIG.SUPPLIES.AMMUNITION[i][2]

				if (current <= minimum)  then

					print("check: " .. name .. " [" .. current .. "/" .. maximum .. "]")
					result = (result + 1)

				end

			end

		end

		------------------------------------------------

	end

	------------------------------------------------

	if (result == 0) then
		result = false
		else
		result = true
	end

return result
end

Copyrights 2014-2020 © Wklejaj.pl Wszelkie prawa zastrzeżone.