Campground caster - makes all your LP-ROM recordings for you

ereinion

Member
Sparked by a request for such a script in this thread, I set out to make a script which automagically collects all the recordings you can make from the LP-ROM burner.

It turned out to be quite a bit trickier than I thought, but thanks to great help from Bale, Winterbay and Veracity I did succeed in the end.

You should however note that I haven't done a lot of quality control or bugsearching for the script, so there might be some flaws in it which I am not aware of. If you find any such flaws, or have any suggestions for improvement, please let me know, either by posting in this thread or by contacting me ingame.

Anyway, here is the script. I hope you find it useful:
View attachment campground_caster.ash

Update log:
25/12/13 - Posted first working copy of the script
28/12/13 - Added check for whether the character has the skills it attempts to cast, in addition to checking $skill[].dailylimit. Coloured the error messages red.

05/02/14 - Fixed the check for the LP-ROM burner for when you wield a staph of homophones/sword of inappropriate prepositions/you don't have any skills you can record. Also improved the logic above the mp-restoration.
 
Last edited:

Bale

Minion
Nicely done! I'm looking forward to adding that to my logoutScript as one of things to do when I am overdrunk.
 

ereinion

Member
Are you sure Jick hasn't put it inside a adventure-php container? ;)

But thanks, even if I couldn't have done it without the help of you and the rest of the people in the thread, though.

Please let me know if you have any further suggestions for improvements.
 

ereinion

Member
Updated the script to check if the character using it has the skills it attempts to use, as the proxy-field "dailylimit" returns the daily limit of the skill, even if the character hasn't permed the skill. I also coloured the error message you get if you haven't got a LP-ROM burner installed red.
 
Last edited:

JimblyCakes

New member
Updated the script to check if the character using it has the skills it attempts to use, as the proxy-field "dailylimit" returns the daily limit of the skill, even if the character hasn't permed the skill. I also coloured the error message you get if you haven't got a LP-ROM burner installed red.


Cool thanks! FYI, the script mis-detects the LP-ROM if you are wielding the sword of inappropriate prepositions, etc. I got naked and then it worked :cool:
 

ereinion

Member
Unfortunately I don't have a LP-ROM burner installed at the moment, so it would be a bit of a bother to obtain the html of the page when it is installed. Do you think you could do me a favour and grab it for me? I'd also like to see what it looks like when you have the staph of homphones equipped, but if you don't already have one of those, I'll grab it myself the next time I have a burner installed (the page in question is the one you select the song you want to record from).
 

jbouzanquet

Member
Here it is, if this is valid. I use Chit, and I don't know it that affects anything in the main pane.
No staph
Code:
<html><head>
<script language=Javascript>
<!--
if (parent.frames.length == -1) location.href="game.php";
//-->
</script>
<script language=Javascript src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/scripts/jquery-1.5.1.js"]/images/scripts/jquery-1.5.1.js[/URL]"></script>
<script language=Javascript src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/scripts/keybinds.min.2.js"]/images/scripts/keybinds.min.2.js[/URL]"></script>
<script language=Javascript src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/scripts/window.20111231.js"]/images/scripts/window.20111231.js[/URL]"></script>
<script language="javascript">function chatFocus(){if(top.chatpane.document.chatform.graf) top.chatpane.document.chatform.graf.focus();}
if (typeof defaultBind != 'undefined') { defaultBind(47, 2, chatFocus); defaultBind(190, 2, chatFocus);defaultBind(191, 2, chatFocus); defaultBind(47, 8, chatFocus);defaultBind(190, 8, chatFocus); defaultBind(191, 8, chatFocus); }</script><script>
function switchFocus()
{
	if (top.chatpane.document.chatform.graf.focus) 
		top.chatpane.document.chatform.graf.focus(); 
	return false;
}
function repeat()
{
	var linx = document.getElementsByTagName("A");
	for (var i = 0; i < linx.length; i++)
	{
		if (typeof timersfunc != 'undefined') {
			if (!timersfunc()) { 
				return; 
			}
			timersfunc = null;
		}
		var link = linx[i];
		if (link.innerHTML.match(/Adventure Again/) || link.innerHTML.match(/Do it again/))
			location.href = link.href;
	}
}

