SRL Archive - RS3 Script Requests

arrow shaft maker


yep

2012-02-02 15:59:34

cuts normal logs into arrow shafts, would be good profit for me thanks.

mika

2012-02-02 16:35:23

try making it yourself this is a relativity simple script to make, btw one might already exist

yep

2012-02-02 17:03:50

From: mika
try making it yourself this is a relativity simple script to make, btw one might already exist


I've looked everywhere and I don't have a clue on how to code for simba.

yep

2012-02-03 19:58:36

bump, please someone make this for free

Sex

2012-02-03 20:00:45

From: yep
cuts normal logs into arrow shafts, would be good profit for me thanks.
So selfish.

Anyway, yeah this is extremely easy to create….I'd do it but I don't have a member account.

yep

2012-02-03 20:01:59

From: Sex
So selfish.

Anyway, yeah this is extremely easy to create….I'd do it but I don't have a member account.


profitable for everyone else too ofcourse.

and yea i'm going to have a look at a script AND EDIT IT TO THE ARROW SHAFT COLOUR SORRY FOR CAPS.

yep

2012-02-04 11:33:16

anyone?

Iambubbleman

2012-02-04 13:20:21

I'm a bit bored with reading through tutorials, so sure, give me like 15 minutes

Striken

2012-02-04 13:43:07

Your way too selfish. At least try to sound not selfish -.-

Iambubbleman

2012-02-04 13:47:12

Made a Thread for it in Monkey Making

Er1k

2012-02-04 23:25:45

From: Iambubbleman
Made a Thread for it in Monkey Making


Linked for those who don't bother checking http://villavu.com/forum/showthread.php?t=74146

I actually fulfilled the OP's request. But I think it's only fair that everyone sees the work. It only works in SW but the functions can be reused anyway


{*******************************************************************************
program Fletch;
by; nosaj421
Description: Simple SW Arrow Shaft Fletcher
Instructions: 1. Logs MUST BE AT FIRST SLOT OF BANK
2. Position character at SW Bank Chest, run
*******************************************************************************}
program Fletch;
{$DEFINE SRL5}
{$DEFINE SMART}
//{$DEFINE DEBUG}
{$I SRL/SRL/misc/SMART.simba}
{$I SRL/SRL.simba}
//{$I sps/sps.simba}

const
SmartWorld = 1;
Members = False;
SignedClient = True;
HighDetail = False;

procedure DeclarePlayers;
Begin
HowManyPlayers := 1; //change accordingly
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

With Players[0] Do
Begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
End;
{
With Players[1] Do
Begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
End;
}
End;

procedure DoLogin;
var t: integer;
begin
MarkTime(t);
while not LoggedIn do
begin
LoginPlayer;
if (TimeFromMark(t) > 180000) then
begin
srl_warn('DoLogin', 'Still not logged in after 180s - Will terminate',
warn_AllVersions);
TerminateScript;
end;
wait(5000);
end;
end;

procedure antiRandoms;
begin
if FindNormalRandoms then
if not LoggedIn then //Logged out because of random, nextplayer
begin
Players[CurrentPlayer].Active := False;
NextPlayer(Players[CurrentPlayer].Active);
Exit;
end;
end;

{*******************************************************************************
function BankAndWithdraw: boolean;
by; nosaj421
Description: Bank function. DepositAll and then withdraw logs at FIRST SLOT
*******************************************************************************}
function BankAndWithdraw: boolean;
begin
Result:=False;
if not LoggedIn then Exit;
if OpenBankChest(SRL_BANK_SW) then
begin
if not WaitFunc(@BankScreen, 200, 2000) then Exit;
DepositAll;
wait(200+random(50));
Withdraw(0, 0, 0); //first slot
wait(200+random(50));
Result:= CloseBank;
end;
end;

//I don't know, but WaitFuncEx was bugging me :(
//These wrappers are used to get around the exception :(
function FindColorWrap(x, y, color, xs, ys, xe, ye: integer): Boolean;
begin
Result:= FindColor(x, y, color, xs, ys, xe, ye);
end;

