Results 1 to 7 of 7

Thread: 2 String like Questions[Help Plz]

  1. #1

    Thread Starter
    Hyperactive Member $uper-$tar's Avatar
    Join Date
    Aug 2001
    Location
    Usa
    Posts
    372

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

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    ??? 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"

  3. #3

    Thread Starter
    Hyperactive Member $uper-$tar's Avatar
    Join Date
    Aug 2001
    Location
    Usa
    Posts
    372
    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)

  4. #4
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    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.


  5. #5

    Thread Starter
    Hyperactive Member $uper-$tar's Avatar
    Join Date
    Aug 2001
    Location
    Usa
    Posts
    372

    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

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    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

  7. #7
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336

    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:
    1. Dim MyArray() as String
    2. MyArray=Split("alpha beta charlie delta echo"," ")
    3. 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:
    1. Dim i as integer,TheChar as String,TheString as string
    2.  
    3. For i = 1 to Len("bbbbbbaaacccccc")
    4. 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
    5. If TheChar="a" Then TheString=TheString & TheChar'Get the letter "a" from the string and add it to the extracted string.
    6. Next
    7.  
    8. 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
  •  



Click Here to Expand Forum to Full Width