SRL Archive - OSR Help

Need help with simple script


arraness14

2011-10-18 21:01:59

ok so Im writing a script that posts ads on a local website. The need for the script is because I offer a worldwide service so I need to post the ad in all the city's listed.

This is what I have so far

program New;
begin
clickmouse(200, 48,true); //address bar
wait(1000);
sendkeys('www.kijiji.ca');
sendkeys(chr(13));
wait(2000);
clickmouse(736, 108,true); //post add
wait(5000);
holdmouse(1019,733,true) //scroll down
wait(3000)
releasemouse(1019,733,true)
clickmouse(122,230,true)
wait(2000)
clickmouse(239,402,true) //BOLD BUTTON
wait(3000)
clickmouse(340,405,true) //center button
wait(3000)
clickmouse(281,504,true)
sendkeys('International Shipping Link Inc.')
end.

I am currently using SCAR but I have Simba also and you can help me out using whichever one. just let me know which.

so im going to list what I need help in

1. I need to know how to label the main part of my script (kind of what i posted up there). i think its called a procedure. so that it can post the ad once im on the page for a different city. So i dont have to copy paste the above code.

2. I need to know how to tell SCAR/SIMBA to clickmouse once the page is loaded. instead of "wait(2000)"

3. I need to tell SCAR/SIMBA to click on a specific link on a page. just in case i use this script on a different computer with a different browser or resolution the clickmouse command wont work.

Thanks

NCDS

2011-10-18 21:05:12

If you're going to be constantly using the same website to advertise then you could use bitmaps to find what you're trying to click, etc. There are numerous tutorials on bitmaps here at villavu if you need assistance.

arraness14

2011-10-19 02:36:25

Thanks NCDS

I tried as hard as I could and i think I almost got somewhere. Im just trying it on its own right now without the rest of the script.

I have a problem though. Im trying to make it click on the 'bitmap' the script compiled but nothing happened.


Var post_ad_free, x, y : Integer;

Begin
post_ad_free := BitmapFromString(82, 11, 'beNqLZPj/+/8I' +
'RAwMyWiIRraQKnstkgENYRV/vqnn+/v3JGkBIqCN31EBpghBgF8L' +
'RBaPGqxSEOfhF39//xzI49umEK8Fl41DyNdoXGr5Gp7s0RQgC2JV' +
'Q4yv4boGla/RvE+kIP4wxKqX/BR+eS9mCkdGuMQxS7Pvn79DEFY2' +
'siBWlXikiGHDERYvYBN/vqoFTQsuoyh3MJ7wQTMBV6gS6Ws84u/v' +
'XwMy7i0qpo+viUwAWMWp6Gsgen56Kyi6D6+lta8pT/YQcar4Goju' +
'tXkBue+fP6eWr7EmZlwpHE+04olurOaT5GtodINzN5FFwTUAkmc8' +
'uA==');

If FindBitmap(post_ad_free, x, y) Then
clickmouse(x, y, True);
End.

NCDS

2011-10-19 09:04:40

From: arraness14
Thanks NCDS

I tried as hard as I could and i think I almost got somewhere. Im just trying it on its own right now without the rest of the script.

I have a problem though. Im trying to make it click on the 'bitmap' the script compiled but nothing happened.


Try to debug it a bit; that's the best way to find out what's wrong.

So perhaps try this:

if FindBitmap(..) then
ClickMouse()
else
Writeln('Failed to find bitmap');

You could also look into DTM's if necessary, though it shouldn't be.

arraness14

2011-10-20 00:54:21

UGH cant get it to work

Home

2011-10-20 06:10:30

From: arraness14
UGH cant get it to work


Hello. PM me your MSN and I will help you out :)

Thanks.


~Home