SRL Archive - Archive

Nebula - SRL Member Application


Nebula

2012-03-02 21:53:24

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


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?
No


What is your general programming knowledge?
Pascal


Are you a member of any other communities?
Not currently.


Tell us about yourself…
From: Nebula
Well I am a 16 year old high school sophomore who lives in America. My interests are all of the Gamer/Nerd type things; I take schoolwork seriously but I also enjoy video games, the internet, and of course Simba scripting. But I am in no way unhealthy; I'm a wrestler and exercise daily. I don't really know what else to put here and I don't want to get too personal so I'll just leave it at that.



Please show us one (or multiple) of your scripts.
This first script is my range guild script… It's what I'd consider my most advanced script since I learned how to use ATPAs and incorporated them into my script.

program NebulaRangeGuilder;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

var
x, y, ang: Integer; // Misc
Failsafe, TimeKeeper, TimePlace: Integer; // Failsafes
Ticket, BronzeArrows, BronzeArrows2: Integer; // DTMs
ArrowsFired, InitialTicketAmount, CompetitionsCompleted: Integer; // Proggy variables


{******************************************************************************}
{-------------------------------------------------------------------------------
---DO NOT TOUCH ANYTHING ABOVE THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING----
-------------------------------------------------------------------------------}
{******************************************************************************}

{****************************** Instructions: ********************************

1: Put your player in the Range guild minigame location.
2: Make sure you have enough arrows and gold to last.
3: Make sure that when you right click the Judge, "Compete" appears.
4: Make sure the XP popup is disabled.
5: Don't have your inventory cluttered with non-required items.
6: Fill out the setup Below.
7: Click Run.
8: Don't Open and close the SMART window for minimum bugs.

******************************************************************************}
const
{******************************************************************************}
{********************************* Setup ************************************}

ArrowRandomness = 15; { Frequency that you weild arrows. Recommended 10-20.
**Example: Arrow randomness of 1 will always equipt arrows**
**Make sure you start with atleast 20x this many arrows equipted**}

TimesToCompete = 1000; { How many times you wish to compete.
**Make sure you start with atleast 200x this amount of coins}

World = 58; // What world you want to use.

Procedure DeclarePlayers;
begin
HowManyPlayers := 1; // Don't touch this
NumberOfPlayers(HowManyPlayers); // Don't touch this
CurrentPlayer := 0; // Don't touch this
Players[0].Name := 'UsernameHere'; // Username
Players[0].Pass := 'PasswordHere'; // Password
Players[0].Active := True; // Don't touch this
end;

{****************************** END OF SETUP **********************************}

{******************************************************************************}
{-------------------------------------------------------------------------------
---DO NOT TOUCH ANYTHING BELOW THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING----
-------------------------------------------------------------------------------}
{******************************************************************************}


Procedure LoadDTMs;
begin
Ticket := DTMFromString('mggAAAHicY2NgYLjDxMBwD4gvAfETIL4CxA+BWImRgUEHiDUYIWxlKDu/LQqoiwmOJ2UFg2l+IIkNM+LAEAAAeGcJJw==');
BronzeArrows := DTMFromString('mbQAAAHicY2VgYLjCxMDwAIjPAvF1IL4JxHqMDAxqQGwBxOZAbATEzmqcDMZqYgwxwrxgNgjzA/WDsAgSZsSCwQAAdCMH2w==');
BronzeArrows2 := DTMFromString('mbQAAAHicY2VgYHjDxMDwGYg/AvEzIP4BxByMDAxcQCwExGJA/B+ozlmNE0gywbGJuhgDP5CFjhmxYDAAAGIhBzQ=');
end;

Procedure Setup;
var
ToLocation: TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE,['6_7']);
writeln(sps_getmypos);
ToLocation := [Point(2531, 2947), Point(2523, 2954), Point(2517, 2963), Point(2517, 2985)];
SPS_WalkPath(ToLocation);
SetAngle(1);
MakeCompass(RandomRange(45, 60));
GameTab(Tab_Inv);
end;

Procedure GetInitialTicketCount;
begin
InitialTicketAmount := (ItemAmount('inv', 'dtm', Ticket, []));
end;

Procedure ClickBronzeArrows;
begin
wait(RandomRange(100,300));
GameTab(Tab_Inv);
If ((FindDTM(BronzeArrows, x, y, MIX1, MIY1, MIX2, MIY2)) or (FindDTM(BronzeArrows2, x, y, MIX1, MIY1, MIX2, MIY2))) then
begin
MMouse(x, y, 4, 4);
wait(RandomRange(200,300));
If IsUpTextMultiCustom(['Bronze', 'ronze', 'ze a', 'rrow']) then
ClickMouse2(true)
else
writeln('couldnt find arrows, Make sure your inventory isnt full of non-required items, ESPECIALLY NON-BRONZE ARROWS');
end;
wait(RandomRange(100, 300));
end;

function JudgeColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL, Tol: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.18, 0.92);

for tol := 0 to 18 do
begin
FindColorsSpiralTolerance(MSCX, MSCY, arP, 2835785, MSX1, MSY1, MSX2, MSY2, tol);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
continue;
end;
if (Length(arP) > 60) then
break;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 0.84) and (X <= 15.60) and (Y >= 0.96) and (Y <= 16.86) and (Z >= 0.44) and (Z <= 8.24) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

function Findjudge: Boolean;
var
i, HighaPoints, RandomShort, RandomLong: Integer;
MyTPA : TPointArray;
aPoints: T2DPointArray;
begin
result := false;
SetLength(MyTPA, 0);
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(x, y, MyTPA, JudgeColor, MSX1, MSY1, MSX2, MSY2, 4);
if ((Length(MyTPA)) = 0) then
begin
writeln('coulnt find judge, adding tolerance');
FindColorsSpiralTolerance(x, y, MyTPA, JudgeColor, MSX1, MSY1, MSX2, MSY2, 6);
end;
aPoints := TPAtoATPAEx(MyTPA, 10, 10);
SortATPAFromFirstpoint(aPoints, Point(MSCX, MSCY-(RandomRange(35, 50))));
SetLength(MyTPA, 0);
HighaPoints := High(aPoints);
MarkTime(TimePlace);
for i := 0 to HighaPoints do
begin
RandomShort := RandomRange(2400, 3000);
RandomLong := RandomRange(5000, 8000);
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.18, 0.92);
if (Length(aPoints[i]) < 10) then
begin
writeln('or');
Continue;
end;
MiddleTPAEx(aPoints[i], X, Y);
MMouse(X, Y, 0, 0);
Wait(RandomRange(150,200));
If (IsUpTextMultiCustom(['Compet', 'etition', 'on Ju', '-to Co', 'uard'])) then
begin
ClickMouse2(false);
if ChooseOption('Compete') then
begin
result := true;
Break;
end;
end;
if ((TimeFromMark(TimePlace)) > RandomShort) then
begin
writeln('judge may be under us, clicking middle');
Mouse(MSCX, MSCY, 3, 3, false);
wait(RandomRange(200,300));
if ChooseOption('Compete') then
begin
result := true;
Break;
end;
end;
if ((TimeFromMark(TimePlace)) > RandomLong) then
break;
end;
end;

Procedure HandleJudge;
begin
If not FindJudge then
begin
MarkTime(TimeKeeper);
repeat
MakeCompass(RandomRange(-135,45));
until(((TimeFromMark(TimeKeeper)) > 45000) or (FindJudge = true));
if ((TimeFromMark(TimeKeeper)) > 45000) then
begin
writeln('couldnt find judge')
Logout;
TerminateScript;
end;
end;
begin
if (WaitColorCount(1972754, 221, 401, 294, 411, 8, 20, 10000000, 5000)) then
begin
writeln('open');
Wait(RandomRange(100, 400));
MouseBox(222, 403, 293, 410, 1);
end else
begin
writeln('couldnt compete');
Logout;
TerminateScript;
end;
end;
wait(RandomRange(500,800));
end;

function FindTarget: Boolean;
var
i: Integer;
MyTPA : TPointArray;
aPoints: T2DPointArray;
begin
result := false;
x := MSCX;
y := MSCY;
FindColorsSpiralTolerance(x, y, MyTPA, 5303805, MSX1, MSY1, MSX2, MSY2, 5);
if Length(MyTPA) = 0 then
FindColorsSpiralTolerance(x, y, MyTPA, 5303805, MSX1, MSY1, MSX2, MSY2, 8);
aPoints := TPAtoATPAEx(MyTPA, 3, 3);
SortATPAFromFirstpoint(aPoints, Point(MSCX, MSCY));
for i := 0 to High(MyTPA) do
begin
if (Length(aPoints[i]) > 6) then
begin
MiddleTPAEx(aPoints[i], x, y);
MMouse(x, y, 7, 7);
Wait(RandomRange(150,200));
if IsUpTextMultiCustom(['ire-', 'Target', 'arget', 'at Tar'] ) then
Break;
end;
end;
result := true;
end;

