Log in

View Full Version : Need Help With First Script



icculus
05-31-2012, 10:12 AM
Hey there!

Just joined the forum and am very new to scripting, but it seems interesting so far. So I just wanted to make a very simple script that opens the internet on my desktop and types in a website (facebook.com for example), but im not really sure how to get it to type. I'm open to new ideas as well.

This is the code so far:

program OpenInternet;

procedure OpenGoogleChrome;
Begin;
MoveMouse(42, 365);
ClickMouse(42,365, 1);
ClickMouse(42,365, 1);
Wait(5000)
end;

procedure GetOnFacebook;
Begin;
MoveMouse(255, 62);
Wait(5000);
ClickMouse(255, 62, 1);
OpenWebPage('google.com');
end;

begin;
OpenGoogleChrome;
GetOnFacebook;
end.

Any help is appreciated. Thanks!

riwu
05-31-2012, 10:15 AM
TypeSend('facebook.com');

Be sure to check out the scripting tutorial section and the Functionlist on the left side of simba.

YoHoJo
05-31-2012, 10:16 AM
SendKeys should do it.

http://docs.villavu.com/simba/scriptref/mouseandkeyboard.html?highlight=sendkeysprocedure SendKeys(const s: string; keywait, keymodwait: integer);

Type the contents of the string s. While typing, hold the keys for keywait. SendKeys should work with any keyboard layout on Windows.

Mufasa
05-31-2012, 10:22 AM
What's wrong with it? It works for me (after changing co-ords) of course.

Don't see it type in "Facebook", it must do it instantly but it still gets me on Facebook.


I didn't really change anything;


program OpenInternet;

procedure OpenGoogleChrome;
Begin;
MoveMouse(42, 365);
ClickMouse(42,365, 1);
ClickMouse(42,365, 1);
Wait(500)
end;

procedure GetOnFacebook;
Begin;
OpenWebPage('www.facebook.com');
end;

begin;
OpenGoogleChrome;
Wait(200);
GetOnFacebook;
end.

http://img214.imageshack.us/img214/8554/ddddddddddddddu.jpg

YoHoJo
05-31-2012, 10:27 AM
TypeSend('facebook.com');

Be sure to check out the scripting tutorial section and the Functionlist on the left side of simba.

I was going to suggest that, but then he'd need to include SRL and call SetupSRL and I think TypeSend is rs only because it looks for the chat box/clicks it to type etc?


Also, you should check out my video tutorials for beginners, they are quite popular.

http://villavu.com/forum/showthread.php?t=67691
http://villavu.com/forum/showthread.php?t=69179

icculus
05-31-2012, 10:27 AM
awesome!

Thanks for the fast replies, got it working. Might have just been that it need www.facebook.com

icculus
05-31-2012, 10:28 AM
I was going to suggest that, but then he'd need to include SRL and call SetupSRL and I think TypeSend is rs only because it looks for the chat box/clicks it to type etc?


Also, you should check out my video tutorials for beginners, they are quite popular.

http://villavu.com/forum/showthread.php?t=67691
http://villavu.com/forum/showthread.php?t=69179

Will do!

I watched the first one last night, so I'm just trying to write basic scripts for anything I can think of

Mufasa
05-31-2012, 10:47 AM
Will do!

I watched the first one last night, so I'm just trying to write basic scripts for anything I can think of

I done the same xD I made one to spam my friends gifts in Marvel Avengers alliance =D


Also in your first post (on this thread) under your GetOnFacebook procedure why is the website Google? lol

http://img214.imageshack.us/img214/8554/ddddddddddddddu.jpg

riwu
05-31-2012, 11:15 AM
I was going to suggest that, but then he'd need to include SRL and call SetupSRL and I think TypeSend is rs only because it looks for the chat box/clicks it to type etc?


Also, you should check out my video tutorials for beginners, they are quite popular.

http://villavu.com/forum/showthread.php?t=67691
http://villavu.com/forum/showthread.php?t=69179
Nope its the same as SendKey except that some random waits are added to make it human-like (as with all srl includes).

@OP its good to start using includes function as u will definitely need them when making rs scripts, and basic setups like {$i SRL/srl.simba} should be ur script skeleton (i.e. save as default) ;)