Clan Chatbot

Trying to figure out how things work? Start here.

Moderator: AFHk Officers

User avatar
stupac2
Oh my! Guy with Pie!
Posts: 3027
Joined: Mon Dec 08, 2008 10:04 pm
Location: Stanford, CA
Contact:

Post by stupac2 » Thu Dec 03, 2009 9:34 pm

Turias, did you change the way emotes work? Looking through now it seems like they bots are spitting out: "[emote_text]", although that may vary by channel. I'm now trying to make this update work and mostly have it (unless you, for some reason, do a /whois on any of the bots, that's a little weird and I might fix it eventually...), but these emotes are way broken. Looking through the code for tabbed chat I can't see where it would fix these emotes.

Turias
AFH
Posts: 134
Joined: Mon Jul 28, 2008 2:06 pm
Contact:

Post by Turias » Thu Dec 03, 2009 9:44 pm

Emotes used to be:

<username text>

Now they just use the same characters as normal chat. So AFH should be:

[username text]

while AFHk is:

(username text)

When I tested it earlier it was working. Let me know if it isn't.

User avatar
stupac2
Oh my! Guy with Pie!
Posts: 3027
Joined: Mon Dec 08, 2008 10:04 pm
Location: Stanford, CA
Contact:

Post by stupac2 » Thu Dec 03, 2009 10:48 pm

No it's definitely working, the problem is that I now have no way to differentiate emotes from normal messages (well, I can't think of one at any rate).

For instance, the difference between:

Code: Select all

AFH: (stupac2) butt butt butt
and:

Code: Select all

AFH: (stupac2 butt butt butt)
is really hard for me to pick out. Like, I'd want to try to and find if the last character is a )}], which I can do, but then I'd miss something like:

Code: Select all

AFH: (stupac2) (I like parentheses!)
I don't know, maybe it would be doable, but I feel like it would make the code a lot more quirky and introduce more weird bugs (that is, make it easier for a false positive or negative, right now you'd need to be saying something kind of silly in order to fuck up other people, like:

Code: Select all

stupac2: AFHobo 1736458 [lalalala]
would look really weird, but who would paste the bot's name and PID but not in the AFHobo (#1736458) form? (That last form won't trigger anything). Even then that wouldn't fuck up through the bots, only in the same clan.

Long story short, since those don't get replaced with a bot name, could we change it back? I think the <> worked fine.

Turias
AFH
Posts: 134
Joined: Mon Jul 28, 2008 2:06 pm
Contact:

Post by Turias » Thu Dec 03, 2009 10:54 pm

stupac2 wrote:Long story short, since those don't get replaced with a bot name, could we change it back? I think the <> worked fine.
But then you can't know which clan the person is emoting from, right? Doesn't that break what we were trying to accomplish with this change in the first place?

User avatar
lostcalpolydude
Forum Maestro
Posts: 2940
Joined: Wed Apr 23, 2008 6:54 pm

Post by lostcalpolydude » Thu Dec 03, 2009 10:58 pm

Maybe a character like ~ could be put in front of emotes, allowing some way to distinguish for a text parser?
bmaher: Softcore character
lostcalpolydude: Hardcore character (abandoned)

User avatar
stupac2
Oh my! Guy with Pie!
Posts: 3027
Joined: Mon Dec 08, 2008 10:04 pm
Location: Stanford, CA
Contact:

Post by stupac2 » Thu Dec 03, 2009 11:05 pm

Not really, since I can't think of a way to put that in for emotes that's not really awkward. The line would have to look like:

Code: Select all

