SRL Archive - Help

Need Help With First Script


icculus

2012-05-31 06:12:21

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

2012-05-31 06:15:16

TypeSend('facebook.com');

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

YoHoJo

2012-05-31 06:16:43

SendKeys should do it.

http://docs.villavu.com/simba/scriptref/mouseandkeyboard.html?highlight=sendkeys
procedure 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

2012-05-31 06:22:04

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.


YoHoJo

2012-05-31 06:27:14

From: riwu
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

2012-05-31 06:27:23

awesome!

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

icculus

2012-05-31 06:28:28

From: YoHoJo
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

2012-05-31 06:47:35

From: icculus
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


riwu

2012-05-31 07:15:19

From: YoHoJo
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) ;)