Procedure HandleTarget;
begin
ArrowsFired := 0;
Failsafe := 0;
if not FindTarget then
repeat
inc(Failsafe);
MakeCompass(RandomRange(45, 60));
until((Failsafe >3) or (FindTarget));
ClickMouse2(False);
ChooseOptionMulti(['at Tar', 'ire-at', 'Fire']);
inc(ArrowsFired);
wait(RandomRange(100,150));
repeat
repeat
wait(RandomRange(45, 55));
until (FindTarget);
wait(RandomRange(25, 75));
ClickMouse2(False);
WaitColorCount(3358536, MSX1, MSY1, MSX2, MSY2, 5, 1000, 10000000, 7000);
if (ArrowsFired<11) then
begin
If FindColorTolerance(x, y, 9340807, MCX1, MCY1, MCX2, MCY2, 2) then //running to the target
begin
Setup;
Wait(RandomRange(1100,1400));
FindTarget;
ClickMouse2(False);
ChooseOptionMulti(['at Tar', 'ire-at', 'Fire']);
wait(RandomRange(300,400));
FindTarget;
ClickMouse2(False);
WaitColorCount(3358536, MSX1, MSY1, MSX2, MSY2, 5, 1000, 10000000, 5000);
ChooseOptionMulti(['at Tar', 'ire-at', 'Fire']);
end;
end;
writeln('Window is open');
wait(RandomRange(100,200));
if not ChooseOptionMulti(['at Tar', 'ire-at', 'Fire']) then //open smart...not chooseop
begin
MouseBox(480, 37, 491, 47, 1);
FindTarget;
ClickMouse2(False);
ChooseOptionMulti(['at Tar', 'ire-at', 'Fire']);
FindTarget;
Inc(ArrowsFired);
Wait(RandomRange(100,300));
ClickMouse2(False);
WaitColorCount(3358536, MSX1, MSY1, MSX2, MSY2, 5, 1000, 10000000, 5000);
ChooseOptionMulti(['at Tar', 'ire-at', 'Fire']);
end;
Inc(ArrowsFired);
MarkTime(TimeKeeper);
Repeat
wait(RandomRange(45, 55));
until ((not FindColorTolerance(x, y, 4500223, MSX1, MSY1, MSX2, MSY2, 5)) or (TimeFromMark(TimeKeeper) > 2000));
if ((TimeFromMark(TimeKeeper)) > 2000) then
if FindColorTolerance(x, y, 3358536, MSX1, MSY1, MSX2, MSY2, 5) then
begin
MouseBox(480, 37, 491, 47, 1);
FindTarget;
ClickMouse2(False);
ChooseOptionMulti(['at Tar', 'ire-at', 'Fire']);
FindTarget;
Inc(ArrowsFired);
Wait(RandomRange(100,300));
ClickMouse2(False);
WaitColorCount(3358536, MSX1, MSY1, MSX2, MSY2, 5, 1000, 10000000, 5000);
ChooseOptionMulti(['at Tar', 'ire-at', 'Fire']);
end;
wait(RandomRange(100,400));
until(ArrowsFired >= 11);
Inc(CompetitionsCompleted);
end;

Procedure PrintOnSmart(TP: TStringArray; Placement: TPoint; Colour: integer);
var
mx, my, Pic, I, B, H, TPH, Numb: Integer;
TTP: TPointArray;
Canvas: TCanvas;
begin
SmartSetDebug(True);
GetClientDimensions(mx, my);
Pic := BitmapFromString(mx, my, '');
TPH := High(TP);
for I := 0 to TPH do
begin
TTP := LoadTextTPA(TP[i], UpChars, H);
for B := 0 to High(TTP) do
begin
Numb := ((I + 1) * 13);
FastSetPixel(Pic, TTP[b].x + 1, TTP[b].y + Numb + 1,131072);
FastSetPixel(Pic, TTP[b].x, TTP[b].y + Numb, Colour);
end;
end;
Canvas := TCANVAS.Create;
Canvas.Handle := SmartGetDebugDC;
DrawBitmap(Pic, Canvas, Placement.x, Placement.y);
FreeBitmap(Pic);
end;

function TicketAmount: Integer;
begin
Result := (ItemAmount('inv', 'dtm', Ticket, []));
end;

Procedure MakeProggy;
Var
SmartLines: TStringArray;
Clock: TIntegerArray;
XPPH, TicketsGained, CPH : integer;
begin
Clock := [0,0,0];
CPH:= Round((CompetitionsCompleted * 3600) / ((GetTimeRunning) / 1000));
TicketsGained := ( TicketAmount - InitialTicketAmount );
XPPH := Round((TicketsGained * 5 * 3600) / ((GetTimeRunning) / 1000));
ConvertTime((GetTimeRunning),Clock[0],Clock[1],Clock[2]);
SetArrayLength(SmartLines, 6);
SmartLines[0]:= 'Nebula Range Guilder'
SmartLines[1]:= 'Time Ran:' + tostr(Clock[0])+':'+tostr(Clock[1])+':'+tostr(Clock[2]) ;
SmartLines[2]:= 'Exp Gained:' + IntToStr(TicketsGained * 5);
SmartLines[3]:= 'Exp Per hour:' + IntToStr(XPPH);
SmartLines[4]:= 'Competitions Completed: ' + IntToStr(CompetitionsCompleted);
SmartLines[5]:= 'Competitions Per Hour: ' + IntToStr(CPH);

PrintOnSmart(SmartLines,Point(10,247),clWhite);
writeln('Nebula Range Guilder');
writeln('Time Ran:' + tostr(Clock[0])+':'+tostr(Clock[1])+':'+tostr(Clock[2]));
writeln('Exp Gained:' + IntToStr(TicketsGained * 5));
writeln('Exp Per hour:' + IntToStr(XPPH));
writeln('Competitions Completed: ' + IntToStr(CompetitionsCompleted));
writeln('Competitions Per Hour: ' + IntToStr(CPH));
end;

Procedure FreeDTMs;
begin
FreeDTM(Ticket);
FreeDTM(BronzeArrows);
end;

begin
MouseSpeed := RandomRange(15,20);
smart_server := World;
smart_members := false;
smart_signed := true;
smart_superDetail := false;
SetupSRL;
DeclarePlayers;
LoginPlayer;
Setup;
LoadDTMs;
GetInitialTicketCount;
MakeProggy;
repeat
HandleJudge;
MakeProggy;
Case Random(ArrowRandomness) of
0: ClickBronzeArrows;
end;
ang := round(rs_GetCompassAngleDegrees());
if not (inRange(ang, 35, 55)) then
begin
MakeCompass(RandomRange(45, 60));
wait(RandomRange(200,500));
end;
HandleTarget;
If FindColorTolerance(x, y, 4500223, MSX1, MSY1, MSX2, MSY2, 5) then
begin
writeln('still open...');
Wait(RandomRange(100, 400));
MouseBox(221, 401, 294, 411, 1);
wait(RandomRange(400,500));
end;
until(CompetitionsCompleted = TimesToCompete);
FreeDTMs;
writeln('Successfully did ' + IntToStr(TimesToCompete) +' Competitions, shutting down');
Logout;
TerminateScript;
end.

This second script is the first script I ever made (Although I have changed a lot since I first made it), my Aio Longbow cutter. Even though it doesn't feature anything "Super Advanced", I believe (for the most part…) that as long as a script works flawlessly, it shouldn't matter what's in it. This script contains mostly intermediate material.

program NebulaAioFletcher;
{$DEFINE SMART}
{$i srl/srl.simba}

///////////////////////////// Instructions: ////////////////////////////////////
//////////////// Start in front of the SoulWars Bank chest /////////////////////
///////////////// Put logs on the right side of your bank //////////////////////
//////////////////// Have your knife in your toolbelt //////////////////////////
////////// Fill Out the Loads you want to complete and XP per log //////////////
//////////////// It is not recommended to wear grey clothing ///////////////////
/////////////////////////////////////////////// ////////////////////////////////

var
x, y, i, Count, TheKnife, Alog, Alog2, TotalXp, XPPH, LogsCut, LogsPerHour:Integer;
items, Clock : TIntegerArray;

const
Loads = 100; //how many loads you want to fletch.
ExpPerLog = 58.25; //how much Xp each log gives. Oak: 25 Willow:41.5 Maple:58.25
// Yew: 75 Magic: 91.5
World = 91; //The world you want to use. Make sure it is a members world.

procedure DeclarePlayers;
begin
HowManyPlayers := 1; // don't touch this.
NumberOfPlayers(HowManyPlayers); // don't touch this.
CurrentPlayer := 0; // don't touch this.
Players[0].Name := 'username'; // Username
Players[0].Pass := 'password'; // Password
Players[0].Active := True; // don't touch this.
Players[0].Pin := ''; // Bank Pin. leave blank if you don't have one set.
end;

//****Do not touch anything below this if you do not know what you are doing****
//****Do not touch anything below this if you do not know what you are doing****

Procedure LoadDTMS;
begin
TheKnife := DTMFromString('mlwAAAHicY2dgYPgPxGyMDAyMQPwNyP4KxJxA9j8gvRhIzwbiWUC8GYg3APFUIF4JxLGRkUAVTFixCJDEhRnxYCgAAHrSCjE=');
Alog := DTMFromString('mrAAAAHic42BgYBBgYmAQBmIeIJYCYjkglgFiSSBmAmIuRqAaIBYCYj4g5gBiViBmhopHWvECTWHCif8DSVY8mJEAhgEAM5sC8Q==');
Alog2 := DTMFromString('m6wAAAHiclcs9CoAwAIPRtFAEtU4Ogl7Fo/Sy6iL4fyH9QAfHNvBClhSSSivlyFCjQoMW3bcFg4l54sKGAysWzBixY0Do/XuMcNMukknwywMz8Qt7');
end;

Procedure Beginning;
begin
MakeCompass('W');
SetAngle(0);
GameTab(Tab_Inv);
end;

