SRL Archive - Simba (Testing) Scripts

Simba PwrWCer!


Naum

2010-03-29 15:18:53

Hey, I coded this script as a kinda of experimental analysis as how simba would bridge the gap in switching. Happy to say that simba worked, on the whole, much much better!
Props to the Dev Team (and Raymond :p) for that!! :)

This was a 'proof of switching-code-thing-thing' which I thought I'd let others use, to test how simba runs and to train their accounts. Here's a small report:

{ [~]>>- Simba Power Chopper V0.1 -<<[~]
>>> Runtime: 1 Hours, 39 Minutes and 48 Seconds
>>> Logs Chopped: 135
>>> Loads Cut: 5
>>> Experience Gained: 10125
{--------------------------------------------------}
>>> Current Player = 0
>>> Using 3 Player[s]
{------- By Naum (Thanks for Using)! -------}
(All 3 players used)

I, still, have to sort out the report and build the script up from it's initial skeleton - it is still kinda messy tbh. This will take some time to complete, but as soon as this prototype is running fine it'll give me the confidence to build onto the current script; instead of building onto a flawed version.

Instructions
  • Paste the script in SIMBA
  • Move your character to where the chosen trees are.
  • Fill in the Player Record and the constant.
  • Have ONLY the axe in the first inventory slot! Leave other places empty!
  • Press Run and watch.
  • Hopefully, post progress reports or issues!
  • This does NOT bank.

What you must do!
  • - Don't over-use or abuse (although I doubt that shall be the case. lol.)
  • - Post proggies.
  • - Post where it may mess up.
  • - The bird is the word.

Script:

Program PwrWCer;
{$define SMART}
{$i SRL/SRL.Scar}
{$i SRL/SRL/Misc/Debug.Scar}
{$i SRL/SRL/Skill/Woodcutting.Scar}

Const MaxTime = 12000; //Max time taken to cut a tree down (10 - 19 is ideal)

procedure DeclarePlayers;
begin
HowManyPlayers := 3; // How many players declared?
CurrentPlayer := 1; // Number of player to start with.
NumberOfPlayers(HowManyPlayers);

MouseSpeed := 24;

with Players[0] do
begin
Name := ''; // Characters full RS username.
Pass := ''; // Characters RS password.
Nick := ''; // 3 non-caps letters of char's RS username.
Integers[0] := 20; //Loads To Do
Strings[0] := 'Tree'; //Tree to cut? 'Tree', 'Oak' or 'Willow'.
Active := True;
end;
{ <-- To use more players, uncomment this section and change HowManyPlayers
to match with the current amount of players declared. }

with Players[1] do
begin
Name := ''; // Characters full RS username.
Pass := ''; // Characters RS password.
Nick := ''; // 3 non-caps letters of char's RS username.
Integers[0] := 20; //Loads To Do
Strings[0] := 'Oak'; //Tree to cut? 'Tree', 'Oak' or 'Willow'.
Active := True;
end;


with Players[2] do
begin
Name := ''; // Characters full RS username.
Pass := ''; // Characters RS password.
Nick := ''; // 3 non-caps letters of char's RS username.
Integers[0] := 10; //Loads To Do
Strings[0] := 'Willow'; //Tree to cut? 'Tree', 'Oak' or 'Willow'.
Active := True;
end;

{
with Players[3] do
begin
Name := ''; // Characters full RS username.
Pass := ''; // Characters RS password.
Nick := ''; // 3 non-caps letters of char's RS username.
Integers[0] := 20; //Loads To Do
Strings[0] := 'Tree'; //Tree to cut? 'Tree', 'Oak' or 'Willow'.
Active := True;
end;
}
end;


Type TTree = Record
Level : Integer;
UpText : String;
Exp : Extended;
Info : TVariantArray;
End;

Type TTreeArray = Array Of TTree;

Var Trees : TTreeArray;
X, Y, Loads, LogsCut, TreeToCut : Integer;
Experience : Extended;

Const
Tree = 0;
Oak = 1;
Willow = 2;

Procedure LoadTrees;
Begin
SetLength(Trees, Willow+1);

With Trees[Tree] Do
Begin
Level := 1;
UpText := 'ree';
Exp := 25.0;
Info := [0.02, 1.08, 2516569, 8];
End;

With Trees[Oak] Do
Begin
Level := 15;
UpText := 'ak';
Exp := 37.5;
Info := [0.02, 1.08, 2516569, 8];
End;

With Trees[Willow] Do
Begin
Level := 30;
UpText := 'illow';
Exp := 67.5;
Info := [1.08, 0.65, 7251868, 4];
End;
End;

Function FindTrees : Boolean;
Var TPA2 : TPointArray;
ATPA : T2DPointArray;
I : Integer;
Begin
SetColorToleranceSpeed(2);
Case Lowercase(Players[CurrentPlayer].Strings[0]) Of
'tree' : TreeToCut := Tree;
'oak' : TreeToCut := Oak;
'willow' : TreeToCut := Willow;
End;
SetToleranceSpeed2Modifiers(Trees[TreeToCut].Info[0], Trees[TreeToCut].Info[1]);

FindColorsSpiralTolerance(MSCX, MSCY, TPA2, Trees[TreeToCut].Info[2], MSX1,
MSY1, MSX2, MSY2, Trees[TreeToCut].Info[3]);
FindNormalRandoms;
ATPA := SplitTPA(TPA2, 10);
SortATPAFromFirstPoint(ATPA, Point(MSCX, MSCY));
//DebugATPA(ATPA, '');
For I := 0 To High(ATPA) Do
If Length(ATPA[I]) > 35 Then
If MiddleTPAEx(ATPA[I], X, Y) Then
Begin
MMouse(X, Y, 5, 5);
If WaitUpText(Trees[TreeToCut].UpText, 400) Then
Begin
GetMousePos(X, Y);

If Random(3) = 0 Then
Begin
Mouse(X, Y, 0, 0, False);
WaitOption('hop', 400);
End Else
Mouse(X, Y, 0, 0, True);

Result := True;
FFlag(0);
End;

While IsMoving Do Wait(100);

If Result Then Break;
End;
End;

Procedure AntiBan;
Begin
If Random(2) = 1 Then //feel free to add more
SleepAndMoveMouse(1000 + Random(800));
End;

Procedure WaitWhileChop;
Begin
If Not LoggedIn Then Exit;
Wait(300 + Random(2000));
FindEnt(x, y, True);
AntiBan;
Wait(300 + Random(2000));
If InvFull Then Exit;
FindNormalRandoms;
End;

Procedure Chop;
Var PrevCount, Mark, LogDTM, TempVar, I : Integer;
Begin
LogDTM := BitmapFromString(39, 28, 'beNrtVssKACAI8/9/us5h' +
'ZD5mSO4YtJnWGlFdjBU5cnwRqqhaNzSNQ1uM+RS4vf6hGBgqij5p7' +
'ytRFUOgq1yShDuJWD/OuxA20qK/iYq0Uc9TmyI8X6HHVQx1xo7mfA' +
'dwMWybu9IiX1rCbLgwATW19Qs=');

While Not InvFull Do
Begin
MarkTime(Mark);
GameTab(TAB_INV);
PrevCount := InvCount;
FindNormalRandoms;
If FindTrees Then
Begin
If Random(40) = 1 Then
GameTab(RandomRange(TAB_COMBAT, TAB_LOGOUT))
Else
If Random(24) = 0 Then
RandomRClick;

While InvCount = PrevCount Do
Begin
If (TimeFromMark(Mark) >= MaxTime) Then
Break
Else
WaitWhileChop;
End;

If (TreeToCut = Oak) Or (TreeToCut = Willow) Then
For I := 0 to 1 Do
WaitWhileChop;

If (InvCount <> PrevCount) Then
TempVar := CountItems('bmp mask', LogDTM, []);
End Else
Begin
If Random(10) = 5 Then
SleepAndMoveMouse(3000 + Random(800));
FindNormalRandoms;
If Random(5) = 0 Then
MakeCompass(Rs_GetCompassAngleDegrees + 30);
End;
End;

FreeBitmap(LogDTM);
If InvFull Then
Begin
DropAllExcept([1]);
Inc(Loads);
LogsCut := LogsCut + TempVar;
Experience := Experience + (Trees[TreeToCut].Exp * LogsCut);
End;
End;

Procedure Proggie;
Begin
WriteLn('');
WriteLn('[~]>>- Simba Power Chopper V0.1 -<<[~]');
WriteLn('>>> Runtime: '+TimeRunning);
WriteLn('>>> Logs Chopped: '+IntToStr(LogsCut));
WriteLn('>>> Loads Cut: '+IntToStr(Loads));
WriteLn('>>> Experience Gained: '+FloatToStr(Experience));
WriteLn('{--------------------------------------------------}');
WriteLn('>>> Current Player = '+IntToStr(CurrentPlayer));
WriteLn('>>> Using '+IntToStr(HowManyPlayers)+' Player[s]');
WriteLn('{------- By Naum (Thanks for Using)! -------}');
WriteLn('');
End;

Begin
{$IFDEF SMART}
Smart_Server := 80;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ENDIF}
SetupSRL;
DeclarePlayers;
LoadTrees;
ActivateClient;
If Not LoggedIn Then
LoginPlayer;
Repeat
Repeat
SetRun(True);
SetAngle(True);

