<?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%3AMaster_comparison_calculator</id>
	<title>Module:Master comparison calculator - 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%3AMaster_comparison_calculator"/>
	<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Master_comparison_calculator&amp;action=history"/>
	<updated>2026-05-05T16:27:55Z</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:Master_comparison_calculator&amp;diff=35043&amp;oldid=prev</id>
		<title>Alex: Created page with &quot;local Paramtest = require( &#039;Module:Paramtest&#039; ) local Slayerlib = require (&#039;Module:Slayer_task_library&#039; ) local SlayerConsts = require(&#039;Module:SlayerConsts&#039;)  local p = {}  function p.invoke_main( frame ) 	local result = p.main( frame:getParent().args ) 	 	return result end   function p.tobool(str) 	if str == &#039;true&#039; then 		return true 	end 	return false end  function p.main( args ) 	-- Handle inputs 	local desiredTask = Paramtest.defaults{ 		{ args.wantedTask, &#039;None&#039; }...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Master_comparison_calculator&amp;diff=35043&amp;oldid=prev"/>
		<updated>2024-10-16T23:12:40Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local Paramtest = require( &amp;#039;Module:Paramtest&amp;#039; ) local Slayerlib = require (&amp;#039;Module:Slayer_task_library&amp;#039; ) local SlayerConsts = require(&amp;#039;Module:SlayerConsts&amp;#039;)  local p = {}  function p.invoke_main( frame ) 	local result = p.main( frame:getParent().args ) 	 	return result end   function p.tobool(str) 	if str == &amp;#039;true&amp;#039; then 		return true 	end 	return false end  function p.main( args ) 	-- Handle inputs 	local desiredTask = Paramtest.defaults{ 		{ args.wantedTask, &amp;#039;None&amp;#039; }...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local Paramtest = require( &amp;#039;Module:Paramtest&amp;#039; )&lt;br /&gt;
local Slayerlib = require (&amp;#039;Module:Slayer_task_library&amp;#039; )&lt;br /&gt;
local SlayerConsts = require(&amp;#039;Module:SlayerConsts&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.invoke_main( frame )&lt;br /&gt;
	local result = p.main( frame:getParent().args )&lt;br /&gt;
	&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function p.tobool(str)&lt;br /&gt;
	if str == &amp;#039;true&amp;#039; then&lt;br /&gt;
		return true&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main( args )&lt;br /&gt;
	-- Handle inputs&lt;br /&gt;
	local desiredTask = Paramtest.defaults{&lt;br /&gt;
		{ args.wantedTask, &amp;#039;None&amp;#039; }&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	local combatLevel, slayerLevel, defenceLevel, agilityLevel, rangedLevel, strengthLevel, hitpointsLevel, thievingCheck, firemakingCheck, magicCheck = Paramtest.defaults{&lt;br /&gt;
		{ tonumber(args.combatLevel), 1 },&lt;br /&gt;
		{ tonumber(args.slayerLevel), 1 },&lt;br /&gt;
		{ tonumber(args.defenceLevel), 1 },&lt;br /&gt;
		{ tonumber(args.agilityLevel), 1 },&lt;br /&gt;
		{ tonumber(args.rangedLevel), 1 },&lt;br /&gt;
		{ tonumber(args.strengthLevel), 1 },&lt;br /&gt;
		{ tonumber(args.hitpointsLevel), 10 },&lt;br /&gt;
		{ args.thievingCheck, true },&lt;br /&gt;
		{ args.firemakingCheck, true },&lt;br /&gt;
		{ args.magicCheck, true }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	local block1, block2, block3, block4, block5, block6 = Paramtest.defaults{&lt;br /&gt;
		{ args.block1, &amp;#039;None&amp;#039;},&lt;br /&gt;
		{ args.block2, &amp;#039;None&amp;#039;},&lt;br /&gt;
		{ args.block3, &amp;#039;None&amp;#039;},&lt;br /&gt;
		{ args.block4, &amp;#039;None&amp;#039;},&lt;br /&gt;
		{ args.block5, &amp;#039;None&amp;#039;},&lt;br /&gt;
		{ args.block6, &amp;#039;None&amp;#039;},&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	local blocks = {&lt;br /&gt;
		block1,&lt;br /&gt;
		block2,&lt;br /&gt;
		block3,&lt;br /&gt;
		block4,&lt;br /&gt;
		block5,&lt;br /&gt;
		block6&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	-- Magic number 23 since this is the highest level required for thieving (magic axes)&lt;br /&gt;
	local thievingLevel = 23&lt;br /&gt;
	if p.tobool(thievingCheck) == false then&lt;br /&gt;
		thievingLevel = 1&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Magic number 33 since this is the highest level required for firemaking&lt;br /&gt;
	local firemakingLevel = 33&lt;br /&gt;
	if p.tobool(firemakingCheck) == false then&lt;br /&gt;
		firemakingLevel = 1&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Magic number 50 since this is the highest level required for magic&lt;br /&gt;
	local magicLevel = 50&lt;br /&gt;
	if p.tobool(magicCheck) == false then&lt;br /&gt;
		magicLevel = 1&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Need to create a stats table, unlocks table, quests table, and other table&lt;br /&gt;
	local stats = {&lt;br /&gt;
		Combat = combatLevel,&lt;br /&gt;
		Slayer = slayerLevel,&lt;br /&gt;
		Magic = magicLevel,&lt;br /&gt;
		Agility = agilityLevel,&lt;br /&gt;
		Strength = strengthLevel,&lt;br /&gt;
		Firemaking = firemakingLevel,&lt;br /&gt;
		Defence = defenceLevel,&lt;br /&gt;
		Hitpoints = hitpointsLevel,&lt;br /&gt;
		Ranged = rangedLevel,&lt;br /&gt;
		Thieving = thievingLevel&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	-- Since the checkboxes return the name of the unlock (same as in UNLOCK_IDS)&lt;br /&gt;
	-- if checked and nil if not checked, this array will only be the names of&lt;br /&gt;
	-- activated unlocks.&lt;br /&gt;
	local unlocks = { args.seeingRed, args.iHopeYouMithMe, args.watchTheBirdie,&lt;br /&gt;
		args.hotStuff, args.reptileGotRipped, args.likeABoss, args.stopTheWyvern, &lt;br /&gt;
		args.basilocked, args.unlockedVamps, args.iWildyMoreSlayer&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	-- Similarly, this will become a list of completed quests.&lt;br /&gt;
	local quests = {&lt;br /&gt;
		args.priestInPeril,&lt;br /&gt;
		args.dragonSlayerII,&lt;br /&gt;
		args.dragonSlayer,&lt;br /&gt;
		args.cabinFever,&lt;br /&gt;
		args.horrorFromTheDeep,&lt;br /&gt;
		args.mourningsEndPartII,&lt;br /&gt;
		args.desertTreasure,&lt;br /&gt;
		args.regicide,&lt;br /&gt;
		args.boneVoyage,&lt;br /&gt;
		args.lostCity,&lt;br /&gt;
		args.elementalWorkshopI,&lt;br /&gt;
		args.deathPlateau,&lt;br /&gt;
		args.lunarDiplomacy,&lt;br /&gt;
		args.olafsQuest,&lt;br /&gt;
		args.contact,&lt;br /&gt;
		args.rumDeal,&lt;br /&gt;
		args.skippyAndTheMogres,&lt;br /&gt;
		args.deathToTheDorgeshuun,&lt;br /&gt;
		args.legendsQuest,&lt;br /&gt;
		args.ernestTheChicken,&lt;br /&gt;
		args.royalTrouble,&lt;br /&gt;
		args.hauntedMine,&lt;br /&gt;
		args.porcineOfInterest,&lt;br /&gt;
		args.SecretsOfTheNorth,&lt;br /&gt;
		args.DesertTreasure2,&lt;br /&gt;
		args.perilousMoons&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	-- List of completed other activities.&lt;br /&gt;
	local accessGWD = nil&lt;br /&gt;
	if stats[&amp;quot;Strength&amp;quot;] &amp;gt;= 60 or stats[&amp;quot;Agility&amp;quot;] &amp;gt;= 60 then&lt;br /&gt;
		accessGWD = &amp;#039;Access GWD&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	local other = {&lt;br /&gt;
		args.ancientCavern,&lt;br /&gt;
		accessGWD,&lt;br /&gt;
		args.brittleKey,&lt;br /&gt;
		args.accessAbyss&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	-- Handle specific tasks that can actually have 2 assignments&lt;br /&gt;
&lt;br /&gt;
	-- Create the player status given our various inputs&lt;br /&gt;
	status = Slayerlib.create_status(stats, quests, unlocks, other, blocks)&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
	-- Add skeleton hellhounds, demonic gorillas, and any other multi-task enemies to this list&lt;br /&gt;
	-- Vorkath may need to be updated with zombie&lt;br /&gt;
	-- I doubt Zulrah is a sea snake&lt;br /&gt;
&lt;br /&gt;
	-- What makes a monster &amp;quot;special&amp;quot;?&lt;br /&gt;
	-- A monster should be considered &amp;quot;special&amp;quot; if it is not a direct task but&lt;br /&gt;
	-- there is a valid reason for wanting to kill it.&lt;br /&gt;
	-- Bosses are not considered a direct task, the &amp;quot;Boss&amp;quot; task is the direct task.&lt;br /&gt;
	-- Therefore, this table will be largely subjective.&lt;br /&gt;
	&lt;br /&gt;
	-- Tasks like Demonic Gorillas could be considered special since there is a&lt;br /&gt;
	-- reason to kill them, but Demonic Gorillas themselves are not a task.&lt;br /&gt;
	&lt;br /&gt;
	-- On the other hand, tasks like Undead Chickens *could* be considered special&lt;br /&gt;
	-- since they count for both Zombie and Chicken tasks, but is there a reason&lt;br /&gt;
	-- to actually want them as a task? Adding them for completion could be nice&lt;br /&gt;
	-- but given how unwieldy the calc already is, this seems like a bad idea.&lt;br /&gt;
	&lt;br /&gt;
	-- Note that the Grotesque Guardians technically require the brittle key to get them&lt;br /&gt;
	-- as a boss task. Adding that as yet another requirement for something that affects&lt;br /&gt;
	-- a fraction of a percent for only boss tasks doesn&amp;#039;t seem worth since it adds&lt;br /&gt;
	-- another checkbox to the calc.&lt;br /&gt;
	local specialTable = {&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_ABYSSAL_SIRE] = {SlayerConsts.TASK_BOSS_ABYSSAL_SIRE, SlayerConsts.TASK_ABYSSAL_DEMONS},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_ARAXXOR] = {SlayerConsts.TASK_BOSS_ARAXXOR, SlayerConsts.TASK_ARAXYTES, SlayerConsts.TASK_SPIDERS},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_ALCHEMICAL_HYDRA] = {SlayerConsts.TASK_BOSS_ALCHEMICAL_HYDRA, SlayerConsts.TASK_HYDRAS},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_BARROWS] = {SlayerConsts.TASK_BOSS_BARROWS},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_CALLISTO] = {SlayerConsts.TASK_BOSS_CALLISTO, SlayerConsts.TASK_BEARS},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_CERBERUS] = {SlayerConsts.TASK_BOSS_CERBERUS, SlayerConsts.TASK_HELLHOUNDS},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_CHAOS_ELEMENTAL] = {SlayerConsts.TASK_BOSS_CHAOS_ELEMENTAL},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_CHAOS_FANATIC] = {SlayerConsts.TASK_BOSS_CHAOS_FANATIC},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_COMMANDER_ZILYANA] = {SlayerConsts.TASK_BOSS_COMMANDER_ZILYANA},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_CRAZY_ARCHAEOLOGIST] = {SlayerConsts.TASK_BOSS_CRAZY_ARCHAEOLOGIST},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_DAGANNOTH_KINGS] = {SlayerConsts.TASK_BOSS_DAGANNOTH_KINGS, SlayerConsts.TASK_DAGANNOTH},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_GENERAL_GRAARDOR] = {SlayerConsts.TASK_BOSS_GENERAL_GRAARDOR},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_GIANT_MOLE] = {SlayerConsts.TASK_BOSS_GIANT_MOLE},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_GROTESQUE_GUARDIANS] = {SlayerConsts.TASK_BOSS_GROTESQUE_GUARDIANS, SlayerConsts.TASK_GARGOYLES},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_KRIL_TSUTSAROTH] = {SlayerConsts.TASK_BOSS_KRIL_TSUTSAROTH, SlayerConsts.TASK_GREATER_DEMONS},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_KALPHITE_QUEEN] = {SlayerConsts.TASK_BOSS_KALPHITE_QUEEN, SlayerConsts.TASK_KALPHITES},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_KING_BLACK_DRAGON] = {SlayerConsts.TASK_BOSS_KING_BLACK_DRAGON, SlayerConsts.TASK_BLACK_DRAGONS},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_KRAKEN] = {SlayerConsts.TASK_BOSS_KRAKEN, SlayerConsts.TASK_CAVE_KRAKEN},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_KREEARRA] = {SlayerConsts.TASK_BOSS_KREEARRA, SlayerConsts.TASK_AVIANSIE},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_SARACHNIS] = {SlayerConsts.TASK_BOSS_SARACHNIS, SlayerConsts.TASK_SPIDERS},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_SCORPIA] = {SlayerConsts.TASK_BOSS_SCORPIA, SlayerConsts.TASK_SCORPIONS},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_THERMONUCLEAR_SMOKE_DEVIL] = {SlayerConsts.TASK_BOSS_THERMONUCLEAR_SMOKE_DEVIL, SlayerConsts.TASK_SMOKE_DEVILS},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_VENENATIS] = {SlayerConsts.TASK_BOSS_VENENATIS, SlayerConsts.TASK_SPIDERS},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_VETION] = {SlayerConsts.TASK_BOSS_VETION, SlayerConsts.TASK_SKELETONS},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_VORKATH] = {SlayerConsts.TASK_BOSS_VORKATH, SlayerConsts.TASK_BLUE_DRAGONS},&lt;br /&gt;
		[SlayerConsts.TASK_BOSS_ZULRAH] = {SlayerConsts.TASK_BOSS_ZULRAH},&lt;br /&gt;
		[SlayerConsts.TASK_SKOTIZO] = {SlayerConsts.TASK_BLACK_DEMONS, SlayerConsts.TASK_GREATER_DEMONS},&lt;br /&gt;
		[SlayerConsts.TASK_DEMONIC_GORILLAS] = {SlayerConsts.TASK_MONKEY, SlayerConsts.TASK_BLACK_DEMONS},&lt;br /&gt;
		[SlayerConsts.TASK_SKELETON_HELLHOUNDS] = {SlayerConsts.TASK_HELLHOUNDS, SlayerConsts.TASK_SKELETONS},&lt;br /&gt;
		[SlayerConsts.TASK_REVENANTS] = {SlayerConsts.TASK_REVENANTS, SlayerConsts.TASK_GHOSTS}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	specialNameTable = {&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_ABYSSAL_SIRE] = &amp;quot;[[Abyssal Sire]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_ARAXXOR] = &amp;quot;[[Araxxor]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_ALCHEMICAL_HYDRA] = &amp;quot;[[Alchemical Hydra]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_BARROWS] = &amp;quot;[[Barrows]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_CALLISTO] = &amp;quot;[[Callisto]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_CERBERUS] = &amp;quot;[[Cerberus]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_CHAOS_ELEMENTAL] = &amp;quot;[[Chaos Elemental]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_CHAOS_FANATIC] = &amp;quot;[[Chaos Fanatic]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_COMMANDER_ZILYANA] = &amp;quot;[[Commander Zilyana]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_CRAZY_ARCHAEOLOGIST] = &amp;quot;[[Crazy archaeologist]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_DAGANNOTH_KINGS] = &amp;quot;[[Dagannoth Kings]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_GENERAL_GRAARDOR] = &amp;quot;[[General Graardor]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_GIANT_MOLE] = &amp;quot;[[Giant Mole]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_GROTESQUE_GUARDIANS] = &amp;quot;[[Grotesque Guardians]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_KRIL_TSUTSAROTH] = &amp;quot;[[K&amp;#039;ril Tsutsaroth]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_KALPHITE_QUEEN] = &amp;quot;[[Kalphite Queen]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_KING_BLACK_DRAGON] = &amp;quot;[[King Black Dragon]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_KRAKEN] = &amp;quot;[[Kraken]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_KREEARRA] = &amp;quot;[[Kree&amp;#039;arra]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_SARACHNIS] = &amp;quot;[[Sarachnis]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_SCORPIA] = &amp;quot;[[Scorpia]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_THERMONUCLEAR_SMOKE_DEVIL] = &amp;quot;[[Thermonuclear smoke devil]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_VENENATIS] = &amp;quot;[[Venenatis]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_VETION] = &amp;quot;[[Vet&amp;#039;ion]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_VORKATH] = &amp;quot;[[Vorkath]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_BOSS_ZULRAH] = &amp;quot;[[Zulrah]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_SKOTIZO] = &amp;quot;[[Skotizo]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_DEMONIC_GORILLAS] = &amp;quot;[[Demonic gorilla]]s&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_SKELETON_HELLHOUNDS] = &amp;quot;[[Skeleton Hellhound (Vet&amp;#039;ion)]]&amp;quot;,&lt;br /&gt;
	[SlayerConsts.TASK_REVENANTS] = &amp;quot;[[Revenant]]s&amp;quot;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	local monstersToSearch = {}&lt;br /&gt;
	if specialTable[SlayerConsts.get_monster_id(desiredTask)] ~= nil then&lt;br /&gt;
		for _, id in ipairs(specialTable[SlayerConsts.get_monster_id(desiredTask)]) do&lt;br /&gt;
			table.insert(monstersToSearch, SlayerConsts.get_monster_name(id))&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		table.insert(monstersToSearch, desiredTask)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local taskPercents = {}&lt;br /&gt;
	local taskName = &amp;#039;&amp;#039;&lt;br /&gt;
	if specialTable[SlayerConsts.get_monster_id(desiredTask)] ~= nil then&lt;br /&gt;
		taskName = specialNameTable[SlayerConsts.get_monster_id(desiredTask)]&lt;br /&gt;
	end&lt;br /&gt;
	for _, monsterToSearch in ipairs(monstersToSearch) do&lt;br /&gt;
		-- Get all masters that can assign this task.&lt;br /&gt;
		slayerMasters = Slayerlib.get_masters_that_assign(monsterToSearch)&lt;br /&gt;
		&lt;br /&gt;
		-- Get the entire task table of the chosen slayer master.&lt;br /&gt;
		for slayerMaster, _ in pairs(slayerMasters) do&lt;br /&gt;
			local masterTable = Slayerlib.get_table(slayerMaster)&lt;br /&gt;
&lt;br /&gt;
			-- If this is the actual monster we are looking for, grab the name from the table&lt;br /&gt;
			if monsterToSearch == desiredTask and taskName == &amp;#039;&amp;#039; then&lt;br /&gt;
				taskName = masterTable[SlayerConsts.get_monster_id(monsterToSearch)][&amp;#039;name&amp;#039;]&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			-- Get the tables of available and unavailable tasks.&lt;br /&gt;
			local effectiveTable, unavailableTable = Slayerlib.get_effective_table(masterTable, status, true)&lt;br /&gt;
&lt;br /&gt;
			-- Pass these to calculate percents.&lt;br /&gt;
			if taskPercents[slayerMaster] == nil then&lt;br /&gt;
				taskPercents[slayerMaster] = p.calculate_percent(effectiveTable, monsterToSearch)&lt;br /&gt;
			else&lt;br /&gt;
				taskPercents[slayerMaster] = taskPercents[slayerMaster] + p.calculate_percent(effectiveTable, monsterToSearch)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Render the results&lt;br /&gt;
	return p.render_table(taskPercents, taskName)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- Calculates the percent chance of getting each task from effectiveTable.&lt;br /&gt;
--&lt;br /&gt;
-- @param effectiveTable {table} A table of all tasks the player can be assigned.&lt;br /&gt;
-- @param unavailableTable {table} A table of all tasks the player cannot be assigned.&lt;br /&gt;
--&lt;br /&gt;
-- @return {table} Returns a table that contains the task name as key and the&lt;br /&gt;
--					percent chance (decimal form) of getting it as the value.&lt;br /&gt;
--&lt;br /&gt;
function p.calculate_percent(effectiveTable, desiredTask)&lt;br /&gt;
	local totalWeight = 0&lt;br /&gt;
	for k, v in pairs(effectiveTable) do&lt;br /&gt;
		totalWeight = totalWeight + v[&amp;#039;weight&amp;#039;]&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	for k, v in pairs(effectiveTable) do&lt;br /&gt;
		if v[&amp;#039;subtable&amp;#039;] ~= nil then&lt;br /&gt;
			subtablePercents = p.calculate_percent(v[&amp;#039;subtable&amp;#039;], desiredTask)&lt;br /&gt;
			if subtablePercents ~= 0 then&lt;br /&gt;
				subtableMult = v[&amp;#039;weight&amp;#039;]/totalWeight&lt;br /&gt;
				return subtableMult*subtablePercents&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if k == Slayerlib.get_monster_id(desiredTask) then&lt;br /&gt;
			return v[&amp;#039;weight&amp;#039;]/totalWeight&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return 0&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function pairs_by_keys(t, f)&lt;br /&gt;
	local a = {}&lt;br /&gt;
	for n in pairs(t) do table.insert(a, n) end&lt;br /&gt;
	table.sort(a, f)&lt;br /&gt;
	local i = 0      -- iterator variable&lt;br /&gt;
	local iter = function ()   -- iterator function&lt;br /&gt;
    	i = i + 1&lt;br /&gt;
    	if a[i] == nil then return nil&lt;br /&gt;
    	else return a[i], t[a[i]]&lt;br /&gt;
    	end&lt;br /&gt;
	end&lt;br /&gt;
	return iter&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Render the results table.&lt;br /&gt;
function p.render_table(results, desiredTask)&lt;br /&gt;
	local resultsDiv = mw.html.create( &amp;#039;div&amp;#039; )&lt;br /&gt;
	local resultsTable = mw.html.create( &amp;#039;table&amp;#039; )&lt;br /&gt;
	resultsTable:addClass( &amp;#039;wikitable&amp;#039; )&lt;br /&gt;
		:addClass( &amp;#039;sortable&amp;#039;)&lt;br /&gt;
		:addClass( &amp;#039;align-center-1&amp;#039; )&lt;br /&gt;
		:tag( &amp;#039;tr&amp;#039; )&lt;br /&gt;
			:tag( &amp;#039;th&amp;#039; )&lt;br /&gt;
				:wikitext( &amp;#039;Results for &amp;#039; .. desiredTask )&lt;br /&gt;
				:attr( &amp;#039;colspan&amp;#039;, 2 )&lt;br /&gt;
			:done()&lt;br /&gt;
		:done()&lt;br /&gt;
		:tag( &amp;#039;tr&amp;#039; )&lt;br /&gt;
			:tag( &amp;#039;th&amp;#039; )&lt;br /&gt;
				:wikitext( &amp;#039;Master&amp;#039; )&lt;br /&gt;
			:done()&lt;br /&gt;
			:tag( &amp;#039;th&amp;#039; )&lt;br /&gt;
				:wikitext( &amp;#039;Assignment Chance&amp;#039;)&lt;br /&gt;
			:done()&lt;br /&gt;
		:done()&lt;br /&gt;
	:done()&lt;br /&gt;
&lt;br /&gt;
	for k, v in pairs_by_keys(results) do&lt;br /&gt;
		resultsTable:tag( &amp;#039;tr&amp;#039; )&lt;br /&gt;
			:tag( &amp;#039;td&amp;#039; )&lt;br /&gt;
				:wikitext( k )&lt;br /&gt;
			:done()&lt;br /&gt;
			:tag( &amp;#039;td&amp;#039; )&lt;br /&gt;
				:wikitext( string.format(&amp;quot;%.2f&amp;quot;, 100*v ) .. &amp;quot;%&amp;quot;)&lt;br /&gt;
				:attr( &amp;#039;align&amp;#039;, &amp;#039;right&amp;#039; )&lt;br /&gt;
			:done()&lt;br /&gt;
		:done()&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	resultsDiv:node(tostring(resultsTable))&lt;br /&gt;
	return resultsDiv&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
</feed>