Giter VIP home page Giter VIP logo

Comments (4)

ttr avatar ttr commented on August 27, 2024

done this very hacky (and didn't actually make local repo to make this as PR)
ISAUI.lua
lines 137-160, replaced with:

		if noPZ > 1 then
			local text = "There are currently " .. noPZ .. " solar panels connected"
			player:Say(text)
		end
		
		if difference > 0 then
		    local dtime = ((capacity - actualCharge) / difference)
			local text4 = "The battery bank has enough solar panels to power my connected devices"
			if dtime > 0 then
				text4 = text4 .. " It will take about " .. math.abs(math.floor(dtime)) .. " hours to fully charge"
			end
			player:Say(text4)
		end
		
		if difference == 0 then
			local text4 = "The battery bank has enough solar panels to power my connected devices but not to charge batteries"
			player:Say(text4)
		end
		
		if difference < 0 then
		    local dtime = (actualCharge / difference)
			local text4 = ""
			if input > 0 then
				text4 = "I need more solar panels to power my devices."
			else
				text4 = "Panels do not generate electricity - need to check during sunny day."
		    end
			text4 = text4 .. " Power will remain for about " .. math.abs(math.floor(dtime)) .. "hours."
			player:Say(text4)
		end
		
		if batterynumber == 0 then
			local text3 = "There are no batteries to charge up the battery bank"
			player:Say(text3)
		end

I do hope my logic is correct.

from immersivesolararrays.

radx5Blue avatar radx5Blue commented on August 27, 2024

I haven't tested this but if it works I am happy to add it in, it all looks correct to me.

I don't have Zomboid installed and ready for modding at the moment, not until the end of Jan.

from immersivesolararrays.

ttr avatar ttr commented on August 27, 2024

Take your time. This is code I do use on my local copy and seems to be working fine.

from immersivesolararrays.

radx5Blue avatar radx5Blue commented on August 27, 2024

I have added this to the mod.

from immersivesolararrays.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.