Procedure Antiban;
begin
Wait(RandomRange(400, 700));
Case Random(250) of
1: Mouse(531, 62, 11, 11, true);
2: begin
HoverSkill('Fletching', false);
Wait(RandomRange(100, 3000));
Gametab(Tab_Inv);
end;
3: begin
Gametab(Tab_Stats);
Wait(randomrange(750, 2400));
Gametab(Tab_Inv);
end;
4: begin
Gametab(Tab_Friends);
Wait(randomrange(750, 2400));
Gametab(Tab_Inv);
end;
5: RandomMovement;
6: MouseBox(0, 0, 753, 492, 2);
7: Case Random(2) of
1: MakeCompass(RandomRange(0,10));
2: MakeCompass(RandomRange(350, 360));
end;
8: SetAngle(RandomRange(0,30));
10: MouseBox(5, 482, 454, 500, 1);
11: PickUpMouse;
12: RandomMovement;
13: MouseBox(0, 0, 753, 492, 2);
14: MMouse(333, 225, 300, 215);
15: MMouse(333, 225, 300, 215);
16: MMouse(333, 225, 300, 215);
17: SetAngle(RandomRange(0,30));
18: Case Random(2) of
1: MakeCompass(RandomRange(0,10));
2: MakeCompass(RandomRange(350, 360));
end;
end;
end;

function Banking: boolean;
begin
Count := 0;
repeat
Inc(count);
CloseBank;
If Not FindNormalRandoms then
begin
Gametab(Tab_Inv);
repeat
OpenBankChestEdge(SRL_BANK_SW);
until(BankScreen);
If PinScreen then
InPin(Players[CurrentPlayer].Pin);
DepositAll;
wait(randomrange(300,600));
If ((FindDTM(alog, x, y, 340, 85, 475, 290 )) or (FindDTM(alog2, x, y, 340, 85, 475, 290 ))) then
begin
Mouse(x, y, 3, 3, false);
WaitOption('All', 1500);
Wait(randomrange(300,700));
CloseBank;
result := true
end else
begin
result := false
Writeln('no logs in bank');
Logout;
TerminateScript;
end;
end else
begin
Writeln('Somehow there was a random event in soulwars. Shutting down.');
Logout;
TerminateScript;
end;
Until((result = true) or (Count>2))
if (Count>2) then
begin
writeln('Banking failed');
Logout;
TerminateScript;
end;
end;

