/Kolmafia/sideCommand Usage

bumcheekcity

Active member
To cut a long story short, is there a way of redirecting the /Kolmafia/sideCommand page to any one, rather than just charpane.php once it's done doing the cmd that you specify?
 

jasonharper

Developer
No; the idea is that you'd target such a URL to the charpane, so that it automatically gets updated with any visible changes due to the command. You'd use something like "<a target='charpane' href='/KoLmafia/sideCommand?..." for a link, or "top.charpane.document.location.href = '/KoLmafia/..." in JavaScript.

There's also a /KoLmafia/submitCommand?<cmd> URL you can use, which returns a blank page rather than a redirect. That would mainly be useful with an Ajax request.
 

jasonharper

Developer
If you're going to refresh the original page in the process, then why bother with sideCommand? Just do the commands as part of the refresh.
 

bumcheekcity

Active member
<a href="javascript:top.mainpane.document.location.href = '/KoLmafia/...'; top.mainpane.document.location.href = 'thepageiwaslookingat.php';">

You mean like this?
 

jasonharper

Developer
If you just want a link in a relay pane that does a command, it would be something like:
<a target=charpane href="/KoLmafia/sideCommand?cmd=eat+7+bottle+of+tequila">
Note that this doesn't reload that pane.

If that doesn't answer your question, back up a bit and explain what you're trying to do.
 

bumcheekcity

Active member
Oh, I get that, but essentially, I want to have in the dungeons (for a locked door), the relay browser display something like:

You have X skeleton bone(s) and Y loose teeth. [make skeleton key]

If you don't have a skeleton key already, and "make skeleton key" be a link. I can make it a link target=charpane, and that makes the skeleton key but doesn't reload the page, so you can't click on the "Use Skeleton Key" link that appears.

Basically, I want the link to make the skeleton key and reload dungeon.php in the mainpane. It doesn't particularly matter if charpane.php is reloaded, because nothing will change as a result of clicking that link, but it doesn't really hurt if it's reloaded too.
 
Top