Help - Search - Members - Calendar
Full Version: Is it possible to make an ACTool script read/detect values on a webpag
AC Tools Everything Macro > AC Tool Macros > Macro Development
SaGaR
Hi all,
like the title says,
example:
a website has the following text on it: "the chance you will die after reading this is 0,000000000001%" or "The chance my question will be answered is 50%
is it possible to make ACTool read/detect ANY of the words/letters/numbers?

and now i am asking i thought of another question:
Is it possible to do the above, and then make it choose the option with the highest %?
Ahk
If you can select the text, and copy it to the clipboard, then yes.
If there's only a couple of percentages you may be able to do this easily using IsObject...I'd go after the select & Ctrl+C for copy though.

GetClipboard will store what is in the clipboard into a variable, and then you could get the number out if it using StrNumber I think.
SaGaR
QUOTE(Ahk @ May 12 2009, 02:16 AM) *
If you can select the text, and copy it to the clipboard, then yes.
If there's only a couple of percentages you may be able to do this easily using IsObject...I'd go after the select & Ctrl+C for copy though.

GetClipboard will store what is in the clipboard into a variable, and then you could get the number out if it using StrNumber I think.

there are four percentages i can choose from,i forgot to say, they are different everytime, so for example: one time the third option will be higer, and the next time the second option will have higher percentage,


thanks, i will try it, but how do i do it with IsObject?
SaGaR
hi, its been a while since my reply, but you haven't answered my question, so can you tell me how to do it with isobject, and with the strnumber thing, cuz i tried everything to make it work, but nothing worked
Vanberk
Here is how it could work, I don't think it will work on your page since it haven't been adjusted for you thing. I played with it in Notepad and pretty much of got it to work.
Just need a little modification to fit the webpage you are going to use it on.
It would be easier if you posted a link to the homepage or tell us the name of it here.

CODE
constants
cb=Vanberk
temp=
count=0
looper=4 // How many diffrent numbers on the page.
end

delay 5 sec
SetActiveWindow {ActiveWindow}
delay 1 sec
keys ^a // ctrl + a
delay 50
keys ^c // ctrl + c
GetClipboard $cb // get the copied text inside $cb
delay 1 sec
loop $looper // loop the copied page text.
StrNumber temp = $cb, {loopno} // take out the numbers from the text and add it inside $temp.
delay 50
if $temp > $count // if $temp is bigger then $count.
SetConst count = $temp // set count to $temp.
end
end // $count will now contain the highest number.


-Vanberk
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.