SRL Archive - Archive

ReadySteadyGo - SRL Member Application


ReadySteadyGo

2010-01-26 04:18:26

How Long have You Played Runescape?
5 Year(s)


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?



What is your general programming knowledge?
SCAR


Are you a member of any other communities?
No


Tell us about yourself…
From: ReadySteadyGo
I'm 18 and studying Fine Art at Central St Martins, London. I'm a figurative painter and hoping to get into Slade School of art at UCL this year.

I like rugby a lot and travel home every other weekend to watch my hometown team Bedford Blues.

I don't know what else to say really lol, I'm a student, I go out too much and don't work enough. :)



Please show us one (or multiple) of your scripts.
{        [url]http://www.villavu.com/forum/showthread.php?p=677959#post677959[/url]




Script name: EDGEVILLE YEW CHOPPER AND BANKER

Author: ReadySteadyGo

Version: 1.04

Date: 24/01/10




Instructions:
- Setup Lines 55-101
- To use SMART modify Line 31
- Start in Edgeville Bank
- Hit Run



Post Progress Reports/Bugs please :-)


}

program YewChopper;
//{.Include srl/srl/Misc/Smart.scar} { <-- Remove '//' to use Smart }
{.Include srl/srl.scar}

const
SCRIPT_VERSION = '1.04';

// Indexes
OBJ_YEW = 0;
OBJ_BANK = 1;

NORTH_TREE = 0;
SOUTH_TREE = 1;

AXE_EQUIPPED = 0;
LOGS = 1;

var
x, y : Integer;
TreeSymbol, LoadsInt : Integer;

{==============================================================================]
[ SETUP PLAYERS HERE ]
[==============================================================================}

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

with Players[0] do
begin
Name := '';
Pass := '';
Nick := ''; // Three lowercase letters of your Username
Active := True;
Pin := ''; // Leave blank ('') if you don't have a pin
Booleans[AXE_EQUIPPED] := True; // Axe Equipped, if not then have it in 1st Inventory Slot
Integers[LOGS] := 0; // Leave on 0 for infinite
BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;

{ // Remove '{' for MultiPlayer

with Players[1] do
begin
Name := '';
Pass := '';
Nick := '';
Active := False;
Pin := ''; // Leave blank ('') if you don't have a pin
Booleans[AXE_EQUIPPED] := True; // Axe Equipped
Integers[LOGS] := 0; // Leave on 0 for infinite
BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;

with Players[2] do
begin
Name := '';
Pass := '';
Nick := '';
Active := False;
Pin := ''; // Leave blank ('') if you don't have a pin
Booleans[AXE_EQUIPPED] := True; // Axe Equipped
Integers[LOGS] := 0; // Leave on 0 for infinite
BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;

}

end;

{==============================================================================]
[ END OF SETUP PLAYERS ]
[==============================================================================}


function ActuallyLoggedIn: Boolean; //LoggedIn from SRL with a Loop
var
cx, cy, i : Integer;
begin
for i := 0 to 10 do
begin
Result := FindColor(cx, cy, 16777215, 439, 491, 440, 492);
if Result then
Break;
Wait(RandomRange(50, 150));
end;
end;

function ActuallyLogOut: Boolean; //LogOut from SRL using ActuallyLoggedIn
var
c, i: Integer;
begin
Result := (not (ActuallyLoggedIn));
if Result = True then
Exit;
if (SRL_Procs[srl_OnLogOut] <> nil) then
SRL_Procs[srl_OnLogOut]();
if GameTab(tab_LogOut) = False then
Exit;
Wait(200 + Random(100));
while (ActuallyLoggedIn) and (c < 10) do
begin
Inc(c);
if(ClickText('here', UpChars, MIX1, MIY1, MIX2, MIY2, True))then
for i := 0 to 10 do
begin
Wait(1000);
if not(ActuallyLoggedIn)then
begin
Result := True;
Exit;
end;
end;
end;
end;

procedure AntiBan;
begin
case Random(100) of
0: HoverSkill('woodcutting', False);
1: HoverSkill('random', False);
2: PickUpMouse;
3: ExamineInv;
4: RandomRClick;
end;
end;

