CLI Links -- easily add CLI power to your relay script

zarqon

Well-known member
HTML is not ASH. HTML is understood by your browser, and ASH is understood by KoLmafia. You cannot freely mix the two. A relay script is written in ASH, and outputs HTML to your browser via the write() and writeln() commands.

Code:
<ash commands>
write("<html>");
write("<head>head stuff, such as scripts included</head>");
write("<body>page content, such as CLI-ified links</body>");
write("</html>");
<more ash commands>

If you try to include HTML in your ASH script without it being in quotes, it will definitely generate errors.
 

Pazleysox

Member
HTML is not ASH. HTML is understood by your browser, and ASH is understood by KoLmafia. You cannot freely mix the two. A relay script is written in ASH, and outputs HTML to your browser via the write() and writeln() commands.

Code:
<ash commands>
write("<html>");
write("<head>head stuff, such as scripts included</head>");
write("<body>page content, such as CLI-ified links</body>");
write("</html>");
<more ash commands>

If you try to include HTML in your ASH script without it being in quotes, it will definitely generate errors.
PHP:
void main()
{
write("<html>");
write("<head><script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>");
write("<script src="clilinks.js"></script></head>");

	if((get_property("stenchAirportAlways") == "true" || get_property("_stenchAirportToday") == "true") && item_amount($item[bag of park garbage]) > 0 && get_property("_dinseyGarbageDisposed") == "false")
	{
	write("You can still <font color=FF0000>Dispose Dinsey Garbage</font>");
	write("<a href=place.php?whichplace=airport_stench&action=airport3_tunnels</a>>\n<a href=choice.php?pwd&whichchoice=1067&option=6 + class="clilink through">Dinsey Garbage</a>");
	}
write("</html>");
getting this error:
Expected ), found write (00TEST.ash, line 5)

Regardless what I have after line 5, it continues to give the error... Not sure what I'm doing wrong here, but I'm sure it's simple
 

Pazleysox

Member
When you have a string contained in "", you need use " to include " in the string.

DUH! I knew it was something simple. I actually thought of this at one point but pushed it out, thinking there's no way.

PHP:
void main()
{
write("<html>");
write("<head><script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js\"></script>");
write("<script src=\"clilinks.js\"></script></head>");

//	if((get_property("stenchAirportAlways") == "true" || get_property("_stenchAirportToday") == "true") && item_amount($item[bag of park garbage]) > 0 && get_property("_dinseyGarbageDisposed") == "false")
	{
	print_html("You can still <font color=FF0000>Dispose Dinsey Garbage</font>");
	print_html ("<body><a href=place.php?whichplace=airport_stench&action=airport3_tunnels>\n<a href=choice.php?pwd&whichchoice=1067&option=6 + class=\"clilink through\">Dinsey Garbage</a></body>");
	}
write("</html>");
This works. The "Dinsey Garbage" link comes up, but it opens a new browser window. I thought doing this was supposed to prevent the browser window from opening?
 

Veracity

Developer
Staff member
Here's what happens when I click on "Update this script" in the Script Manager for CLI Links:

Code:
Validating repo...
Repo validated.
Updating clilinks...
/Users/brianna/Library/Application Support/KoLmafia/svn/clilinks
At revision 7
Done.
bogus dependency: https://svn.code.sf.net/p/drag-n-drop-inventories/code
Requests complete.

I draw your attention to this line:

Code:
bogus dependency: https://svn.code.sf.net/p/drag-n-drop-inventories/code

I realize that project is now obsolete, but perhaps you should remove it from dependencies.txt for this project?

Edit:

Curiously, looking at the project on SourceForge, I see no dependencies.txt. So, where in the world is SVNManager finding it?
 
Last edited:

zarqon

Well-known member
Thanks Veracity, just pushed an updated dependencies.txt for CLI Links out into the world.
 
Top