function FindDTMWrap(dtm, x, y, xs, ys, xe, ye: integer): Boolean;
begin
Result:= FindDTM(dtm, x, y, xs, ys, xe, ye);
end;

{*******************************************************************************
function FletchArrowShafts: boolean;
by; nosaj421
Description: Finds logs and tries to fletch them into arrow shafts.
Uses DTMs. Handles tool selection.
*******************************************************************************}
function FletchArrowShafts: boolean;
var x, y, log, knife, shaft: integer;
v:TVariantArray;
begin
Result:=False;
if not LoggedIn then Exit;
log:= DTMFromString('m1gAAAHic42JgYFjDxMCwBYi3A/EuIN4BxGuBeD0QbwXiFUC8FIjlgFgGiMWBWBGIVYFYHYiVoXwQrQDE7mbyQFOZMHCMqwYcB9oqM4gwYAciaJiRSIwAALB1DH8=');
knife:= DTMFromString('mggAAAHicY2NgYOABYlYGCOAEYg4gFgBiLiCWgGIhIOaGqulsbgaSTBhYhAE7YMSBIQAAuSUCQw==');
shaft:= DTMFromString('mlwAAAHicY2dgYDgAxIeA+BgQnwLis0B8BIj3AzEHMwPDPyYIZoKyhYC0GBADRfBg3IARD4YCAEHhCL0=');
if ExistsItemDTM(log, x, y) then
MouseItem(CoordsToItem(x, y), mouse_left);
// MouseItem(1, mouse_left);
v:=[x, y, srl_outline_black, MCX1, MCY1, MCX2, MCY2];
if WaitFuncEx('FindColorWrap', v, 100, 3000) then
begin
if FindDTM(knife, x, y, MCX1, MCY1, MCX2, MCY2) then
begin
MouseBox(280, 400, 300, 420, mouse_left); //knife
wait(500+random(250));
end;
v:=[shaft, x, y, MCX1, MCY1, MCX2, MCY2];
if WaitFuncEx('FindDTMWrap', v, 400, 5000) then
begin
MouseBox(100, 400, 130, 420, mouse_left); //arrow
Result:=True;
wait(500+random(250));
end;
end;
FreeDTM(shaft);
FreeDTM(knife);
FreeDTM(log);
end;

{*******************************************************************************
function FletchArrowShafts: boolean;
by; nosaj421
Description: Wait until completion of arrow shafts.
Uses DTMs. Timeout in 120s
*******************************************************************************}
procedure waitTillComplete;
var x, y, log, t: integer;
begin
if not LoggedIn then Exit;
log:= DTMFromString('m1gAAAHic42JgYFjDxMCwBYi3A/EuIN4BxGuBeD0QbwXiFUC8FIjlgFgGiMWBWBGIVYFYHYiVoXwQrQDE7mbyQFOZMHCMqwYcB9oqM4gwYAciaJiRSIwAALB1DH8=');
MarkTime(t);
repeat
wait(600+ random(50));
until (not ExistsItemDTM(log, x, y)) or (TimeFromMark(t) > 120000);
FreeDTM(log);
end;

{*******************************************************************************
procedure doWork;
by; nosaj421
Description: Wrapper of main tasks.
*******************************************************************************}
procedure doWork;
var action: string;
begin
action:= 'bank';
while LoggedIn do
begin
case action of
'bank': if BankAndWithdraw then action:='work';
'work': if FletchArrowShafts then
begin
waitTillComplete;
action:='bank';
end;
end;
wait(100);
// AntiRandoms; //sw has no randoms
end;
end;

begin
Smart_Server := SmartWorld;
Smart_Members := Members;
Smart_Signed := SignedClient;
Smart_SuperDetail := HighDetail;

ClearDebug;
SetupSRL();
DeclarePlayers;

repeat
DoLogin;
while LoggedIn do
begin
doWork;
end;
until AllPlayersInactive;

end.

Note it is barely failsafed and does not check how many loads are done or whether you have logs at bank :P. The user should be able to figure out on their own and make the necessary changes, or simply just babysit it.

I only tested it with 300 logs, so use at own risk?