SRL Archive - First Scripts

SimplestSteelSuperheater


Solar

2012-08-29 17:06:06

Ok, so this isn't really my first script, but it is the first one I've posted.
The main reason for posting is I want to ask; Is this script is easily detectable, and if so, why?
Another reason is just to show how simple it can be to create a script!

program SimplestSteelSuperheater;

{$DEFINE SMART}
{$i srl/srl.simba}
{$i srl/srl/skill/magic.simba}

var
i, o : Integer;

const
Loads = '99'; //How many inventories do we want to complete?
Author = 'Solar';

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

with Players[0] do
begin
Name :='';
Pass :='';
Pin :='';
Active:=True;
end;
end;


Procedure AntiBan;

var
R : Integer;

begin
R := Random(100);
if R<=6 then
WriteLn('Antiban called');
case R of
0:
begin
HoverSkill('Magic', False);
GameTab(Tab_Magic);
end;
1:
begin
PickUpMouse;
end;
2:
begin
MakeCompass(RandomRange(20,60));
MakeCompass('N');
end;
3:
begin
ExamineInv;
end;
4:
begin
Wait(RandomRange(500, 2000));
end;
5:
begin
BoredHuman;
end;
6:
begin
ExamineInv;
end;
end;
end;

function Banking() : Boolean;
begin
Result := False;
if OpenBank('vwb', True, False) then
begin
Wait(RandomRange(100, 250));
Deposit(1, 27, True);
Wait(RandomRange(200, 350));
if WithdrawEx(9, 0, 9, ['on o', 'ron', 'n ore']) then
begin
Wait(RandomRange(0, 200));
if WithdrawEx(8, 0, 0, ['oal', 'Coal']) then
begin
Wait(RandomRange(0, 200));
WriteLn('Withdrew iron and coal');
CloseBank;
Wait(RandomRange(50, 150));
Result := True;
end else WriteLn('Failed coal withdraw');
end else WriteLn('Failed withdrawing iron');
end else WriteLn('Failed to bank');
end;

Procedure Superheat;

begin
Wait(RandomRange(0, 200));
o := 1
repeat
if (Cast('superheat item', False)) then
begin
if FindNormalRandoms then
Exit;
Wait(RandomRange(50, 200));
MMouseItem(o);
ClickMouse2(True);
FindNormalRandoms;
end;
Inc(o);
until o = 10
WriteLn('Casted Superheat Item!');
Inc(i);
Wait(RandomRange(100, 250));
end;

Procedure MainLoop;
begin
if Banking then
begin
FindNormalRandoms;
Superheat;
end else TerminateScript;
FindNormalRandoms;
AntiBan;
end;

begin
ClearDebug;
SetupSRL;
ActivateClient;
DeclarePlayers;
if not(LoggedIn) then
LoginPlayer;
i := 0
Wait(RandomRange(700,1100));
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
GameTab(Tab_Magic);
repeat
MainLoop;
until(Not(LoggedIn)) or ('i' = 'Loads')
end.

Setup:
Start with the iron ore in the top right slot of the bank, with withdraw-x set to withdraw-9 and coal right next to it to the left. Like this;

Start off with a fire staff equipped, nature runes in the bottom right of the inventory, while in the Varrock west bank.

P1ng

2012-08-29 18:28:47

Looks like a perfectly reasonable script, I see no reason why this would be any more detectable than any other script.

I do have one suggestion though, your integers i and o could both easily be local variables in the procedures that need them.

Only declare global variables if you require that information across procedure/functions.

Chen Monopoly

2012-08-29 20:05:46

The script could be faster while still working because you have a lot of sleeps that really don't do much.

e.g.

Wait(RandomRange(100, 250));
Deposit(1, 27, True);
Wait(RandomRange(200, 350));

Solar

2012-08-30 04:33:02

From: P1ng
Looks like a perfectly reasonable script, I see no reason why this would be any more detectable than any other script.

I do have one suggestion though, your integers i and o could both easily be local variables in the procedures that need them.

Only declare global variables if you require that information across procedure/functions.


Thanks for the feedback, I'll change that now.

Edit: Don't I still need the i variable to be global since I use it in the main loop and in the Superheat procedure?

From: scipio
The script could be faster while still working because you have a lot of sleeps that really don't do much.

e.g.

Wait(RandomRange(100, 250));
Deposit(1, 27, True);
Wait(RandomRange(200, 350));

I put in so many waits to try to make it a bit more random and humanlike since I was using so many premade functions/procedure from includes.
But I do realise I have probably put in a few more than needed. Thanks.

print

2012-09-05 00:07:34

ill try to post a proggy up tummorrow

Ashaman88

2012-09-05 00:57:12

Looks pretty good! I would suggest having a failsafe for running out of nature runes (unless the cast function already has it built in) and maybe have it try to bank a couple times before giving up instead of just once. But again, not bad at all!

Solar

2012-09-05 04:00:57

From: Ashaman88
Looks pretty good! I would suggest having a failsafe for running out of nature runes (unless the cast function already has it built in) and maybe have it try to bank a couple times before giving up instead of just once. But again, not bad at all!


Thanks. :) When I get some more time I'll try updating this script and working on some better projects.