Help: visit_url() for saying things in chat

petaros

New member
I don't know which section to post this in, since chat scripts aren't turn-burners or farming scripts or anything else... so here goes.

I'm trying to make a chat-reply script that will say things in /clan, instead of only replying to private chats. As far as I can tell, there are no .ash or CLI functions that do this, which is why I'm trying to do it with visit_url. Looking through chatbot's perl code, I found the url that chatbot accesses to send chats and am trying to use that address.

It doesn't seem to be working.

I've put the URL I am using here. I don't know if the problem is that I don't set 'pwd' to a password hash or that I made a mistake the message from 'graf'. It might just not work at all.

Does anybody have any ideas? Help with this would be appreciated.

Code:
visit_url("http://www8.kingdomofloathing.com/submitnewchat.php?pwd=&graf=/clan%20hi!");

What follows 'graf=', as far as I can tell from Chatbot's code, would be "/channel message", or in this case, "/clan Hi"

Edit: This worked when I copied the URL from the source code of lchat.php, but the mirror, session pwd, and playerid must be the same to work. How does .ash (or kolmafia in general) handle pwd, or how can I include it?
 

dangerpin

Member
I seem to remember that scripting open chat is verboten, to avoid the possibility of using mafia to spam chat in any way. Even buffbots use private messages for chat replies.

This may be outdated thinking, Hola has recently changed his stance on a number of things that were once off-limits, but I still hesitate.
 

zarqon

Well-known member
This doesn't answer your question, but your script won't work with the code you posted unless you are always logged in to KoL server 8. You can omit the server when using visit_url(), so in your case just
Code:
visit_url("submitnewchat.php?pwd=&graf=/clan%20hi!");
 
Top