Procedure Fletching;
begin
if (FindDTM(alog, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
IncEx(TotalXp, 28);
IncEx(LogsCut, 28);
items := [1, 2, 5, 6, 9, 10];
MouseItem(items[Random(High(items))], 1);
Wait(RandomRange(600,900));
If (FindDTM(TheKnife, x, y, MCX1, MCY1, MCX2, MCY2)) then
begin
Mouse(x, y, 5, 5, true);
wait(randomrange(700, 900));
end else
MMouse(257, 427, 30, 20);
wait(RandomRange(150, 250));
If (IsUpText('make')) then
Mouse(x, y, 0, 0, true)
else
MMouse(257, 427, 30, 20);
ClickMouse2(true);
repeat
Antiban;
until(FindDTM(alog, x, y, MIX1, MIY1, MIX2, MIY2)= false);
Wait(randomrange(200, 1400));
end else
begin
writeln('no logs');
Logout;
TerminateScript;
end;
end;

Procedure PrintOnSmart(TP: TStringArray; Placement: TPoint; Colour: integer);
var
mx, my, Pic, I, B, H, TPH, Numb: Integer;
TTP: TPointArray;
Canvas: TCanvas;
begin
SmartSetDebug(True);
GetClientDimensions(mx, my);
Pic := BitmapFromString(mx, my, '');
TPH := High(TP);
for I := 0 to TPH do
begin
TTP := LoadTextTPA(TP[i], UpChars, H);
for B := 0 to High(TTP) do
begin
Numb := ((I + 1) * 13);
FastSetPixel(Pic, TTP[b].x + 1, TTP[b].y + Numb + 1,131072);
FastSetPixel(Pic, TTP[b].x, TTP[b].y + Numb, Colour);
end;
end;
Canvas := TCANVAS.Create;
Canvas.Handle := SmartGetDebugDC;
DrawBitmap(Pic, Canvas, Placement.x, Placement.y);
FreeBitmap(Pic);
end;

Procedure WriteProggy;
Var
SmartLines: TStringArray;
begin
Clock := [0,0,0];
XPPH := Round((TotalXp * 3600) / (GetTimeRunning / 1000));
LogsPerHour := Round((LogsCut * 3600) / (GetTimeRunning / 1000));
ConvertTime(GetTimeRunning,Clock[0],Clock[1],Clock[2])
SetArrayLength(SmartLines, 5);
SmartLines[0]:= 'Time Running- ' +tostr(Clock[0])+':'+tostr(Clock[1])+':'+tostr(Clock[2])
SmartLines[1]:= 'XP gained-' + ToStr(TotalXp*ExpPerLog)
SmartLines[2]:= 'Exp Per hour-' + ToStr(XPPH*ExpPerLog)
SmartLines[3]:= 'Logs cut-' + IntToStr(LogsCut)
SmartLines[4]:= 'Logs Cut Per Hour-' +IntToStr(LogsPerHour)
PrintOnSmart(SmartLines,Point(10,254),clWhite);

end;

Procedure FreeDTMS;
begin
FreeDTM(TheKnife);
FreeDTM(Alog);
end;

begin
smart_server := World;
smart_members := true;
smart_signed := true;
smart_superDetail := false;
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
LoadDTMS;
Beginning;
repeat
MouseSpeed := RandomRange(13,17);
inc(i);
banking;
WriteProggy;
wait(RandomRange(800, 1300));
fletching;
WriteProggy;
until(i=loads);
Writeln('Finished');
FreeDTMS;
end.

Even though I'm only including two scripts in this application, the rest of my scripts are in my signature so you can check them out if you want more examples of my work.

masterBB

2012-03-03 09:57:40

I believe many global vars shouldn't be global but function vars. I do like the way you use TPA's bit I believe it is in combination with a piece of aca code(I don't really recognize that). I will give a proper review of the code tomorrow.

Sin

2012-03-03 13:44:20



function JudgeColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL, Tol: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.18, 0.92);

for tol := 0 to 18 do
begin
FindColorsSpiralTolerance(MSCX, MSCY, arP, 2835785, MSX1, MSY1, MSX2, MSY2, tol);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
continue;
end;
if (Length(arP) > 60) then
break;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 0.84) and (X <= 15.60) and (Y >= 0.96) and (Y <= 16.86) and (Z >= 0.44) and (Z <= 8.24) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

ACA.


And instead of having banking as a function, it should be a procedure.
A function gives you two paths to go from, True or False.
Banking as a function won't give either.

Nebula

2012-03-03 15:36:15

From: Sin

ACA.


Yes I used ACA… is it against the rules to use it in scripts? I don't think so. And I didn't just copy/paste the code It spit out. This entire chunk was added by me.
  for tol := 0 to 18 do
begin
FindColorsSpiralTolerance(MSCX, MSCY, arP, 2835785, MSX1, MSY1, MSX2, MSY2, tol);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
continue;
end;
if (Length(arP) > 60) then
break;
end;

From: Sin

And instead of having banking as a function, it should be a procedure.
A function gives you two paths to go from, True or False.
Banking as a function won't give either.


I turned banking into a function so that I could have the script repeat the function until the result is true (or the failsafe stops the script).

Sin

2012-03-03 15:40:49

From: Nebula
Yes I used ACA… is it against the rules to use it in scripts? I don't think so. And I didn't just copy/paste the code It spit out. This entire chunk was added by me.
  for tol := 0 to 18 do
begin
FindColorsSpiralTolerance(MSCX, MSCY, arP, 2835785, MSX1, MSY1, MSX2, MSY2, tol);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
continue;
end;
if (Length(arP) > 60) then
break;
end;



I turned banking into a function so that I could have the script repeat the function until the result is true (or the failsafe stops the script).


Yes, but it doesn't seem efficient, that's all :P

Anyways, the question of ACA.
One of the biggest problems that applicants do is they apply with pieces of other people's code. It'd be better if you applied with a script that is 100% yours.(Excluding the include lol)

Nebula

2012-03-03 16:19:16

From: Sin
Yes, but it doesn't seem efficient, that's all :P


If it isn't efficient, then how is it possible that people have posted 6 Hour progress reports on the thread?


From: Sin

Anyways, the question of ACA.
One of the biggest problems that applicants do is they apply with pieces of other people's code. It'd be better if you applied with a script that is 100% yours.(Excluding the include lol)


Okay, here's a script that is "100% mine". It has no ACA, and the banking is a procedure not a function. Hope you're happy.

program NebulaMonkFisher;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

///////////////////////////// Instructions: ////////////////////////////////////
///////////////////// Start in the Piscatoris Bank /////////////////////////////
////////////////// Have a small net in your Toolbelt ///////////////////////////
/////////// Enter how many Loads of monkfish you want to fish //////////////////
///////////////////Enter what world you want to fish in ////////////////////////
//////////////////// Enter your username + password ////////////////////////////
////////////////////////////////////////////////////////////////////////////////

Var
f, k, g, count:integer; // Failsafes
x, y, MonkfishFished, XpGained, monkfish: integer; //other
MiddleWalk, spot1, spot2, spot3, EastWalk, WestWalk:TPointArray;
items: TIntegerArray;
aFound: extended;
PBox: TBox;

const
Loads = 100; // Amount of loads to do
World = 91; // What world you want to be in

Procedure DeclarePlayers;
begin
HowManyPlayers := 1; // Don't touch this
NumberOfPlayers(HowManyPlayers);// Don't touch this
CurrentPlayer := 0; // Don't touch this
Players[0].Name := 'username'; // Username
Players[0].Pass := 'password'; // Password
Players[0].Active := True; // Don't touch this
Players[0].Pin := ' '; // Bank Pin, Leave blank if you don't have one
end;

{---------------------Don't touch anything past this line---------------------}

Procedure Antiban;
begin
Wait(RandomRange(400,600));
Case random(75) of
1: Mouse(531, 62, 11, 11, true);
2: begin
HoverSkill('Fishing', false);
Wait(RandomRange(2000, 3000));
Gametab(Tab_Inv);
end;
3: begin
Gametab(Tab_Stats);
Wait(randomrange(750, 2400));
Gametab(Tab_Inv);
end;
4: begin
Gametab(Tab_Friends);
Wait(randomrange(750, 2400));
Gametab(Tab_Inv);
end;
5: MakeCompass(RandomRange(0,20));
6: MouseBox(0, 0, 753, 492, 2);
7: MakeCompass(RandomRange(340, 360));
8: SetAngle(RandomRange(0,30));
10: MouseBox(5, 482, 454, 500, 1);
11: PickUpMouse;
12: PickUpMouse;
13: MouseBox(0, 0, 753, 492, 2);
14: MMouse(333, 225, 300, 215);
15: MMouse(333, 225, 300, 215);
16: MMouse(333, 225, 300, 215);
17: SetAngle(RandomRange(0,30));
18: MakeCompass(RandomRange(0,20));
19: MakeCompass(RandomRange(340, 360));
20: MakeCompass('N');
21: MakeCompass('N');
22: MouseSpeed := RandomRange(15,20);
23: MouseSpeed := RandomRange(15,20);
end;
end;

Procedure LoadDTMS;
begin
monkfish := DTMFromString('mggAAAHicY2NgYBBmZmCQB2JJIOYDYi4gVgficEYGBj8gjgVifyCOguJsD2ugLiYMzM+AHTDiwBAAAFOTA7s=');
end;

Procedure Beginning;
begin
MakeCompass('N');
SetAngle(0);
Writeln('done with beginning');
GameTab(Tab_Inv);
end;

Procedure WalkBankFromMiddle;
begin
MiddleWalk := [Point(1185, 1858), Point(1180, 1870), Point(1176, 1883), Point(1158, 1882)];
SPS_WalkPath(MiddleWalk);
end;

Procedure WalkFishingSpot1;
begin
spot1 := [Point(1180, 1835)];
SPS_WalkPath(spot1);
end;

Procedure WalkFishingSpot2;
begin
spot2 := [Point(1220, 1838)];
SPS_WalkPath(spot2);
end;

Procedure WalkFishingSpot3;
begin
spot3 := [Point(1145, 1841)];
SPS_WalkPath(spot3);
end;

Procedure WalkBankFromEast;
begin
EastWalk := [Point(1242, 1844), Point(1229, 1852), Point(1216, 1860), Point(1204, 1866), Point(1188, 1873), Point(1178, 1883), Point(1156, 1885)];
SPS_WalkPath(EastWalk);
end;

Procedure WalkBankFromWest;
begin
WestWalk := [Point(1096, 1842), Point(1110, 1846), Point(1125, 1849), Point(1142, 1851), Point(1158, 1853), Point(1174, 1857), Point(1176, 1885), Point(1158, 1883)];
SPS_WalkPath(WestWalk);
end;

Function StartFishing: Boolean;
begin
if not findnormalrandoms then
begin
count := 1
f := 0
repeat
inc(count);
x := MSCX;
y := MSCY;
Writeln('Searching');
Wait(randomrange(300,500));
If (FindObjTPA(x, y, 11379098, 10, 1, 20, 20, 2,['Harpoon'])) then
begin
writeln('Found possible spot');
Mouse(x, y, 4, 4, False);
If (WaitOption('Net', 3000)) then
begin
writeln('found spot');
result := true
Break;
end;
end;
until((Count>4) or (true));
If (count>4) then
begin
result := false
end;
end else
begin
Writeln('found random');
Logout;
TerminateScript;
end;
end;

Procedure WhileFishing;
begin
if not findnormalrandoms then
begin
wait(randomrange(2000,2500));
repeat
PBox := IntToBox(245, 130, 285, 195);
repeat
if (AveragePixelShift(PBox, 1, 2500)>=4) then
AntiBan;
until ((AveragePixelShift(PBox, 1, 2500)<3) or (InvFull));
Writeln('pixelshift A done');
if (InvFull) then
begin
writeln('Inv is full');
break;
end else
begin
if (AveragePixelShift(PBox, 250, 2500)<550) then
begin
Writeln('PixelShift B done');
wait(randomrange(10,150));
if not startfishing then
break;
end;
end;
until(InvFull);
end else
begin
writeln('found random event');
Logout;
TerminateScript;
end;
end;

Procedure WalkToBank;
var
P : TPoint;
Begin
SPS_GetMyPos;
Writeln(ToStr(SPS_GetMyPos));
P := SPS_GetMyPos;
if (P.x>1200) then
begin
writeln('Walking East Path');
WalkBankFromEast;
end else
if (P.x<1166) then
begin
writeln('Walking Wast Path');
WalkBankFromWest;
end else
begin
writeln('Walking Middle Path');
WalkBankFromMiddle;
end;
end;

Procedure Banking;
begin
if not findnormalrandoms then
begin
MouseSpeed := RandomRange(100,110);
writeln('done walking to bank2;')
Writeln('Banking');
f := 0;
Wait(randomrange(400,800));
repeat
Wait(randomrange(250, 600));
Inc(f);
x := MSCX;
y := MSCY;
if (FindObjTPA(x, y, 2846095, 15, 1, 4, 5, 4, ['Talk'])) then
begin
Mouse(x, y, 0, 0, false);
if (WaitOption('Bank Ar', 600)) then
begin
g := 0
repeat
Inc(g);
Wait(RandomRange(45, 55))
until((BankScreen) or (g>60) or (PinScreen));
If PinScreen then
InPin(Players[CurrentPlayer].Pin);
end;
end else
begin
MakeCompass(RandomRange(90,270));
end;
until((BankScreen) or (f>5));
if (f>4) then
begin
writeln('couldnt find the banker');
Logout;
TerminateScript;
end else
begin
DepositAll;
Wait(randomRange(400, 800));
IncEx(MonkfishFished, 27);
IncEx(XpGained, 3240);
CloseBank;
end;
end;
end;

Procedure PrintOnSmart(TP: TStringArray; Placement: TPoint; Colour: integer);
var
mx, my, Pic, I, B, H, TPH, Numb: Integer;
TTP: TPointArray;
Canvas: TCanvas;
begin
SmartSetDebug(True);
GetClientDimensions(mx, my);
Pic := BitmapFromString(mx, my, '');
TPH := High(TP);
for I := 0 to TPH do
begin
TTP := LoadTextTPA(TP[i], UpChars, H);
for B := 0 to High(TTP) do
begin
Numb := ((I + 1) * 13);
FastSetPixel(Pic, TTP[b].x + 1, TTP[b].y + Numb + 1,131072);
FastSetPixel(Pic, TTP[b].x, TTP[b].y + Numb, Colour);
end;
end;
Canvas := TCANVAS.Create;
Canvas.Handle := SmartGetDebugDC;
DrawBitmap(Pic, Canvas, Placement.x, Placement.y);
FreeBitmap(Pic);
end;

Procedure MakeProggy;
Var
SmartLines: TStringArray;
Clock: TIntegerArray;
XPPH, FishPerHour : integer;
begin
ClearDebug;
Clock := [0,0,0];
XPPH := Round((XpGained * 3600) / (GetTimeRunning / 1000));
FishPerHour := Round((MonkfishFished * 3600) / (GetTimeRunning / 1000));
ConvertTime(GetTimeRunning,Clock[0],Clock[1],Clock[2]);
SetArrayLength(SmartLines, 5);
SmartLines[0]:= 'Time Ran:' + tostr(Clock[0])+':'+tostr(Clock[1])+':'+tostr(Clock[2]) ;
SmartLines[1]:= 'Exp Gained:' + IntToStr(XpGained);
SmartLines[2]:= 'Exp Per hour:' + IntToStr(XPPH);
SmartLines[3]:= 'Monkfish Fished:' + IntToStr(MonkfishFished);
SmartLines[4]:= 'monkfish per hour:' + IntToStr(FishPerHour);

PrintOnSmart(SmartLines,Point(10,254),clWhite);

end;

Procedure FreeDTMs;
begin
FreeDTM(monkfish);
end;

begin
MouseSpeed := RandomRange(15,20);
smart_server := World;
smart_members := false;
smart_signed := true;
smart_superDetail := false;
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
Beginning;
writeln('Starting');
MakeProggy;
SPS_Setup(RUNESCAPE_SURFACE,['2_4']);
repeat
repeat
repeat
SPS_GetMyPos;
if (invfull) then
break
else
if not Startfishing then
begin
MouseSpeed := RandomRange(15,20);
WalkFishingSpot1;
wait(RandomRange(600,1200));
if not Startfishing then
begin
MouseSpeed := RandomRange(15,20);
WalkFishingSpot2;
wait(RandomRange(600,1200));
if not Startfishing then
begin
MouseSpeed := RandomRange(15,20);
WalkFishingSpot1;
wait(RandomRange(600,1200));
if not Startfishing then
begin
MouseSpeed := RandomRange(15,20);
WalkFishingSpot3;
wait(RandomRange(600,1200));
if not Startfishing then
begin
end;
end;
end;
end;
end;
until(true);
WhileFishing;
until(InvFull);
if (InvFull) then
begin
Wait(Randomrange(1300,4000));
WalkToBank;
LoadDTMS;
Banking;
MakeProggy;
inc(k);
Writeln('Done!');
FreeDTMs;
MouseSpeed := RandomRange(15,20);
end;
until(k=loads);
end.

Sin

2012-03-03 16:23:19

Procedure WalkBankFromMiddle;
begin
MiddleWalk := [Point(1185, 1858), Point(1180, 1870), Point(1176, 1883), Point(1158, 1882)];
SPS_WalkPath(MiddleWalk);
end;

Procedure WalkFishingSpot1;
begin
spot1 := [Point(1180, 1835)];
SPS_WalkPath(spot1);
end;

Procedure WalkFishingSpot2;
begin
spot2 := [Point(1220, 1838)];
SPS_WalkPath(spot2);
end;

Procedure WalkFishingSpot3;
begin
spot3 := [Point(1145, 1841)];
SPS_WalkPath(spot3);
end;

Procedure WalkBankFromEast;
begin
EastWalk := [Point(1242, 1844), Point(1229, 1852), Point(1216, 1860), Point(1204, 1866), Point(1188, 1873), Point(1178, 1883), Point(1156, 1885)];
SPS_WalkPath(EastWalk);
end;

Procedure WalkBankFromWest;
begin
WestWalk := [Point(1096, 1842), Point(1110, 1846), Point(1125, 1849), Point(1142, 1851), Point(1158, 1853), Point(1174, 1857), Point(1176, 1885), Point(1158, 1883)];
SPS_WalkPath(WestWalk);
end;
You should make these into a case statement.




Anyways, if you feel like i'm bothering you, i'll hop off, i'm just giving you advice.
I won't if you don't want to haha.

masterBB

2012-03-03 19:02:49

There is nothing wrong with using ACA, but I would like to see a comment stating it is ACA so I know you didn't wrote that piece yourself. But it's no big deal though. I will still hold my vote for tomorrow but don't be offended too fast we get a lot of member apps and reviewing them cost time. Sin was just stating what he thinks about it. If you're fast you could implement his advice so others read an improved script. Good luck.

Bam Bam

2012-03-04 14:07:55

SIN you are so ENTIRELY wrong about preferring a procedure for banking. AND, for using that as a basis to vote no.

Functions return a result. I for one, WOULD want to know if my openbank function succeeded. I usually vote no for ACA but I've used it myself and generally it's quite helpful. I prefer to modify the ACA functions for my own purposes though versus using them in exactly generated form.

Good job on recognizing the importance of functions vs procedures and using failsafes.

Yes from me.

-Bam Bam

cause

2012-03-05 01:47:44

What Bam Bam said.

I liked the use of pixelshift. Yes from me.

Er1k

2012-03-05 01:52:59

From: Bam Bam
Functions return a result. I for one, WOULD want to know if my openbank function succeeded. I usually vote no for ACA but I've used it myself and generally it's quite helpful. I prefer to modify the ACA functions for my own purposes though versus using them in exactly generated form.

Good job on recognizing the importance of functions vs procedures and using failsafes.

Yes from me.

-Bam Bam


True that. IMO anything that gives a success/failure scenario should be coded as a function instead of a procedure. Most new scripters do not realize this. We could have given a lot of No to most applications if this is strictly considered.

If one does not want the boolean results you can simply disregard it, but I am also among the ones who think it is almost mandatory and good standards.

Nebula

2012-03-05 20:40:00

Thank you to the above three.

Here is a HoneyComb Collector I wrote wrote for personal use today.

program NebulaHoneyCombs;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

var
x, y, Honey1, Honey2, Honey3: Integer;
HoneyCombs, TimePlace: Integer;
PathToHoney: TPointArray;

Procedure DeclarePlayers;
begin
HowManyPlayers := 1; // Don't touch this
NumberOfPlayers(HowManyPlayers);// Don't touch this
CurrentPlayer := 0; // Don't touch this
Players[0].Name := 'UsernameHere'; // Username
Players[0].Pass := 'PasswordHere'; // Password
Players[0].Active := True; // Don't touch this
Players[0].Pin := ' '; // Bank Pin, Leave blank if you don't have one
end;

Procedure LoadDTMs;
begin
Honey1 := DTMFromString('mggAAAHicY2NgYBBgZmAQBWJWIBYBYjkgFgPiMEYGBh8gTgTiOCCOBeIkIC6PNwHqYgJjZDY/kMSGGXFgCAAAqZcFLQ==');
Honey2 := DTMFromString('mbQAAAHicY2VgYHjKxMDwCYg/AvFrIL4DxGGMDAxJjAg6EYgrE02BqplQMD+QRMeMWDAYAACe2Afc');
Honey3 := DTMFromString('mbQAAAHicY2VgYOBnZmAQAGJJIJYFYnYglmZkYFCHYmVGCL88wQSomgmOq5PNGESALHTMiAWDAQDl+AOr');
end;

Procedure WalkToHoney;
begin
PathToHoney := [Point(2736, 2677), Point(2738, 2694), Point(2739, 2705), Point(2744, 2713), Point(2745, 2734), Point(2747, 2745), Point(2749, 2760), Point(2753, 2777), Point(2756, 2793), Point(2764, 2810), Point(2769, 2829), Point(2776, 2846), Point(2776, 2868), Point(2781, 2879), Point(2807, 2876), Point(2824, 2875), Point(2839, 2875), Point(2849, 2876)];
SPS_WalkPath(PathToHoney);
end;

Procedure WalkToBank;
begin
InvertTPA(PathToHoney);
SPS_WalkPath(PathToHoney);
end;

Procedure Setup1;
begin
SetAngle(0);
MakeCompass('W');
end;

Procedure Setup2;
begin
SetAngle(0);
MakeCompass('E');
end;

Function PosFailsafe: boolean;
var
P : TPoint;
Begin
Flag;
Result := False;
P := SPS_GetMyPos;
if ((P.x >= 2905) or (P.x <= 2830)) then
begin
writeln('not in Honey area');
Result := true;
end;
end;

Procedure Antiban;
begin



end;

function HiveColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.06, 0.38);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 10132656, MSX1, MSY1, MSX2, MSY2, 30);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 11.53) and (X <= 76.28) and (Y >= 11.90) and (Y <= 78.51) and (Z >= 12.74) and (Z <= 83.80) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