Chop;
Proggie;
Until(Loads >= Players[CurrentPlayer].Integers[0]) Or (Not LoggedIn);

Loads := 0;
LogsCut := 0;
Experience := 0.0;

If Not LoggedIn Then
NextPlayer(False)
Else
Begin
WriteLn('Loads Done!');
WriteLn('Switching Player!!!!');
Proggie;
NextPlayer(True);
End;
Until(AllPlayersInactive);
Proggie;
End.

{ [~]>>- Simba Power Chopper V0.1 -<<[~]
>>> Runtime: 1 Hours, 39 Minutes and 48 Seconds
>>> Logs Chopped: 135
>>> Loads Cut: 5
>>> Experience Gained: 10125
{--------------------------------------------------}
>>> Current Player = 0
>>> Using 3 Player[s]
{------- By Naum (Thanks for Using)! -------}
(All 3 players used)

Thanks in advance :spongebob:

mastaraymond

2010-03-29 15:28:12

Left yo password in there.. (or maybe it was fake, donno, changed nevertheless)

Naum

2010-03-29 15:30:41

From: mastaraymond
Left yo password in there.. (or maybe it was fake, donno, changed nevertheless)


They were fake ;). Thanks tho :)

nielsie95

2010-03-30 04:18:31

Why do you do


If (TreeToCut = Oak xOr Willow) Then

That would never result true?

Wizzup?

2010-03-30 04:25:27

Yay! Simba script!
Will try in a bit once I get my VM set up. (and free time)

weequ

2010-03-30 10:23:47

From: nielsie95
Why do you do


If (TreeToCut = Oak xOr Willow) Then

That would never result true?
What does that xOr do?

Naum

2010-03-30 11:24:22

From: antti mies
What does that xOr do?


If one of the statements are true and one is false, it results true.
If both are false and both are true, it results false.
Think of it as something which only reins true if mutually exclusive (only one can happen at one time).

However, in this case I used it wrong, because it mucks up with constants and just changes the value to 3. Should have been separate 'or' statements, will change it now. Thanks niels