SRL Archive - OSR Help

Tanner Help


BuckWild

2011-11-29 21:07:41

So I decided to try my hand at making a script that will tan green d'hides in al kharid. I felt that I finished but I noticed a few things I'd love some help with!

Edited! New question!


Keep in mind this is a 'rough' draft with a few features missing, randoms, antiban, fail safe. I just want to make sure I'm heading in the right direction before dealing with those!

1. If this is brutally so far off from something you'd relatively even consider calling a script, please tell me. In that case I'll get rid of this and start from scratch.
2. At the end of the script I get an error on the "end." Saying identifier expected at that line. I know this is usually from begin/end nests but it being the final end, it's throwing me off.
3. Questions/Comments/Concerns


Thanks everyone!
Buck

Oh yea you might need this…
I used a default script that I learned from a tut here, thats why some things may seem advance while others seem awful (If awful is the case :whistling:)

Updated with some fixes (Hopefully) - 11/30

program Tanner;
{//$DEFINE SMART}
{$i srl/srl.scar}
{$i sps/sps.simba}


const
{-----Breaking Settings-----}
TakeBreaks = True; // Take breaks?
HowOften = 90; // How often to break in minutes
HowOftenRandom = 30; // Added randomness to how often you break
HowLong = 20; // How long to break for
HowLongRandom = 8; // Added randomness in break length
{---------------------------}
{---SMART Setup Constants---}
WORLD = 121;// Set a world, if you'd like.
MEMBERS = False;// Change accordingly.
SIGNED = True; // True if running a single account, false otherwise.
{---------------------------}
{--------Script Info--------}
Author = 'Username';
Name = 'Base';
Version = '1.00';
{---------------------------}

Var
BreakOften, BreakLength, BreakTimes: Integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username
Players[0].Active := True; // Set to true if you want to use this player
Players[0].Pin := '0000'; // Leave blank if the player doesn't have a bank pin
end;

procedure AntiBan;
begin
case Random(6) of
0: HoverSkill('Random', False);
1: begin
RandomMovement;
HoverSkill('Random', False);
end;
2: BoredHuman;
3: BoredHuman;
4: ExamineInv;
5: begin
RandomAngle(1);
HoverSkill('Random', False);
ExamineInv;
end;
end;
end;

procedure BreakCheck;
begin
if not LoggedIn then
begin
Players[CurrentPlayer].Active := False;
Exit;
end;
BreakOften := ((HowOften*60000)-(HowOftenRandom*60000)+Random(HowOftenRandom*120000));
if GetTimeRunning >= BreakOften*BreakTimes then
begin
BreakLength := ((HowLong*60000)-(HowLongRandom*60000)+Random(HowLongRandom*120000));
Logout;
Wait(BreakLength);
LoginPlayer;
end;
end;

procedure ProgressReport;
begin
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
WriteLn(Name + 'by' + Author + 'V' + Version);
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
end;
function FindTanner: Boolean;
var
x, y : Integer;
begin
if not LoggedIn then Exit;
if FindObjCustom(x, y, ['Elli', 'llis'], [16248055, 4616928], 5) then //Colors/Name
begin
Mouse(x, y, 5, 5, false);
Result := True;
if ChooseOption('rade') and FindObjCustom(x, y, ['Green','athe'], [1006349,1274897], 3) then
begin
Mouse(x, y, 1, 1, false);
WaitOptionMulti(['Tan', 'all'], (500 + Random(150)));
Result := True;
end;
end else
begin
SPS_WalkToPos(Point(4936, 3897));
FindTanner;
Result := True;
end;

end;
function MakeHides: Boolean;
var x, y : Integer;
begin
if not LoggedIn then Exit;
if FindObjCustom(x, y, ['Green','athe'], [1006349,1274897], 3) then //colors/names
begin
Mouse(x, y, 1, 1, false);
WaitOptionMulti(['Tan', 'all'], (500 + Random(150)));
Result := True;
end;
end;
procedure Bank;
begin
if not LoggedIn then Exit;
if FindBank('akb') then
begin
Deposit(2, 28, True);
Writeln('Banked the Leather!')
Wait(250 + Random(50));
WithdrawEx(1, 1, 0, ['hide']);
end else
begin
SPS_WalkToPos(point(4909, 3988));
Bank;
end;
end;
function RepeatTanning: Boolean; //FullLeather, NoLeather,
begin
repeat
// if FullLeather then Bank;
Bank; //Check
FindTanner; //check
MakeHides; //check
Wait(2011 + Random(150))
AntiBan; //check
Wait(5051 + Random (250))
{until ((NoLeather) or (FullLeather));
wait(3014 + random(500));}



begin
Smart_Server := WORLD;
Smart_Members := MEMBERS;
Smart_Signed := SIGNED;
Smart_SuperDetail := False; // These four lines, setup and run Smart, using the constants you made earlier.
SetupSRL; // This is used to setup SRL's base features, and is almost always necessary.

DeclarePlayers; // This runs your DeclarePlayers procedure, setting them up to run
LoginPlayer; // This logs in your first player.
repeat // This is the start of a loop, it will repeat until the conditions set after the until below are met.
BreakCheck; // Runs the breaks
RepeatTanning;
until AllPlayersInactive; // This means that, once all characters have failed, the script will stop.
end.

[XoL]

2011-11-29 22:16:51

I did not put it into my simba to see what the errors were but

3) You can just {code} to make it blue (just a comment) this way you can just press the play button and if it runs most of the time that means it works (You can try it in rs too if you want)

