SRL Archive - Archive

Sabzi - SRL Member Application


Sabzi

2009-07-27 19:10:05

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


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?



What is your general programming knowledge?
HTML, Visual Basic 6.0
Both of them learned in school that means I got strong base knowledge for further advancement but currently I know just the basics.
And now scar is pretty good.


Are you a member of any other communities?
A few hungarian anime communities, not realy actively, and if Bfheroes is a community then that.


Tell us about yourself…
From: Sabzi
First about "How Long have You Played Runescape?*": About 3 - 4 month if I count every day together. So not 1 year.

Well, I am a 18 year old hungarian boy. I am going to the best secondary school in our region and I got pretty good marks without any(or just very little) learning. I am not that outgoing guy, I am a too shy sometimes.
I like playing computer games(fps, mmorpgs) and programming. In my future I want to be a programmer.
I like my dog as he would be my brother. He is a very strong and beautifull giant snaucher.
My favourite lesson(after IT) is math. I am good at it.
Now you may think I am a couch potatoe but actually not.
Neither a muscle man. Something between them.

I haven't contributed or posted much because I am a reader type. I almost read everything happening here(learn from others mistakes! :D). I have started scripting about 3-4 weeks ago with a full day of tutorial reading. (I have learned much from scripts before because I like understanding what I am using.)
Thx to Narlce his fighters inspired me the most, <3.
Then written my very first script(that you will see here). After that because of real life I took a few week break from scripting and now I got time again so I finsihed/tested the script.
Nowadays as scripting is so addictive I can't help doing it if I got enough time.
And if I can say this, now I mostly understand what a script does without running it, even advanced things that I can't write, but understand. (I know for most of you it's so obvious but it wasn't for me)
That's all I can think of at the moment hope you haven't died in boredom.



Please show us one (or multiple) of your scripts.
program AirCrafter;
{.include SRL/SRL/Misc/SMART.scar}
{.include SRL/SRL.scar}
{.include SRL/SRL/Misc/Users.scar}
{.include SRL/SRL/Misc/Reports.scar}

{Instructions: - tally in 1st inv slot or tiara equipped,
- Setup World, Signed in const, press run
- I will write more detailed instructions for Jr. Members :P You don't need it.

{variables:
- Booleans[0] - audio off?
- Booleans[1] - Tiara/tally
- Booleans[2] - check
- Integers[0] - Loads to do?
- Integers[1] - Time before switching/breaking?(mins)
- Integers[2] - If singleplayer time to break?(mins)
- Integers[3] - Maxtime?(hours)
- Integers[4] - levels gained.
- Integers[5] - timemarker
- Integers[6] - loads done
- Integers[7] - switched from player
- Integers[8] - breaks taken
- Integers[9] - essence we should got(if tally 27 if tiara 28)
- Integers[10] - player runecrafting lvl
- Integers[11] - airs/ess
- Integers[12] - loads/hr
- Integers[13] - xp gained
- Integers[14] - xp/hour
- Integers[15] - airs crafted
- Integers[16] - airs/hour
- Integers[17] - another timemarker :/}

const
World = 43; //smart server to load;
// if you leave it 0 a random world will be chosen AND
// a new SMART will always loads at script startup
Signed = True; //True = Signed SMART Flase = Unsigned SMART;
//if False then SMART will load up the desired world

function FindAltarColor: Integer; //ACA v2
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.31, 0.25);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 8950668, MSX1, MSY1, MSX2, MSY2, 2);
if (Length(arP) = 0) then
begin
Writeln('Failed to find altarcolor, 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
ColorToRGB(arC[i], R, G, B);

if (R >= 136) and (R <= 144) and (G >= 143) and (G <= 151) and (B >= 132) and (B <= 140) then
begin
Result := arC[i];
Writeln('Altarcolor = ' + IntToStr(arC[i]));
Break;
end;
end;

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

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

function FindPortalColor: Integer; //ACA v2

var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;

begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 9749962, MSX1, MSY1, MSX2, MSY2, 23);
if (Length(arP) = 0) then
begin
Writeln('Failed to find PortalColor, no result.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;

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

for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);

if (R >= 188) and (R <= 215) and (G >= 182) and (G <= 211) and (B >= 135) and (B <= 161) then
begin
Result := arC[i];
Writeln('PortalColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);

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

function FindGlowingColor: Integer; //ACA v2
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(0);

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

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

for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);

