<?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%3AHerbiboar</id>
	<title>Module:Herbiboar - 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%3AHerbiboar"/>
	<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Herbiboar&amp;action=history"/>
	<updated>2026-05-05T15:19: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:Herbiboar&amp;diff=34981&amp;oldid=prev</id>
		<title>Alex: Created page with &quot;local experience = require( &#039;Module:Experience&#039; ) local paramtest = require( &#039;Module:Paramtest&#039; ) local herbData = require( &#039;Module:Skill calc/Herblore&#039; ) local gePrices = mw.loadJsonData(&#039;Module:GEPrices/data.json&#039;) local commas = require(&#039;Module:Addcommas&#039;)._add local coins = require(&#039;Module:Coins&#039;)._amount  local p = {}  function p.strtobool(str) 	local result = false 	if str == &#039;true&#039; then 		result = true 	end 	return result end  local herbs = { 	&#039;Guam leaf&#039;, 	&#039;Marre...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Herbiboar&amp;diff=34981&amp;oldid=prev"/>
		<updated>2024-10-16T23:12:16Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local experience = require( &amp;#039;Module:Experience&amp;#039; ) local paramtest = require( &amp;#039;Module:Paramtest&amp;#039; ) local herbData = require( &amp;#039;Module:Skill calc/Herblore&amp;#039; ) local gePrices = mw.loadJsonData(&amp;#039;Module:GEPrices/data.json&amp;#039;) local commas = require(&amp;#039;Module:Addcommas&amp;#039;)._add local coins = require(&amp;#039;Module:Coins&amp;#039;)._amount  local p = {}  function p.strtobool(str) 	local result = false 	if str == &amp;#039;true&amp;#039; then 		result = true 	end 	return result end  local herbs = { 	&amp;#039;Guam leaf&amp;#039;, 	&amp;#039;Marre...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local experience = require( &amp;#039;Module:Experience&amp;#039; )&lt;br /&gt;
local paramtest = require( &amp;#039;Module:Paramtest&amp;#039; )&lt;br /&gt;
local herbData = require( &amp;#039;Module:Skill calc/Herblore&amp;#039; )&lt;br /&gt;
local gePrices = mw.loadJsonData(&amp;#039;Module:GEPrices/data.json&amp;#039;)&lt;br /&gt;
local commas = require(&amp;#039;Module:Addcommas&amp;#039;)._add&lt;br /&gt;
local coins = require(&amp;#039;Module:Coins&amp;#039;)._amount&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.strtobool(str)&lt;br /&gt;
	local result = false&lt;br /&gt;
	if str == &amp;#039;true&amp;#039; then&lt;br /&gt;
		result = true&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local herbs = {&lt;br /&gt;
	&amp;#039;Guam leaf&amp;#039;,&lt;br /&gt;
	&amp;#039;Marrentill&amp;#039;,&lt;br /&gt;
	&amp;#039;Tarromin&amp;#039;,&lt;br /&gt;
	&amp;#039;Harralander&amp;#039;,&lt;br /&gt;
	&amp;#039;Ranarr weed&amp;#039;,&lt;br /&gt;
	&amp;#039;Irit leaf&amp;#039;,&lt;br /&gt;
	&amp;#039;Avantoe&amp;#039;,&lt;br /&gt;
	&amp;#039;Kwuarm&amp;#039;,&lt;br /&gt;
	&amp;#039;Snapdragon&amp;#039;,&lt;br /&gt;
	&amp;#039;Cadantine&amp;#039;,&lt;br /&gt;
	&amp;#039;Lantadyme&amp;#039;,&lt;br /&gt;
	&amp;#039;Dwarf weed&amp;#039;,&lt;br /&gt;
	&amp;#039;Torstol&amp;#039;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local success_chance = {&lt;br /&gt;
	{&lt;br /&gt;
		name = &amp;#039;Ranarr weed&amp;#039;,&lt;br /&gt;
		low = -10,&lt;br /&gt;
		high = 20,&lt;br /&gt;
		req = 31&lt;br /&gt;
	}, {&lt;br /&gt;
		name = &amp;#039;Torstol&amp;#039;,&lt;br /&gt;
		low = -70,&lt;br /&gt;
		high = 20,&lt;br /&gt;
		req = 31&lt;br /&gt;
	}, {&lt;br /&gt;
		name = &amp;#039;Snapdragon&amp;#039;,&lt;br /&gt;
		low = -60,&lt;br /&gt;
		high = 20,&lt;br /&gt;
		req = 31&lt;br /&gt;
	}, {&lt;br /&gt;
		name = &amp;#039;Dwarf weed&amp;#039;,&lt;br /&gt;
		low = -50,&lt;br /&gt;
		high = 30,&lt;br /&gt;
		req = 31&lt;br /&gt;
	}, {&lt;br /&gt;
		name = &amp;#039;Lantadyme&amp;#039;,&lt;br /&gt;
		low = -30,&lt;br /&gt;
		high = 40,&lt;br /&gt;
		req = 31&lt;br /&gt;
	}, {&lt;br /&gt;
		name = &amp;#039;Cadantine&amp;#039;,&lt;br /&gt;
		low = -10,&lt;br /&gt;
		high = 50,&lt;br /&gt;
		req = 31&lt;br /&gt;
	}, {&lt;br /&gt;
		name = &amp;#039;Kwuarm&amp;#039;,&lt;br /&gt;
		low = 10,&lt;br /&gt;
		high = 60,&lt;br /&gt;
		req = 31&lt;br /&gt;
	}, {&lt;br /&gt;
		name = &amp;#039;Avantoe&amp;#039;,&lt;br /&gt;
		low = 20,&lt;br /&gt;
		high = 60,&lt;br /&gt;
		req = 31&lt;br /&gt;
	}, {&lt;br /&gt;
		name = &amp;#039;Irit leaf&amp;#039;,&lt;br /&gt;
		low = 30,&lt;br /&gt;
		high = 70,&lt;br /&gt;
		req = 31&lt;br /&gt;
	}, {&lt;br /&gt;
		name = &amp;#039;Tarromin&amp;#039;,&lt;br /&gt;
		low = 70,&lt;br /&gt;
		high = -20,&lt;br /&gt;
		req = 31&lt;br /&gt;
	}, {&lt;br /&gt;
		name = &amp;#039;Harralander&amp;#039;,&lt;br /&gt;
		low = 100,&lt;br /&gt;
		high = -30,&lt;br /&gt;
		req = 31&lt;br /&gt;
	}, {&lt;br /&gt;
		name = &amp;#039;Marrentill&amp;#039;,&lt;br /&gt;
		low = 170,&lt;br /&gt;
		high = -40,&lt;br /&gt;
		req = 31&lt;br /&gt;
	}, {&lt;br /&gt;
	--numbers are very high&lt;br /&gt;
		name = &amp;#039;Guam leaf&amp;#039;,&lt;br /&gt;
		low = 1000,&lt;br /&gt;
		high = 1000,&lt;br /&gt;
		req = 31&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function p.nameToIndex(str)&lt;br /&gt;
	local res = 13&lt;br /&gt;
	for i,herb in ipairs(success_chance) do&lt;br /&gt;
		if herb.name == str then&lt;br /&gt;
			res = i&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return res&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--borrowed from module:skilling success chart&lt;br /&gt;
function p.interp(low, high, level)&lt;br /&gt;
	local value = math.modf(low*(99-level)/98) + math.modf(high*(level-1)/98) + 1&lt;br /&gt;
	return math.min(math.max(value / 256, 0), 1)	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.cascadeInterp(bounds, level, index)&lt;br /&gt;
	local rate = 1.0&lt;br /&gt;
	for i, v in ipairs(bounds) do&lt;br /&gt;
		if i == index then&lt;br /&gt;
			rate = rate * p.interp(v.low, v.high, level)&lt;br /&gt;
			return rate&lt;br /&gt;
		end&lt;br /&gt;
		if level &amp;gt;= v.req then&lt;br /&gt;
			rate = rate * (1 - p.interp(v.low, v.high, level))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.hunter_experience(level)&lt;br /&gt;
	-- you would theoretically get -450 xp per herbiboar at level 0, plus average of 2.56 searches&lt;br /&gt;
	local xp = -450 + 2.56*50&lt;br /&gt;
	xp = xp + 30*math.min(level,94)&lt;br /&gt;
	if level&amp;gt;94 then&lt;br /&gt;
		xp = xp + 15&lt;br /&gt;
		xp = xp + 19*(level-95)&lt;br /&gt;
	end&lt;br /&gt;
	return xp&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--converts remaining hunter xp to herbis&lt;br /&gt;
function p.herbisForHunter(goal,start)&lt;br /&gt;
	if goal &amp;lt; start or goal ==0 then&lt;br /&gt;
		return 0&lt;br /&gt;
	end&lt;br /&gt;
	local resnum = 0&lt;br /&gt;
	local left = goal - start&lt;br /&gt;
	local currentxp = start&lt;br /&gt;
	local currentLevel = experience.level_at_xp({args = {start}})&lt;br /&gt;
	while left &amp;gt; 0 do&lt;br /&gt;
		local xp = p.hunter_experience(currentLevel)&lt;br /&gt;
		if xp&amp;lt;0 then&lt;br /&gt;
			xp = 1&lt;br /&gt;
		end&lt;br /&gt;
		local xpforlevel = left&lt;br /&gt;
		if currentLevel &amp;lt; 99 then&lt;br /&gt;
			currentLevel = currentLevel + 1&lt;br /&gt;
			xpforlevel = math.min(left,experience.xp_to_level({args = {currentxp,currentLevel}}))&lt;br /&gt;
		end&lt;br /&gt;
		local herbisForNext = math.ceil(xpforlevel/xp)&lt;br /&gt;
		local xpFromThis = xp*herbisForNext&lt;br /&gt;
		resnum = resnum + herbisForNext&lt;br /&gt;
		currentxp = currentxp + xpFromThis&lt;br /&gt;
		left = left - xpFromThis&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return resnum&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--converts herbis to hunterxp&lt;br /&gt;
function p.xpForHerbis(number,start)&lt;br /&gt;
	local resxp = 0&lt;br /&gt;
	local left = number&lt;br /&gt;
	local currentxp = start&lt;br /&gt;
	local currentLevel = experience.level_at_xp({args = {start}})&lt;br /&gt;
	&lt;br /&gt;
	while left &amp;gt; 0 do&lt;br /&gt;
		local xp = p.hunter_experience(currentLevel)&lt;br /&gt;
		if xp&amp;lt;0 then&lt;br /&gt;
			xp = 1&lt;br /&gt;
		end&lt;br /&gt;
		local xpforlevel = 200000000&lt;br /&gt;
		if currentLevel &amp;lt; 99 then&lt;br /&gt;
			currentLevel = currentLevel + 1&lt;br /&gt;
			xpforlevel = experience.xp_to_level({args = {currentxp,currentLevel}})&lt;br /&gt;
		end&lt;br /&gt;
		local herbisForNext = math.min(left,math.ceil(xpforlevel/xp))&lt;br /&gt;
		local xpFromThis = xp*herbisForNext&lt;br /&gt;
		resxp = resxp+xpFromThis&lt;br /&gt;
		currentxp = currentxp + xpFromThis&lt;br /&gt;
		left = left - herbisForNext&lt;br /&gt;
	end&lt;br /&gt;
	if resxp+start &amp;gt; 200000000 then&lt;br /&gt;
		resxp = 200000000 - start&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return resxp&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.herbXp(herb,clean,product,mult)&lt;br /&gt;
	local res = 0&lt;br /&gt;
	for _,entry in pairs(herbData) do&lt;br /&gt;
		if clean and entry.name == herb then&lt;br /&gt;
			res = res + math.floor(10*entry.xp*mult)/10&lt;br /&gt;
		elseif entry.name == product or entry.title == product then&lt;br /&gt;
			res = res + entry.xp&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return res&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.createHerbHeader(complex)&lt;br /&gt;
	local header = mw.html.create(&amp;#039;table&amp;#039;):addClass(&amp;#039;wikitable sortable sticky-header alternating-rows align-left-1&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	header:tag(&amp;#039;caption&amp;#039;):wikitext(&amp;#039;Herbs&amp;#039;)&lt;br /&gt;
	if complex then&lt;br /&gt;
		header:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
			:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;colspan&amp;#039;, 2):wikitext(&amp;#039;Herb&amp;#039;)&lt;br /&gt;
			:tag(&amp;#039;th&amp;#039;):wikitext(&amp;#039;Average quantity&amp;#039;)&lt;br /&gt;
			:tag(&amp;#039;th&amp;#039;):wikitext(&amp;#039;Price&amp;#039;)&lt;br /&gt;
			:tag(&amp;#039;th&amp;#039;):wikitext(&amp;#039;Experience&amp;#039;)&lt;br /&gt;
		:done()&lt;br /&gt;
	else&lt;br /&gt;
		header:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
			:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;colspan&amp;#039;, 2):wikitext(&amp;#039;Herb&amp;#039;)&lt;br /&gt;
			:tag(&amp;#039;th&amp;#039;):wikitext(&amp;#039;Average quantity&amp;#039;)&lt;br /&gt;
			:tag(&amp;#039;th&amp;#039;):wikitext(&amp;#039;Price&amp;#039;)&lt;br /&gt;
		:done()&lt;br /&gt;
	end&lt;br /&gt;
	return header	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.createHerbRow(complex,herbName,quantity,price,xp)&lt;br /&gt;
	local herbGrimy = &amp;#039;Grimy &amp;#039; .. herbName:lower()&lt;br /&gt;
	local quantityRound = math.floor(1000*quantity+0.5)/1000&lt;br /&gt;
	--+0.5 provides rounding to nearest int&lt;br /&gt;
	local geprice = price&lt;br /&gt;
	local xpRound = math.floor(10*xp)/10&lt;br /&gt;
	quantityRound = commas(quantityRound)&lt;br /&gt;
	xpRound = commas(xpRound)&lt;br /&gt;
	local row&lt;br /&gt;
	if complex then&lt;br /&gt;
		row = mw.html.create(&amp;#039;tr&amp;#039;)&lt;br /&gt;
			:tag(&amp;#039;td&amp;#039;):wikitext(&amp;#039;[[File:&amp;#039; .. herbGrimy .. &amp;#039;.png]]&amp;#039;):done()&lt;br /&gt;
			:tag(&amp;#039;td&amp;#039;):wikitext(&amp;#039;[[&amp;#039;.. herbGrimy .. &amp;#039;]]&amp;#039;):done()&lt;br /&gt;
			:tag(&amp;#039;td&amp;#039;):wikitext(quantityRound):done()&lt;br /&gt;
			:tag(&amp;#039;td&amp;#039;):wikitext(coins(geprice)):done()&lt;br /&gt;
			:tag(&amp;#039;td&amp;#039;):wikitext(xpRound):done()&lt;br /&gt;
	else&lt;br /&gt;
		row = mw.html.create(&amp;#039;tr&amp;#039;)&lt;br /&gt;
			:tag(&amp;#039;td&amp;#039;):wikitext(&amp;#039;[[File:&amp;#039; .. herbGrimy .. &amp;#039;.png]]&amp;#039;):done()&lt;br /&gt;
			:tag(&amp;#039;td&amp;#039;):wikitext(&amp;#039;[[&amp;#039;.. herbGrimy .. &amp;#039;]]&amp;#039;):done()&lt;br /&gt;
			:tag(&amp;#039;td&amp;#039;):wikitext(quantityRound):done()&lt;br /&gt;
			:tag(&amp;#039;td&amp;#039;):wikitext(coins(geprice)):done()&lt;br /&gt;
	end&lt;br /&gt;
	return row&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.createHerbFooter(complex,quantity,price,xp)&lt;br /&gt;
	local footer&lt;br /&gt;
	local xpRound = math.floor(10*xp)/10&lt;br /&gt;
	if complex then&lt;br /&gt;
		footer = mw.html.create(&amp;#039;tr&amp;#039;):addClass(&amp;#039;sortbottom&amp;#039;)&lt;br /&gt;
		:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;colspan&amp;#039;, 2):wikitext(&amp;#039;Total:&amp;#039;):done()&lt;br /&gt;
		:tag(&amp;#039;td&amp;#039;):wikitext(commas(quantity)):done()&lt;br /&gt;
		:tag(&amp;#039;td&amp;#039;):wikitext(coins(price)):done()&lt;br /&gt;
		:tag(&amp;#039;td&amp;#039;):wikitext(commas(xpRound)):done()&lt;br /&gt;
	else&lt;br /&gt;
		footer = mw.html.create(&amp;#039;tr&amp;#039;):addClass(&amp;#039;sortbottom&amp;#039;)&lt;br /&gt;
		:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;colspan&amp;#039;, 2):wikitext(&amp;#039;Total:&amp;#039;):done()&lt;br /&gt;
		:tag(&amp;#039;td&amp;#039;):wikitext(commas(quantity)):done()&lt;br /&gt;
		:tag(&amp;#039;td&amp;#039;):wikitext(coins(price)):done()&lt;br /&gt;
	end&lt;br /&gt;
	return footer&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	--we don&amp;#039;t need to test these as strtobool will set nil to false&lt;br /&gt;
	local complex = p.strtobool(args.complex)&lt;br /&gt;
	local herbProcess = p.strtobool(args.herbToggle)&lt;br /&gt;
	local secateurs = p.strtobool(args.secateurs)&lt;br /&gt;
	local herbXp = 0&lt;br /&gt;
	local herbLevel = 1&lt;br /&gt;
	local herbToggle = paramtest.default_to(args.currentHerbToggle,&amp;#039;Level&amp;#039;)&lt;br /&gt;
	local currentHerb = paramtest.default_to(tonumber(args.currentHerb),31)&lt;br /&gt;
	if herbToggle == &amp;#039;Level&amp;#039; and currentHerb &amp;lt; 127 and currentHerb &amp;gt; 0 then&lt;br /&gt;
		herbXp = experience.xp_at_level_unr({args = {currentHerb}})&lt;br /&gt;
		herbLevel = math.min(currentHerb,99)&lt;br /&gt;
	else&lt;br /&gt;
		herbXp = currentHerb&lt;br /&gt;
		herbLevel = experience.level_at_xp({args = {currentHerb}})&lt;br /&gt;
	end&lt;br /&gt;
	local hunterXp = 0&lt;br /&gt;
	local hunterLevel = 1&lt;br /&gt;
	local hunterToggle = paramtest.default_to(args.currentHunterToggle,&amp;#039;Level&amp;#039;)&lt;br /&gt;
	local currentHunter = paramtest.default_to(tonumber(args.currentHunter),80)&lt;br /&gt;
	if hunterToggle == &amp;#039;Level&amp;#039; and currentHunter &amp;lt; 127 and currentHunter &amp;gt; 0 then&lt;br /&gt;
		hunterXp = experience.xp_at_level_unr({args = {currentHunter}})&lt;br /&gt;
		hunterLevel = math.min(currentHunter,99)&lt;br /&gt;
	else&lt;br /&gt;
		hunterXp = currentHunter&lt;br /&gt;
		hunterLevel = experience.level_at_xp({args = {currentHunter}})&lt;br /&gt;
	end&lt;br /&gt;
	local levelWarning = &amp;#039;&amp;#039;&lt;br /&gt;
	if complex and (herbLevel &amp;lt;31 or hunterLevel &amp;lt; 75) then&lt;br /&gt;
		levelWarning = &amp;#039;&amp;lt;b&amp;gt;Warning!&amp;lt;/b&amp;gt; You need at least 31 herblore and 80 hunter (boostable) to catch these creatures. Expect unexpected results below.&amp;lt;br&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	local clean = {}&lt;br /&gt;
	local products = {}&lt;br /&gt;
	clean[&amp;#039;Guam leaf&amp;#039;] = p.strtobool(paramtest.default_to(args.guamClean,&amp;#039;false&amp;#039;))&lt;br /&gt;
	products[&amp;#039;Guam leaf&amp;#039;] = paramtest.default_to(args.guam,&amp;#039;None&amp;#039;)&lt;br /&gt;
	clean[&amp;#039;Marrentill&amp;#039;] = p.strtobool(paramtest.default_to(args.marClean,&amp;#039;false&amp;#039;))&lt;br /&gt;
	products[&amp;#039;Marrentill&amp;#039;] = paramtest.default_to(args.mar,&amp;#039;None&amp;#039;)&lt;br /&gt;
	clean[&amp;#039;Tarromin&amp;#039;] = p.strtobool(paramtest.default_to(args.tarClean,&amp;#039;false&amp;#039;))&lt;br /&gt;
	products[&amp;#039;Tarromin&amp;#039;] = paramtest.default_to(args.tar,&amp;#039;None&amp;#039;)&lt;br /&gt;
	clean[&amp;#039;Harralander&amp;#039;] = p.strtobool(paramtest.default_to(args.harClean,&amp;#039;false&amp;#039;))&lt;br /&gt;
	products[&amp;#039;Harralander&amp;#039;] = paramtest.default_to(args.har,&amp;#039;None&amp;#039;)&lt;br /&gt;
	clean[&amp;#039;Ranarr weed&amp;#039;] = p.strtobool(paramtest.default_to(args.ranarrClean,&amp;#039;false&amp;#039;))&lt;br /&gt;
	products[&amp;#039;Ranarr weed&amp;#039;] = paramtest.default_to(args.ranarr,&amp;#039;None&amp;#039;)&lt;br /&gt;
	clean[&amp;#039;Irit leaf&amp;#039;] = p.strtobool(paramtest.default_to(args.iritClean,&amp;#039;false&amp;#039;))&lt;br /&gt;
	products[&amp;#039;Irit leaf&amp;#039;] = paramtest.default_to(args.irit,&amp;#039;None&amp;#039;)&lt;br /&gt;
	clean[&amp;#039;Avantoe&amp;#039;] = p.strtobool(paramtest.default_to(args.avantoeClean,&amp;#039;false&amp;#039;))&lt;br /&gt;
	products[&amp;#039;Avantoe&amp;#039;] = paramtest.default_to(args.avantoe,&amp;#039;None&amp;#039;)&lt;br /&gt;
	clean[&amp;#039;Kwuarm&amp;#039;] = p.strtobool(paramtest.default_to(args.kwuarmClean,&amp;#039;false&amp;#039;))&lt;br /&gt;
	products[&amp;#039;Kwuarm&amp;#039;] = paramtest.default_to(args.kwuarm,&amp;#039;None&amp;#039;)&lt;br /&gt;
	clean[&amp;#039;Snapdragon&amp;#039;] = p.strtobool(paramtest.default_to(args.snapClean,&amp;#039;false&amp;#039;))&lt;br /&gt;
	products[&amp;#039;Snapdragon&amp;#039;] = paramtest.default_to(args.snap,&amp;#039;None&amp;#039;)&lt;br /&gt;
	clean[&amp;#039;Cadantine&amp;#039;] = p.strtobool(paramtest.default_to(args.cadClean,&amp;#039;false&amp;#039;))&lt;br /&gt;
	products[&amp;#039;Cadantine&amp;#039;] = paramtest.default_to(args.cad,&amp;#039;None&amp;#039;)&lt;br /&gt;
	clean[&amp;#039;Lantadyme&amp;#039;] = p.strtobool(paramtest.default_to(args.lanClean,&amp;#039;false&amp;#039;))&lt;br /&gt;
	products[&amp;#039;Lantadyme&amp;#039;] = paramtest.default_to(args.lan,&amp;#039;None&amp;#039;)&lt;br /&gt;
	clean[&amp;#039;Dwarf weed&amp;#039;] = p.strtobool(paramtest.default_to(args.dwarfClean,&amp;#039;false&amp;#039;))&lt;br /&gt;
	products[&amp;#039;Dwarf weed&amp;#039;] = paramtest.default_to(args.dwarf,&amp;#039;None&amp;#039;)&lt;br /&gt;
	clean[&amp;#039;Torstol&amp;#039;] = p.strtobool(paramtest.default_to(args.torstolClean,&amp;#039;false&amp;#039;))&lt;br /&gt;
	products[&amp;#039;Torstol&amp;#039;] = paramtest.default_to(args.torstol,&amp;#039;None&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	local cleanMethod = paramtest.default_to(args.cleanMethod,&amp;#039;Manual&amp;#039;)&lt;br /&gt;
	local cleanMult&lt;br /&gt;
	if cleanMethod == &amp;#039;Manual&amp;#039; then&lt;br /&gt;
		cleanMult = 1&lt;br /&gt;
	elseif cleanMethod == &amp;#039;Degrime&amp;#039; then&lt;br /&gt;
		cleanMult = 0.5&lt;br /&gt;
	else&lt;br /&gt;
		cleanMult = 0&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local chance&lt;br /&gt;
	local amount = secateurs and 3 or 2&lt;br /&gt;
	local quantities = {}&lt;br /&gt;
	local xps = {}&lt;br /&gt;
	local prices = {}&lt;br /&gt;
	local quantitySum = 0&lt;br /&gt;
	local priceSum = 0&lt;br /&gt;
	local xpSum = 0&lt;br /&gt;
	for _,herb in ipairs(herbs) do&lt;br /&gt;
		chance = p.cascadeInterp(success_chance,herbLevel,p.nameToIndex(herb))&lt;br /&gt;
		quantities[herb] = amount*chance&lt;br /&gt;
		xps[herb] = p.herbXp(herb,clean[herb],products[herb],cleanMult)*quantities[herb]&lt;br /&gt;
		xpSum = xpSum + xps[herb]&lt;br /&gt;
		quantitySum = quantitySum + quantities[herb]&lt;br /&gt;
		prices[herb] = gePrices[&amp;#039;Grimy &amp;#039; .. herb:lower()]*quantities[herb]&lt;br /&gt;
		priceSum = priceSum + prices[herb]&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local herbis = 1&lt;br /&gt;
	local goal&lt;br /&gt;
	local goalType = paramtest.default_to(args.goalType,&amp;#039;Herbiboars&amp;#039;)&lt;br /&gt;
	local goalLevel = 1&lt;br /&gt;
	local goalXp = 0&lt;br /&gt;
	local hunterGained = 0&lt;br /&gt;
	local herbGained = 0&lt;br /&gt;
	local goalText = &amp;#039;&amp;#039;&lt;br /&gt;
	local progressText = &amp;#039;&amp;#039;&lt;br /&gt;
	if complex then&lt;br /&gt;
		goal = tonumber(paramtest.default_to(args.goal,1))&lt;br /&gt;
		local xpPerHerbi = xpSum + (amount-1)*25&lt;br /&gt;
		herbis = goal&lt;br /&gt;
		local goalToggle = paramtest.default_to(args.goalToggle,&amp;#039;Level&amp;#039;)&lt;br /&gt;
		if goalType ~= &amp;#039;Herbiboars&amp;#039; then&lt;br /&gt;
			if goalToggle == &amp;#039;Level&amp;#039; and goal &amp;gt; 0 and goal &amp;lt; 127 then&lt;br /&gt;
				goalXp = experience.xp_at_level_unr({args = {goal}})&lt;br /&gt;
				goalLevel = math.min(goal,99)&lt;br /&gt;
			else&lt;br /&gt;
				goalXp = goal&lt;br /&gt;
				goalLevel = experience.level_at_xp({args = {goal}})&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if goalType == &amp;#039;Hunter&amp;#039; then&lt;br /&gt;
			herbis = math.max(p.herbisForHunter(goalXp,hunterXp),0)&lt;br /&gt;
			goalText = &amp;#039;To reach &amp;#039; .. commas(goalXp) .. &amp;#039; hunter experience (level &amp;#039; .. tostring(goalLevel) .. &amp;#039;) from &amp;#039; .. commas(hunterXp) .. &amp;#039; experience (level &amp;#039; .. tostring(hunterLevel) .. &amp;#039;) you will need to catch &amp;lt;b&amp;gt;&amp;#039; .. commas(herbis) .. &amp;#039;&amp;lt;/b&amp;gt; [[herbiboar]]s.\n&amp;#039;&lt;br /&gt;
		elseif goalType == &amp;#039;Herblore&amp;#039; then&lt;br /&gt;
			herbis = math.max(math.ceil((goalXp-herbXp)/xpPerHerbi),0)&lt;br /&gt;
			goalText = &amp;#039;To reach &amp;#039; .. commas(goalXp) .. &amp;#039; herblore experience (level &amp;#039; .. tostring(goalLevel) .. &amp;#039;) from &amp;#039; .. commas(herbXp) .. &amp;#039; experience (level &amp;#039; .. tostring(herbLevel) .. &amp;#039;) you will need to catch &amp;lt;b&amp;gt;&amp;#039; .. commas(herbis) .. &amp;#039;&amp;lt;/b&amp;gt; [[herbiboar]]s.\n&amp;#039;&lt;br /&gt;
		else&lt;br /&gt;
			goalText = &amp;#039;You are aiming to catch &amp;#039; .. commas(herbis) .. &amp;#039; [[herbiboar]]s.\n&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		local herbisPerHour = paramtest.default_to(tonumber(args.perHour),1)&lt;br /&gt;
		local timeTaken = math.floor(10*herbis/herbisPerHour+0.5)/10&lt;br /&gt;
		goalText = goalText .. &amp;#039;This will take &amp;#039; .. commas(timeTaken)&lt;br /&gt;
		if timeTaken == 1 then&lt;br /&gt;
			goalText = goalText .. &amp;#039; hour.\n&amp;#039;&lt;br /&gt;
		else&lt;br /&gt;
			goalText = goalText .. &amp;#039; hours.\n&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		hunterGained = p.xpForHerbis(herbis,hunterXp)&lt;br /&gt;
		herbGained = math.floor(herbis*xpPerHerbi)&lt;br /&gt;
		if herbGained + herbXp &amp;gt; 200000000 then&lt;br /&gt;
			herbGained = 200000000 - herbXp&lt;br /&gt;
		end&lt;br /&gt;
		hunterLevelGained = experience.level_at_xp({args={hunterGained + hunterXp}})&lt;br /&gt;
		herbLevelGained = experience.level_at_xp({args={herbGained + herbXp}})&lt;br /&gt;
		progressText = &amp;#039;You will gain &amp;#039; .. commas(hunterGained) .. &amp;#039; hunter experience, reaching reaching level &amp;#039; .. tostring(hunterLevelGained) .. &amp;#039; hunter and gain &amp;#039; .. commas(herbGained) .. &amp;#039; herblore experience, reaching level &amp;#039; .. tostring(herbLevelGained) .. &amp;#039; herblore.\n&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local petText = &amp;#039;&amp;#039;&lt;br /&gt;
	if complex and herbis &amp;gt; 0 then&lt;br /&gt;
		local baseChance = 1/6500&lt;br /&gt;
		local petChance = 1-(1-baseChance)^herbis&lt;br /&gt;
		local petChanceReverse = math.floor(100/petChance+0.5)/100&lt;br /&gt;
		petChance = math.floor(1000*petChance+0.5)/10&lt;br /&gt;
		petText = &amp;#039;Catching &amp;#039; .. commas(herbis) .. &amp;#039; herbiboars gives a ~&amp;#039; .. commas(petChance) .. &amp;#039;% chance (or ~1/&amp;#039; .. commas(petChanceReverse) .. &amp;#039;) to get the [[Herbi]] pet.\n&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	local herbXpColumn = complex and herbProcess&lt;br /&gt;
	&lt;br /&gt;
	local herbTable = p.createHerbHeader(herbXpColumn)&lt;br /&gt;
	for _,herb in ipairs(herbs) do&lt;br /&gt;
		if quantities[herb] &amp;gt; 0 then&lt;br /&gt;
			herbTable:node(p.createHerbRow(herbXpColumn,herb,herbis*quantities[herb],herbis*prices[herb],herbis*xps[herb]))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	herbTable:node(p.createHerbFooter(herbXpColumn,herbis*quantitySum,herbis*priceSum,herbis*xpSum))&lt;br /&gt;
	&lt;br /&gt;
	local fossilTable = &amp;#039;&amp;#039;&lt;br /&gt;
	if complex then&lt;br /&gt;
		local fossils = {&lt;br /&gt;
			math.floor(1000*2.56*herbis/50+0.5)/1000,&lt;br /&gt;
			math.floor(1000*2.56*herbis/100+0.5)/1000,&lt;br /&gt;
			math.floor(1000*2.56*herbis/125+0.5)/1000,&lt;br /&gt;
			math.floor(1000*2.56*herbis/500+0.5)/1000&lt;br /&gt;
		}&lt;br /&gt;
		local fossilsTable = mw.html.create(&amp;#039;table&amp;#039;):addClass(&amp;#039;wikitable sortable sticky-header alternating-rows align-left-1&amp;#039;)&lt;br /&gt;
		fossilsTable&lt;br /&gt;
			:tag(&amp;#039;caption&amp;#039;):wikitext(&amp;#039;Fossils&amp;#039;)&lt;br /&gt;
			:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;th&amp;#039;):attr(&amp;#039;colspan&amp;#039;,2):wikitext(&amp;#039;Fossil&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;th&amp;#039;):wikitext(&amp;#039;Average quantity&amp;#039;)&lt;br /&gt;
			:done()&lt;br /&gt;
			:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;td&amp;#039;):wikitext(&amp;#039;[[File:Unidentified small fossil.png]]&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;td&amp;#039;):wikitext(&amp;#039;[[Unidentified small fossil]]&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;td&amp;#039;):wikitext(commas(fossils[1]))&lt;br /&gt;
			:done()&lt;br /&gt;
			:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;td&amp;#039;):wikitext(&amp;#039;[[File:Unidentified medium fossil.png]]&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;td&amp;#039;):wikitext(&amp;#039;[[Unidentified medium fossil]]&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;td&amp;#039;):wikitext(commas(fossils[2]))&lt;br /&gt;
			:done()&lt;br /&gt;
			:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;td&amp;#039;):wikitext(&amp;#039;[[File:Unidentified large fossil.png]]&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;td&amp;#039;):wikitext(&amp;#039;[[Unidentified large fossil]]&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;td&amp;#039;):wikitext(commas(fossils[3]))&lt;br /&gt;
			:done()&lt;br /&gt;
			:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;td&amp;#039;):wikitext(&amp;#039;[[File:Unidentified rare fossil.png]]&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;td&amp;#039;):wikitext(&amp;#039;[[Unidentified rare fossil]]&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;td&amp;#039;):wikitext(commas(fossils[4]))&lt;br /&gt;
			:done()&lt;br /&gt;
		fossilTable = tostring(fossilsTable)&lt;br /&gt;
	end&lt;br /&gt;
	return levelWarning .. goalText .. progressText .. petText .. tostring(herbTable) .. fossilTable&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
</feed>