SRL Archive - General

Help me SCRIPT. =-) please


da scripter

2009-04-13 15:52:53

(To forum admins and mods: I do not know where else to put this topic, this seemed to be the best place to put it if it is not, please move it/delete it. Thanks)

Ok, the reason for this thread is for me to learn scripting (I need help). I have been around srl for around a year and a half and have not made a single script, it just looked soooooo hard at the beginning. I have noticed the decline in our community and with the community also go some scripters. I figure it is time for me to learn scripting.

I have looked at like 2 tuts and they are overwhelming me with info (btw, good job on the tuts guys). I need someone to walk me through it step by step. I know most of the (very) basic things already, I just need to build to it. I want someone to help me (via AIM or something similar) make a simple script, such as a power miner or something.

Please (with a cherry on top!) post if you could help me.

I will pm whoever can help me with aim or whatever detail so we can start.

Thanks, da scripter.

JAD

2009-04-13 16:10:02

This is how I learned to script.

I read WhoCares357's guide to beginning SCAR scripting. I didn't just read the words through as fast as I could. I took time on each section to make sure I understood everything and applied it in simple test scripts. Once I learned all of that, I learned some of the basic srl function syntax, and began building a power miner. Every time I learned something new I would apply it to the power miner, and finally it became complex enough and worked well enough to apply and get me into srl members. The script started something like this:


program JADPowerMiner;

var x,y: Integer;

procedure MineRock;
begin
if(FindColor(x,y,249386,0,0,500,500))then
ClickMouse(x,y,true);
end;

begin
repeat
MineRock;
Wait(5000);
until(False);
end.

Now, this script would get you banned. So then I posted my script and asked how to improve my script (there was no tutorials on Mouse, MMouse, and similar srl functions) and people gave me tips. Later I went on to write a tutorial "Things the beginner tuts don't teach you" about these things, as the next step after reading a guide like WhoCares357's. So my next script probably looked something more like this:



program JADPowerMiner;
{.include SRL/SRL.scar}

var x,y: Integer;

procedure MineRock;
begin
if(FindColorTolerance(x,y,249386,0,0,500,500,3))then
begin
MMouse(x,y,2,2,true);
if(IsUpText('Mine'))then
Mouse(x,y,2,2,true);
end;
end;

begin
repeat
MineRock;
Wait(5000+random(2000));
if(invfull)then
DropAll;
until(False);
end.

So now with this version the mouse moves more humanly, the wait does not wait exactly 5 seconds; it's random. Before clicking the color found, we make sure it's a rock by checking the text in the upper left hand corner. And I added dropping for power mining.

You see where this is going? Just start developing a script now, no matter how simple it is. Along the way keep adding to it. Once I got it working good, I learned how to add anti randoms, anti ban, progress report…etc. And if you get stuck and need help along the way, me and many others will be browsing the scripting help section answering questions, so feel free to ask.

Good luck!

da scripter

2009-04-13 16:24:15

thanks jad

da scripter

2009-04-13 16:52:09

where is a list of commands (like dropall in the script above)? this would really help me. Sorry 4 dub post.

Frt

2009-04-13 16:55:44

Look in your SRL folder. All the functions are in those folders.

impiwimpi

2009-04-13 16:55:57

Take a look in your include folder, there are lots of commands there. ;)
Or you could use Freddy1990's online manual…

Quickmarch

2009-04-13 17:09:05

Press CTRL + SPACE in SCAR.

WhoCares357

2009-04-13 17:13:35

I'd be willing to teach you. PM me with your msn (or whatever else you use; I probably have it). Just tell me where you want to start, e.g total beginner, want to learn SRL, or advanced. We can talk about it in more detail through the messenger.

Of course, this is only if you want it. Nobody is forcing you.