if (R >= 99) and (R <= 108) and (G >= 117) and (G <= 133) and (B >= 128) and (B <= 154) then
begin
Result := arC[i];
Writeln('GlowColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);

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

{function TryAC(Color: Integer) : Integer;

var
co: function(Color: Integer): Integer;
i: Integer;

begin
for i := 0 to 5 do
begin
co := @TryAC;
Result := co(Color);
if Result <> 0 then Exit;
end;
end;}

procedure SStatus(s: string);
begin
try
Status(s + ' [' + IntToStr(Players[CurrentPlayer].Integers[6]) + '/' + IntToStr(Players[CurrentPlayer].Integers[0]) + ']');
Disguise(s + ' [' + IntToStr(Players[CurrentPlayer].Integers[6]) + '/' + IntToStr(Players[CurrentPlayer].Integers[0]) + ']');
//WriteLn(s);
except
Status(s);
Disguise(s);
//WriteLn(s);
end;
end;

procedure Proggy(fin: Boolean); forward;

procedure ScriptTerminate;
begin
Proggy(True);
WriteLn('Things saved to ' + ScriptPath + '[SAC]');
end;

procedure Mainloop; forward;

procedure AntiBans(what: Integer);
begin
case what of
0: if RBool then
HoverSkill('runecrafting', false);
1: if RBool then
if Random(10) < 6 then PickUpMouse;
else
if RBoolEx(3) then BoredHuman;
end;
end;

function MultiPlayer(debug: Boolean) : Boolean;

var
i, PlayerCount: Integer;

begin
for i := 0 to High(Players) do
if Players[i].Active then Inc(PlayerCount);
Result := PlayerCount > 1;
if debug then
begin
if Result then WriteLn('We got: ' + IntToStr(PlayerCount) + ' player. MultiPlayer ftw!')
else
WriteLn('We got one player. SinglePlayer ftw!');
end;
end;

procedure HandlePlayer(reason, location : string);

var
TDP: TDebugParams;

begin
TDP := GetDebugParams;
TDP.Color := clRed;
SetDebugParams(TDP);
Players[CurrentPlayer].Loc := location;
WriteLn('[' + TheTime + '] ' + reason + ' Location: ' + Players[CurrentPlayer].Loc);
if MultiPlayer(False) then
begin
NextPlayer(False);
WriteLn('Switched player.');
Alert('One player went inactive.');
MainLoop;
end;
CloseWindow;
if LoggedIn then LogOut;
TerminateScript;
end;

procedure SwitchandBreak;

var
TimeToBreak, CheckTime, h, m, s: Integer;

begin
if Players[CurrentPlayer].Integers[6] >= Players[CurrentPlayer].Integers[0] then Exit;
if Players[CurrentPlayer].Booleans[2] then
begin
IncEx(Players[CurrentPlayer].Worked, TimeFromMark(Players[CurrentPlayer].Integers[5]));
Players[CurrentPlayer].Booleans[2] := False;
MarkTime(Players[CurrentPlayer].Integers[17]);
end else
IncEx(Players[CurrentPlayer].Worked, TimeFromMark(Players[CurrentPlayer].Integers[17]));
MarkTime(Players[CurrentPlayer].Integers[17]);
if Players[CurrentPlayer].Worked > Players[CurrentPlayer].Integers[3] * 3600000 then
HandlePlayer('Maxtime reached.', 'At bank.');

if TimeFromMark(Players[CurrentPlayer].Integers[5]) > Players[CurrentPlayer].Integers[1] * 60000 then
if MultiPlayer(False) then
begin
WriteLn('Max worktime reached. Switching players.');
NextPlayer(True); //Multiplayer switch
Inc(Players[currentPlayer].Integers[7]);
WriteLn('Switched player.');
MainLoop;
end else
begin
Inc(Players[CurrentPlayer].Integers[8]); //Singleplayer Break
CloseWindow;
if Loggedin then LogOut;

TimeToBreak := RandomRange((Players[CurrentPlayer].Integers[2] * 60000) - (Players[CurrentPlayer].Integers[2] * 60000 / 10),
(Players[CurrentPlayer].Integers[2] * 60000) + (Players[CurrentPlayer].Integers[2] * 60000 / 10));

WriteLn('Breaking for: ' + Left(FloatToStr(TimeToBreak / 60000.0), 5) + ' minutes.');
MarkTime(CheckTime);
while TimeFromMark(CheckTime) < TimeToBreak do
begin
ConvertTime(TimeToBreak - TimeFromMark(CheckTime), h, m, s);
if h <> 0 then SStatus('Breaking for ' + IntToStr(h) + ':' + IntToStr(m) + ':' + Replace(Padl(IntToStr(s), 2), ' ', '0'))
else
SStatus('Breaking for ' + IntToStr(m) + ':' + Replace(Padl(IntToStr(s), 2), ' ', '0'));
Wait(200);
end;
WriteLn('Break completed!');
LoginPlayer;
MainLoop;
end;
end;

function FindAltarOut(var x, y: Integer) : Boolean;

var
GlowColors: TPointArray;
GlowColor: T2DPointArray;
i, ArrayLength, fst: Integer;

begin
SetAngle(True);
FindColorsTolerance(GlowColors, FindGlowingColor, MSX1, MSY1, MSX2, MSY2, 15);
GlowColor := TPAToATPA(GlowColors, 100);
if Length(GlowColor) = 0 then HandlePlayer('Glowing color was not found.', 'Stucket outside of altar.');
SortATPASize(GlowColor, True);
ArrayLength := High(GlowColor);
MarkTime(fst);
for i := 0 to ArrayLength do
begin
FindNormalRandoms;
if TimeFromMark(fst) > 5000 then Break;
MiddleTPAEx(GlowColor[i], x, y);
MMouse(x, y, 5, 5);
if WaitUptext('yster', 500) then
begin
Result := True;
GetMousePos(x, y);
Exit;
end;
end;
Result := False;
end;

function FindAltarIn(var x, y: Integer) : Boolean;

var
AltarColors: TPointArray;
AltarColor: T2DPointArray; // See the "s"? Huh?
i, ArrayLength, fst: Integer;

begin
FindColorsSpiralTolerance(MSCX, MSCY, AltarColors, FindAltarColor, MSX1, MSY1, MSX2, MSY2, 5);
AltarColor := TPAtoATPA(AltarColors, 200);
if Length(AltarColor) = 0 then HandlePlayer('Altarcolor was not found', 'Stucked inside the altar.');
SortATPASize(AltarColor, True);
ArrayLength := High(AltarColor);
MarkTime(fst);
for i := 0 to ArrayLength do
begin
FindNormalRandoms;
if TimeFromMark(fst) > 5000 then Break;
MiddleTPAEx(AltarColor[i], x, y);
MMouse(x, y, 5, 5);
if WaitUptext('raft', 500) then
begin
Result := True;
GetMousePos(x, y);
Exit;
end;
end;
Result := False;
end;

function FindPortal(var x, y: Integer) : Boolean;

var
PortalColors: TPointArray;
PortalColor: T2DPointArray;
i, ArrayLength, fst: Integer;
Fund: Boolean;

begin
for i := 0 to 2 do
begin
FindColorsSpiralTolerance(MSCX, MSCY, PortalColors, FindPortalColor, MSX1, MSY1 + 70, MSCX - 10, MSCY - 10, 30);
PortalColor := TPAtoATPA(PortalColors, 30);
if Length(PortalColor) <> 0 then
begin
Fund := True;
Break;
end;
end;
if not Fund then HandlePlayer('Portalcolor was not found', 'Stucked inside the altar.');
SortATPASize(PortalColor, True);
ArrayLength := High(PortalColor);
MarkTime(fst);
for i := 0 to ArrayLength do
begin
FindNormalRandoms;
if TimeFromMark(fst) > 5000 then Break;
MiddleTPAEx(PortalColor[i], x, y);
MMouse(x, y, 2, 2);
if WaitUptext('ortal', 500) then
begin
Result := True;
GetMousePos(x, y);
Exit;
end;
end;
Result := False;
end;

function FindLvlUp : Boolean;

var
TDP: TDebugParams;
x, y: Integer;

begin
if not LoggedIn then HandlePlayer('Player found logged out.', 'In altar.');
if IsTextInAreaEx(MCX1, MCY1, MCX2, MCY2, x, y, 'advanced', 1, NPCChars, False, False, 0, 0, -1) then
begin
Result := True;
TDP := GetDebugParams;
TDP.Name := 'Comic Sans MS';
TDP.Color := 16776960;
TDP.BackColor := clYellow;
TDP.Style := [FSBold];
SetDebugParams(TDP);
WriteLn('Yay! We have gained one level!!!');
HoverSkill('runecrafting', True);
Inc(Players[CurrentPlayer].Integers[4]);
Inc(Players[CurrentPlayer].Integers[10]);
case Players[CurrentPlayer].Integers[10] of
1..10: Players[CurrentPlayer].Integers[11] := 1;
11..21: Players[CurrentPlayer].Integers[11] := 2;
22..32: Players[CurrentPlayer].Integers[11] := 3;
33..43: Players[CurrentPlayer].Integers[11] := 4;
44..54: Players[CurrentPlayer].Integers[11] := 5;
55..65: Players[CurrentPlayer].Integers[11] := 6;
66..76: Players[CurrentPlayer].Integers[11] := 7;
77..87: Players[CurrentPlayer].Integers[11] := 8;
88..98: Players[CurrentPlayer].Integers[11] := 9;
99: Players[CurrentPlayer].Integers[11] := 10;
end;
end;
end;

function LeaveAltar : Boolean;

var
x, y, i: Integer;

begin
MakeCompass('w');
repeat
begin
if FindPortal(x, y) then
begin
FindNormalRandoms;
Mouse(x, y, 0, 0, False);
Result := WaitOption('Use Portal', 300);
end;
Inc(i);
end;
until Result or (i >= 4);
end;

function LoadBmpEss : Integer;

begin
Result := BitmapFromString(5, 5, 'beNqLiUmNi0tPSACirOSknNQUIBdZJ' +
'DkmBojggglRkUAEF4wLDwciqAgAODQcEA==');
end;

function CheckEss : Boolean; //Thx for Coh3n who encouraged me. //Yeah, finally a bitmap.

var
bmpEss, EssCount: Integer;

begin
if not LoggedIn then HandlePlayer('Player found logged out.', 'Bank?');
SStatus('Checking if we got enough essence or not.');
bmpEss := LoadBmpEss;
GameTab(tab_Inv);
Wait(RandomRange(150, 300));
EssCount := CountItems('bmp', bmpEss, [5, 0]);
WriteLn('We got ' + InttoStr(EssCount) + ' essence.');
if EssCount = Players[CurrentPlayer].Integers[9] then Result := True
else
Result := False;
try
FreeBitmap(bmpEss);
except end;
end;

procedure SearchBankFS;

var
S: TBox;
x, y: Integer;

begin
WriteLn('Bitmap was not found. Trying to search for the essence.');
SearchBank('Rune Essence');
S := BankIndexToMSBox(1);
MouseBox(S.x1, S.y1, S.x2, S.y2, 3);
if WaitUptext('une essence', 1000) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
if WaitOption('ll', 300) then CloseBank;
end;
if InvCount = 28 then
begin
FindNormalRandoms;
MMouseItem(2);
if not WaitUptext('une essence', 1000) then HandlePlayer('Failed at banking.', 'bank.');
end else HandlePlayer('Failed at banking.', 'bank.');
WriteLn('Sucesfully banked!');
Antibans(0);
end;

procedure Bank;

var
bmpEss, x, y, TabCount, i: Integer;
Foundd: Boolean;

begin
if not LoggedIn then HandlePlayer('Player found logged out.', 'Bank?');
SStatus('Banking.');
FindNormalRandoms;
if not OpenBankFast('feb') then HandlePlayer('Failed opening bank.', 'Bank?');
if not WaitFunc(@BankScreen, 5000) then HandlePlayer('Failed while banking.', 'Bank?');
if not Players[CurrentPlayer].Booleans[1] then Deposit(2, 28, True)
else
if InvCount <> 0 then DepositAll;
bmpEss := LoadBmpEss;
FixBank;
while ExistsBankTab(TabCount + 1) do Inc(TabCount);
WriteLn('We got ' + IntToStr(TabCount) + ' banktab.');
for i := 1 to TabCount do
begin
if not LoggedIn then HandlePlayer('Player found logged out.', 'Bank?');
FindNormalRandoms;
BankTab(i);
if i > 1 then
begin
GetMousePos(x, y);
MMouse(x, y + 40, 20, 10);
Wait(RandomRange(300, 600));
end;
if FindBitmapToleranceIn(bmpEss, x, y, MBX1, MBY1, MBX2, MBY2, 5) then
begin
Foundd := True;
Break;
end;
end;
try
FreeBitmap(bmpEss);
except end;
if Foundd then
begin
FindNormalRandoms;
MMouse(x, y, 5, 5);
if WaitUptext('une essence', 1000) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, false);
WaitOption('ll', 500);
WriteLn('Sucesfully banked!');
Wait(RandomRange(70, 140));
CloseBank;
Antibans(0);
Exit;
end else SearchBankFS;
end else SearchBankFS;
end;

