SRL Archive - First Scripts

Crude Chair Maker {First Script}


CephaXz

2012-04-17 20:52:06

A little intro of myself. I'm a business degree student, and have no knowledge of scripting at all. Have been a leecher until the Bot Nuke last year. Started to play Runescape again and decided to start learning to script 5 days ago by reading many of those tutorials and videos here.

I know this isn't a hard script to make and the codes used aren't that advanced since I just started learning, but I appreciate all advises and critisms. I used like 3 days of my free time to make it :duh:

This is a construction script that makes wooden crude chair.
Instructions:
1. Start the bot outside the house portal and having your nails in your inventory.
2. Unlock Edgeville and Port Sarim lodestones as the script will be using it to bank and walk to house.
3. Have planks in your bank findable when you open your bank.
4. Should only work if the house is still very basic as when you go into your house at level 1 construction.



program crudechair;
{$i srl/srl/misc/smart.simba}
{$i SRL/SRL.simba}
{$i sps/sps.simba}

Const

SRLStats_Username = ''; //LoginPlayer; Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)
BreakEvery = '' ;
BreakFor = '' ;


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

with Players[0] do
begin
Name := ''; // Username
Pass := ''; // Password
Nick := ''; // 3-4 lower case letters of your character's name
Pin := ''; // Bank pin
Member := True;
Active := True;
end;
end;


Procedure FindChair;
var
ChairDTM, Build, x, y:Integer;
aFound: Extended;


Begin
ChairDTM := DTMFromString('mwQAAAHic42RgYGBkZGDgB+IfQDYTkGYG4u8MCDFeIH0eSJ8B4gtAfByInwHxAyB+BOUfBWJ/RwkGAw1+hkBnSQZrQyGGZa2eDBFBzmC8aNZEhsWzJzPwg8wlgBmJwHAAAKEQFEQ=');
Build := DTMFromString('mwQAAAHic42RgYOBmgABWKFsMiKWAWBTKZwNiXiAWAWIJIFaAqgHJs0P1cgDxkd3bGQ7t3MoQHujEsHj2FIapfW1g9typExkWzZrMsHvLerAZcgQwIxEYDgDtOhGA');

if not LoggedIn then Exit;

