Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Retriving information from text box
#1
Htm el=htm("DIV" "" "" win(" " "ATL:007C37C8"))
str s=el.Text

lpstr s1 = s
str s2
int i

i=findcr(s1 ':')+2
if(i>=0) s2.get(s1 i)
,out s2
else
,out i

this code here will get the last text from Messnger inbox...
basically what i want to do is to make it get last text only if it is a number...

and if it is a number it will store into a string and then run function23

example..

hey are you still here..
hello?
call me if u get this
7777777

I Want to make the code constently read the text...and if the last message is a 7 didget phone number then to store the code into a string or copy it and then run a macro..if it isnt a 7 didget number then to keep checking. is this possible?
thanks for all the help
#2
Macro
Code:
Copy      Help
rep
,Htm el=htm("DIV" "" "" win(" " "ATL:007C37C8"))
,str s=el.Text
,
,if(findrx(s "^\d+$")=0)
,,out "it is a number"
,
,wait 1
#3
Gintaras Wrote:Macro
Code:
Copy      Help
rep
,Htm el=htm("DIV" "" "" win(" " "ATL:007C37C8"))
,str s=el.Text
,
,if(findrx(s "^\d+$")=0)
,,out "it is a number"
,
,wait 1

i tried using this code...and it did not pick up the numbers...am i doing somthing wrong?
#4
what i need to do is for it to find the last message in yahoo messenger window and to check if it is a number... and if it is a number i need it to store into string so i can set the wintext of a winow in notepad (id 15 i belive)
hope this helps
#5
I don't know what is in s. if it is a number, the code works.

Macro
Code:
Copy      Help
str s="7777"

if(findrx(s "^\d+$")=0)
,out "it is a number"
#6
what im trying to do is read the last message in a text box:
there is a picture attached...
i simply want a macro that will constantly run this chat window scanning the last message received and if a 7 didget number comes up it will run macro42 and if the 7 didget number does not then it will keep checking... here is a picture attached to the post this might help you


Attached Files Image(s)
   
#7
Function MainTran
Code:
Copy      Help
Htm el1=htm("DIV" "" "" win(" " "ATL:007C37C8"))

this is the window handle as well. its in html format i beleve
#8
Macro
Code:
Copy      Help
out
str s=
;xxxxxx22xxxxxx
;333
;yyyy7654321yyyyyy
;1234567
;aaa

str s7
if(findrx(s "\b\d{7}\b" 0 0 s7)>=0)
,out "s contains a 7-digit a number %s" s7
#9
i need to make it check only the last line though Gintaras. Not all the messages at once and tell.
#10
Maybe your htm finds wrong element. Make sure it finds element of last message. I cannot help more because don't have YM.


Forum Jump:


Users browsing this thread: 1 Guest(s)