procedure CheckRun; //GetMMLevels is not working for me atm. Just the color output.

var
c: string;

begin
GetMMLevels('run', c);
if (c = 'Yellow') or (c = 'Green') then SetRun(True)
else
begin
Status('Resting.');
SetRest;
while not (c = 'Green') do
begin
FindNormalRandoms;
AntiBans(1);
GetMMLevels('run', c);
Status(c);
Wait(100);
end;
Wait(RandomRange(7000, 8300));
SetRun(True);
end;
end;

function SetDDTM(z: Integer) : Integer; // credit to Blumblebee for his great tut //DDTM_editor

var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
TempTDTM: TDTM;
Color, i: Integer;

begin
Color := FindRoadColor;
case z of
0:
begin
with dtmMainPoint do
begin
x := 607;
y := 216
AreaSize := 0;
AreaShape := 0;
Color := Color;
Tolerance := 255;
end;
with dtmSubPoints[0] do
begin
x := 607;
y := 216
AreaSize := 0;
AreaShape := 0;
Color := Color;
Tolerance := 255;
end;
dtmSubPoints[1].x := 618;
dtmSubPoints[1].y := 261;
dtmSubPoints[2].x := 635;
dtmSubPoints[2].y := 257;
dtmSubPoints[3].x := 674;
dtmSubPoints[3].y := 171;
dtmSubPoints[4].x := 675;
dtmSubPoints[4].y := 229;
end;
1:
begin
with dtmMainPoint do
begin
x := 610;
y := 272;
AreaSize := 0;
AreaShape := 0;
Color := FindRockColor;
Tolerance := 6;
end;
with dtmSubPoints[0] do
begin
x := 610;
y := 272
AreaSize := 0;
AreaShape := 0;
Color := FindRockColor;
Tolerance := 6;
end;
dtmSubPoints[1].x := 623;
dtmSubPoints[1].y := 247;
dtmSubPoints[2].x := 628;
dtmSubPoints[2].y := 257;
dtmSubPoints[3].x := 632;
dtmSubPoints[3].y := 266;
dtmSubPoints[4].x := 631;
dtmSubPoints[4].y := 279;
end;
end;
for i := 1 to High(dtmSubPoints) do
begin
dtmSubPoints[i].AreaSize := 0;
dtmSubPoints[i].AreaShape := 0;
dtmSubPoints[i].Color := Color;
dtmSubPoints[i].Tolerance := 5;
end;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;