repeat
if FindDTMRotated(ChairDTM, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
wait(RandomRange(100,500));
MMouse(x, y, 0, 0);
IsUpText('Chair');
Mouse(x, y, 0, 0, False);
WaitOption('Remove', 500);
ClearReport;
ClearDebug;
writeln('Destroying Chair');
writeln('' +TimeRunning);
wait(RandomRange(1000,1500));

end else
Exit;
until FindNPCChatText('Yes', Clickleft)
ClearReport;
ClearDebug;
writeln('Destroyed Chair');
wait(1000);
FreeDTM(ChairDTM);
FreeDTM(Build);
End;



Procedure BuildChair;
var
Built, x, y, Build, ChairDTM:Integer;

Begin
Build := DTMFromString('mwQAAAHic42RgYOBmgABWKFsMiKWAWBTKZwNiXiAWAWIJIFaAqgHJs0P1cgDxkd3bGQ7t3MoQHujEsHj2FIapfW1g9typExkWzZrMsHvLerAZcgQwIxEYDgDtOhGA');
ChairDTM := DTMFromString('mwQAAAHic42RgYGBkZGDgB+IfQDYTkGYG4u8MCDFeIH0eSJ8B4gtAfByInwHxAyB+BOUfBWJ/RwkGAw1+hkBnSQZrQyGGZa2eDBFBzmC8aNZEhsWzJzPwg8wlgBmJwHAAAKEQFEQ=');
MarkTime(Built);
repeat
if FindDTM(Build, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
wait(RandomRange(100,300));
MMouse(x, y, 0, 0);
if IsUpText('4 more') then
begin
Mouse(x, y, 0, 0, false);
WaitOption('Build Chair', 500);
ClearReport;
ClearDebug;
writeln('Finding Crude Chair');
writeln('' +TimeRunning);
wait(RandomRange(1400,1500));
MouseBox(101, 61, 120, 84, mouse_Move);
wait(500);
if IsUpText('Crude') then
begin
ClearReport;
ClearDebug;
writeln('Crude Chair Found!');
ClickMouse2(mouse_left);
wait(500);
writeln('Building chair');
writeln('' +TimeRunning);
wait(RandomRange(5500,6000));
end;
end;
end;
until (TimeFromMark(Built) > 9500) or (FindChatBoxText('material', 8, clBlack));
FreeDTM(Build);
FreeDTM(ChairDTM);
End;

Procedure TeleportEdge;

Begin
if not GameTab(tab_Magic) then
GameTab(tab_Magic);
begin
if GameTab(tab_Magic) then
MouseOval(572, 230, 7, 7, mouse_Move);
IsUpText('Home');
ClickMouse2(mouse_Left);
ClearReport;
ClearDebug;
writeln('Banking');
end;
repeat
until LodestoneScreen;
LodestoneTeleport('Edgeville');
ClickMouse2(mouse_Left)
wait (18000);
Exit;
End;



Procedure WalktoBank;
var
myPath: TPointArray;

begin
SPS_Setup(RUNESCAPE_SURFACE,['10_6']);
myPath := [Point(4111, 2628), Point(4121, 2632), Point(4128, 2634), Point(4136, 2637), Point(4145, 2640), Point(4151, 2644), Point(4159, 2647), Point(4167, 2653), Point(4173, 2658), Point(4180, 2665), Point(4186, 2674), Point(4193, 2683), Point(4203, 2686), Point(4208, 2686)];
SPS_WalkPath(myPath);
ClearReport;
ClearDebug;
writeln('At bank');
wait(2500);
end;


Procedure Banking;
var
x, y, Plank:Integer;

begin
Plank := DTMFromString('mwQAAAHic42RgYMhjZGAoBeJiIE4H4kwgzgbiSiBOAeJcEB+oLg6Ic4C4ggHCrwTiBCAuBeI0IA521QOSTDhxQoApAz+QRQgzEoHhAAB/IgoD');
if not LoggedIn then TerminateScript;

repeat
OpenBankNPC;
wait(3000);
if FindDTM(Plank, x, y, MBX1, MBY1, MBX2, MBY2) then
begin
MMouse(x, y, 2, 2);
wait(RandomRange(500,1000));
IsUpText('lank')
ClearReport;
ClearDebug;
writeln('Withdrawing Planks');
Mouse(x, y, 0, 0, false);
ChooseOption('All Plank');
end else
begin
Logout;
TerminateScript;
end;
until CloseBank;
FreeDTM(Plank);
end;


//Teleport to Port Sarim
Procedure TeleportPS;
Begin
if not GameTab(tab_Magic) then
GameTab(tab_Magic);
begin
if GameTab(tab_Magic) then
MouseOval(572, 230, 7, 7, mouse_Move);
IsUpText('Home');
ClickMouse2(mouse_Left);
ClearReport;
ClearDebug;
writeln('Teleporting');
end;
repeat
until LodestoneScreen;
LodestoneTeleport('Port Sarim');
ClickMouse2(mouse_Left)
wait (16000);
Exit;
End;


Procedure WalktoHouse;
var
myPath: TPointArray;

begin
SPS_Setup(RUNESCAPE_SURFACE,['9_9']);
myPath := [Point(3861, 3787), Point(3850, 3785), Point(3840, 3784), Point(3828, 3782), Point(3818, 3781), Point(3809, 3781), Point(3801, 3778), Point(3794, 3778), Point(3785, 3778), Point(3775, 3778), Point(3765, 3777), Point(3754, 3774), Point(3742, 3774), Point(3732, 3773), Point(3720, 3772), Point(3710, 3770), Point(3701, 3769), Point(3690, 3767), Point(3678, 3766), Point(3663, 3765)];
SPS_WalkPath(myPath);
wait(2000);
ClearReport;
ClearDebug;
writeln('Walking to House');
end;


Procedure EnterPortal;
var
x, y:Integer;
Begin
repeat
If FindColorSpiralTolerance(x, y, 6496589, MSX1, MSY1, MSX2, MSY2, 14) then
ClearReport;
ClearDebug;
writeln('Entering Portal');
Mouse(x, y, 2, 2, true);
wait(RandomRange(2000,2500));
until FindNPCChatText('mode', Clickleft);
wait(RandomRange(5000,5500));
writeln('Entered Portal');
End;


Procedure WalktoChair;
var
x, y, Center:Integer;

Begin
x := 235
y := 25

Mouse(x, y, 2, 2, true);
ClearReport;
ClearDebug;
writeln('Walking to Center');
wait(3000);
FreeDTM(Center);
End;





begin
ClearReport;
ClearDebug;

Smart_Server := 10;
Smart_Signed := true;
Smart_Members := true;
Smart_SuperDetail := false;

SetupSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
repeat
wait(1000)
until LoggedIn;

ClickNorth(SRL_ANGLE_HIGH);


repeat
EnterPortal;
WalktoChair;
repeat
FindChair
BuildChair;
until FindChatBoxText('material', 8, clBlack);
writeln('No materials');
TeleportEdge;
WalktoBank;
Banking;
TeleportPS;
WalktoHouse
until (false);

end.

blink

2012-04-17 21:11:53

looks pretty good for a first script, keep up the good work

RWZ

2012-04-18 19:50:00

A slightly more efficient way would be using the house you get in Taverley now. After the update to Burthorpe/Taverley (sometime in late January), the first house you get is always in Taverley now (as opposed to Rimmington, as it used to be) - That being said, the bank is only a few steps south of the house portal, so it's a lot faster in terms of bankin (I only found this out a few days ago, as I just started construction on my new skiller).

SeaBass

2012-04-18 20:06:16

Great script… Do you know much exp per hour it is by any chance?

CephaXz

2012-04-19 13:31:08

From: blink
looks pretty good for a first script, keep up the good work


Thanks! Any suggestions on where should I improve and how can I make the script better?

From: RWZ
A slightly more efficient way would be using the house you get in Taverley now. After the update to Burthorpe/Taverley (sometime in late January), the first house you get is always in Taverley now (as opposed to Rimmington, as it used to be) - That being said, the bank is only a few steps south of the house portal, so it's a lot faster in terms of bankin (I only found this out a few days ago, as I just started construction on my new skiller).


Wow, didn't know about that! Thanks for the information, might be updating the script to use Taverly Lodestone or just run out from the portal after my mid-term exam this saturday.

From: SeaBass
Great script… Do you know much exp per hour it is by any chance?


Thanks!:D
I don't know how much exp per hour, but this script is mainly only for construction starters from lvl 1-33, after that Oak Larders are better. That's what I read from a construction leveling guide. Might be making a Oak Larder script because I need to get construction to lvl50 before doing livid farm.

peetu

2012-04-29 07:53:39

Tip: Do not use things like mouse(x, y, 0, 0, true);
Put a little randomization in them. For example: mouse(x, y, 5, 5, true);

CephaXz

2012-04-29 14:49:27

From: peetu
Tip: Do not use things like mouse(x, y, 0, 0, true);
Put a little randomization in them. For example: mouse(x, y, 5, 5, true);


Didn't know I would still get feedback from this thread, since I don't think I'll update it because nobody is using it. When I don't use randomization, I probably want it to click it exactly at the spot so that it won't miss, or maybe its because this is my first script. Check out my second script here http://villavu.com/forum/showthread.php?t=81016

peetu

2012-04-29 15:13:58

From: CephaXz
Didn't know I would still get feedback from this thread, since I don't think I'll update it because nobody is using it. When I don't use randomization, I probably want it to click it exactly at the spot so that it won't miss, or maybe its because this is my first script. Check out my second script here http://villavu.com/forum/showthread.php?t=81016


Can't really tell if you're being sarcastic or not, but I'll just throw this here.

If you click on the exact pixel or the time you will get banned in no time.

CephaXz

2012-04-30 09:39:34

From: peetu
Can't really tell if you're being sarcastic or not, but I'll just throw this here.

If you click on the exact pixel or the time you will get banned in no time.


Even if I randomize the x and y by 5, it won't change by much. Jagex will not be able to detect that much. If you randomize it and it misclicks, that would break the script and have more chance of you getting banned even higher. Btw, its not sarcastic or anything.