<?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%3ASkilling_experience_rate_chart</id>
	<title>Module:Skilling experience rate chart - 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%3ASkilling_experience_rate_chart"/>
	<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Skilling_experience_rate_chart&amp;action=history"/>
	<updated>2026-04-30T16:28:28Z</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:Skilling_experience_rate_chart&amp;diff=35151&amp;oldid=prev</id>
		<title>Alex: Created page with &quot;local chart = require( &#039;Module:Chart data&#039; ) local skillingSuccess = require( &#039;Module:Skilling success chart&#039; )  local p = {}  -- s/tick local tickRate = 0.6  function p._calculateDataSets(args) 	local dataSets = skillingSuccess._calculateDataSets(args) 	-- Assuming an xp drop every single action 	local tickDelay = args.ticksPerAction * tickRate 	local maxXpHr = (3600 / tickDelay) * args.xpPerAction * (1 + args.xpBonus)  	for i, dataSet in ipairs(dataSets) do 		if dataSe...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Skilling_experience_rate_chart&amp;diff=35151&amp;oldid=prev"/>
		<updated>2024-10-16T23:13:08Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local chart = require( &amp;#039;Module:Chart data&amp;#039; ) local skillingSuccess = require( &amp;#039;Module:Skilling success chart&amp;#039; )  local p = {}  -- s/tick local tickRate = 0.6  function p._calculateDataSets(args) 	local dataSets = skillingSuccess._calculateDataSets(args) 	-- Assuming an xp drop every single action 	local tickDelay = args.ticksPerAction * tickRate 	local maxXpHr = (3600 / tickDelay) * args.xpPerAction * (1 + args.xpBonus)  	for i, dataSet in ipairs(dataSets) do 		if dataSe...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local chart = require( &amp;#039;Module:Chart data&amp;#039; )&lt;br /&gt;
local skillingSuccess = require( &amp;#039;Module:Skilling success chart&amp;#039; )&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- s/tick&lt;br /&gt;
local tickRate = 0.6&lt;br /&gt;
&lt;br /&gt;
function p._calculateDataSets(args)&lt;br /&gt;
	local dataSets = skillingSuccess._calculateDataSets(args)&lt;br /&gt;
	-- Assuming an xp drop every single action&lt;br /&gt;
	local tickDelay = args.ticksPerAction * tickRate&lt;br /&gt;
	local maxXpHr = (3600 / tickDelay) * args.xpPerAction * (1 + args.xpBonus)&lt;br /&gt;
&lt;br /&gt;
	for i, dataSet in ipairs(dataSets) do&lt;br /&gt;
		if dataSet[&amp;#039;data&amp;#039;] then&lt;br /&gt;
			for j, point in ipairs(dataSet[&amp;#039;data&amp;#039;]) do&lt;br /&gt;
				local successChance = point[&amp;#039;y&amp;#039;]&lt;br /&gt;
				local failureChance = 1 - successChance&lt;br /&gt;
				if args.failurePenalty &amp;lt;= 0 or failureChance == 0 then&lt;br /&gt;
					-- /Long-term/ expected xp/hr&lt;br /&gt;
					dataSets[i][&amp;#039;data&amp;#039;][j][&amp;#039;y&amp;#039;] = math.floor(maxXpHr * successChance)&lt;br /&gt;
				else&lt;br /&gt;
					-- need to recalculate max XP/hr, accounting for the expected tick penalty&lt;br /&gt;
					local expectedDelay = (tickDelay * successChance) + (args.failurePenalty * tickRate) * failureChance&lt;br /&gt;
					local adjustedMaxXpHr = (3600 / expectedDelay) * args.xpPerAction * (1 + args.xpBonus)&lt;br /&gt;
					&lt;br /&gt;
					dataSets[i][&amp;#039;data&amp;#039;][j][&amp;#039;y&amp;#039;] = math.floor(adjustedMaxXpHr * successChance)&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return dataSets&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = frame:getParent().args&lt;br /&gt;
	args.ticksPerAction = tonumber(args.ticksPerAction or 4)&lt;br /&gt;
	args.failurePenalty = tonumber(args.failurePenalty or 0)&lt;br /&gt;
	-- silent failure&lt;br /&gt;
	args.xpPerAction = tonumber(args.xpPerAction or 0)&lt;br /&gt;
	args.xpBonus = tonumber(args.xpBonus or 0)&lt;br /&gt;
	args.yStep = tonumber(args.yStep or 5000)&lt;br /&gt;
&lt;br /&gt;
    local plot = chart.newChart{ type = &amp;#039;scatter&amp;#039; }&lt;br /&gt;
        :setTitle( args.label )&lt;br /&gt;
        :setDimensions( &amp;#039;540px&amp;#039;, &amp;#039;400px&amp;#039;, &amp;#039;540px&amp;#039;, &amp;#039;400px&amp;#039;, true )&lt;br /&gt;
        :setXLabel( args.xlabel or &amp;#039;Level&amp;#039; )&lt;br /&gt;
        :setYLabel( args.ylabel or &amp;#039;XP per hour&amp;#039; )&lt;br /&gt;
        :setXLimits( nil, nil, 1 )&lt;br /&gt;
        :setYLimits( (args.startAtZero == &amp;#039;yes&amp;#039; and 0 or nil), nil, args.yStep )&lt;br /&gt;
        :setDatasetsPerGroup(3)&lt;br /&gt;
   &lt;br /&gt;
	local dataSets = p._calculateDataSets(args)&lt;br /&gt;
	for i, dataSet in ipairs(dataSets) do&lt;br /&gt;
		plot:newDataSet(dataSet)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
    return plot&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
</feed>