//Yeah I know I don't got a bunch of failsafes but still enough. I didn't want to overcomplicate this simple walking.

function Walk(which: Integer) : Boolean; //Radial Walking Aid by Yakman helped me a lot but didn't do everything XD
//It's good for visualizing what are you doing. But after the first 5 with the Aid your brain will do it for you.
var
WordMap: TBox;
TehDTM, dtmBank, x, y, i, tol: Integer;

begin
case which of
0:
begin
FindNormalRandoms;
Result := RadialRoadWalk(FindFallyRoadColor, 221, 207, RandomRange(53, 57), 1, 0);
end;

1:
begin
FindNormalRandoms;
Result := RadialRoadWalk(FindFallyRoadColor, 165, 210, RandomRange(58, 62), 1, 0);
end;

2:
begin
FindNormalRandoms;
Result := RadialRoadWalk(FindFallyRoadColor, 160, 200, RandomRange(68, 72), 1, -1);
end;

3:
begin
FindNormalRandoms;
Result := RadialRoadWalk(FindRoadColor, 150, 220, RandomRange(63, 67), 2, -2);
end;

4:
begin
WordMap := IntToBox(521, 118, 564, 161);
Result := FindColorSkipBoxTolerance(x, y, FindRockColor, MMX1, MMCY, MMCX, MMY2, 10, WordMap);
FindNormalRandoms;
if Result then Mouse(x - 13, y + 3, 4, 4, True)
else
begin
TehDTM := SetDDTM(1);
Result := DTMRotated(TehDTM, x, y, MMX1, MMY1, MMX2, MMY2);
if Result then Mouse(x - 10, y + 2, 4, 4, True);
try
FreeDTM(TehDTM);
except end;
end;
end;