Function FindHive: boolean;
var
MyTPA : TPointArray;
i, HiveTimer: Integer;
aPoints: T2DPointArray;
begin
SetLength(MyTPA, 0);
Result := false;
x := MSCX;
y := MSCY;
MarkTime(HiveTimer);
repeat
FindColorsSpiralTolerance(x, y, MyTPA, HiveColor, MSX1, MSY1, MSX2, MSY2, 15);
if Length(MyTPA) < 2500 then
FindColorsSpiralTolerance(x, y, MyTPA, HiveColor, MSX1, MSY1, MSX2, MSY2, 20);
aPoints := TPAtoATPAEx(MyTPA, 40, 40);
SortATPAFromFirstpoint(aPoints, Point((MSCX + (RandomRange(-20, 20))), (MSCY + (RandomRange(-20, 20)))));
for i := 0 to 2 do
begin
if (Length(MyTPA) > 1200) then
begin
MiddleTPAEx(aPoints[i], x, y);
MMouse(X, Y, 0, 0);
If (WaitUpTextMulti(['eehiv', '-fro', 'ake-'], 400)) then
begin
ClickMouse2(False);
WaitOptionMulti(['oney', 'e-h', 'y B'], 400);
Flag;
wait(RandomRange(100,200));
result := true;
break;
end;
end;
end;
if (Result = true) then
break;
until (TimeFromMark(HiveTimer) > 7000)
end;


Function CollectHoney: boolean;
begin
if (PosFailsafe = False) then
begin
Setup1;
repeat
FindHive;
until (InvFull);
end else
begin
writeln('not in honey area after first failsafe');
TerminateScript;
end;
end;

function SeersBankColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.11, 1.34);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 5402238, MSX1, MSY1, MSX2, MSY2, 6);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 12.64) and (X <= 18.93) and (Y >= 12.88) and (Y <= 19.64) and (Z >= 6.80) and (Z <= 15.38) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