defaultBind(47, CTRL, switchFocus);
defaultBind(191, CTRL, switchFocus);
defaultBind(47, META, switchFocus);
defaultBind(191, META, switchFocus);
defaultBind(192, NONE, repeat);
defaultBind(220, NONE, repeat);
</script><script language="javascript">
	function updateParseItem(iid, field, info) {
		var tbl = $('#ic'+iid);
		var data = parseItem(tbl);
		if (!data) return;
		data[field] = info;
		var out = [];
		for (i in data) {
			if (!data.hasOwnProperty(i)) continue;
			out.push(i+'='+data[i]);
		}
		tbl.attr('rel', out.join('&'));
	}
	function parseItem(tbl) {
		tbl = $(tbl);
		var rel = tbl.attr('rel');
		var data = {};
		if (!rel) return data;
		var parts = rel.split('&');
		for (i in parts) {
			if (!parts.hasOwnProperty(i)) continue;
			var kv = parts[i].split('=');
			tbl.data(kv[0], kv[1]);
			data[kv[0]] = kv[1];
		}
		return data;
	}
</script><script type="text/javascript" src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/scripts/pop_query.20130705.js"]/images/scripts/pop_query.20130705.js[/URL]"></script>
<script type="text/javascript"> function pop_ircm(clicked) { return false; } </script><link rel="stylesheet" type="text/css" href="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/styles.20130904.css"]/images/styles.20130904.css[/URL]">
<style type='text/css'>
.faded {
	zoom: 1;
	filter: alpha(opacity=35);
	opacity: 0.35;
}
</style>

<script src="[URL="http://kolmafia.us/view-source:http://code.jquery.com/jquery-1.9.1.js"]http://code.jquery.com/jquery-1.9.1.js[/URL]"></script><script src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/stationarybuttons.1.js"]/stationarybuttons.1.js[/URL]"></script><link rel="stylesheet" type="text/css" href="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/stationarybuttons.1.css"]/stationarybuttons.1.css[/URL]"><script language="Javascript" src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/basics.js"]/basics.js[/URL]"></script><link rel="stylesheet" href="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/basics.1.css"]/basics.1.css[/URL]" /></head>

<body><div id="page"><div id="mafiabuttons"><center><table width="95%"><tr><td align=left><div id="btnwrap"><input type="button" onClick="document.location.href='choice.php?action=auto';void(0);" value="auto" id="defaultButton"> <input type="button" onClick="document.location.href='choice.php?whichchoice=821&option=1&pwd=f00b95d0add78f8a5c00d90cb80972ba';void(0);" value="Burn It"> <input type="button" onClick="document.location.href='choice.php?whichchoice=821&option=2&pwd=f00b95d0add78f8a5c00d90cb80972ba';void(0);" value="Back to Campground"> </div></td></tr></table></center></div><div class='content' id='content_'><div id='effdiv' style='display: none;'></div><div>
<Center><centeR><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>LP-ROM burner</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td><center><img src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/adventureimages/nopic.gif"]/images/adventureimages/nopic.gif[/URL]" width=100 height=100></center><p>You step into your workshed and fire up the old LP-ROM burner.  What song would you like to record?
<p>
<center><form action="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/choice.php"]choice.php[/URL]" method="post">Play: <select name="whicheffect"><option value="-1">-- Choose a Song --</option><option value="614" >Donho's Bubbly Ballad (0/50)</option></select> <input type="text" size="3" value="1" name="times" /> times <input type=hidden name=pwd value='f00b95d0add78f8a5c00d90cb80972ba'><input type=hidden name=whichchoice value=821><input type=hidden name=option value=1><input class=button type=submit value="Burn It"></form></center><center><form name=choiceform2 action=[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/choice.php"]choice.php[/URL] method=post><input type=hidden name=pwd value='f00b95d0add78f8a5c00d90cb80972ba'><input type=hidden name=whichchoice value=821><input type=hidden name=option value=2><input class=button type=submit value="Back to Campground"></form></center></td></tr></table></center></td></tr><tr><td height=4></td></tr></table></center></div></div></div></body><script src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/onfocus.1.js"]/onfocus.1.js[/URL]"></script></html>
Sword
Code:
<html><head>
<script language=Javascript>
<!--
if (parent.frames.length == -1) location.href="game.php";
//-->
</script>
<script language=Javascript src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/scripts/jquery-1.5.1.js"]/images/scripts/jquery-1.5.1.js[/URL]"></script>
<script language=Javascript src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/scripts/keybinds.min.2.js"]/images/scripts/keybinds.min.2.js[/URL]"></script>
<script language=Javascript src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/scripts/window.20111231.js"]/images/scripts/window.20111231.js[/URL]"></script>
<script language="javascript">function chatFocus(){if(top.chatpane.document.chatform.graf) top.chatpane.document.chatform.graf.focus();}
if (typeof defaultBind != 'undefined') { defaultBind(47, 2, chatFocus); defaultBind(190, 2, chatFocus);defaultBind(191, 2, chatFocus); defaultBind(47, 8, chatFocus);defaultBind(190, 8, chatFocus); defaultBind(191, 8, chatFocus); }</script><script>
function switchFocus()
{
	if (top.chatpane.document.chatform.graf.focus) 
		top.chatpane.document.chatform.graf.focus(); 
	return false;
}
function repeat()
{
	var linx = document.getElementsByTagName("A");
	for (var i = 0; i < linx.length; i++)
	{
		if (typeof timersfunc != 'undefined') {
			if (!timersfunc()) { 
				return; 
			}
			timersfunc = null;
		}
		var link = linx[i];
		if (link.innerHTML.match(/Adventure Again/) || link.innerHTML.match(/Do it again/))
			location.href = link.href;
	}
}