procedure AntiRandoms;
begin
LampSkill := 'woodcutting';
FindNormalRandoms;
UseRewardBox;
end;


function FindMMBankCarpet : Boolean;
var
TempCTS : Integer;
TPA : TPointArray;
begin
Result := False;
TempCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.49, 1.11);
FindColorsTolerance(TPA, 987731, MMX1, MMY1, MMX2, MMY2, 9);
WriteLn(IntToStr(Length(TPA)));
if (172 < Length(TPA)) then
begin
MiddleTPAEx(TPA, x, y);
Mouse(x, y, 2, 2, True);
Result := True;
end;
ColorToleranceSpeed(TempCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;

function FindBankBooth : Boolean;
var
TempCTS, i, H : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
begin
Result := False;
TempCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.19, 0.23);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 7370363, MSX1, MSY1, MSX2, MSY2, 4);
ATPA := TPAToATPA(TPA, 50);
H := High(TPA);
for i := 0 to H do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
GetMousePos(x, y);
if WaitUpTextMulti(['ank', 'ooth'], RandomRange(500, 1000)) then
begin
Mouse(x, y, 0, 0, False);
WaitOptionMulti(['quickly', 'qui', 'kly'], RandomRange(500, 1000));
Result := True;
Break;
end;
end;
ColorToleranceSpeed(TempCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;

function BothTreesVisible : Boolean;
var
TPA : TPointArray;
begin
Result := False;
if FindColors(TPA, TreeSymbol, MMX1, MMY1, MMX2, MMY2) then
Result := (Length(TPA) < 30);
end;

function CurrentTree : Integer;
begin
if (not ActuallyLoggedIn) then
Exit;
x := MMCX;
y := MMCY;
if not BothTreesVisible then
begin
WriteLn('Could not find Tree Symbol');
Players[CurrentPlayer].Active := False;
ActuallyLogOut;
Exit;
end;
Result := SOUTH_TREE;
if not FindColorSpiral(x, y, TreeSymbol, MMX1, MMY1, MMX2, 57) then
Result := NORTH_TREE;
end;

function TransferTree : Boolean;
var
ym : Integer;
begin
if (not ActuallyLoggedIn) then
Exit;
case CurrentTree of
NORTH_TREE : begin
x := MMCX;
y := 150;
ym := - 12;
end;
SOUTH_TREE : begin
x := MMCX;
y := 15;
ym := 15;
end;
end;
Result := FindColorSpiral(x, y, TreeSymbol, MMX1, MMY1, MMX2, MMY2);
if Result then
Mouse(x + 5, y + ym , 2, 2, True)
else
begin
Players[CurrentPlayer].Active := False;
ActuallyLogOut;
Exit;
end;
end;


function FindTree : Boolean;
var
TempCTS, i, H : Integer;
TPA : TPointArray;
TempTBox : TBox;
ATPA : T2DPointArray;
begin
Result := False;
TempCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.06, 0.72);
FindColorsTolerance(TPA, 1461824, MSX1, MSY1, MSX2, MSY2, 3);
ATPA := TPAToATPA(TPA, 50);
SortATPASize(ATPA, True);
H := High(ATPA);
for i := 0 to H do
begin
TempTBox := GetTPABounds(ATPA[i]);
if Distance(TempTBox.x1, TempTBox.y1, TempTBox.x2, TempTBox.y2) < 10 then
begin
SetArrayLength(ATPA, i);
Break;
end;
end;
H := High(ATPA);
for i := 0 to H do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
if WaitUpTextMulti(['hop', 'own', 'ew' ], RandomRange(500, 1000)) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
Result := True;
Break;
end;
end;
ColorToleranceSpeed(TempCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;

{function IsChopping : Boolean; //Animation Version
var
AnimationBox : TBox;
i, c : Integer;
begin
Result := False;
AnimationBox.x1 := MSCX - 5;
AnimationBox.y1 := MSCY - 15;
AnimationBox.x2 := MSCX + 25;
AnimationBox.y2 := MSCY + 15;
c := 0;
for i := 0 to 5 do
begin
if (PixelShift(AnimationBox, 50) >= 90) then
c := c + 1;
if (c > 1) then
begin
Result := True;
Break;
end;
end;
end; }

function IsChopping: Boolean;
var
TempCTS : Integer;
TPA : TPointArray;
begin
TempCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.06, 0.72);
FindColorsTolerance(TPA, 1461824, MSX1, MSY1, MSX2, MSY2, 3);
Result := Length(TPA) > 10;
ColorToleranceSpeed(TempCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;

function BankToTrees : Boolean;
var
i : Integer;
begin
if (not ActuallyLoggedIn) then
Exit;
MakeCompass('N')
SetAngle(True);
SetRun(True);
x := MMCX;
y := MMCY;
for i := 0 to 10 do
begin
Result := FindColorSpiral(x, y, TreeSymbol, MMX1, MMY1, MMX2, MMY2);
if Result then
begin
Mouse(x + RandomRange(1, 6), y + RandomRange(15, 19), 2, 2, True)
WriteLn('Moving to trees');
FFlag(RandomRange(1, 5));
Break;
end;
Wait(RandomRange(100,500));
end;
if not Result then
begin
WriteLn('Could not find Tree Symbol');
Players[CurrentPlayer].Active := False;
ActuallyLogOut;
Exit;
end;
end;

procedure ProgressReport; forward;

function Chop : Boolean;
var
T, InvC : Integer;
begin
if (not ActuallyLoggedIn) then
Exit;
Result := False;
while not InvFull do
begin
MarkTime(T)
while not FindTree do
begin
AntiRandoms;
AntiBan;
Wait(1000 + Random(200));
if(TimeFromMark(T) >= 4*60*1000) then
begin
WriteLn('Could not find Tree');
x := MMCX;
y := MMCY;
if FindColorSpiral(x, y, TreeSymbol, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 2, 2, True);
Break;
end else
begin
Players[CurrentPlayer].Active := False;
ActuallyLogOut;
Exit;
end;
end;
end;
MarkTime(T);
Flag;
Wait(RandomRange(1000,2000));
InvC := InvCount;
while IsChopping do
begin
AntiRandoms;
AntiBan;
Wait(1000 + Random(200));
if InvC > 24 then
if InvFull then
Exit;
if (TimeFromMark(T) >= 4*60*1000) then
Break;
end;
TransferTree;
ProgressReport;
end;
Result := True;
end;

function TreesToBank : Boolean;
var
BankDTM, T : Integer;
begin
if (not ActuallyLoggedIn) then
Exit;
Result := False;
BankDTM := DTMFromString('78DA63AC646260486000034608C5F0E70F130' +
'32B94FF1F0818416A2270AB018B83D4041250530B54E38B5F0D00' +
'08EF0F4B');
case CurrentTree of
NORTH_TREE : begin
Result := FindMMBankCarpet
if Result then
begin
repeat
Wait(RandomRange(400, 900));
until not BothTreesVisible;
FFlag(RandomRange(0, 4));
Exit;
end;
WriteLn('Used a blind click.');
MouseMM(654, 70, 4, 4);
end;

SOUTH_TREE : begin
x := MMCX;
y := MMY1;
if FindColorSpiral(x, y, TreeSymbol, MMX1, MMY1, MMX2, MMY2) then
Mouse(x + RandomRange(6, 8), y - RandomRange(12, 16), 4, 4, True)
else
begin
WriteLn('Used a blind click.')
MouseMM(649, 42, 4, 4);
end;
end;
end;
MarkTime(T);
while not FindMMBankCarpet do
begin
Wait(RandomRange(400, 1000));
if(TimeFromMark(T) >= 15*1000) then
if DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x - 10, y, 2, 2, True);
Break;
end else
begin
if FindSymbol(x, y, 'bank') then
begin
Mouse(x, y, 2, 2, True);
Break;
end else
begin
WriteLn('Could not find Bank');
Players[CurrentPlayer].Active := False;
ActuallyLogOut;
Exit;
end;
end;
end;
FFlag(RandomRange(0, 4));
FreeDTM(BankDTM);
end;

