xdp22 Posted January 6, 2011 Share Posted January 6, 2011 (edited) Hello guys, i have problem with my code, i wan't take one thing from site, and save to .txt file, but it's hard. I used FFReadText to take text from site, and need take some string from this text, but i don't know how. Here is my code : $sText = _FFReadText(7) $lvl = _StringBetween($sText, "1.", "All rights reserved.") FileWriteLine(test.txt, $lvl) And that's dont work, i have empty file test.txt or 0 in this file. Here is $sText Server Info Commands Screens 1. Super Tutut (delete) 8 Paladin Offline [ view ] Bought characters NameLevelStatus You have no bought chars! Buy character using our auction system! Copyrights EXAMPLE[size="7"] All rights reserved[/size]. How can i get this between 1. and All rights reserved? in this example i need to get : Super Mama (delete) 8 Paladin Offline [ view ] Bought characters NameLevelStatus You have no bought chars! Buy character using our auction system! Copyrights EXAMPLE Thank you. Edited January 6, 2011 by xdp22 Link to comment Share on other sites More sharing options...
nitekram Posted January 6, 2011 Share Posted January 6, 2011 can you provide the code for the function _FFReadText 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
xdp22 Posted January 6, 2011 Author Share Posted January 6, 2011 (edited) Hello it's in topic but here is _FFReadText : Server Info Commands Screens 1. Super Tutut (delete) 8 Paladin Offline [ view ] Bought characters NameLevelStatus You have no bought chars! Buy character using our auction system! Copyrights EXAMPLE[size="7"] All rights reserved[/size]. Edited January 6, 2011 by xdp22 Link to comment Share on other sites More sharing options...
nitekram Posted January 6, 2011 Share Posted January 6, 2011 A normal function in AutoIT contains the key words Func and EndFunc - the info you provided does not contain that info - so that might be your problem. If you call a function - you need the function in your code or included in a file within your code. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
xdp22 Posted January 6, 2011 Author Share Posted January 6, 2011 Noo i just gived part of code what don't work for me... my code is loooooong, but here doesn't needed other code.. i just need take string from this FFReadText and i can't do that. Link to comment Share on other sites More sharing options...
nitekram Posted January 6, 2011 Share Posted January 6, 2011 OK then - that will be the problem - you need to read each line within your file to check and see if it contains the info that you are looking for. In the code that you provided, it does not show that info - so I am not going to be able to be of further assistance. If you put the text in a varable and then stringsplit($text, @crlf) then read each index - that should be enough to show you what you want. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
xdp22 Posted January 7, 2011 Author Share Posted January 7, 2011 I don't know how use that :/ M23 i need you :DD Link to comment Share on other sites More sharing options...
Bowmore Posted January 7, 2011 Share Posted January 7, 2011 _StringBetween() returns an array. So you need to use array notation with the return variable $sText = _FFReadText(7) $lvl = _StringBetween($sText, "1.", "All rights reserved.") FileWriteLine(test.txt, $lvl[0]) ;<==== This is how to write the value "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
xdp22 Posted January 7, 2011 Author Share Posted January 7, 2011 Thanks, works, but why its return for me only Super Tutut (delete) 8 Paladin Offline not rest? 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