<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AAmmo_cost_efficiency</id>
	<title>Module:Ammo cost efficiency - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AAmmo_cost_efficiency"/>
	<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Ammo_cost_efficiency&amp;action=history"/>
	<updated>2026-05-05T14:02:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.runerealm.org/index.php?title=Module:Ammo_cost_efficiency&amp;diff=34412&amp;oldid=prev</id>
		<title>Alex: Created page with &quot;-- &lt;nowiki&gt; local p = {} local gep = mw.loadJsonData(&#039;Module:GEPrices/data.json&#039;) local curr = require(&#039;Module:Currency&#039;)._amount local yesNo = require(&#039;Module:Yesno&#039;)  function coins(x) 	return curr(string.format(&#039;%.2f&#039;, x), &#039;coins&#039;) end function p.main(frame) 	return p._main(frame.args) end  function p._main(args) 	mw.logObject(args) 	local UsingBlowpipe = yesNo(args[&#039;UsingBlowpipe&#039;]) 	local ScalePrice = gep[&#039;Zulrah\&#039;s scales&#039;] 	local AttackSpeed = args[&#039;AttackSpeed&#039;]...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Ammo_cost_efficiency&amp;diff=34412&amp;oldid=prev"/>
		<updated>2024-10-16T22:59:28Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;-- &amp;lt;nowiki&amp;gt; local p = {} local gep = mw.loadJsonData(&amp;#039;Module:GEPrices/data.json&amp;#039;) local curr = require(&amp;#039;Module:Currency&amp;#039;)._amount local yesNo = require(&amp;#039;Module:Yesno&amp;#039;)  function coins(x) 	return curr(string.format(&amp;#039;%.2f&amp;#039;, x), &amp;#039;coins&amp;#039;) end function p.main(frame) 	return p._main(frame.args) end  function p._main(args) 	mw.logObject(args) 	local UsingBlowpipe = yesNo(args[&amp;#039;UsingBlowpipe&amp;#039;]) 	local ScalePrice = gep[&amp;#039;Zulrah\&amp;#039;s scales&amp;#039;] 	local AttackSpeed = args[&amp;#039;AttackSpeed&amp;#039;]...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- &amp;lt;nowiki&amp;gt;&lt;br /&gt;
local p = {}&lt;br /&gt;
local gep = mw.loadJsonData(&amp;#039;Module:GEPrices/data.json&amp;#039;)&lt;br /&gt;
local curr = require(&amp;#039;Module:Currency&amp;#039;)._amount&lt;br /&gt;
local yesNo = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function coins(x)&lt;br /&gt;
	return curr(string.format(&amp;#039;%.2f&amp;#039;, x), &amp;#039;coins&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	return p._main(frame.args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	mw.logObject(args)&lt;br /&gt;
	local UsingBlowpipe = yesNo(args[&amp;#039;UsingBlowpipe&amp;#039;])&lt;br /&gt;
	local ScalePrice = gep[&amp;#039;Zulrah\&amp;#039;s scales&amp;#039;]&lt;br /&gt;
	local AttackSpeed = args[&amp;#039;AttackSpeed&amp;#039;]&lt;br /&gt;
	local CurrentDPS = args[&amp;#039;CurrentDPS&amp;#039;]&lt;br /&gt;
	local UpgradedDPS = args[&amp;#039;UpgradedDPS&amp;#039;]&lt;br /&gt;
	local AvaDevice = args[&amp;#039;AvaDevice&amp;#039;]&lt;br /&gt;
	local AmmoType = args[&amp;#039;AmmoType&amp;#039;]&lt;br /&gt;
	local CurrentAmmo = args[string.format(&amp;#039;Current%s&amp;#039;, AmmoType)]&lt;br /&gt;
	local UpgradedAmmo = args[string.format(&amp;#039;Upgraded%s&amp;#039;, AmmoType)]&lt;br /&gt;
	ScalePrice = tonumber(ScalePrice)&lt;br /&gt;
	AttackSpeed = tonumber(AttackSpeed)&lt;br /&gt;
	CurrentDPS = tonumber(CurrentDPS)&lt;br /&gt;
	UpgradedDPS = tonumber(UpgradedDPS)&lt;br /&gt;
	AvaDevice = string.lower(AvaDevice)&lt;br /&gt;
	&lt;br /&gt;
	local ret = makeTable(UsingBlowpipe, ScalePrice, AttackSpeed, CurrentDPS, UpgradedDPS, AvaDevice, CurrentAmmo, UpgradedAmmo)&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local AvaDeviceRate = {&lt;br /&gt;
	none = 1,&lt;br /&gt;
	[&amp;#039;avas attractor&amp;#039;] = 0.4,&lt;br /&gt;
	[&amp;#039;avas accumulator&amp;#039;] = 0.28,&lt;br /&gt;
	[&amp;#039;avas assembler&amp;#039;] = 0.2&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function makeTable(UsingBlowpipe, ScalePrice, AttackSpeed, CurrentDPS, UpgradedDPS, AvaDevice, CurrentAmmo, UpgradedAmmo)&lt;br /&gt;
	local ScaleCost = UsingBlowpipe and ScalePrice * 2 / 3 or 0&lt;br /&gt;
	local CurrentAmmoCost = gep[CurrentAmmo] or 0&lt;br /&gt;
	local UpgradedAmmoCost = gep[UpgradedAmmo] or 0&lt;br /&gt;
	local CurrentCostPerTick = ((CurrentAmmoCost * AvaDeviceRate[AvaDevice]) + ScaleCost) / AttackSpeed&lt;br /&gt;
	local UpgradedCostPerTick = ((UpgradedAmmoCost * AvaDeviceRate[AvaDevice]) + ScaleCost) / AttackSpeed&lt;br /&gt;
	local DPSRatio = CurrentDPS / UpgradedDPS&lt;br /&gt;
	local SecondsSaved = 3600 - DPSRatio * 3600&lt;br /&gt;
	local TicksSaved = (3600 - SecondsSaved) / 0.6&lt;br /&gt;
	local HourRatio = 3600 / SecondsSaved&lt;br /&gt;
	local CurrentCostPerHour = 6000 * CurrentCostPerTick&lt;br /&gt;
	local UpgradedCostPerHour = TicksSaved * UpgradedCostPerTick&lt;br /&gt;
	&lt;br /&gt;
	local t = mw.html.create(&amp;#039;table&amp;#039;)&lt;br /&gt;
	t:addClass(&amp;#039;wikitable&amp;#039;)&lt;br /&gt;
	t:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
		:tag(&amp;#039;th&amp;#039;)&lt;br /&gt;
			:wikitext(&amp;#039;GP/Hour&amp;#039;)&lt;br /&gt;
			:addClass(&amp;#039;unsortable&amp;#039;)&lt;br /&gt;
		:done()&lt;br /&gt;
	:done()&lt;br /&gt;
	:tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
		:wikitext(coins((UpgradedCostPerHour - CurrentCostPerHour) * HourRatio))&lt;br /&gt;
	:done()&lt;br /&gt;
	return t&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;br /&gt;
-- &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
</feed>