function Bank : Boolean;
var
i : Integer;
begin
if (not ActuallyLoggedIn) then
Exit;
for i := 0 to 4 do
begin
Result := FindBankBooth;
if Result then
Break;
Wait(RandomRange(500, 1000));
end;
if not Result then
begin
for i := 0 to 4 do
begin
Result := OpenBankFast('eb');
if Result then
Break;
Wait(RandomRange(500, 1000));
end;
end;
if not Result then
begin
WriteLn('Could not find Bank Booth');
Players[CurrentPlayer].Active := False;
LogOut;
Exit;
end;
Flag;
Wait(1000 + Random(200));
if (PinScreen) then
InPin(Players[CurrentPlayer].Pin);
if not Players[CurrentPlayer].Booleans[AXE_EQUIPPED] then
Deposit(2, 28, True)
else
DepositAll;
CloseBank;
Inc(LoadsInt);
end;

procedure ProgressReport;
//var
//ProgFile : Integer;
begin
ClearDebug;
WriteLn('[==============================================]');
WriteLn(PadR('[ Yew Chopper Version ' + SCRIPT_VERSION + ' by Jack', 75) + ']');
WriteLn('[==============================================]');
WriteLn(PadR('[ Script duration : ' + TimeRunning, 81) + ']');
WriteLn(PadR('[ Logs banked : ' + IntToStr(LoadsInt * 28), 85) + ']');
WriteLn(PadR('[ Loads : ' + IntToStr(LoadsInt), 89) + ']');
WriteLn('[==============================================]');

