Sign in to follow this  
Followers 0
xdp22

String down html code

9 posts in this topic

#1 ·  Posted (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. :x

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 by xdp22

Share this post


Link to post
Share on other sites



can you provide the code for the function _FFReadText


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."

 

WindowsError.gif

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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hello :x it's in topic :P

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 by xdp22

Share this post


Link to post
Share on other sites

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.


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."

 

WindowsError.gif

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.


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."

 

WindowsError.gif

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

Share this post


Link to post
Share on other sites

I don't know how use that :/

M23 i need you :DD

Share this post


Link to post
Share on other sites

_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

Share this post


Link to post
Share on other sites

Thanks, works, but why its return for me only

Super Tutut
(delete)
8 Paladin
Offline

not rest?

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0