Function FindSeerBank: Boolean;
var
MyTPA : TPointArray;
i : Integer;
aPoints: T2DPointArray;
begin
MarkTime(TimePlace);
repeat
SetLength(MyTPA, 0);
Result := false;
x := MSCX;
y := MSCY;
FindColorsSpiralTolerance(x, y, MyTPA, SeersBankColor, MSX1, MSY1, MSX2, MSY2, 10);
if Length(MyTPA) < 1000 then
FindColorsSpiralTolerance(x, y, MyTPA, SeersBankColor, MSX1, MSY1, MSX2, MSY2, 15);
aPoints := TPAtoATPAEx(MyTPA, 30, 30);
SortATPAFromFirstpoint(aPoints, Point(MSCX, MSCY));
for i := 0 to 2 do
begin
if (Length(MyTPA) > 600) then
begin
MiddleTPAEx(aPoints[i], x, y);
MMouse(X, Y, 0, 0);
If (WaitUpTextMulti(['k boo', 'ank B', 'booth'], 400)) then
begin
result := true;
break;
end;
end;
end;
break;
until(TimeFromMark(TimePlace) > 20000);
if (TimeFromMark(TimePlace) > 20000) then
begin
writeln('couldnt find bank booth');
Logout;
TerminateScript;
end;
end;

Function DoBanking: Boolean;
var
BankTimePlace: Integer;
MasterTimePlace: Integer;
begin
result := false;
MarkTime(MasterTimePlace);
repeat
if (FindSeerBank) then
begin
ClickMouse2(False);
WaitOptionMulti(['ank B', 'Bank B'], 400);
MarkTime(BankTimePlace);
repeat
writeln('waiting for bankscreen');
until(Bankscreen or (TimeFromMark(BankTimePlace) > 6000));
if (Bankscreen) then
begin
wait(RandomRange(200, 300));
If (FindDTM(Honey1, x, y, MIX1, MIY1, MIX2, MIY2) or FindDTM(Honey2, x, y, MIX1, MIY1, MIX2, MIY2) or FindDTM(Honey3, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
MMouse(x, y, 5, 5);
WaitUpTextMulti(['oney', 'se H', 'ank'], 400);
ClickMouse2(False);
WaitOptionMulti(['ll', '-A'], 400);
end else
begin
writeln('couldnt find honeycombs in inv');
Logout;
TerminateScript;
end;
wait(RandomRange(150, 300));
CloseBank;
if not InvFull then
begin
result := true;
break;
end;
end;
end;
until (TimeFromMark(MasterTimePlace) > 30000);
if (TimeFromMark(MasterTimePlace) > 30000) then
begin
writeln('banking entirely failed');
Logout;
TerminateScript;
end;
end;

Procedure FreeAllDTMs;
begin
FreeDTM(Honey1);
FreeDTM(Honey2);
FreeDTM(Honey3);
end;

begin
MouseSpeed := RandomRange(15,20);
smart_server := 91;
smart_members := false;
smart_signed := true;
smart_superDetail := false;
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
writeln('Starting');
LoadDTMs;
SPS_Setup(RUNESCAPE_SURFACE,['6_6','6_7','7_7']);
writeln(sps_getmypos);
repeat
WalkToHoney;
Writeln(TimeRunning);
if (PosFailsafe = true) then
begin
WalkToHoney;
wait(RandomRange(600,900));
If (PosFailsafe = true) then
begin
writeln('we got lost walking, shutting down');
Logout;
TerminateScript;
end;
end;
CollectHoney;
Writeln(TimeRunning);
IncEx(HoneyCombs, 27);
WalkToBank;
repeat
wait('Attempting To Bank');
until (DoBanking = true);
writeln(IntToStr(HoneyCombs));
Writeln(TimeRunning);
until(False);
FreeAllDTMs;
end.

Sin

2012-03-05 20:41:39

From: Bam Bam
SIN you are so ENTIRELY wrong about preferring a procedure for banking. AND, for using that as a basis to vote no.

Functions return a result. I for one, WOULD want to know if my openbank function succeeded. I usually vote no for ACA but I've used it myself and generally it's quite helpful. I prefer to modify the ACA functions for my own purposes though versus using them in exactly generated form.

Good job on recognizing the importance of functions vs procedures and using failsafes.

Yes from me.

-Bam Bam


Not nessecarily, it's opionative.
I have failsafes INSIDE the banking procedure so that if it doesn't succeed it will either try again and switch off.

Brandon

2012-03-05 20:46:32

From: Sin
Not nessecarily, it's opionative.
I have failsafes INSIDE the banking procedure so that if it doesn't succeed it will either try again and switch off.


And that right there.. is an infinite loop. Bam is definitely 1000% right. Using a procedure for banking imo would be the worst thing in the script _-_

it's like having a void function but returning a value internally to check if it succeeded or not.. that's pretty well.. bad. Might as well make it a Boolean and avoid the nonsense

Sin

2012-03-05 20:47:38

From: ggzz
And that right there.. is an infinite loop. Bam is definitely 1000% right. Using a procedure for banking imo would be the worst thing in the script _-_

it's like having a void function but returning a value internally to check if it succeeded or not.. that's pretty well.. not good.


Nope, I have tries/MarkTimes, so infinite loops don't happen ^.^

Brandon

2012-03-05 20:49:15

From: Sin
Nope, I have tries/MarkTimes, so infinite loops don't happen ^.^


In that case.. it's useless.. internally checking a function for a return value.. lol.. I think your just arguing for arguing sake so it won't look too bad.

My advice for the Applicant is to leave the banking as a function and check the return values like you originally did.

Bam Bam

2012-03-05 21:59:39

From: ggzz
In that case.. it's useless.. internally checking a function for a return value.. lol.. I think your just arguing for arguing sake so it won't look too bad.

My advice for the Applicant is to leave the banking as a function and check the return values like you originally did.


I think I just stung his pride a little bit.. Oh well. Nebula good luck on your application I hope you get accepted. :)

-Bam Bam

[XoL]

2012-03-05 22:02:52

Yes from me, the script is good enough for my standards and you have proven to be active enough :).

Daniel

2012-03-06 02:11:36