{ProgFile := RewriteFile(ScriptPath + 'ProgFile.txt',false);
WriteFileString(ProgFile, '[==============================================]');
WriteFileString(ProgFile, PadR('[ Yew Chopper Version ' + SCRIPT_VERSION + ' by Jack', 75) + ']');
WriteFileString(ProgFile, '[==============================================]');
WriteFileString(ProgFile, PadR('[ Script duration : ' + TimeRunning, 81) + ']');
WriteFileString(ProgFile, PadR('[ Logs banked : ' + IntToStr(LoadsInt * 28), 85) + ']');
WriteFileString(ProgFile, PadR('[ Loads : ' + IntToStr(LoadsInt), 89) + ']');
WriteFileString(ProgFile, '[==============================================]');
CloseFile(ProgFile);}
end;

begin
ClearDebug;
ActivateClient;
SetupSRL;
DeclarePlayers;
Wait(2000);
if not ActuallyLoggedIn then // Temp Fix for broken LoginPlayer
LoginPlayer;
repeat
TreeSymbol := GetSymbolColor(x, y, 'tree');
repeat
ProgressReport;
BankToTrees;
Chop;
TreesToBank;
Bank;
if not (Players[CurrentPlayer].Integers[LOGS] = 0) then
if (Players[CurrentPlayer].Integers[LOGS] <= (LoadsInt * 28)) then
Break;
until not ActuallyLoggedIn;
NextPlayer(Players[CurrentPlayer].Active);
WriteLn('Switched to next Player');
until AllPlayersInactive;
end.

WT-Fakawi

2010-01-26 05:20:00

From: ReadySteadyGo

I don't know what else to say really lol, I'm a student, I go out too much and don't work enough.
But your scripting is ok. Yah.

Home

2010-01-26 05:52:22

Yes from me ;) ( Welcome :D )


~Home

MylesMadness

2010-01-26 06:56:39

Your the one I talked to on msn right? You have improved that script! Yes from me

ReadySteadyGo

2010-01-26 07:23:35

Thanks everyone :D Yeah Myles, that was so helpful, thank you!

Naike

2010-01-26 08:07:27

Yarr!

Gu3st...

2010-01-26 08:31:42

I know very little about you, but it seems like you know how to code :)
Yes

Kyle Undefined

2010-01-26 09:11:55

Yes, good code, just a few standards need some work. Good job!

~Camo

ReadySteadyGo

2010-01-26 10:47:14

From: Camo Developer
Yes, good code, just a few standards need some work. Good job!

~Camo


Can you point them out please? Will help a lot :)