5:
begin
TehDTM := SetDDTM(0);
FFlag(4);
Result := DTMRotated(TehDTM, x, y, MMX1, MMY1, MMX2, MMY2);
try
FreeDTM(TehDTM);
except end;
FindNormalRandoms;
if Result then Mouse(x, y, 2, 0, True)
else
begin
TehDTM := SetDDTM(1);
if DTMRotated(TehDTM, x, y, MMX1, MMY1, MMX2, MMY2) then Mouse(x - 10, y + 2, 3, 3, True);
try
FreeDTM(TehDTM);
except end;
TehDTM := SetDDTM(0);
FFlag(4);
Result := DTMRotated(TehDTM, x, y, MMX1, MMY1, MMX2, MMY2);
try
FreeDTM(TehDTM);
except end;
FindNormalRandoms;
if Result then Mouse(x, y, 2, 0, True);
end;
Flag;
SStatus('Arrived to altar.');
Wait(RandomRange(100, 150));
end;

6:
begin
tol := 5;
for i := 0 to 2 do
begin
x := MMCX;
y := MMCY;
Result := FindColorSpiralTolerance(x, y, FindRockColor, MMCX, MMY1, MMX2, MMCY, tol);
FindNormalRandoms;
if Result then
begin
Mouse(x - 10, y + 5, 5, 5, True);
if not FlagPresent then Wait(RandomRange(800, 1500));
Break;
end;
IncEx(tol, 5);
end;
end;

7:
begin
FFlag(2);
for i := 0 to 2 do
begin
FindNormalRandoms;
Result := RadialRoadWalk(FindRoadColor, 20, 65, RandomRange(65, 69), -1, 0);
if Result then Exit;
Wait(300);
end;
end;

8:
begin
FindNormalRandoms;
Result := RadialRoadWalk(FindRoadColor, 345, 395, RandomRange(68, 72), -1, 1);
end;

9:
begin
FindNormalRandoms;
Result := RadialRoadWalk(FindFallyRoadColor, 345, 395, RandomRange(63,67), -1, 1);
end;

10:
begin
FindNormalRandoms;
Result := RadialRoadWalk(FindFallyRoadColor, 345, 395, RandomRange(63,67), -1, 1);
end;
11:
begin
dtmBank := DTMFromString('78DA639CC8C4C0E0CB8002FEFDFBC7F01F483' +
'302F17F2060EC04AA094555F3E70F13032B540D08304E2442CD54' +
'22D4CC24AC0600C23E1480');
FindNormalRandoms;
Result := DTMRotated(dtmBank, x, y, MMX1, MMY1, MMX2, MMY2);
if Result then Mouse(x, y, 4, 4, True);
Flag;
Wait(RandomRange(400, 650));
try
FreeDTM(dtmBank);
except end;
end;
end;
end;

procedure WalkTo;

var
i: Integer;

begin
if not LoggedIn then HandlePlayer('Player found logged out.', 'Bank.');
FindNormalRandoms;
CheckRun;
for i := 0 to 5 do
begin
SStatus('Walking to altar. [' + IntToStr(i + 1) + '/6]');
if not Walk(i) then HandlePlayer('Walking failed.', 'Between bank -> the altar. [' + IntToStr(i + 1) + '/]');
end;
end;

procedure WalkFrom;

var
i: Integer;

begin
if not LoggedIn then HandlePlayer('Player found logged out.', 'Stucked outside the altar(after runes crafted).');
FindNormalRandoms;
MakeCompass('n');
CheckRun;
for i:= 6 to 11 do
begin
SStatus('Walking to bank. [' + IntToStr(i - 5) + '/6]');
if not Walk(i) then HandlePlayer('Walking failed.', 'Betweem the altar -> bank. [' + IntToStr(i - 5) + '/6]');
end;
end;

procedure WaitToUser;

var
SecsToStart: Integer;