Couple of things with your scripts:
  • Your script has a little too many variables that are in the global scope. You should cut down on those and try to stick with local variables as much as possible.
  • You often use DTM object finding, and essentially cop Demise's tutorial.
  • You also often use FindObj to find things.
  • Also, try learning about how to condense your script a bit more - especially for your walking routines in the script that is "100% yours" (i.e. there is no need to have separate methods for each little step of the way), and also for your main loop (you don't need all those repeats and then copying and pasting code).
  • In your script (the latest one you have posted), you load your DTMs repetitively.
  • You have a multiplayer setup, but you don't actually have it implemented.
  • You don't need to call TerminateScript when your script is just about to terminate!

You post quite a lot, which shows you are part of the community. You try to actively help those that want it.

I'm at a crossroads at the moment, although more leaning to head into the yes direction.

From: Nebula
If it isn't efficient, then how is it possible that people have posted 6 Hour progress reports on the thread?

Okay, here's a script that is "100% mine". It has no ACA, and the banking is a procedure not a function. Hope you're happy.


Bit retaliative and hostile?

RISK

2012-03-06 02:50:45

I don't think he was hostile at all. :) Maybe he was just making sure they were happy with his script with the changes in it. Nothing wrong with that!

From: Daniel
Bit retaliative and hostile?

Er1k

2012-03-06 03:52:58

I am also thinking yes and no. Sometimes your scripts look really nice and have well implemented failsafes, but some of them the same level of care is missing. But activity-wise you should make a fine addition here.

WT-Fakawi

2012-03-06 04:17:58

Script shows originality and understanding of most underlying principles. Yes.

bg5

2012-03-06 05:55:05

I don't like something in your standards:

Istead of
    14: MMouse(333, 225, 300, 215);
15: MMouse(333, 225, 300, 215);
16: MMouse(333, 225, 300, 215);
you can make:
14..16: MMouse(333, 225, 300, 215);

This is very long part of code.You make a lot of short procedures ,which are unneeded. :

Procedure WalkBankFromMiddle;
begin
MiddleWalk := [Point(1185, 1858), Point(1180, 1870), Point(1176, 1883), Point(1158, 1882)];
SPS_WalkPath(MiddleWalk);
end;

Procedure WalkBankFromEast;
begin
EastWalk := [Point(1242, 1844), Point(1229, 1852), Point(1216, 1860), Point(1204, 1866), Point(1188, 1873), Point(1178, 1883), Point(1156, 1885)];
SPS_WalkPath(EastWalk);
end;

Procedure WalkBankFromWest;
begin
WestWalk := [Point(1096, 1842), Point(1110, 1846), Point(1125, 1849), Point(1142, 1851), Point(1158, 1853), Point(1174, 1857), Point(1176, 1885), Point(1158, 1883)];
SPS_WalkPath(WestWalk);
end;

Procedure WalkToBank;
var
P : TPoint;
Begin
SPS_GetMyPos;
Writeln(ToStr(SPS_GetMyPos));
P := SPS_GetMyPos;
if (P.x>1200) then
begin
writeln('Walking East Path');
WalkBankFromEast;
end else
if (P.x<1166) then
begin
writeln('Walking Wast Path');
WalkBankFromWest;
end else
begin
writeln('Walking Middle Path');
WalkBankFromMiddle;
end;
end;

Much shorter ,and less global variables:
Procedure WalkToBank;
var
P : TPoint;
MiddleWalk,WestWalk,EastWalk ,Path :TPointArray;
Begin
MiddleWalk := [Point(1185, 1858), Point(1180, 1870), Point(1176, 1883), Point(1158, 1882)];
WestWalk := [Point(1096, 1842), Point(1110, 1846), Point(1125, 1849), Point(1142, 1851), Point(1158, 1853), Point(1174, 1857), Point(1176, 1885), Point(1158, 1883)];
EastWalk := [Point(1242, 1844), Point(1229, 1852), Point(1216, 1860), Point(1204, 1866), Point(1188, 1873), Point(1178, 1883), Point(1156, 1885)];

SPS_GetMyPos;
Writeln(ToStr(SPS_GetMyPos));
P := SPS_GetMyPos;
if (P.x>1200) then
begin
writeln('Walking East Path');
SPS_WalkPath(EastWalk);
end else
if (P.x<1166) then
begin
writeln('Walking Wast Path');
SPS_WalkPath(WestWalk);
end else
begin
writeln('Walking Middle Path');
SPS_WalkPath(MiddleWalk);
end;
end;

Mainloop from your Monkfisher. This …doesn't look well :( :
  repeat
repeat
repeat
SPS_GetMyPos; // calling this func in this way is pointless
if (invfull) then
break
else
if not Startfishing then // horrible copy-paste , loop should be here
begin
MouseSpeed := RandomRange(15,20);
WalkFishingSpot1;
wait(RandomRange(600,1200));
if not Startfishing then
begin
MouseSpeed := RandomRange(15,20);
WalkFishingSpot2;
wait(RandomRange(600,1200));
if not Startfishing then
begin
MouseSpeed := RandomRange(15,20);
WalkFishingSpot1;
wait(RandomRange(600,1200));
if not Startfishing then
begin
MouseSpeed := RandomRange(15,20);
WalkFishingSpot3;
wait(RandomRange(600,1200));
if not Startfishing then
begin
end;
end;
end;
end;
end;
until(true); // repeat until(TRUE) - it's not loop..it does nothing
WhileFishing;
until(InvFull);
if (InvFull) then
begin
Wait(Randomrange(1300,4000));
WalkToBank;
LoadDTMS;
Banking;
MakeProggy;
inc(k);
Writeln('Done!');
FreeDTMs;
MouseSpeed := RandomRange(15,20);
end;
until(k=loads);

However standards are not the most important thing to judge here. You showed knowledge of ATPA finding and you are active. I'm on the way to vote yes ,but I will hold vote for some time.

Nebula

2012-03-06 08:46:05

Actually that antiban procedure is pretty old, and when I made it I didn't know you could use Integer Arrays like this:

10..20: RandomMovement;
The antiban in my newer scripts uses Integer Arrays in the antiban, but I just haven't updated the monkfisher.

And in the monkfisher mainloop, It's not the same thing copy-pasted over and over. Each time, the place the script walks to is different (WalkFishingSpot1, 2, 3)



Edit:

If the antiban Integer..Integer: thing is a big deal, Here's "Proof" that I used it in my scripts before you posted, beginner.

you posted today at 5am, but I last saved the script at 10pm Yesterday (Eastern Time)

If you're wondering what "CompassMovement" does, it's an antiban function I made which can be found here: http://villavu.com/forum/showthread.php?t=76326

Bam Bam

2012-03-06 17:19:28

From: Nebula
Actually that antiban procedure is pretty old, and when I made it I didn't know you could use Integer Arrays like this:

10..20: RandomMovement;
The antiban in my newer scripts uses Integer Arrays in the antiban, but I just haven't updated the monkfisher.

And in the monkfisher mainloop, It's not the same thing copy-pasted over and over. Each time, the place the script walks to is different (WalkFishingSpot1, 2, 3)



Edit:

If the antiban Integer..Integer: thing is a big deal, Here's "Proof" that I used it in my scripts before you posted, beginner.

you posted today at 5am, but I last saved the script at 10pm Yesterday (Eastern Time)

If you're wondering what "CompassMovement" does, it's an antiban function I made which can be found here: http://villavu.com/forum/showthread.php?t=76326


If your computer date/time is off that doesn't prove anything :P :sasmokin:
Regardless, it's not a big enough deal for something to need "proving".

-Bam Bam

Nebula

2012-03-06 17:22:29

Yeah I guess that's true, But just in case I created a copy of the script and am editing the copy instead of the original, that way if for whatever somebody want's to teamview me as proof, they can. But yeah like you said it probably isn't a big deal lol.

Jagex_Fagex

2012-03-06 17:29:48

Well, i really don't like new people in SRL members, however, it is now been 3 months (Borderline length in my opinion). That being said though, you have awesome activity and the script looks good. Yes from me.

bg5

2012-03-07 14:06:25

And in the monkfisher mainloop, It's not the same thing copy-pasted over and over. Each time, the place the script walks to is different (WalkFishingSpot1, 2, 3)


You can make it in for-loop ,you change only one number every loop.

If the antiban Integer..Integer: thing is a big deal, Here's "Proof" that I used it in my scripts before you posted, beginner.


It's not big thing ,it was just suggestion ,I don't need proof :P

Nebula

2012-03-08 21:01:35

Thanks for the support,

Somebody requested a working plank making script, so I made one. Here it is:

program NebulaPlanker;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

var
x, y, i, LoadsDone, PlanksMade: Integer;
TimePlace, BankColorToUse, Width, Hei, MinCount, PlankerTimer: Integer;
PathToPlanker: TPointArray;
UpText, OptionText: TStringArray;

{******************************************************************************}
{-------------------------------------------------------------------------------
---DO NOT TOUCH ANYTHING ABOVE THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING----
-------------------------------------------------------------------------------}
{******************************************************************************}

{****************************** Instructions: ********************************

1: Put your player in the Varrock East bank.
2: Make sure you have enough planks and gold to last.
3: Make sure that your logs are in the upper right corner of your bank.
4: Try to wear lightweight clothing.
5: Be in Safe mode, lowest detail, highest brightness, etc.
6: Fill out the setup Below.
7: Click Run.
8: Don't Open and close the SMART window for minimum bugs.

******************************************************************************}
const
{******************************************************************************}
{********************************* Setup ************************************}


PlankType = 'Oak'; { Type of plank you wish to make. Wood, Oak, Teak, Mahogany }

LoadsToPlank = 1000; { How many loads of planks to make. Make sure you have 28x
This many logs }

ProfitPerPlank = 100; { How much profit you make per plank }

World = 91; { World you wish to use }

Procedure DeclarePlayers;
begin
HowManyPlayers := 1; // Don't touch this
NumberOfPlayers(HowManyPlayers); // Don't touch this
CurrentPlayer := 0; // Don't touch this
Players[0].Name := 'UsernameHere'; // Username
Players[0].Pass := 'PasswordHere'; // Password
Players[0].Active := True; // Don't touch this
Players[0].Pin := ' '; // Bank Pin, Leave blank if you don't have one
end;

{****************************** END OF SETUP **********************************}

{******************************************************************************}
{-------------------------------------------------------------------------------
---DO NOT TOUCH ANYTHING BELOW THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING----
-------------------------------------------------------------------------------}
{******************************************************************************}

function Antiban(Walking: Boolean): boolean;
begin
case Random(800) of
1..30: if (walking = false) then
CompassMovement(5, 30, False);
31..70: if (walking = false) then
CompassMovement(15, 80, True);
71..80: CompassMovement(15, 40, True);
80..120: CompassMovement(5, 20, True);
121..125: RandomRClick;
126..135: PickUpMouse;
136..175: MMouse(MSX1, MSY1, MIX2, MIY2);
176..185: Wait(RandomRange(100, 300));
end;
end;


{Credit to Marpis for this SPS Function. Edited by me (Nebula) to use a different
********method of detecting when you are done walking and include antiban********}
function SPS_WalkPathModified(Path: TPointArray): boolean;
var
I, H, T, D: integer;
P, MM: TPoint;
begin
H := High(Path);
T := GetSystemTime + 20000 + Random(5000);
while (not Result) and (GetSystemTime < T) do
begin
RunEnergy(RandomRange(20, 50));

P := SPS_GetMyPos;
for I := H downto 0 do
begin
MM.X := MMCX + Path[I].X - P.X;
MM.Y := MMCY + Path[I].Y - P.Y;

D := Distance(MM.X, MM.Y, MMCX, MMCY);

if (D < 3) then
break
else begin
if (D < 65) then
begin
Mouse(MM.X, MM.Y, 0, 0, true);
repeat
case Random(3) of
1: Antiban(True);
end;
until (WalkingToFlag(400) = false)
T := getSystemTime + 20000 + Random(1000);
Break;
end;
end;
end;
Result := (I = H);
end;
end;

Procedure WalkToPlanker;
begin
PathToPlanker := [Point(4850, 2971), Point(4851, 2962), Point(4851, 2954), Point(4853, 2945), Point(4859, 2938), Point(4869, 2938), Point(4878, 2938), Point(4887, 2938), Point(4898, 2937), Point(4907, 2937), Point(4916, 2936), Point(4935, 2936), Point(4946, 2936), Point(4958, 2934), Point(4971, 2929), Point(4977, 2915), Point(4983, 2902), Point(4981, 2888), Point(4978, 2876), Point(4979, 2866), Point(4985, 2851), Point(4983, 2837), Point(4989, 2817), Point(5001, 2808), Point(5013, 2801), Point(5019, 2786), Point(5018, 2769), Point(5022, 2757), Point(5029, 2746), Point(5033, 2734), Point(5038, 2724), Point(5042, 2712), Point(5047, 2699), Point(5045, 2685)];
SPS_WalkPathModified(PathToPlanker);
end;

Procedure WalkToBank;
begin
InvertTPA(PathToPlanker);
SPS_WalkPathModified(PathToPlanker);
end;

Procedure Setup1;
begin
SetAngle(0);
MakeCompass('N');
GameTab(Tab_Inv);
Antiban(False);
end;

Procedure NotInArea;
var
P : TPoint;
Begin
Flag;
P := SPS_GetMyPos;
if ((P.x <= 4825) or (P.x >= 5070) or (P.y <= 2560) or (P.y >= 3000)) then
begin
writeln('not in area');
Logout;
TerminateScript;
end else
writeln('in area');
end;

function PlankerColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.10, 1.13);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 13410502, MSX1, MSY1, MSX2, MSY2, 25);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 17.56) and (X <= 88.01) and (Y >= 17.92) and (Y <= 89.63) and (Z >= 20.60) and (Z <= 103.92) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

