Assault Posted September 11, 2007 Share Posted September 11, 2007 (edited) I have no clue where to start I have looked around and saw a few commands that could work but I am probably just over complicating things so... I would like to have a bot that responds to some questions in a chat room, like "Where can I find a car?" and then have it access an answer and say where. So... <Car Guy> Where can i find a car? <BOT> You can find a car at a dealership. But with a lot more questions and answers. I was thinking ControlGetText then try to match it with a question which leads to an answer but I confused myself in planning it out. : / Thank you, Assault P.S. Is their like a get between function? I couldnt find one. I.E. GetBetween("<",">") Edited September 11, 2007 by Assault Link to comment Share on other sites More sharing options...
Marc Posted September 11, 2007 Share Posted September 11, 2007 I was thinking ControlGetText then try to match it with a questionThis depends on the type of chat you're trying to use. Is it an application like MIRC? Or a web browser? P.S. Is their like a get between function? I couldnt find one. I.E. GetBetween("<",">") For example $a = StringRegExpReplace("<html>", "<(.*?)>","\1") Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL) Link to comment Share on other sites More sharing options...
Assault Posted September 11, 2007 Author Share Posted September 11, 2007 The chat is an application like MIRC. I dont under stand how to use StringRegExpReplace, could you explain? Link to comment Share on other sites More sharing options...
Marc Posted September 11, 2007 Share Posted September 11, 2007 Okay, so you'll have to get the chat-text from the application, most likely with WinGetText.About the StringRegExReplace: it uses three parameters:1) the text to be filtered, in my example line "<html>2) the regular expression which defines what text shall be searched. In our case, we are searching for any amount of characters (which is represented by ".*?") standing between the two brackets3) the definition of the output string, in our case \1 which causes the command to give out the text between the brackets Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL) Link to comment Share on other sites More sharing options...
Assault Posted September 11, 2007 Author Share Posted September 11, 2007 Ok so I would use something like this(just the basic idea)?: $txt = wingettext() $ansr = StringRegExpReplace("" & $txt , "<(.*?)>","\1") Link to comment Share on other sites More sharing options...
Marc Posted September 12, 2007 Share Posted September 12, 2007 Quite so, except for the ""& - part $txt = wingettext() $ansr = StringRegExpReplace($txt , "<(.*?)>","\1") You'd get the html-codes between < and > as a result, text of the chat will be removed. If you want to get the plain text without the html-codes, simply change the two brackets in the RegEx. Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now