SRL Archive - Reflection Tutorials

Using Animations


TRiLeZ

2009-03-22 01:49:32

If you want to use animations in your script and not want to download anytihng then this is the tutorial for you.

First off, you will want to get your animation.
Use this script that I made to get it.

program GetAnimation;//By TRiLeZ
{.include SRL\SRL\Misc\Smart.scar}
{.include SRL\SRL.scar}
{.include SRL\SRL\Reflection\Reflection.scar}

var
Ref_Ani: Integer;

begin
SmartSetupEx(154, False, True, False);
SetTargetDc(SmartGetDC);
SetupSRL;
Ref_Ani := GetAnimation;
if (Ref_Ani > -1) then
begin
WriteLn('_______________________');
WriteLn('Animation ' + IntToStr(Ref_Ani));
WriteLn('=======================');
end;
if (Ref_Ani = -1) then
begin
WriteLn('_______________________');
WriteLn('Not doing an animation');
WriteLn('=======================');
end;
end.
Now you are wondering how to use your animation in a script.
There are many ways to include your animation in your script.
Here is an example. Scar waits while do your animation.

While(GetAnimation = 1337) do wait(100);
If you want Scar to wait while doing any animation, you can use this code.

While(GetAnimation > 0) do wait(100);
You dont have to wait 100 ms, so change it to whatever ms you want to wait.
If you want to do multiple actions as you do your animation you could use:

If (GetAnimation = 1337) then
begin
//Whatever you want your script to do
end;
Or

While(GetAnimation = 1337) then
begin
//Whatever you want your script to do
end;
If you really needed to know how to do multiple actions then I say your a noob. LOL :D
Also in those last 2 codes, you could make them (GetAnimation > 0) instead of (GetAnimation = 1337).
If you didnt know that too then your a bigger noob. LOL :D

Just to let you know, the animation -1 is nothing and if the script says your not doing an animation and your sure you were, it could mean your animation went by too fast and the script couldnt catch it. If that happens, try inserting the script in your script after it clicks something in Runescape.

Thanks for reading my tutorial on Using Animations.

DeSnob

2009-03-27 16:36:03

A Big Thanks to You! I couldn't download RsBot so if this works rep+ tysm.

masterBB

2009-07-17 15:15:51

This is a litlle bit old, Some fixes are:

program GetAnimation;//By TRiLeZ
{.include SRL\SRL\Misc\Smart.scar}
{.include SRL\SRL.scar}
{.include SRL\SRL\Reflection\Reflection.scar}

var
Ref_Ani: Integer;

begin
Smart_Signed := true;
Smart_Server := 34;
Smart_SuperDetail := false;
SetupSRL;
SetupReflection;
wait(10000); //wait 10 seconds before checking your animation
//So you got plenty time to log in and click on a object(tree,rock, etc);
Ref_Ani := GetAnimation;
if (Ref_Ani > -1) then
begin
WriteLn('_______________________');
WriteLn('Animation ' + IntToStr(Ref_Ani));
WriteLn('=======================');
end;
if (Ref_Ani = -1) then
begin
WriteLn('_______________________');
WriteLn('Not doing an animation');
WriteLn('=======================');
end;
end

This works better for me :)

Coh3n

2009-07-17 18:24:28

You shouldn't call anyone a noob in a tutorial, after all, it's a tutorial, they're reading it because they DON'T know how to do something, bringing them down may not make them enthused to want to learn to script. :)

Using animations is covered pretty decently in ZaSz's Reflection Tutorial, so this wasn't desperately needed, but either way, it's a good tutorial, makes it very clear and it seems it has helped a couple people already. :)

Rep +. :)

Cheers.

Wow EDIT: Didn't look at the date, this was a big gravedig, my apologies.

senrath

2009-07-17 18:49:53

From: Coh3n

Wow EDIT: Didn't look at the date, this was a big gravedig, my apologies.


Don't worry about it. I'm pretty sure that you can't gravedig tutorials.

Coh3n

2009-07-17 18:50:50

From: Da 0wner
You can call them newb :p.


I'm going to take that as if you weren't joking, even if you were.

Why would you? Some people may find it offensive, isn't this suppose to be a friendly community that doesn't insult new people because they don't know some simple scripting knowledge yet? If you discourage them because they don't know something, why would they want to continue to learn if they're going to get called a noob if they do something wrong?

EDIT:

From: senrath
Don't worry about it. I'm pretty sure that you can't gravedig tutorials.


:p Even so, I was surprised when I say the date. XD

Coh3n

2009-07-17 18:56:10

From: Da 0wner
Um, Coh3n, newb <> noob..


Lol, yes, I know, but not everyone knows that. IMO, it's better to just not say any version of noob at all. :)

Coh3n

2009-07-17 19:00:13

From: Da 0wner
Lol, yeah, but people that are reading this are, in fact, newbs. Whatever, best not to use it :D.


<3 you. :D