begin
while not SmartActive do Wait(150);
MarkTime(SecsToStart);
repeat
begin
Wait(100);
SStatus('Script will start in ' + InttoStr(10 - (TimeFromMark(SecsToStart)/1000)) +
' seconds. Press F2 if you want to start it now!');
end;
until (TimeFromMark(SecsToStart) >= 10000) or (IsFKeyDown(2));
end;

procedure Proggy(fin: Boolean);

var
h, m, s, Loadz, Switched, ActivePlayers, o, I, II, III: Integer;

begin
for o := 0 to High(Players) do
begin
if Players[o].Active then Inc(ActivePlayers);
IncEx(Loadz, Players[o].Integers[6]); // these are not global variables so every (Loadz, Switched)
IncEx(Switched, Players[o].Integers[7]); //time this procedure called they are zero, right?
end; //this IS a question because I am not sure
Players[CurrentPlayer].Integers[12] := Round(Players[CurrentPlayer].Integers[6] / (Players[CurrentPlayer].Worked / 3600000.0)); //Loads/hour
PLayers[CurrentPlayer].Integers[13] := Players[CurrentPlayer].Integers[6] * Players[CurrentPlayer].Integers[9] * 5; //xp
Players[CurrentPlayer].Integers[14] := Round(PLayers[CurrentPlayer].Integers[13] / (Players[CurrentPlayer].Worked / 3600000.0)); //xp/hr
Players[CurrentPlayer].Integers[15] := Players[CurrentPlayer].Integers[6] * Players[CurrentPlayer].Integers[9] * Players[CurrentPlayer].Integers[11]; //airs crafted
Players[CurrentPlayer].Integers[16] := Round(Players[CurrentPlayer].Integers[15] / (Players[CurrentPlayer].Worked / 3600000.0)); //airs/hr
ClearReport;
FindNormalRandoms;
ConvertTime(GetTimeRunning, h, m, s);
if fin then
begin
I := RewriteFile(ScriptPath + '[SAC]\' + TheDate(3) + '_ProgressReport_' + Replace(Left(TheTime, 8), ':', '_') + '.txt', False); //Looked in Quickmarch's cooker for ideas, thx Quickmarch
if I > -1 then
WriteFileString(I, SRLProgressReport(
ResultString, '[SAC] Sabzi''s AirCrafter', 'Sabzi', 'v1',
['Time Running', 'Loads Done', 'Switches done', 'Active Players'],
[IntToStr(h) + ':' + IntToStr(m) + ':' + Replace(Padl(IntToStr(s), 2), ' ', '0'), Loadz, Switched, ActivePlayers]));
II := RewriteFile(ScriptPath + '[SAC]\' + TheDate(3) + '_PlayerReport_' + Replace(Left(TheTime, 8), ':', '_') + '.txt', False);
if II > -1 then
WriteFileString(II, SRLPlayerReport(ResultString, 0, True,
[True, False, False, True, False, False],
['Tiara', 'Loads', 'Loads/hr', 'Xp Gained', 'Xp/hr', 'Lvlups', 'Airs Crafted', 'Airs/hr', 'Breaks'],
[1], [6, 12, 13, 14, 4, 15, 16, 8], [], []));
III := RewriteFile(ScriptPath + '[SAC]\' + TheDate(3) + '_Debug_' + Replace(Left(TheTime, 8), ':', '_') + '.txt', False);
if III > -1 then
WriteFileString(III, GetDebugText);
end else
begin
SRLProgressReport(
ResultReportBox, '[SAC] Sabzi''s AirCrafter', 'Sabzi', 'v1',
['Time Running', 'Loads Done', 'Switches done', 'Active Players'],
[IntToStr(h) + ':' + IntToStr(m) + ':' + IntToStr(s), Loadz, Switched, ActivePlayers]);
SRLPlayerReport(
ResultDebugBox, 0, True,
[True, False, False, True, False, False],
['Tiara', 'Loads', 'Loads/hr', 'Xp Gained', 'Xp/hr', 'Lvlups', 'Airs Crafted', 'Airs/hr', 'Breaks'],
[1], [6, 12, 13, 14, 4, 15, 16, 8], [], []);
end;
end;

function FindBlackChatMessageArr(Text: TStringArray) : Boolean;

var
i, o: Integer;

begin
o := High(Text);
for i := 0 to o do
if FindBlackChatMessage(Text[i]) then
begin
Result := True;
Exit;
end;
end;

function WaitBlackText(Text: TStringArray; MaxTime: Integer) : Boolean;

var
fs: Integer;

begin
MarkTime(fs);
repeat
begin
FindNormalRandoms;
Result := FindBlackChatMessageArr(Text)
Wait(RandomRange(50, 100));
end;
until Result or (TimeFromMark(fs) >= MaxTime);
end;

procedure ProjectCraft;

var
x, y, LeaveTime: Integer;

begin
if not LoggedIn then HandlePlayer('Player found logged out.', 'Outside of the altar.');
FindNormalRandoms;
SStatus('Entering altar.');

if not FindAltarOut(x, y) then HandlePlayer('AltarOut was not found.', 'Outside of the altar.');

FindNormalRandoms;
Mouse(x, y, 0, 0, True);

if not WaitBlackText(['eel'], 3000) then HandlePlayer('We could not enter the altar.', 'Outside of the altar.');

FindNormalRandoms;
Wait(RandomRange(600, 1000));

if not FindAltarIn(x, y) then HandlePlayer('AltarIn was not found.', 'In altar.');

FindNormalRandoms;
Mouse(x, y, 0, 0, True);
SStatus('Altar found! Crafting runes.');
MakeCompass('w');

if not WaitBlackText(['sparkles', 'bind the'], 3000) then HandlePlayer('We could not craft runes.', 'In altar.');
SStatus('Runes Crafted! Leaving altar. Searching portal. Yeah pretty much here.' +
'And I am sure you can''t read it through.');

MarkTime(LeaveTime);
Wait(RandomRange(2000, 2500));
FindNormalRandoms;
if not FindLvlUp then
begin
AntiBans(1);
AntiBans(0);
end;
while (TimeFromMark(LeaveTime) <= RandomRange(3500, 4000)) do
begin
Wait(100);
FindNormalRandoms;
end;

if not LeaveAltar then HandlePlayer('Stucked in altar.', 'altar.');

SStatus('Leaving altar. Portal found.');

if not WaitBlackText(['hrough'], 10000) then HandlePlayer('We could not leave the altar.', 'In altar.');

Flag;
Wait(RandomRange(700, 1300));
SStatus('Altar left');
end;

procedure Chooseworld;

begin
SStatus('Choosing world.');
if Signed then
begin
if SelectWorld(World) then
begin
WriteLn('We have succesfully chose world: ' + IntToStr(World) + '.');
SStatus('Logging in player.');
LoginPlayer;
end;
end;
end;

{*******************************************************************************
function ConvertXpToLvl(Xp: Integer): Integer;
By: Brak, Flyboy fixed by me
Description: Returns skill level based on xp level
*******************************************************************************}

function ConvertXpToLvl(xp: Integer): Integer;
var
level, exp: Integer;
begin
for level := 1 to 99 do
begin
IncEx(exp, Trunc(level + 300 * Pow(2, level / 7)));
if ((exp / 4) > xp) then
begin
Result := level;
Exit;
end;
end;
Result := 99;
end;

procedure SetupPlayer;

var
xp, i: Integer;

begin
if not LoggedIn then HandlePlayer('Player found logged out.', 'Start.');
if Players[CurrentPlayer].Booleans[1] then Players[CurrentPlayer].Integers[9] := 28
else
Players[CurrentPlayer].Integers[9] := 27;
for i := 0 to 4 do
begin
xp := GetXP('runecrafting');
if xp > -1 then Break;
end;
Players[CurrentPlayer].Integers[10] := ConvertXpToLvl(xp);
WriteLn('Our runecrafting level is: ' + IntToStr(Players[CurrentPlayer].Integers[10]));
case Players[CurrentPlayer].Integers[10] of
1..10: Players[CurrentPlayer].Integers[11] := 1;
11..21: Players[CurrentPlayer].Integers[11] := 2;
22..32: Players[CurrentPlayer].Integers[11] := 3;
33..43: Players[CurrentPlayer].Integers[11] := 4;
44..54: Players[CurrentPlayer].Integers[11] := 5;
55..65: Players[CurrentPlayer].Integers[11] := 6;
66..76: Players[CurrentPlayer].Integers[11] := 7;
77..87: Players[CurrentPlayer].Integers[11] := 8;
88..98: Players[CurrentPlayer].Integers[11] := 9;
99: Players[CurrentPlayer].Integers[11] := 10;
else
WriteLn('Runecrafting level was not found. Proggy will be messed up.');
end;
end;

procedure Setup;

begin
ChangeReportWidth(350);
Smart_Server := World;
Smart_Signed := Signed;
GetSelf.WindowState := wsMinimized;
SStatus('The form is up!');
SRLPlayerForm(True, ['Set audio off?', 'Tiara = True Tally = False'], ['Loads to do?', 'Time before switching/breaking?(mins)',
'If singleplayer time to break?(mins)', 'Maxtime?(hours)'], [], []);
GetSelf.WindowState := wsNormal;
SStatus('SMART loading.');
SetupSrl;
while not RSReady do Wait(300);
MultiPlayer(True);
WaitToUser;
if not LoggedIn then Chooseworld;
end;

procedure MainLoop;

var
i: Integer;

begin
if Players[CurrentPlayer].Booleans[0] then SetAudioOff;
Players[CurrentPlayer].Booleans[2] := True;
MarkTime(Players[CurrentPlayer].Integers[5]);
SetupPlayer;
for i := Players[CurrentPlayer].Integers[6] to (Players[CurrentPlayer].Integers[0] - 1) do
begin
if not LoggedIn then HandlePlayer('Player found logged out.', 'Start/Bank.');
FindNormalRandoms;
SetChat('all', 0);
Players[CurrentPlayer].Loc := 'bank.';
SetAngle(True);
MakeCompass('n');
if not CheckEss then Bank;
WalkTo;
ProjectCraft;
WalkFrom;
Inc(Players[CurrentPlayer].Integers[6]);
SwitchandBreak;
Proggy(False);
end;
HandlePlayer('Loads have done!', 'Bank.');
end;

begin
Setup;
MainLoop;
end.

Naum

2009-07-27 20:16:33

Good app,

1) Begin not needed here:

  if debug then
begin

could be:

  if debug then
if Result then WriteLn('We got: ' + IntToStr(PlayerCount) + ' player. MultiPlayer ftw!')


2)Loads of ACA, apparently 80% is meant to be yours :confused:

3)Loads of others things could be shortened.