defaultBind(47, CTRL, switchFocus);
defaultBind(191, CTRL, switchFocus);
defaultBind(47, META, switchFocus);
defaultBind(191, META, switchFocus);
defaultBind(192, NONE, repeat);
defaultBind(220, NONE, repeat);
</script><script language="javascript">
	function updateParseItem(iid, field, info) {
		var tbl = $('#ic'+iid);
		var data = parseItem(tbl);
		if (!data) return;
		data[field] = info;
		var out = [];
		for (i in data) {
			if (!data.hasOwnProperty(i)) continue;
			out.push(i+'='+data[i]);
		}
		tbl.attr('rel', out.join('&'));
	}
	function parseItem(tbl) {
		tbl = $(tbl);
		var rel = tbl.attr('rel');
		var data = {};
		if (!rel) return data;
		var parts = rel.split('&');
		for (i in parts) {
			if (!parts.hasOwnProperty(i)) continue;
			var kv = parts[i].split('=');
			tbl.data(kv[0], kv[1]);
			data[kv[0]] = kv[1];
		}
		return data;
	}
</script><script type="text/javascript" src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/scripts/pop_query.20130705.js"]/images/scripts/pop_query.20130705.js[/URL]"></script>
<script type="text/javascript"> function pop_ircm(clicked) { return false; } </script><link rel="stylesheet" type="text/css" href="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/styles.20130904.css"]/images/styles.20130904.css[/URL]">
<style type='text/css'>
.faded {
	zoom: 1;
	filter: alpha(opacity=35);
	opacity: 0.35;
}
</style>

<script src="[URL="http://kolmafia.us/view-source:http://code.jquery.com/jquery-1.9.1.js"]http://code.jquery.com/jquery-1.9.1.js[/URL]"></script><script src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/stationarybuttons.1.js"]/stationarybuttons.1.js[/URL]"></script><link rel="stylesheet" type="text/css" href="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/stationarybuttons.1.css"]/stationarybuttons.1.css[/URL]"><script language="Javascript" src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/basics.js"]/basics.js[/URL]"></script><link rel="stylesheet" href="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/basics.1.css"]/basics.1.css[/URL]" /></head>

