McGod Posted February 5, 2006 Share Posted February 5, 2006 (edited) This script doesnt want to display the $line command in send funticion My Script :P Any suggestions\fixes or why it isnt working? Edited February 6, 2006 by Chip [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...
BigDod Posted February 5, 2006 Share Posted February 5, 2006 Change Send ( "$line" ) to Send ( $line ) Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
McGod Posted February 5, 2006 Author Share Posted February 5, 2006 Change Send ( "$line" ) to Send ( $line )It works now but it only uses first line?any way of it going threw the list? [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...
BigDod Posted February 5, 2006 Share Posted February 5, 2006 It works now but it only uses first line?any way of it going threw the list?The way you are using FileReadLine it will only read the first line. See the example in the help file for the proper way to read every line. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
McGod Posted February 5, 2006 Author Share Posted February 5, 2006 MouseClick("left", 303, 650, 1) ;Create Character While 1 MouseClick("left", 579, 418, 1) ;Selects Char $file = FileOpen("test.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 $line = FileReadLine($file) If @error = -1 Then ExitLoop Send ( "$line" ) ;Characters Name MouseClick("left", 881, 711, 1) ;Hits OK MouseClick("left", 598, 478, 1) ;Hits Retry for every line? [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...
McGod Posted February 5, 2006 Author Share Posted February 5, 2006 i tried adding MouseClick("left", 579, 418, 1) ;Selects Char $file = FileOpen("test.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 $line = FileReadLine($file) If @error = -1 Then ExitLoop Send ( $line ) ;Characters Name MouseClick("left", 881, 711, 1) ;Hits OK MouseClick("left", 598, 478, 1) ;Hits Retry again but $line = FileReadLine(2) It gave error any easier way of reading text from file and sending it? [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...
BigDod Posted February 5, 2006 Share Posted February 5, 2006 Replace this ; Read in lines of text until the EOF is reached $line = FileReadLine($file) If @error = -1 Then ExitLoop Send ( "$line" ) with this ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop Send ( "$line" ) Wend Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 5, 2006 Moderators Share Posted February 5, 2006 (edited) I gave the udf to look at: #include <file.au3> Local $FilePath = FileOpenDialog('Find File To Send Text', @ScriptDir, 'All Files (*.*)') Local $nArray = '' _FileReadToArray($FilePath, $nArray) SendStrings($nArray) Func SendStrings(ByRef $nArray) For $i = 1 To UBound($nArray) - 1 Send($nArray[$i]) Next EndFunc Edit: BigDod beat me, but now you have 2 different ways. Edited February 5, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
McGod Posted February 5, 2006 Author Share Posted February 5, 2006 #include <file.au3> Local $FilePath = FileOpenDialog('Find File To Send Text', @ScriptDir, 'All Files (*.*)') Local $nArray = '' _FileReadToArray($FilePath, $nArray) SendStrings($nArray) Func SendStrings(ByRef $nArray) For $i = 1 To UBound($nArray) - 1 Send($nArray[$i]) Next EndFunc I dont get where you put this or where you put the file.au3 [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...
Moderators SmOke_N Posted February 5, 2006 Moderators Share Posted February 5, 2006 I probably (I know I did, over complicate it for you, but I really don't understand what your trying to do, if your trying to repeat that time and time again or whatever#include <file.au3> Opt('MouseCoordMode', 0); check Opt('MouseCoordMode') in the help file to see what you need to set 0 to. Local $FilePath = FileOpenDialog('Find File To Send Text', @ScriptDir, 'All Files (*.*)') Local $nArray = '' _FileReadToArray($FilePath, $nArray) MouseClick("left", 579, 418, 1, 1) SendStrings($nArray) Func SendStrings(ByRef $nArray) For $i = 1 To UBound($nArray) - 1 If $i = 1 Then Send($nArray[$i]) MouseClick("left", 881, 711, 1) MouseClick("left", 598, 478, 1) ElseIf $i = 2 Then MouseClick("left", 579, 418, 1, 1) Send($nArray[$i]) MouseClick("left", 881, 711, 1) MouseClick("left", 598, 478, 1) Else ExitLoop EndIf Next EndFuncIf your doing it more than twice just copy the ElseIf and put in another one with 3, 4, 5 etc... A while loop would be better probably for you, but to be honest, I'm to tired to re-write it. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
BigDod Posted February 5, 2006 Share Posted February 5, 2006 Have you tried my suggestion? Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
McGod Posted February 5, 2006 Author Share Posted February 5, 2006 The idea i want it to try is to like It tries a name,if the name exists it hits ok and then repeats with a new name. When i tried ur suggestion it put all 3 lines into the box and tried and Smoke_N i dont know what i need in file.au3 So pretty much it repeats a process with a new name that comes from a text file [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...
McGod Posted February 6, 2006 Author Share Posted February 6, 2006 Well i want to be able to do like more then 50 names is there any way other then the copy n paste method to do it? [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...
Oxin8 Posted February 6, 2006 Share Posted February 6, 2006 The too ways already given should go as many as are in the text file. If you haven't tried it yet, it should work. If it doesn't, post updated code and we'll try to help. Btw, why are you trying different character names for D2? ~My Scripts~ *********_XInput UDF for Xbox 360 ControllerSprayPaint_MouseMovePlus Link to comment Share on other sites More sharing options...
McGod Posted February 6, 2006 Author Share Posted February 6, 2006 (edited) The too ways already given should go as many as are in the text file. If you haven't tried it yet, it should work. If it doesn't, post updated code and we'll try to help.Btw, why are you trying different character names for D2?NamebotNew Code is pretty bigtrys 30 names Edited February 6, 2006 by Chip [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...
Oxin8 Posted February 6, 2006 Share Posted February 6, 2006 I think you're just a bit confused. All you should need is: Func SendStrings(ByRef $nArray) For $i = 1 To UBound($nArray) - 1 If $i = 1 Then Send($nArray[$i]) MouseClick("left", 1005, 845, 1);OK MouseClick("left", 715, 609, 1);Retry Else MouseClick("left", 720, 551, 1, 1);Selects Char Send($nArray[$i]) MouseClick("left", 1005, 845, 1);OK MouseClick("left", 715, 609, 1);Retry EndIf Next EndFunc I left the If Then in there because I noticed that if it $i=1 then it doesn't do the initial click. Seeing as how that selects the character, probably want you really want the function to be: Func SendStrings(ByRef $nArray) For $i = 1 To UBound($nArray) - 1 MouseClick("left", 720, 551, 1, 1);Selects Char Send($nArray[$i]) MouseClick("left", 1005, 845, 1);OK MouseClick("left", 715, 609, 1);Retry Next EndFunc ~My Scripts~ *********_XInput UDF for Xbox 360 ControllerSprayPaint_MouseMovePlus Link to comment Share on other sites More sharing options...
McGod Posted February 6, 2006 Author Share Posted February 6, 2006 *Does Happy Dance* Worked Perfectly Thanks [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...
Moderators SmOke_N Posted February 6, 2006 Moderators Share Posted February 6, 2006 Thanks Oxin8, I got caught up in the superbowl and guest, thanks for helping him out with my post . Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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