SRL Archive - SRL Snippets

Spherecam A human like camera movement


Main

2012-05-31 18:58:58

What this is, it will change the the camera by randomly press either up/down/left/right first and let them go in a random fashion too.

For example, if I want to move the camera 180 degrees left and 90 degrees up with the sphere cam.

SphereCam( -180, 90);

1:The script will start by randomly press either left or up key and hold it.
2:The script will then press the remaining key and hold it.
3:When the 180 degrees has achieved, it will let go of the left key.
4:When the 90 degrees has achieved, it will let go of he up key.
*Step 3 and 4 are done at the "same time"*



If this were used as a antiban. You can call this:

SphereCam( RandomRange( -180, 180), RandomRange( -90, 90));

Then it would just change the camera randomly just as a human would. Random and ends right at the spot.

I'll try to get a video in.


Procedure SphereCam( X, Y: Integer);
Var
WDT, WT: Tpoint;
Begin
WT := IntToPoint( Round( Abs( X * 4800 / 360)), Round( Abs( Y * 1200 / 90)));
Case Random ( 2) of
0: Begin
If X < 0 Then
KeyDown( VK_Left);
If X > 0 Then
KeyDown( VK_Right);
MarkTime( WDT.X);
Wait( Random( WT.X));
If Y < 0 Then
KeyDown( VK_Down);
If Y > 0 Then
KeyDown( VK_Up);
MarkTime( WDT.Y);
Repeat
Wait( Random( 100));
Until ( TimeFromMark( WDT.Y) > Random( WT.Y)) or ( TimeFromMark( WDT.X) > WT.X)
If TimeFromMark( WDT.X) > WT.X Then
Begin
If X < 0 Then
KeyUp( VK_Left);
If X > 0 Then
KeyUp( VK_Right);
End;
End;
1: Begin
If Y < 0 Then
KeyDown( VK_Down);
If Y > 0 Then
KeyDown( VK_Up);
MarkTime( WDT.Y);
If X < 0 Then
KeyDown( VK_Left);
If X > 0 Then
KeyDown( VK_Right);
MarkTime( WDT.X);
Wait( Random( WT.X));
Repeat
Wait( Random( 100));
Until ( TimeFromMark( WDT.X) > Random( WT.X)) or ( TimeFromMark( WDT.Y) > WT.Y)
If TimeFromMark( WDT.X) > WT.X Then
Begin
If Y < 0 Then
KeyUp( VK_Down);
If Y > 0 Then
KeyUp( VK_Up);
End;
End;
End;
Repeat
Wait( Random( 100));
Until TimeFromMark( WDT.X) > WT.X
If TimeFromMark( WDT.X) > WT.X Then
Begin
If X < 0 Then
KeyUp( VK_Left);

If X > 0 Then
KeyUp( VK_Right);
End;
Repeat
Wait( Random( 100));
Until ( TimeFromMark( WDT.Y) > WT.Y);
If TimeFromMark( WDT.Y) > WT.Y Then
Begin
If Y < 0 Then
KeyUp( VK_Down);
If Y > 0 Then
KeyUp( VK_Up);
End;
End;

Am not really aiming for this to be in SRL, but its definitly something cool to have in your script as anti ban.