<body><div id="page"><div id="mafiabuttons"><center><table width="95%"><tr><td align=left><div id="btnwrap"><input type="button" onClick="document.location.href='choice.php?action=auto';void(0);" value="auto" id="defaultButton"> <input type="button" onClick="document.location.href='choice.php?whichchoice=821&option=1&pwd=f00b95d0add78f8a5c00d90cb80972ba';void(0);" value="Burn It"> <input type="button" onClick="document.location.href='choice.php?whichchoice=821&option=2&pwd=f00b95d0add78f8a5c00d90cb80972ba';void(0);" value="Back to Campground"> </div></td></tr></table></center></div><div class='content' id='content_'><div id='effdiv' style='display: none;'></div><div>
<Center><centeR><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>LP-ROM burner</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td><center><img src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/adventureimages/nopic.gif"]/images/adventureimages/nopic.gif[/URL]" width=100 height=100></center><p>You step about your workshed and fire throughout the old LP-ROM burner.  What song would you within down record?
<p>
<center><form action="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/choice.php"]choice.php[/URL]" method="post">Play: <select name="whicheffect"><option value="-1">-- Choose a Song --</option><option value="614" >Donho's Bubbly Ballad (0/50)</option></select> <input type="text" size="3" value="1" name="times" /> times <input type=hidden name=pwd value='f00b95d0add78f8a5c00d90cb80972ba'><input type=hidden name=whichchoice value=821><input type=hidden name=option value=1><input class=button type=submit value="Burn It"></form></center> <center><form name=choiceform2 action=[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/choice.php"]choice.php[/URL] method=post><input type=hidden name=pwd value='f00b95d0add78f8a5c00d90cb80972ba'><input type=hidden name=whichchoice value=821><input type=hidden name=option value=2><input class=button type=submit value="Back to Campground"></form></center></td></tr></table></center></td></tr><tr><td height=4></td></tr></table></center></div></div></div></body><script src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/onfocus.1.js"]/onfocus.1.js[/URL]"></script></html>
Staph
Code:
<html><head>
<script language=Javascript>
<!--
if (parent.frames.length == -1) location.href="game.php";
//-->
</script>
<script language=Javascript src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/scripts/jquery-1.5.1.js"]/images/scripts/jquery-1.5.1.js[/URL]"></script>
<script language=Javascript src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/scripts/keybinds.min.2.js"]/images/scripts/keybinds.min.2.js[/URL]"></script>
<script language=Javascript src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/scripts/window.20111231.js"]/images/scripts/window.20111231.js[/URL]"></script>
<script language="javascript">function chatFocus(){if(top.chatpane.document.chatform.graf) top.chatpane.document.chatform.graf.focus();}
if (typeof defaultBind != 'undefined') { defaultBind(47, 2, chatFocus); defaultBind(190, 2, chatFocus);defaultBind(191, 2, chatFocus); defaultBind(47, 8, chatFocus);defaultBind(190, 8, chatFocus); defaultBind(191, 8, chatFocus); }</script><script>
function switchFocus()
{
	if (top.chatpane.document.chatform.graf.focus) 
		top.chatpane.document.chatform.graf.focus(); 
	return false;
}
function repeat()
{
	var linx = document.getElementsByTagName("A");
	for (var i = 0; i < linx.length; i++)
	{
		if (typeof timersfunc != 'undefined') {
			if (!timersfunc()) { 
				return; 
			}
			timersfunc = null;
		}
		var link = linx[i];
		if (link.innerHTML.match(/Adventure Again/) || link.innerHTML.match(/Do it again/))
			location.href = link.href;
	}
}

defaultBind(47, CTRL, switchFocus);
defaultBind(191, CTRL, switchFocus);
defaultBind(47, META, switchFocus);
defaultBind(191, META, switchFocus);
defaultBind(192, NONE, repeat);
defaultBind(220, NONE, repeat);
</script><script language="javascript">
	function updateParseItem(iid, field, info) {
		var tbl = $('#ic'+iid);
		var data = parseItem(tbl);
		if (!data) return;
		data[field] = info;
		var out = [];
		for (i in data) {
			if (!data.hasOwnProperty(i)) continue;
			out.push(i+'='+data[i]);
		}
		tbl.attr('rel', out.join('&'));
	}
	function parseItem(tbl) {
		tbl = $(tbl);
		var rel = tbl.attr('rel');
		var data = {};
		if (!rel) return data;
		var parts = rel.split('&');
		for (i in parts) {
			if (!parts.hasOwnProperty(i)) continue;
			var kv = parts[i].split('=');
			tbl.data(kv[0], kv[1]);
			data[kv[0]] = kv[1];
		}
		return data;
	}