4) FindNormalRandom, put it in.

BuckWild

2011-11-29 22:35:39

From: R4nd0m
I did not put it into my simba to see what the errors were but

3) You can just {code} to make it blue (just a comment) this way you can just press the play button and if it runs most of the time that means it works (You can try it in rs too if you want)

4) FindNormalRandom, put it in.


Thanks for the quick reply! After getting the first few compiling errors I'm starting to think I should just start from scratch. Although for some reason I'm getting unknown id for write1n command, I thought that was a perfectly fine thing to use but maybe not?

RISK

2011-11-29 23:00:32

"Write1n" is not a real thing, you must mean "WriteLn", right?
What is(are) the other error(s) you are having? Maybe we could help. It's never a good thing to get in the habit of "Starting from scratch" on anything unless you truly have to. But even then, I don't suggest it. It's just a bad habit for life, not just developing.

From: BuckWild
Thanks for the quick reply! After getting the first few compiling errors I'm starting to think I should just start from scratch. Although for some reason I'm getting unknown id for write1n command, I thought that was a perfectly fine thing to use but maybe not?

skumesh

2011-11-30 10:04:05

From: RISK
"Write1n" is not a real thing, you must mean "WriteLn", right?
What is(are) the other error(s) you are having? Maybe we could help. It's never a good thing to get in the habit of "Starting from scratch" on anything unless you truly have to. But even then, I don't suggest it. It's just a bad habit for life, not just developing.


Oh man, I'm embarrassed! Thanks for that. Another thing I'm noticing is something like identifier expected at line x. Thanks again!

RISK

2011-11-30 11:31:00

Hey, don't worry about it. We all make mistakes sometimes.
The "Identifier expected at line X" is when you forgot to complete a begin end nest. Look at this example, please:

procedure Skumesh;
begin
begin // See how there is no corresponding end for this begin? This would
// give you an error like "Identifier expected".
end;


procedure Skumesh;
begin
begin // And here is the now fixed begin end nest, this will get rid of the
end; // error!
end;

So if you get this error, just double check the begin end nests you have before the line it gives you.

From: skumesh
Oh man, I'm embarrassed! Thanks for that. Another thing I'm noticing is something like identifier expected at line x. Thanks again!

skumesh

2011-11-30 12:11:56

Edit:
Updated with a new error after fixing those, op changed accordingly! Thanks for all the help thus far



Oh! That makes perfect sense actually, I thought it might have been something to do with procedures.
Also, sorry for possible confusions with usernames, I created this way back and wanted to start fresh on BuckWild and this happens to be saved on my phone.

Once i get home I'll try to fix these things and come back with the results!

From: RISK
Hey, don't worry about it. We all make mistakes sometimes.
The "Identifier expected at line X" is when you forgot to complete a begin end nest. Look at this example, please:

procedure Skumesh;
begin
begin // See how there is no corresponding end for this begin? This would
// give you an error like "Identifier expected".
end;


procedure Skumesh;
begin
begin // And here is the now fixed begin end nest, this will get rid of the
end; // error!
end;

So if you get this error, just double check the begin end nests you have before the line it gives you.