Jump to content
Sign in to follow this  

Getting number from a desired row in text

Recommended Posts


Hello all!

I am making a bot for a MMORPG online game. So far so good - it works. You forum is really helpfull.

I want to add some new features but i can't solve my problem. It's about win/loss statistics and how much gold you win/lose. With the help of it, i could make the bot store the names and auto attack those who give a lot of gold.

Here is how it goes:

After an attack, bot goes to messages, puts up a search bar and finds the part where it says: "blabla captured: 8" ("captured: " is the search keyword). Mouse then drags over the number and copies it. Ok, it is primitive but it works. Mouse movements are not aways accurate and i want to minimise them.

What are yout suggestions?

How can i get a number from a row in text?

source of it:

<h2>Winner: blabla</h2><p>blabla captured: 138 <img src="img/res2.gif" alt="Gold" align="absmiddle" border="0"> </p>

thanks in advance

edit: forgot add that bot works and navigates through IE.

Edited by Consty

Share this post

Link to post
Share on other sites

This worked for me:

$Test = "<h2>Winner: blabla</h2><p>blabla captured: 138 <img src=""img/res2.gif"" alt=""Gold"" align=""absmiddle"" border=""0""> </p>"
$Test1 = StringSplit($Test,"captured:",1)
$Number = Number($Test1[2])

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