here,
SCAR Code:
//phassy smelter
//starts in bank...full inventory of iron ore(if using, start out with ring of forging equiped...
//credits:
//uses smart in ru5ture
//in the future, mabye reflection
//
//
//
//
//
//
{.include srl/srl.scar}
{.include srl/srl/misc/Users.scar}
Var Loads
Const
//loging setup
LogoutEvery = 4;// loads to log out after
//smart setup
WorldNumber =44;//i preffer u not to use quickchat worlds, like 160
//ring setup
UseRing =true,//use ring of forgings (recomended; extra costi about 7gp per ore)well worth it and easy to buy
procedure DeclarePlayers;
begin
HowManyPlayers := 1;//Change this accordinly
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';//Character Name
Players[0].Pass := ''; //Character Pass
Players[0].Nick := ''; //Nickname 3 - 4 Letter's of char name
Players[0].Active := True; //Use player in script?
{------------------------------------------------------------------------------}
{========================Don't touch Below this!===============================}
{------------------------------------------------------------------------------}
end;
procedure SetupScript
Begin
DeclarePlayers;
LoginPlayer;
InitPlayer;
scriptOrder;
end;
procedure ScriptOrder;
begin
CheckRing;
WalkToSmelter;
SmeltBars;
WalkToBank;
BankBars;
AntiRandoms;
end,
Procedure InitPlayer; // credits go to wizup for this, because i was sorta to lazy to make my own
Var
I: Integer;
Begin
For I := 1 To 5 Do
If Not Players[CurrentPlayer].Booleans[i] Then
Begin
Case I Of
1: SetGraphics(4, '', '' ,'', '', '', '', '', '');
2: Retaliate(False);
3: SetAudio(0, 0, 0, Mono);
End;
Players[CurrentPlayer].Booleans[i] := True;
End;
SetChat('on',1);
SetChat('friends',2);
SetChat('on',3);
SetAngle(True);
End;
procedure WalkToSmelter;
procedure SmeltBars;
procedure WalkToBank;
procedure Bank;
function BankScreen: Boolean;
begin
Result := FindTextTPA(4106994, 20, 20, 22, 400, 45, 'Bank', upchars, Nothing);
end;
procedure DepositAll;
begin
if (BankScreen) then
Deposit(1, 28, True);
end;
procedure AntiRandoms; // thank you for the example mickaliscious
begin
if not LoggedIn then Exit;
FindNormalRandoms; // find random events
if FindFight then RunTo('N',True); // if a fight is found, run to the north and run far (will
procedure AntiBan;
begin
case random(100) of //do a random number so it won't always perform the antiban
0: BoredHuman;
1. HoverSkill('smithing', False);
2: RandomSpam; //made up procedure to say random stuff
3: AlmostLogout;
end;
end;
and you need to put the procedure SetUpScript at the bottom, keep it the bottom most procedure, then the main loop or you will get compiling errors
so heres a good an bad example:
SCAR Code:
program New;
procedure blahblah;
begin
mmouse(100, 100);
end;
procedure CheckSomething;
begin
(SCAR procedure/funtion here);
end;
procedure DoSomething;
begin
blahblah;
wait(5000);
end;
procedure setupscript;
begin
Declareplayer;
DoSomething;
terminatescript;
end;
begin
setupscript;
end.
bad:
SCAR Code:
program New;
procedure setupscript;
begin
Declareplayer;
DoSomething;
CheckSomething;
terminatescript;
end;
procedure blahblah;
begin
mmouse(100, 100);
end;
procedure CheckSomething;
begin
writeln('checking something');
end;
procedure DoSomething;
begin
blahblah;
wait(5000);
end;
begin
setupscript;
end.