Will hold vote, until more replies.

JPHamlett

2009-07-27 20:28:10

very nice app couldnt really find anything major that wasnt stated above but then again i didnt look in super detail



yes

JAD

2009-07-27 20:29:41

Best application I have seen in a long time. I skimmed through the whole thing and there really wasn't anything I found wrong about it.

Definite yes! Great job Sabzi!

Wizzup?

2009-07-27 20:39:09

Yes.

P1nky

2009-07-27 20:40:47

Yes.
Seriously I havent seen a app like this for a lonnng time dude.
Good Job!

Sabzi

2009-07-27 20:47:24

if debug then
Ahh, that's a shame. I wouldn't do that again. That was the first or second function (so an early one) I have made and probably I haven't checked it back.

I like ACA and I found it so great I didn't want to write autocolor myself. Or would it be better to have worse AutoColor or even don't have?

For the others thank you :)
Oh and I got a yes from Wizzup?! I am so excited!

ps.: Am I supposed to answer or not?

JAD

2009-07-27 20:51:28

From: Sabzi
ps.: Am I supposed to answer or not?


Yes you are. I asked the same question back when I applied too, because it was never very clear :p

Awkwardsaw

2009-07-27 21:00:28

oh. my god. i am going to say yes, although there are a few things that can be done better and shortened, although not already said :)