Function FindPlanker: boolean;
var
MyTPA : TPointArray;
i: Integer;
aPoints: T2DPointArray;
begin
SetLength(MyTPA, 0);
Result := false;
x := MSCX;
y := MSCY;
MarkTime(PlankerTimer);
repeat
FindColorsSpiralTolerance(x, y, MyTPA, PlankerColor, MSX1, MSY1, MSX2, MSY2, 10);
if Length(MyTPA) < 30 then
FindColorsSpiralTolerance(x, y, MyTPA, PlankerColor, MSX1, MSY1, MSX2, MSY2, 15);
aPoints := TPAtoATPAEx(MyTPA, 7, 7);
SortATPAFromFirstpoint(aPoints, Point(MSCX, MSCY));
for i := 0 to 2 do
begin
if (Length(MyTPA) > 30) then
begin
MiddleTPAEx(aPoints[i], x, y);
MMouse(X, Y, 0, 0);
If (WaitUpTextMulti(['awmil', 'Sawm', 'perat', 'lk-'], 400)) then
begin
ClickMouse2(False);
if WaitOptionMulti(['uy-', 'plank', 'k S'], 400) then
begin
Flag;
wait(RandomRange(10,100));
result := true;
break;
end else
break;
end else
break;
end;
end;
if (Result = true) then
break;
until (TimeFromMark(PlankerTimer) > 20000)
end;

Function DoPlanker: Boolean;
begin
result := false
repeat
If (FindPlanker = True) then
begin
MarkTime(PlankerTimer);
repeat
writeln('waiting for Plank Screen to be open');
until ((FindColorTolerance(x, y, 16764672, MSX1, MSY1, MSX2, MSY2, 15) and FindColorTolerance(x, y, 2070783, MSX1, MSY1, MSX2, MSY2, 15)) or (TimeFromMark(PlankerTimer) > 4000));
if (TimeFromMark(PlankerTimer) > 4000) then
continue;
Case Lowercase(PlankType) of
'wood': MouseBox(140, 75, 225, 170, 0);
'oak': MouseBox(295, 75, 380, 170, 0);
'teak': MouseBox(140, 200, 225, 265, 0);
'mahogany': MouseBox(295, 200, 380, 265, 0);
end;
if (WaitOptionMulti(['All', 'll', 'Al', 'y A'], 500)) then
begin
Result := true;
wait(RandomRange(250, 500));
writeln('clicking x');
MMouse(465, 30, 477, 42);
ClickMouse2(True);
wait(RandomRange(100, 300));
Inc(LoadsDone);
IncEx(PlanksMade, 28);
end;
end;
until(Result = true);
end;

function BankerColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.17, 0.71);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 4664885, MSX1, MSY1, MSX2, MSY2, 12);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 1.02) and (X <= 8.60) and (Y >= 0.88) and (Y <= 8.02) and (Z >= 1.93) and (Z <= 12.91) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

function BoothColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.04, 1.04);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 2378327, MSX1, MSY1, MSX2, MSY2, 13);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 1.96) and (X <= 13.66) and (Y >= 2.07) and (Y <= 14.44) and (Z >= 0.69) and (Z <= 7.24) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

Procedure DetermineBanking;
begin
case Random(2) of
0: begin
BankColorToUse := BoothColor;
Width := 80;
Hei := 30;
MinCount := 1800;
UpText := ['boot', 'nk b', 'ank B', 'ooth'];
OptionText := ['ank B', 'k B', 'Bank Bank'];
end;

1: begin
BankColorToUse := BankerColor;
Width := 10;
Hei := 10;
MinCount := 60;
UpText := ['nker', 'Banke'];
OptionText := ['ank B', 'k B', 'Bank B', 'o B'];
end;
end;
end;

Function FindVarrockBank: Boolean;
var
MyTPA : TPointArray;
i : Integer;
aPoints: T2DPointArray;
begin
MarkTime(TimePlace);
repeat
SetLength(MyTPA, 0);
Result := false;
x := MSCX;
y := MSCY;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(x, y, MyTPA, BankColorToUse, MSX1, MSY1, MSX2, MSY2, 2);
if Length(MyTPA) < MinCount then
FindColorsSpiralTolerance(x, y, MyTPA, BankColorToUse, MSX1, MSY1, MSX2, MSY2, 5);
aPoints := TPAtoATPAEx(MyTPA, Width, Hei);
SortATPAFromFirstpoint(aPoints, Point(MSCX, MSCY));
for i := 0 to 4 do
begin
if (Length(MyTPA) > MinCount) then
begin
writeln(Length(MyTPA));
MiddleTPAEx(aPoints[i], x, y);
MMouse(X, Y, 0, 0);
If (WaitUpTextMulti(UpText, 400)) then
begin
result := true;
break;
end;
end;
end;
break;
until(TimeFromMark(TimePlace) > 20000);
if (TimeFromMark(TimePlace) > 20000) then
begin
writeln(':Couldnt find bank:::');
Logout;
TerminateScript;
end;
end;

Function DoBanking: Boolean;
var
BankTimePlace: Integer;
MasterTimePlace: Integer;
begin
Antiban(false);
result := false;
MarkTime(MasterTimePlace);
repeat
DetermineBanking;
if (FindVarrockBank) then
begin
ClickMouse2(False);
WaitOptionMulti(OptionText, 400);
MarkTime(BankTimePlace);
repeat
writeln('waiting for bankscreen');
until(Bankscreen or (TimeFromMark(BankTimePlace) > 6000) or PinScreen);
If PinScreen then
InPin(Players[CurrentPlayer].Pin);
if (Bankscreen) then
begin
DepositAll;
wait(RandomRange(150, 300));
if not InvFull then
Withdraw(9, 0, 28);
CloseBank;
if WaitInvCount(28, 2000, ExactCT) then
begin
result := true;
break;
end;
end;
end;
until (TimeFromMark(MasterTimePlace) > 90000);
if (TimeFromMark(MasterTimePlace) > 90000) then
begin
writeln('banking entirely failed');
Logout;
TerminateScript;
end;
end;

Procedure PrintOnSmart(TP: TStringArray; Placement: TPoint; Colour: integer);
var
mx, my, Pic, I, B, H, TPH, Numb: Integer;
TTP: TPointArray;
Canvas: TCanvas;
begin
SmartSetDebug(True);
GetClientDimensions(mx, my);
Pic := BitmapFromString(mx, my, '');
TPH := High(TP);
for I := 0 to TPH do
begin
TTP := LoadTextTPA(TP[i], UpChars, H);
for B := 0 to High(TTP) do
begin
Numb := ((I + 1) * 13);
FastSetPixel(Pic, TTP[b].x + 1, TTP[b].y + Numb + 1,131072);
FastSetPixel(Pic, TTP[b].x, TTP[b].y + Numb, Colour);
end;
end;
Canvas := TCANVAS.Create;
Canvas.Handle := SmartGetDebugDC;
DrawBitmap(Pic, Canvas, Placement.x, Placement.y);
FreeBitmap(Pic);
end;

Procedure MakeProggy;
Var
SmartLines: TStringArray;
Clock: TIntegerArray;
PlanksPerHour, Profit, ProfitPerHour : integer;
begin
ClearDebug;
Clock := [0,0,0];
Profit := (ProfitPerPlank * PlanksMade);
PlanksPerHour := Round((PlanksMade * 3600) / (GetTimeRunning / 1000));
ProfitPerHour := Round((Profit * 3600) / (GetTimeRunning / 1000));
ConvertTime(GetTimeRunning,Clock[0],Clock[1],Clock[2]);
SetArrayLength(SmartLines, 5);
SmartLines[0]:= 'Time Ran:' + tostr(Clock[0])+':'+tostr(Clock[1])+':'+tostr(Clock[2]) ;
SmartLines[1]:= 'Planks Made:' + IntToStr(PlanksMade);
SmartLines[2]:= 'Planks Per hour:' + IntToStr(PlanksPerHour);
SmartLines[3]:= 'Profit Made:' + IntToStr(Profit);
SmartLines[4]:= 'Profit Per hour:' + IntToStr(ProfitPerHour);
PrintOnSmart(SmartLines,Point(10,254),clWhite);

end;

begin
MouseSpeed := RandomRange(10,25);
smart_server := World;
smart_members := false;
smart_signed := true;
smart_superDetail := false;
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
writeln('Starting');
SPS_Setup(RUNESCAPE_SURFACE,['12_7','12_6']);
writeln(sps_getmypos);
wait(1000);
WalkToPlanker;
WalkToBank;
repeat
MakeProggy;
DoBanking;
Setup1;
NotInArea;
WalkToPlanker;
NotInArea;
DoPlanker;
NotInArea;
WalkToBank;
NotInArea;
until(LoadsDone = LoadsToPlank);
end.

Hobbit

2012-03-17 20:56:16

In!

Welcome :)