Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New to Quick Macros
#1
I am not a hacker like many of the others I am seeing on this board. Half of the code in these forums is unfamiliar to me although I have read and re-read the documentation with quick macros. My past experience with macros is through MUD programs that usually have a frontend that is very simplified. One specifies a trigger and then defines a reaction and you are done.

What I would like to do is create a macro that will identify a line of text in the explorer window when I open a page, and then paste that to an input field. In a mud program the line would look similar to this:

The sky is very $color blue today.

This would save whatever color was in that line as $color which I could then program the mouse to click the field and paste the text in.

I am sorry this is such a lenghtly explanation for a simple action, but I should give the exact application I intend to use this for. Ebay has a line on the bottom of every page to bid that looks like this

(Enter US $0.01 or more)

All I want to do is have the macro paste 0.01 into the bid field so that I can just click "place bid" manually after running the macro. I bid on many auctions and not having to type amounts in every time when I can just hit a function key and have the form autofill would be a great help and save what's left of my aching hands.

So how to save a changing number to a variable, and then paste it onto a page....

Thank you in advance for any insight anyone can provide.
#2
With IE or IE-based browser, you can use html element functions. Use dialogs Find Html Element and Html Element Actions.

Code:
Copy      Help
;find the Enter US$... element
MSHTML.IHTMLElement el=htm("B" "or more" "" "eBay item" 0 49 0x21 0 -1)
;get its text
str text=el.innerText
;extract the number
str amount
findrx(text "[\d\.,]+" 0 0 amount)

;example of manipulating the number
;double d=amount
;d+1
;amount=d


;find the adjacent input field
el=htm("B" "" "<B>or more</B>" "eBay item" 0 49 0x24 0 -4)
;set its text
el.innerText=amount

;also can click the button
el=htm("INPUT" "Place Bid >" "" "eBay item" 0 100 0x421)
el.click


Forum Jump:


Users browsing this thread: 1 Guest(s)