Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Webpage responder
#1
Dear Sir,
I need to monitor a webpage every half a second for new offers (by clicking new offers)and need to accept offer immediately when new offer is displayed on the webpage. Accepting process should be so quick that human eyes can't see. So for this I need a macro or function which accepts offer instantly.
I use Chrome browser. I have attached webpage which I saved when offer was displayed. I can provide live website and login too if you need to see it.
I would be so glad if you help and make this possible and would buy 1 more license as a thank you favor.
Please let me know.
Thank you.

Mohnish


Attached Files
.zip   Webpage.zip (Size: 95.23 KB / Downloads: 424)
#2
To create code for it:
Open dialog "Find accessible object".
Drag to capture the object you want to click.
Specify a big wait time.
OK. It will create some code.
Test how the macro works. It should wait for the captured object, and end when it appears.
Then open dialog "Accessible object actions", select "do default action", OK.
Test again, it should wait and click.
Now just need to repeat it with rep.
When tested and works, convert the macro to function, to be able to run other macros while this one is running.
#3
I tried but it does not do anything. Can you please provide me some codes which I can test and let you know. I can provide you website access if needed. URL is https://as.realtrans.com/webtop/default.html
Also what is key to stop a function if it is repeating infinite.
Thanks.

Mohnish
#4
Example. Repeatedly waits for "Quick Macros" link in Chrome, and clicks it. When you navigate Chrome back, clicks again, and so on.
Function web_responder
Code:
Copy      Help
int w=win("- Google Chrome" "Chrome_WidgetWin_1")
rep
,Acc a.Find(w "LINK" "Quick Macros - *" "" 0x2001 1000000)
,a.DoDefaultAction
To end a function thread with a hotkey, create another function that have the hotkey as its trigger, and ends the first function's thread.
Function end_web_responder
Trigger AG     Help - how to add the trigger to the macro (Alt+Pause)
Code:
Copy      Help
EndThread "web_responder"
Note: run Chrome with command line --force-renderer-accessibility
#5
I created a function and a macro for Firefox. Function is clicking on new offer each second and macro waits for object and once object is visible it does default action. Below are codes for both. BUT the problem is I need function to stop when object (w "CHECKBUTTON" "" "a:id=chkOffer" 0x3014 3600) is found on webpage I tried puting hotkey by another function but it is not working. Can you please edit code below and let me know solution.

FUNCTION newoffer
int w=wait(3600 WV win("Welcome To REALTrans - Mozilla Firefox" "Mozilla*WindowClass" "" 0x804))
Acc a.Find(w "LINK" "New Offers " "" 0x3011 3)
rep
a.DoDefaultAction
1

MACRO acceptoffer
int w=wait(3600 WV win("Welcome To REALTrans - Mozilla Firefox" "Mozilla*WindowClass" "" 0x804))
Acc a.Find(w "CHECKBUTTON" "" "a:id=chkOffer" 0x3014 3600)
a.DoDefaultAction
int w1=wait(3600 WV win("Welcome To REALTrans - Mozilla Firefox" "Mozilla*WindowClass" "" 0x804))
Acc a1.Find(w1 "LINK" "Respond" "" 0x3011 3600)
a1.DoDefaultAction
int w2=wait(3600 WV win("Welcome To REALTrans - Mozilla Firefox" "Mozilla*WindowClass" "" 0x804))
Acc a2.Find(w2 "GRAPHIC" "Submit" "" 0x3011 3600)
a2.DoDefaultAction
#6
Macro Macro2189
Code:
Copy      Help
int w=wait(30 WV win("Welcome To REALTrans - Mozilla Firefox" "Mozilla*WindowClass" "" 0x804))
Acc a.Find(w "CHECKBUTTON" "" "a:id=chkOffer" 0x3014 3600)
EndThread "newoffer"
a.DoDefaultAction
a.Find(w "LINK" "Respond" "" 0x3011 30)
a.DoDefaultAction
a.Find(w "GRAPHIC" "Submit" "" 0x3011 30)
a.DoDefaultAction
#7
Thanks, it is working however I need this done at lightning fast speed like human eye can't even see it happening. Current macro is working slow regarding object actions, is there any way to do it extremely fast? Because other competitors try to get offers and it is matter of milliseconds and offer is gone due to competition in getting it.
Also some times if Internet is disconnected, the website will logout automatically and popup is displayed on the page, so is there any way macro can relogin and restart running itself?
Thanks.
Mohnish
#8
Finding accessible objects is slow. To make faster, try:
When creating code with dialog "Find accessible object", check "as firefox node". Also try to check "reverse". Test speed with the Test button.
Try other web browser (Internet Explorer, Firefox or Chrome). Will need to create code for each, same code will not work in all browsers.
Use Internet Explorer, and create code with dialog "Find html element". Test speed too. It also can wait.
Create code with dialog "Find image". Test speed too. It also can wait.
Maybe your macro is slow because newoffer clicks every 1 s. Maybe need to click more frequently. But look how much CPU it uses.

To relogin, don't know, maybe some trigger can be used, or the code changed somehow to look for a "relogin" object, maybe in separate thread (like now newoffer does), or newoffer could look for the object.
#9
Thanks a million, "Find html element" is working good, I will test it in realtime tomorrow and let you know.
Regarding "Find accessible object" why Chrome is not working? It is generating codes but when I runt it always says "Error (RT) in Macro: object not found."
For example I generated below codes but when I run it says "Error (RT) in Macro: object not found."
FUNCTION newofferchrome

int w=wait(3000 WV win("Welcome To REALTrans - Google Chrome" "Chrome_WidgetWin_1"))
Acc a.Find(w "LINK" "New Offers " "" 0x3001 3000)
a.DoDefaultAction

Also let me know how to run Chrome with command line --force-renderer-accessibility. I am not sure I did it correctly, Please let me know solution for this.
Thank you.

Mohnish
#10
Append --force-renderer-accessibility in Target field in Properties dialog of Chrome shortcut.
Or run from QM:
Macro Macro2193
Code:
Copy      Help
run "chrome.exe" "--force-renderer-accessibility"
Because Chrome starts with disabled accessible objects. Even then may need to Refresh some tabs to make it work. Accessible objects in Chrome are less reliable than in IE and Firefox.
#11
I have this repeat function as below, but I want it to pause itself for 10 seconds when screen color is "0xAC7900" at location "1746 315" and then restart itself again.

FUNCTION newoffer
int w=wait(36000 WV win("Welcome To REALTrans - Internet Explorer" "IEFrame"))
rep
Htm e=htm("U" "New Offers " "" w "1/1/2" 5 0x21 0)
e.Click
1

Could you please help me how to do it
Thank you.
#12
Did you try function pixel? Or scan?
To find functions, use the "Find help, functions, tools" field in QM window. For example, type color and Enter.
#13
Here color and location is fixed (color "0xAC7900" at location "1746 315") Just want your help to edit the function code so it can stop when color "0xAC7900" is found at location "1746 315"
I tried but not successful, could you please let me know function codes for that.
Thank you.
Mohnish
#14
Dear Gintaras,

I tried but not much idea how to do it. Need your help to create function. Color and location is fixed (color "0xAC7900" at location "1746 315") Would be great if you can edit the function code below so it can stop when color "0xAC7900" is found at location "1746 315"

FUNCTION newoffer
int w=wait(36000 WV win("Welcome To REALTrans - Internet Explorer" "IEFrame"))
rep
Htm e=htm("U" "New Offers " "" w "1/1/2" 5 0x21 0)
e.Click
1

Appreciate your answer.


Forum Jump:


Users browsing this thread: 1 Guest(s)