west Posted July 10, 2007 Share Posted July 10, 2007 Hi all I explain my situation i am totaly new to autoit I want to make a bot to advertise rules in a chat room i am amble to take the main windows active but now how i can send text in the thext box and click button I also noticed that i cant send Thai language font and its what i need to send if somenone have any tutorial or help i can rest i will appreciate thank a lots Link to comment Share on other sites More sharing options...
west Posted July 10, 2007 Author Share Posted July 10, 2007 Hi allI explain my situation i am totaly new to autoitI want to make a bot to advertise rules in a chat roomi am amble to take the main windows activebut now how i can send text in the thext box and click buttonI also noticed that i cant send Thai language font and its what i need to sendif somenone have any tutorial or help i can rest i will appreciatethank a lotsok I've find out hoe to write thai in note pad at least this is good nowjust need know how to use the exact place in a more complex window where to send the textlike in a chat window you have the ext where you read it me i want to send in the text send window and clike SEND button??? Link to comment Share on other sites More sharing options...
dandymcgee Posted July 10, 2007 Share Posted July 10, 2007 Read up on the ControlSend() function and check out the Window Info tool that comes with the AutoIt installation. - Dan [Website] Link to comment Share on other sites More sharing options...
west Posted July 10, 2007 Author Share Posted July 10, 2007 Read up on the ControlSend() function and check out the Window Info tool that comes with the AutoIt installation.Yes all is fine nowi can make it run and do sned textbut now lol how i make this BOT repaat send text in x sec interval i need it run always until i disconect from the roomhow i can include the windows active stutus in a loop or any other way to do big big thanks Link to comment Share on other sites More sharing options...
west Posted July 10, 2007 Author Share Posted July 10, 2007 Yes all is fine nowi can make it run and do sned textbut now lol how i make this BOT repaat send text in x sec interval i need it run always until i disconect from the roomhow i can include the windows active stutus in a loop or any other way to do big big thanksok if find out how to make my loopbot works but its somewhat messynow i want to id read the text from a file and put into clipboard to try save the format of the text ( multi lines text) and then paste it into the roomany help on thatclipboard and files i realy dont know at all how to doi try read the help but so many things so i dont know where to beginTHanks Link to comment Share on other sites More sharing options...
dandymcgee Posted July 10, 2007 Share Posted July 10, 2007 I'm not sure if you'll even need to use the clipboard at all. Read up on the FileOpen() and FileRead() functions in the help file. You should be able to store the text from the file as a variable in the program. As far as keeping it's original format you will probably have to read and send the text file line by line using the FileReadLine() and then ControlSend() functions. I am taking the time to reply to your posts, regardless of the fact that you don't speak the best english, because you state your problem very clearly and ask specific questions which makes it very easy for others here on the forum to help you. Keep up the good work and post back if you have further problems. P.S. I'd also appreciate checking out the source code of this program when you are finished so that I may learn from your programming techniques and maybe even show you some alternative methods. -Dan - Dan [Website] Link to comment Share on other sites More sharing options...
west Posted July 10, 2007 Author Share Posted July 10, 2007 I'm not sure if you'll even need to use the clipboard at all. Read up on the FileOpen() and FileRead() functions in the help file. You should be able to store the text from the file as a variable in the program. As far as keeping it's original format you will probably have to read and send the text file line by line using the FileReadLine() and then ControlSend() functions. I am taking the time to reply to your posts, regardless of the fact that you don't speak the best english, because you state your problem very clearly and ask specific questions which makes it very easy for others here on the forum to help you. Keep up the good work and post back if you have further problems.P.S. I'd also appreciate checking out the source code of this program when you are finished so that I may learn from your programming techniques and maybe even show you some alternative methods.-DanYes i am reading it not sure if I am uderstanding well so it will need some time to experiementI appologize my english is not good at all sorryfrom what i am understandting in your last post is i will need to read the .txt file and put the text into a varibaleI will try to do itbut when its time to paste the text into the room i realy need to put in 1 time a few lines of text and then SEND with the buttonits make the BOT more clean into the roomas exembleif i do 1 by 1 with a SEND for each will do this BOT: welcome BOT: welcome BOT: welcome BOT: welcomeme i want to do this BOT: welcome welcomewelcomewelcomeits need paste the 4 lines of text in 1 time and then click SEND in the chat roomP.S of course soon as i will have someting who is not so bad i will paste the code there fo you guys ////////////////////////////////////////also I am planning to do my text in notepad and save the file and try to read it from autoitbut how i can only read the good part of the file to paste in roomi mean i will add many different advertsas welcomerules of roometc etchow i can be sure to go read the good part in the text file and paste iti dont want to use 30 000 different text file for every text i want to advert in the chat roomThank you so much guys Link to comment Share on other sites More sharing options...
west Posted July 11, 2007 Author Share Posted July 11, 2007 Ok i finaly have someting fonctional, its very basic and not exactly what i want but its work i paste the code there Dim $RoomName ; Read the ini file "name of room for the bot to connect" $file = FileOpen("Room_ini.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop MsgBox(0, "Connect to:", $line) $RoomName = $line Wend FileClose($file) ;test pour voir la variable ;MsgBox(0, "Room name is:", $RoomName) ; Wait for the Chat room become active - WinWaitActive($RoomName) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; open the advert file read it and paste text in the chat room While 1 $file = FileOpen("Adv.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop ;MsgBox(0, "Line read:", $line) ControlSetText($RoomName, "", "[iD:1042]", $line ) ControlClick($RoomName, "", "[iD:1019]") sleep(30000) Wend FileClose($file) Wend Link to comment Share on other sites More sharing options...
McGod Posted July 11, 2007 Share Posted July 11, 2007 An IRC based chatroom? [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
west Posted July 11, 2007 Author Share Posted July 11, 2007 An IRC based chatroom?nope a camfrog video chat room Link to comment Share on other sites More sharing options...
west Posted July 12, 2007 Author Share Posted July 12, 2007 IVE found a problem if someone in room add a topic the chat room title will change so the Bot dont work anymore or cannot be started any clue how to use the window in an another way ???? Link to comment Share on other sites More sharing options...
dandymcgee Posted July 12, 2007 Share Posted July 12, 2007 (edited) You don't always need the complete title to use a window, if only a portion of the title remains the same that will work too (ie. with Internet Explorer the title always ends with "Internet Explorer". You'd just have to make sure you only have one chat window open or the bot will get confused on which one to use. So maybe the title always begins with "Chat Room - " and then has other text following it that changes (this is just an example). Read the help file and look up the Opt() command the WinTitleMatchMode() parameters. Let me know if you need more help (sorry it took me so long to reply my internet has been going on and off the last couple of days so it's hard to log on). EDIT: Also if this doesn't work (the entire title changes and you can't use this method) you could try just searching the text of the window for certain text that is always in the window. Just another idea. Edited July 12, 2007 by dandymcgee - Dan [Website] Link to comment Share on other sites More sharing options...
west Posted July 14, 2007 Author Share Posted July 14, 2007 You don't always need the complete title to use a window, if only a portion of the title remains the same that will work too (ie. with Internet Explorer the title always ends with "Internet Explorer". You'd just have to make sure you only have one chat window open or the bot will get confused on which one to use. So maybe the title always begins with "Chat Room - " and then has other text following it that changes (this is just an example). Read the help file and look up the Opt() command the WinTitleMatchMode() parameters. Let me know if you need more help (sorry it took me so long to reply my internet has been going on and off the last couple of days so it's hard to log on).EDIT: Also if this doesn't work (the entire title changes and you can't use this method) you could try just searching the text of the window for certain text that is always in the window. Just another idea.yes could be nice if you give me an exemple cause i dont got it even after read Link to comment Share on other sites More sharing options...
west Posted July 14, 2007 Author Share Posted July 14, 2007 yes could be nice if you give me an exemple cause i dont got it even after readall is fine i've found out Link to comment Share on other sites More sharing options...
dandymcgee Posted July 14, 2007 Share Posted July 14, 2007 all is fine i've found out Cool, let me know if you have any other problems. - Dan [Website] Link to comment Share on other sites More sharing options...
west Posted September 7, 2007 Author Share Posted September 7, 2007 Cool, let me know if you have any other problems.Yea and then if i want to control the BOT with !start and !stopany clue ???? 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