Thanks everyone. This is exciting aha.

Kyle Undefined

2010-01-26 11:11:31


case CurrentTree of
NORTH_TREE : begin
x := MMCX;
y := 150;
ym := - 12;
end;
SOUTH_TREE : begin
x := MMCX;
y := 15;
ym := 15;
end;
end;

Should be


case CurrentTree of
NORTH_TREE :
begin
x := MMCX;
y := 150;
ym := - 12;
end;
SOUTH_TREE :
begin
x := MMCX;
y := 15;
ym := 15;
end;
end;

Just easier to read.

~Camo

ReadySteadyGo

2010-01-26 11:31:48

Cheers, will change that.

Bionicle

2010-01-26 15:12:31

I have not seen you around in the forums…but from what I see here, you have a great attitude and seem anxious to learn! Your script is great if however, as Camo already pointed out, you standards are a bit off…;)

Yes from me!

MylesMadness

2010-01-26 15:17:37

From: Camo Developer

case CurrentTree of
NORTH_TREE : begin
x := MMCX;
y := 150;
ym := - 12;
end;
SOUTH_TREE : begin
x := MMCX;
y := 15;
ym := 15;
end;
end;

Should be


case CurrentTree of
NORTH_TREE :
begin
x := MMCX;
y := 150;
ym := - 12;
end;
SOUTH_TREE :
begin
x := MMCX;
y := 15;
ym := 15;
end;
end;

Just easier to read.

~Camo
Or even

x := MMCX;
case CurrentTree of
NORTH_TREE :
begin
y := 150;
ym := - 12;
end;
SOUTH_TREE :
begin
y := 15;
ym := 15;
end;
end;

Brain

2010-01-26 15:31:42

yes from me, you have always had a good attitude here at the forums, didn't see any flaming posts in your history, and you were courteous on your last app too.

Wanted

2010-01-26 17:27:15

Hey, it all looks pretty good. There are better ways to do the cases, both standard wise and functionally, like replacing the variables with arrays ect..

But the most obvious problem I can see is this

205:

    MMouse(x, y, 2, 2);
GetMousePos(x, y);
if WaitUpTextMulti(['ank', 'ooth'], RandomRange(500, 1000)) then
begin

You should put GetMousePos after it finds text ;)

Overall looks good, but keep working at it though, lots of room for improvement.

Yes from me for SRL/SCAR knowledge and attidude.

-IceFire

Sir R. M8gic1an

2010-01-26 17:37:38

guys, standards with cases are very personal; There is no common consensus as far as I know.


case something of

ONE_THING:
begin
DoSomething;
DoSomething2;
DoSomething3;
end;

TWO_THING:
begin
DoSomething;
DoSomething2;
DoSomething3;
end;
end;

That is how I'd do it ^

~RM

Wanted

2010-01-26 17:46:02

As long as it isn't too crazy, and consistency is the most important thing… thats most important and will prevent errors and make scripting look more readable and editable. This is how I do mine

case something of
ONE_THING: begin
DoSomething;
DoSomething2;
DoSomething3;
end;
TWO_THING: begin
DoSomething;
DoSomething2;
DoSomething3;
end;
end;


Edit: Wow, ok, SCAR tags FAIL, paste that into SCAR :-/

ReadySteadyGo

2010-01-26 18:35:23

Thank you I'll change those things. :)

^^ Haha! That's what I did and got told off for? :P

Wanted

2010-01-26 18:39:54

From: ReadySteadyGo
Thank you I'll change those things. :)

^^ Haha! That's what I did and got told off for? :P


The GetMousePos being after the uptext is really needed though ;) you could easily miss your target.

ReadySteadyGo

2010-01-26 19:00:38

Thank you for spotting it! I think that might have been the problem why it's sometimes stopping.

Griff

2010-01-26 23:47:05

Yarp. Nice script and attitude.

0wn 4 skill

2010-01-27 12:11:24

Yes from me!

Sabzi

2010-01-27 13:54:54

I voted yes too.

Sir R. M8gic1an

2010-01-29 08:53:54

Welcome to Jah People.

~RM