i wont mark down because of ACA, because honestly, if you made your own auto color, it would look almost the same, that, and i use it too sometimes :D

Naum

2009-07-28 00:10:39

I voted yes, to add to that.

You can call FindNormalRandoms before you call
case which of
in your walk procedure. It cuts out loads of lines :).

Good Luck :)

Sabzi

2009-07-28 00:15:15

Yeah. Done on my version. I was thinking about that but uhmm I just leaved it.
Thank you.

Awkwardsaw please tell me the bad things so I can improve it before release.

Brain

2009-07-28 00:16:33

I took a look through you past posts, at the start they mighta been a little spammy, but then you started posting some proggies and it was obvious you were learning, and becoming a good member of the community, I'll vote yes.

Sabzi

2009-07-28 00:21:18

I admitted it somewhere. That I have spammed a few at the beginning then read the rules, blabla. But I can't remember the thread. I may look it up. Since then I am trying to help as much as I can. And from now on I will release some scripts too. But I can't promise I will learn autocoloring :D Pure's tutorial is soooo long.

Ohh! I found it:
http://www.villavu.com/forum/showpost.php?p=598137&postcount=7
maybe more than 2 :P

Awkwardsaw

2009-07-28 00:28:55

From: Sabzi
Yeah. Done on my version. I was thinking about that but uhmm I just leaved it.
Thank you.

Awkwardsaw please tell me the bad things so I can improve it before release.


i cant help out with the code part atm :( im at the wrong cpu. i'll try to remember to do it tonight :)

edit: every thing that i can find was what naum said :) good job

Brain

2009-07-28 00:39:31

yeah, don't worry about the few spammy spams at the start, pretty much everyone does a little :p it's pretty much expected.

Simtoon

2009-07-28 01:01:13

Wow, good script just finish reading it.
NaumanAkhlaQ stop hogging all the help!


Yes.

Coh3n

2009-07-28 01:52:08

Very, very nice application. I don't know what to say that hasn't been said. Great job!

Also, w00t! I'm in the script! :D

Yes.

ZaSz

2009-07-28 03:17:03

Your not active in my arcade anymore. So no.

Its a shame, was a nice app.





Jk, yes.

cycrosism

2009-07-28 09:45:27

Yes. Very good script

ZephyrsFury

2009-07-28 13:35:51

Yes from me. Good luck :)

bugger0001

2009-07-28 13:44:32

Wow! My application was told to be pretty good and since then I've improved my Scar and SRL knowledge a lot, but this is way better than I could write ATM. It's a 100% YES from me. Best app I've seen so far!

marpis

2009-07-28 17:37:51

Yes :) Very nice

Naum

2009-07-28 18:31:58

Btw, does he hold the current record for the best app?

Sabzi

2009-07-29 15:24:36

Thaks everyone. It's so great to hear all of that. I hope I won't hear any worse ;)

From: NaumanAkhlaQ
Btw, does he hold the current record for the best app?
Who he?

cycrosism

2009-07-29 15:33:08

he = you

EvilChicken!

2009-07-29 17:18:36

Yes.

Boreas

2009-07-29 17:33:04

Yes, keep up the good work!

Torrent of Flame

2009-07-29 18:13:05

From: The Man
Great app.
You = best
but
Me = Fastest =p
G'Luck
If anyone reads this please could they quote this so I can delete this,
Need to save my 2k for a surprise :)

T~M


Quoted on Request.


Yes, btw.

Boreas

2009-07-29 22:42:38

25-0, I don't see a need to let this go on any more.


In, congrats!