When creating mIRC scripts, how do I detect when someone uses /me and what he has said?
For example, if someone types "/me says hello" (which shows on screen something similar to "Name says hello"), how would I respond something like "Welcome!"?
on *:ACTION:Hello:#:{
describe $chan Welcome!
}
Change "Hello" to anything you want (support wildcards), and "#" to the channel you want this to work on (using just # would make it to work on every channel).
Example to use of wildcard on ON ACTION event (Beware! would reply every /me action on any channel!):
on *:ACTION:*:#:{
describe $chan Welcome!
}
Related
I must be using bad search terms because this has got to be a super-simple question, but I'm not getting any meaningful search hits. I am sending out a link to a page that will expire. MY script checks whether the link is still valid. when valid I have no problems, but when invalid I can't find a simple response and instead I keep stopping myself from writing a hundred lines of code.
I would like to put a simple response.error in the sub Page_Load().
response.error("expired")? something like that? I could do a response.redirect but that would mean a new error handler page. isn't there something super simple? I don't want any other code on the page to execute if the link is invalid.
Dim IsValid as Boolean = YourScriptThatCheckForValidLink()
If Not IsValid Then
Response.Write("This link has expired.")
HttpApplication.CompleteRequest()
End If
not sure what the issue was, but I couldn't find HttpApplication anywhere, IIS always said it didn't recognize it.
ended up with
response.write ("<HTML><head></head><body>This Link has expired</body></HTML>")
response.end()
I'm using a simple app with one story
https://i.stack.imgur.com/Lf1yr.png
Entity: user-defined "intent" with value "greetings", search strategy "trait"
https://i.stack.imgur.com/LBQpz.png
But my bot says "OK Hello" when user types any chain of symbols like "blablabla":
User says: Hello
Bot says: OK Hello
User says: Bye
Bot says: OK Hello
User says: fjkjdskfsdfslfjl
Bot says: OK Hello
What I'm doing wrong?
I would rather create a free text/keywords intent called greetings, and add "hello", "yo", "hey" into that entity. Then you can have a trait intent with the value userGreeting. This way your bot can recognize when the user has sent a greeting.
Use free text and keyword entities for words or sentences, while trait entities are for recognizing where the focus should be. But makes sure to not mix them, your entity should be either a trait entity, or keyword and free text.
I'm not sure if my definitions are correct, but at least my bot works! Try it out at https://m.messenger/IGDBcom
I feel I must be doing something wrong in the API. I am following the weather example with a missing location. The story works fine.
However when I use the API over http using postman for testing purposes I cannot get it to raise the action after sending back the location from the user, It always returns a stop message. I think I must be not sending the correct context across or similar.
My understanding is as follows:
send across message 'I want to know the weather'
raises action from wit: 'Weather' (works correctly)
Respond with 'missingLocation'
wit replies with msg 'Which location do you want to know the weather for?' (works correctly)
I respond with 'Paris' in the message (no context all with same session)
wit replies with finding the entity 'Paris' but a 'stop' and no action. Here I would expect to get an action request again with everything I need to know this time. This is what happens when I use the story and test using the bot messenger.
Any ideas from anyone? I expect I need to respond with something more than just 'Paris' in the message
Thanks.
Note: the question was asked by "scruffjinks" on github before with no answer
https://github.com/wit-ai/wit/issues/301
I'm using webflows in Grails and I'm currently writing tests for it. Now, inside I've got something that throws an error so I set a message to the flash scope before redirecting:
...
if (some_condition) {
flash.message = "my error message"
return error()
}
...
Now, I know that when I'm going to display this in the GSP page, I access the flash message as
<g:if test="${message}">...
instead of the usual
<g:if test="${flash.message}">...
So anyway, I'm writing my test and I'm wondering how to test the content of the message? Usually, in normal actions in the controllers, I follow what's written in here . However, since this is a webflow, I can't seem to find the message even if I check controller.flash.message / controller.params.message / controller.message . I've also tried looking at the flow scope...
Any ideas on how to see the message then? Thanks a bunch!
Based on your example, you can access your flash.message as controller.request.message in your webflow test. I did a lot of googling for this same exact issue and a lot of webflow documentations talk about it merging all scopes into the "view model". But I also read somewhere that it merges the flash scope into the request scope for redirection. That's what prompted me to try looking in the controller.request in my test case.
I want to be able to intercept outgoing email on a specific domain in Exchange Server and modify the headers before it is actually delivered.
Basically, my company has been bought by another and where we were using MDaemon and signing all our emails with DKim and DomainKeys, the new company uses Exchange Server which cannot and will not do this. This appears to be a major oversight I would have thought so I think I will need to do it myself. I have already written a COM component that can sign given message files which I use on my personal mail server using hMailServer, so wanted to do a similar thing for Exchange.
Is this possible, and if so how would you do it?
I have looked but could not find an obvious way of doing this. Some of the things I looked at included:
Transport Agents
Event Sinks
Store Events
Any help would be appreciated. Thanks.
For Exchange 2007 and later: It seems that a TransportAgent is the right way of doing it.
A very basic sample:
public class TestAgent : SmtpReceiveAgent
{
public TestAgent()
{
this.OnEndOfData += new EndOfDataEventHandler(MyEndOfDataHandler);
}
private void MyEndOfDataHandler(ReceiveMessageEventSource source, EndOfDataEventArgs e)
{
// The following line appends text to the subject of the message that caused the event.
e.MailItem.Message.Subject += " - this text appended by MyAgent";
}
}
You can change the actual message via the GetContentWriteStream() and just append or replace existing content.
More samples can be found here.
I know... it's a late answer, but I stumbled over this question and just want to leave some helpful links that I found.
Maybe you can use the Generic Exchange Transport Agent (open source, link goes to GitHub) for this. It provides an abstraction layer above the Exchange transport agent and is specifically designed to handle events for incoming/outgoing email. You can call custom batch scripts to rewrite the whole e-mail, e.g. for adding custom headers and so on.