Romm Posted February 8, 2008 Posted February 8, 2008 2F&gender=1&lvl=2&const=501&sk=6&mount=0&hp=53&hpMax=53&hpT=0&mp=67&mpMax=67&mpT=0&parts= This is part of HTML code. I need to find "hp=" and then "cut" numbers to the right (here - 53).
whim Posted February 8, 2008 Posted February 8, 2008 (edited) Use StringInStr to get position, then various other String funcs to manipulate Edited February 8, 2008 by whim
Romm Posted February 8, 2008 Author Posted February 8, 2008 Returns the new string, the number of replacements performed is stored in @extended.This is not what i need. 2F&gender=1&lvl=2&const=501&sk=6&mount=0&hp=53&hpMax=53&hpT=0&mp=67&mpMax=67&mpT=0&parts= This code shows how many health and mana your character has. "hp=" and "mp=" are current health and mana. For example hp=53&hpMax=53&mp=67&mpMax=67. How to get value of hp=??
rudi Posted February 8, 2008 Posted February 8, 2008 (edited) 2F&gender=1&lvl=2&const=501&sk=6&mount=0&hp=53&hpMax=53&hpT=0&mp=67&mpMax=67&mpT=0&parts= This is part of HTML code. I need to find "hp=" and then "cut" numbers to the right (here - 53). Use FileReadToArray($MyHtmlFile,$MyArray) to get your file's content to an array. Then search all array values ($i = 1 to $MyArray[0]) for your "hp=n[n....]" StringRegExp($MyArray[$i],"hp=\d+",1) "hp=" will give you the part in the line starting with "hp=" "\d" is any directly following numeric char. (0-9) "+" tells regex to find the previous specified char at least one time. Have a look to the help for RegEx and other string operators. Regards, Rudi. Edited February 8, 2008 by rudi Earth is flat, pigs can fly, and Nuclear Power is SAFE!
erezlevi Posted February 8, 2008 Posted February 8, 2008 This is not what i need. 2F&gender=1&lvl=2&const=501&sk=6&mount=0&hp=53&hpMax=53&hpT=0&mp=67&mpMax=67&mpT=0&parts= This code shows how many health and mana your character has. "hp=" and "mp=" are current health and mana. For example hp=53&hpMax=53&mp=67&mpMax=67. How to get value of hp=?? first he is right use StringinStr: #include <String.au3> $m="hp=53&hpMax=53&mp=67&mpMax=67" $p=stringinstr ($m,"hp=",1) $n=$p+4 $n1=stringmid ($m,$p,$n) $n2=stringsplit ($n1,"=") $n3=$n2[2] MsgBox (0,"",$n3) by the way did you use the network sniffer?
Romm Posted February 8, 2008 Author Posted February 8, 2008 by the way did you use the network sniffer?no but im thinking about this now...
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