|
-
Jul 21st, 2003, 05:12 PM
#1
Thread Starter
Hyperactive Member
2 String like Questions[Help Plz]
I play a game called: Anaroch.Com and I made a client so I could check my stats as I went up XP and things like that.
But I cant get these string functions...
1. Search the strHTML for <img height="75" src="anaroch.cgi?captcha=1058824761" width="100">
and if it finds it it would send a message box up saying "Image Stop"
2. Search the strHTML which would be something like:
<font face="arial" size="2">
Name: <font color="#ffff00" face="arial" size="2">
SuperStar101</font>; AP: <font color="#ffff00" face="arial">17500
So I can take out the SuperStar101 (The name) and 17500 (The AP)
If you can help, I will put ya in the credits =P (Many Many people are getting to program, if ya wanna check it out so far:
http://foxxgear.cjb.net
Last edited by $uper-$tar; Jul 22nd, 2003 at 10:59 AM.
-
Jul 21st, 2003, 05:26 PM
#2
??? why cant you search for those strings?
if instr(strHTML,"String to search for") > 0 then Msgbox "Found it"
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jul 21st, 2003, 05:41 PM
#3
Thread Starter
Hyperactive Member
Well wait I can search ther outertext so it be:
Name: SuperStar101; AP: 17500; DP: 17200; HP: 17200; SP: 560; XP: 337647; Team: Fox X Team
How can get whats their name and stuff
(i did what u said it worked, i'm new to strings)
-
Jul 21st, 2003, 06:06 PM
#4
PowerPoster
Do some research on Instr, Mid,Left,Right functions..
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
Jul 22nd, 2003, 10:47 AM
#5
Thread Starter
Hyperactive Member
I have
No luck, thats why if someone could show a ex of getting the name, or taking a string:
"alpha beta charlie delta echo"
and get charlie out of it. It would Help Alot. Like ALOT
-
Jul 22nd, 2003, 11:29 AM
#6
Originally posted by Arc
Do some research on Instr, Mid,Left,Right functions..
VB has a help system (and a web site - http://msdn.microsoft.com/vbasic/ )
It has examples
The above functions all have examples in VB help and the web site.
Have a look
-
Jul 22nd, 2003, 12:05 PM
#7
PowerPoster
Re: I have
Originally posted by $uper-$tar
No luck, thats why if someone could show a ex of getting the name, or taking a string:
"alpha beta charlie delta echo"
and get charlie out of it. It would Help Alot. Like ALOT
THis will get charlie from that string
VB Code:
Dim MyArray() as String
MyArray=Split("alpha beta charlie delta echo"," ")
Msgbox MyArray(2)
That uses the Split function to break that string into an array of individual words using the Delimiter " ". If you said Msgbox MyArray(4) you would get the word "echo"
BUt for your other examples it won;t be nearly as simple. You'll have to use Mid AND Split AND Maybe even Instr.
Here's an example of using Mid. I'm going to get the string "aaa" out of the string "bbbbbbaaacccccc".
VB Code:
Dim i as integer,TheChar as String,TheString as string
For i = 1 to Len("bbbbbbaaacccccc")
TheChar=Mid("bbbbbbaaacccccc",i,1)'This means start at "i" whatever number that is in the loop and then go over 1 character at a time
If TheChar="a" Then TheString=TheString & TheChar'Get the letter "a" from the string and add it to the extracted string.
Next
Msgbox TheString
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|