Embed a CLI box in relay?

Howdy.

I'm working on modifying toledo's chatlaunch.ash to my needs (http://kolmafia.us/showthread.php?11375-toledo-s-tiny-tweaks-script-collection).
It's basically a checklist, but he added a wiki searchbox which is quite handy. I've seen similar ones in a couple of other relay scripts, as well as a mall search box, but I don't recall ever seeing a CLI execute box done.
I like having the CLI in the right-hand pane, but I also like using it as a checklist.

My idea was setting a string to be used by cli_execute when the submit button is clicked, but my scripting skills aren't enough to pull it off (yet).

Help?

If it helps, this is how toldo's wikibox looks like:
Code:
list.append("<form action='http://kol.coldfront.net/thekolwiki/index.php/Special:Search' name=searchform target=kolwiki><input type=text name=search><input type=submit value=Wiki></form>");
 
Cool, I found it. I guess batman relay doesn't work properly for me, since I never saw that box. (other features do work, but it's a bit wonky)

I've got box to show up, and it works, but not exactly as I want it to. Tomorrow'll dig deeper into fight.ash to get what I want.
(that is- don't reload the pane to notify me if it worked- just print the last line from the cli. Also- don't rely on fight.ash to work)


Thanks winterbay (and zarqon)!

edit:
Ok, I got the code off fight.ash, and now it works independently but it reloads the pane and gives a true/false response to the cli_excute.

I want it to stay in the same place (so I won't have to hit "back" after every execute) and if it's possible, have it give the actual line that the CLI gives rather than a general did/didn't work.

Any ideas?
 
Last edited:

zarqon

Well-known member
You flat out can't access the contents of the CLI from ASH. If I could, I would have done that with BatMan RE. You can only detect whether a command resulted in mafia entering an error state or not. So unfortunately what you are envisioning is impossible. If we could duplicate the CLI pane in the browser, we would probably already have a CLI chat window.

Also, rather than digging through BatMan RE, I've extracted all the nifty CLI<=>relay interaction stuff from it into a separate module called CLI Links, which might make it easier to do something like what you're trying to do. You could make a textarea with an edit box under it which outputs "Executing <cmd>..." when you submit a command, then outputs "Success!" or "Failed!" depending on the true/false. Just add a cli_Execute(command) to the submit event of the editbox, then extend cliComplete as described in CLI Links' first post to write the results in the textarea. But that's as close as you can get.

Also also, as a side note, I'm curious what's wonky about BatMan RE for you. I can't fix it if I don't know what's wrong. If you feel like sharing, post over there please and thank you.
 
Top