AFH: AFHk: [i]stupac2 emotes[/i]
That looks weird to me (I'd italicize it to replace the brackets). I much prefer the old form, personally.

My main purpose (which has been accomplished) is that the majority of communications show clan of origin. Emotes not showing that (as well as not making the playername clickable) seems fine to me. If people want me to change emotes to something else I could do that. Honestly, I'd kind of like to do:

Code: Select all

AFH: [i]stupac2 emotes[/i]
That's much more in line with the way the game does it. Actually, come to think of it, it might be able to do something like this:

Code: Select all

[AFH|AFHk|AFHobo]: [i][b]stupac2[/b] emotes[/i]
I'll try to think of a way to get that to work without introducing too many places where someone could break it.

...A few seconds of thinking about it and I don't think I can do it, because sending:

Code: Select all

/me )(lalala
would break it, or at least wouldn't register, at least if:

Code: Select all

stupac2: (lalala)
also doesn't register.


...Fuck, emotes suck. I can't think of any good way to do it. I'll continue to think about it, and if anyone else can think of anything please let me know.


ETA: Lost, I don't like adding a symbol because it starts to get less readable to people not using the script, and I'm not sure if it accomplishes our goal. Although, I guess it would since there's no other way to put a tilde right after something a bot says, so we'd be back to needing to say:

Code: Select all

stupac2: AFH: ~ (botid#) stuff
in order to break it. I could probably work with that.

Turias
AFH
Posts: 134
Joined: Mon Jul 28, 2008 2:06 pm
Contact:

Post by Turias » Thu Dec 03, 2009 11:23 pm

What about:

[*Turias emotes about something*]
{*HoboKiller emotes about something else*}
(*AnAFHker emotes*}

User avatar
stupac2
Oh my! Guy with Pie!
Posts: 3027
Joined: Mon Dec 08, 2008 10:04 pm
Location: Stanford, CA
Contact:

Post by stupac2 » Thu Dec 03, 2009 11:27 pm

I think that would work, since those combinations are kind of rare, whereas some of the others might be reasonable.

Turias
AFH
Posts: 134
Joined: Mon Jul 28, 2008 2:06 pm
Contact:

Post by Turias » Thu Dec 03, 2009 11:31 pm

Is it possible for there to be an ambiguous chat message this way? I agree that before, this would be ambiguous:

AFH: [The Big Man] jumps up and down]

Is "The Big Man" saying "jumps up and down]"?
Is "The Big" emoting "Man] jumps up and down"?

Both are possible.

Though I can't think of an ambiguous situation with the new proposition. Especially if the script is hardcoded with the userIDs of our bots and only looks for bot-like constructs from those users.

User avatar
stupac2
Oh my! Guy with Pie!
Posts: 3027
Joined: Mon Dec 08, 2008 10:04 pm
Location: Stanford, CA
Contact:

Post by stupac2 » Fri Dec 04, 2009 12:01 am

Yeah, it only fires if the bot's ID and name are both in it. What would be really nice for me is if we could somehow note when the player's name ends. I'd really like to be able to add back the functionality of bolded and linked usernames. Right now I'm going to italicize it, but would really like to add that back.

User avatar
tannenzaepfle
Spy vs. Pie
Posts: 90
Joined: Mon Mar 24, 2008 1:40 am

Post by tannenzaepfle » Tue Dec 08, 2009 10:17 am

Does having the bots emote work?

AFHk would say "/me [Pantsless] is not wearing pants"
which would appear as

"AFHk [Pantsless] is not wearing pants"

Or has this been tried?
Tannenzaepfle (#1185696)

User avatar
stupac2
Oh my! Guy with Pie!
Posts: 3027
Joined: Mon Dec 08, 2008 10:04 pm
Location: Stanford, CA
Contact:

Post by stupac2 » Tue Dec 08, 2009 10:19 am

That would make it easier to do some of the parsing I set up. In fact, it would make the code identical to non-emotes, I'm fairly sure.

User avatar
Eleron
Has a thing!
Posts: 870
Joined: Tue Jun 03, 2008 1:52 pm

Post by Eleron » Tue Dec 08, 2009 7:53 pm

tannenzaepfle wrote:Does having the bots emote work?

AFHk would say "/me [Pantsless] is not wearing pants"
which would appear as

"AFHk [Pantsless] is not wearing pants"

Or has this been tried?
I like this. It's in italic for everyone, and the name is nicely bracketed, all good.

User avatar
stupac2
Oh my! Guy with Pie!
Posts: 3027
Joined: Mon Dec 08, 2008 10:04 pm
Location: Stanford, CA
Contact:

Re: Clan Chatbot

Post by stupac2 » Wed Mar 10, 2010 8:30 pm

Quick question, would it be easy to have the bots auto-send stuff back to you when you fuck up and right-click them when the person's not in the system? If it would be at all hard don't bother, but with kbay doing kmailing stuff I'm guessing it might not be.

Turias
AFH
Posts: 134
Joined: Mon Jul 28, 2008 2:06 pm
Contact:

Re: Clan Chatbot

Post by Turias » Thu Mar 11, 2010 1:33 pm

It wouldn't be that hard at all. It would just take a little time to implement. The main thing to consider is that right now the clan chatbots don't check kmail at all, so there would definitely be a bandwidth increase in doing this. I'd prefer for the code to be written such that the kmail page is not downloaded very often. Right now the bots cycle every five seconds or so looking for new chat messages.

As always, if someone wants to tackle writing this feature I'd be happy to merge it in. Baby is still eating up way too much of my time right now for me to do it myself. I don't even have time to play my turns anymore! :)

User avatar
stupac2
Oh my! Guy with Pie!
Posts: 3027
Joined: Mon Dec 08, 2008 10:04 pm
Location: Stanford, CA
Contact:

Re: Clan Chatbot

Post by stupac2 » Thu Mar 11, 2010 8:24 pm

Well, if it were implemented something like once/hour would definitely be enough, perhaps too much. But if you're too busy it's probably not worth the time in any meaningful sense.

(And thanks for sending the thingie back >.>)

User avatar
NardoLoopa
Market Manipulator
Posts: 1201
Joined: Tue Jun 19, 2007 10:37 pm

Re: Clan Chatbot

Post by NardoLoopa » Fri Mar 12, 2010 1:08 pm

I think you can get notification of arrival of a kmail -- then you only need to check on an event driven basis -- or maybe just on log-in. Either way would probably solve stu's problem.
Image

User avatar
smanoli
Spy vs. Pie
Posts: 73
Joined: Tue Apr 22, 2008 6:21 pm

Re: Clan Chatbot

Post by smanoli » Fri Mar 12, 2010 3:21 pm

Couldn't you just have a command that the user can send to the bot (via pm) that will have the chatbot check its kmail and return anything? Might be easier than monitoring for kmails.

Turias
AFH
Posts: 134
Joined: Mon Jul 28, 2008 2:06 pm
Contact:

Re: Clan Chatbot

Post by Turias » Fri Apr 02, 2010 3:33 pm

New feature!

Code: Select all

/msg AFH uneffect EFFECT_ID
As long as the bot has a SGEEA in its inventory, it will use it to remove the specified effect! Hooray for defenses against clubbing!

(This feature has also been added to kbay.)

User avatar
lostcalpolydude
Forum Maestro
Posts: 2940
Joined: Wed Apr 23, 2008 6:54 pm

Re: Clan Chatbot

Post by lostcalpolydude » Tue Apr 27, 2010 12:43 pm

Sending
oh, apparently you have to use || and && instead of OR and AND

turns into
oh, apparently you have to use || and

The bots eat everything starting with &&, which apparently was never noticed before chat macros.
bmaher: Softcore character
lostcalpolydude: Hardcore character (abandoned)

p4n1q
My Pie Blown Sky High
Posts: 593
Joined: Tue Mar 10, 2009 6:44 pm
Location: Bongistan

Re: Clan Chatbot

Post by p4n1q » Tue Apr 27, 2010 3:22 pm

I'm pretty sure that's KoL chat.

User avatar
lostcalpolydude
Forum Maestro
Posts: 2940
Joined: Wed Apr 23, 2008 6:54 pm

Re: Clan Chatbot

Post by lostcalpolydude » Tue Apr 27, 2010 3:49 pm

Even when people in the same channel see the whole message?
bmaher: Softcore character
lostcalpolydude: Hardcore character (abandoned)

p4n1q
My Pie Blown Sky High
Posts: 593
Joined: Tue Mar 10, 2009 6:44 pm
Location: Bongistan

Re: Clan Chatbot

Post by p4n1q » Tue Apr 27, 2010 5:09 pm

I don't know. But putting && in a message cuts off the rest of it in /hc, for example.

User avatar
lostcalpolydude
Forum Maestro
Posts: 2940
Joined: Wed Apr 23, 2008 6:54 pm

Re: Clan Chatbot

Post by lostcalpolydude » Tue Apr 27, 2010 5:50 pm

After some experimenting, it turns out that if your message starts with a / (such as /clan, /hardcore, /msg whoever), it terminates at && because that's assumed to be the start of a new message. If you just send a message to the channel you're in, no / is needed and the && goes through (I tested this in an unused clan with two characters). I'm guessing the bots put /clan in front of the messages they're sending. Or there's some other reason for it, which would probably be harder to change.
bmaher: Softcore character
lostcalpolydude: Hardcore character (abandoned)

User avatar
slaphappy snark
Widdle Fudge Bunny
Posts: 2689
Joined: Fri Apr 04, 2008 1:27 pm
Location: SF Bay Area

Re: Clan Chatbot

Post by slaphappy snark » Tue Apr 27, 2010 6:10 pm

lostcalpolydude wrote:I'm guessing the bots put /clan in front of the messages they're sending. Or there's some other reason for it, which would probably be harder to change.
I assume the bots put /msg or similar in front of them when they send them to each other.

Turias
AFH
Posts: 134
Joined: Mon Jul 28, 2008 2:06 pm
Contact:

Re: Clan Chatbot

Post by Turias » Tue Apr 27, 2010 8:11 pm

No need for the bots to /msg each other as they are all run from the same process.

But yeah, thanks for looking into this. The bots indeed prefix all of their chats with /clan. I wanted to make sure the bots never started to broadcast clan chat to /newbie, so I did that. However, I could also just "/channel clan" whenever the bots log in. This isn't a huge priority, but I'll try to do it when I have the chance. Thanks!

User avatar
slaphappy snark
Widdle Fudge Bunny
Posts: 2689
Joined: Fri Apr 04, 2008 1:27 pm
Location: SF Bay Area

Re: Clan Chatbot

Post by slaphappy snark » Tue Apr 27, 2010 8:53 pm

That is much neater than what I pictured them doing. I'll go back to just thinking they are magic!

Turias
AFH
Posts: 134
Joined: Mon Jul 28, 2008 2:06 pm
Contact:

Re: Clan Chatbot

Post by Turias » Wed Apr 28, 2010 1:51 pm

Alright, the bots should now join /clan on login (just in case) and thus no longer prefix all of their chat messages with "/clan"

Antipasta
AFH
Posts: 251
Joined: Fri Sep 21, 2007 5:24 pm

Re: Clan Chatbot

Post by Antipasta » Thu Apr 29, 2010 12:59 pm

Turias wrote:New feature!

Code: Select all

/msg AFH uneffect EFFECT_ID
As long as the bot has a SGEEA in its inventory, it will use it to remove the specified effect! Hooray for defenses against clubbing!

(This feature has also been added to kbay.)
For what little it's worth, I run a PSA bot (for mall bargains) in the clan where my other char lives, and since people liked snowballing him and jawbruising him, I just put in a periodic check for any nefarious chat effects... and it hits the guilty party with some toilet paper or a nerf dart in hopes of starting a big fight.

I just assume that people will forget what exactly is it that they need to do if it's not automatic.

User avatar
lostcalpolydude
Forum Maestro
Posts: 2940
Joined: Wed Apr 23, 2008 6:54 pm

Re: Clan Chatbot

Post by lostcalpolydude » Thu Apr 29, 2010 1:30 pm

Antipasta wrote:I just assume that people will forget what exactly is it that they need to do if it's not automatic.
There's enough of us that have this forum memorized that it shouldn't be an issue, I think.
bmaher: Softcore character
lostcalpolydude: Hardcore character (abandoned)

User avatar
vampirewolf3
Inscrutable Pi
Posts: 211
Joined: Thu Dec 11, 2008 11:12 pm

Re: Clan Chatbot

Post by vampirewolf3 » Wed Aug 11, 2010 1:49 am

One day, the chat bots got a lot less snarky when you bragged about being welcomed back to the Kingdom.

How can we reignite their pugnacious tendency?
[url=http://koldb.com/player.php?name=vampirewolf3]vampirewolf3[/url] (#433366)

Locked