</script><script type="text/javascript" src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/scripts/pop_query.20130705.js"]/images/scripts/pop_query.20130705.js[/URL]"></script>
<script type="text/javascript"> function pop_ircm(clicked) { return false; } </script><link rel="stylesheet" type="text/css" href="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/styles.20130904.css"]/images/styles.20130904.css[/URL]">
<style type='text/css'>
.faded {
	zoom: 1;
	filter: alpha(opacity=35);
	opacity: 0.35;
}
</style>

<script src="[URL="http://kolmafia.us/view-source:http://code.jquery.com/jquery-1.9.1.js"]http://code.jquery.com/jquery-1.9.1.js[/URL]"></script><script src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/stationarybuttons.1.js"]/stationarybuttons.1.js[/URL]"></script><link rel="stylesheet" type="text/css" href="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/stationarybuttons.1.css"]/stationarybuttons.1.css[/URL]"><script language="Javascript" src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/basics.js"]/basics.js[/URL]"></script><link rel="stylesheet" href="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/basics.1.css"]/basics.1.css[/URL]" /></head>

<body><div id="page"><div id="mafiabuttons"><center><table width="95%"><tr><td align=left><div id="btnwrap"><input type="button" onClick="document.location.href='choice.php?action=auto';void(0);" value="auto" id="defaultButton"> <input type="button" onClick="document.location.href='choice.php?whichchoice=821&option=1&pwd=f00b95d0add78f8a5c00d90cb80972ba';void(0);" value="Burn It"> <input type="button" onClick="document.location.href='choice.php?whichchoice=821&option=2&pwd=f00b95d0add78f8a5c00d90cb80972ba';void(0);" value="Back to Campground"> </div></td></tr></table></center></div><div class='content' id='content_'><div id='effdiv' style='display: none;'></div><div>
<Center><centeR><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>LP-ROM burner</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td><center><img src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/images/adventureimages/nopic.gif"]/images/adventureimages/nopic.gif[/URL]" width=100 height=100></center><p>Ewe steppe into you're workshed and fire up the old LP-ROM burner.  What song wood ewe like two record?  <p>  <center><form action="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/choice.php"]choice.php[/URL]" method="post">Play: <select name="whicheffect"><option value="-1">-- Chews a Song --</option><option value="614" >Donho's Bubbly Ballad (0/50)</option></select> <input type="text" size="3" value="1" name="times" /> times <input type=hidden name=pwd value='f00b95d0add78f8a5c00d90cb80972ba'><input type=hidden name=whichchoice value=821><input type=hidden name=option value=1><input class=button type=submit value="Burn It"></form></center><center><form name=choiceform2 action=[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/choice.php"]choice.php[/URL] method=post><input type=hidden name=pwd value='f00b95d0add78f8a5c00d90cb80972ba'><input type=hidden name=whichchoice value=821><input type=hidden name=option value=2><input class=button type=submit value="Back to Campground"></form></center></td></tr></table></center></td></tr><tr><td height=4></td></tr></table></center></div></div></div></body><script src="[URL="http://kolmafia.us/view-source:http://127.0.0.1:60080/onfocus.1.js"]/onfocus.1.js[/URL]"></script></html>
 

ereinion

Member
I've updated the script to (hopefully) detect the LP-ROM burner when you wield the staph of homophones or sword behind inappropriate prepositions. I've also added a different error message to the script if you don't have any skills which you can record on the burner, as well as a bit more logic for the mp-restoration part of it.

I couldn't really see why it didn't find the burner if you wielded the sword, so there may still be some errors there. Will troubleshoot a bit further the next time I am in aftercore with the burner available.

Feel free to come with further comments and suggestions for improvements on the script :)
 
Top