SRL Archive - Archive

HT BaaFly - SRL Member Application


HT BaaFly

2011-12-31 11:35:52

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


Are you affilated in anyway with Jagex LTD?
no

Were you Referred to SRL?



What is your general programming knowledge?
Basic Java, Visual Basic and C++
and Pascal if it counts


Are you a member of any other communities?
too many to name just google HT BaaFly or htbaafly


Tell us about yourself…
From: HT BaaFly
My name is Zaid but I'm known best by my internet alias HT BaaFly (Silly name that I picked up while playing Medla of Honour: Heroes 2)
I enjoy playing video games, occasional scripting, and masterbating
I'm a very direct person and don't usually like talking for long periods (small chats are fine)
That's all I have to share for now



Please show us one (or multiple) of your scripts.
program GEFlipper;
{$i srl/srl/misc/smart.scar}
{$i SRL/SRL.scar}
{$i srl/srl/misc/grandexchange.scar}
var
BuyIMG, SellIMG, BuyPrice, ItemSearchBox, Profit, Profit2, SetPriceBox, ConfirmBox, CollectionBox1, CollectionBox2, SellPrice, BoughtFor1, SoldFor1: integer;
incprofit: boolean;

const
ITEM1_NAME = 'Lobster'; //The name of item 1 - Make sure it's inbetween two apostrophes -> ''
ITEM1_COLOUR = 1992652; //The colour of item 1 - Use the colour picker and find a somewhat unique colour about the item. e.g. for rune armour, go for the blueish part not the darker outlines
ITEM1_SPOT = 1; //What spot should be allocated to item 1 (From 1 to 6)
ITEM1_REFRESH = 2; // Time (mins) after which the script should abort an offer for not Selling or Buying
ITEM1_LIMIT = 1000; //Make sure you put in the correct limit else the script will not function properly
ITEM1_PERCENTAGEABOVE = 5; //Percentage above the mid price to BuyPrice at
ITEM1_PERCENTAGEBELOW = 5; //Percentage below the mid price to SellPrice at
Version = 0.2;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'iamond', 'uby'];
end;

function isBuyOpen: boolean;
var
x, y: integer;
begin
BuyIMG := DTMFromString('m6wAAAHic42ZgYGhhguB6IO4E4gYgbofyO4C4CYibgbgViFcxMjCsY4TQILwWyl8GxMuBeCkQL4TSjb5yDPJSwjjxiXcMcEwKYCQBIwEAN3IVQQ==');
Result := (FindDTM(BuyIMG, x, y, MSX1, MSY1, MSX2, MSY2));
FreeDTM(BuyIMG);
end;

function isSellOpen: boolean;
var
x, y: integer;
begin
SellIMG := DTMFromString('m1gAAAHic42JgYNBkYWBQYYHQelCsBsQ6QKwNxBpArArEsxgZGGYC8Twgng3EM6BsEJ4MxBOBeCoQN/rKMchLCWPF/9YxgDGITSxgJBIjAACdvg40');
Result := (FindDTM(SellIMG, x, y, MSX1, MSY1, MSX2, MSY2));
FreeDTM(SellIMG);
end;

function isItemSearchOpen: boolean;
var
x, y: integer;
begin
ItemSearchBox := DTMFromString('m6wAAAHic42ZgYBAEYlUg5gFiISAWBWIVIGaEYmWoPAgIADE7ECtC+SBaAYoZkdSAzFw9p4ohO96FKEwKYCQBIwEAJoEN9g==');
Result := (FindDTM(ItemSearchBox, x, y, 10, 348, 58, 388));
FreeDTM(ItemSearchBox);
end;

function isSetOpen(State: integer): boolean;
var
x, y:integer;
begin
SetPriceBox := DTMFromString('mwQAAAHic42RgYLjLwsBwBorfQPEdKD4NxG+BOIaJgSEQiNOhGMQOAOIMJogcCKdHewNNYwRjMTExOBsVEwbYdOE0BQC2mgyY');
If State = 0 then
begin
Result := FindDTM(SetPriceBox, x, y, 370, 209, 404, 233);
end else
If State = 1 then
begin
Result := FindDTM(SetPriceBox, x, y, 220, 209, 254, 233);
end else
If State = 2 then
begin
Result := FindDTM(SetPriceBox, x, y, 179, 209, 213, 233);
end;
FreeDTM(SetPriceBox);
end;

function isConfirmBoxVisible: boolean;
var
x, y:integer;
begin
ConfirmBox := DTMFromString('mwQAAAHic42RgYEhhYWBQg+LZUJwExMlArArEc4B4ORMDwyQg3gXFIPZEIN4NxEuAeBkQn5nBAAd8fHwM5AJGIjAcAABIKgsY');
Result := FindDTM(ConfirmBox, x, y, 204, 274, 323, 316);
FreeDTM(ConfirmBox);
end;

function isCollectionBoxEmpty1: boolean;
var
x, y: integer;
begin
CollectionBox1 := DTMFromString('mAAEAAHic42FgYJjHzMDQA8SzgXg9EM8F4k4o3gDE64C4G0p3AXEzEwNDMRAXAXEjEE9hgoj1QnEJEE+G4mogdjZTZLA1kmWI8LFg8LLTAuNwLxOGEA9jMAbxfRy0GVwtVMBqRYBuIgUzkoiRAQDlYxc1');
Result := (FindDTM(CollectionBox1, x, y, 448, 280, 487, 315));
FreeDTM(CollectionBox1);
end;

function isCollectionBoxEmpty2: boolean;
var
x, y: integer;
begin
CollectionBox2 := DTMFromString('mVAEAAHicE2BgYJjHzMDQBcSdUBrE3wDE64B4DpSeCsTrgXgSkjqQmqVA3MzEwFAMxE1APAWIp0LZILEiIJ4MFauGilUBcTcQd0LFJ3aZMRQXqsBxVooEQ2qCFENOphSYH5PMDBZLTGFmiIpgAIuBaJA8SJwSIALEjBRidAAASXYhWw==');
Result := (FindDTM(CollectionBox2, x, y, 448, 280, 487, 315));
FreeDTM(CollectionBox2);
end;

function InPinGE(Pin: string): Boolean; //Ripped out of the SRL - Made minor changes to work with the GE interface instead of the bank.
var
Tx, Ty, X, Y, H, I, J, Tries, ColorCount : Integer;
Boxes: array of TBox;
begin
Result := False;
if not PinScreen then Exit;

if (GetNumbers(Pin) <> Pin) then
begin
srl_Warn('InPin', '''' + Pin + ''' is not a valid Pin', warn_AllVersions);
Exit;
end;
if (Length(Pin) <> 4) then
begin
srl_Warn('InPin', 'Pin must be 4 digits long', warn_AllVersions);
Exit;
end;

Boxes := [IntToBox(37, 107, 100, 170), IntToBox(127, 107, 190, 170), IntToBox(217, 107, 280, 170), IntToBox(307, 107, 370, 170),
IntToBox(37, 179, 100, 242), IntToBox(127, 179, 190, 242), IntToBox(217, 179, 280, 242),
IntToBox(37, 251, 100, 314), IntToBox(127, 251, 190, 314), IntToBox(217, 251, 280, 314)];

while PinScreen do
begin
for I := 1 to 4 do
begin
if not PinScreen then Break;

ColorCount := CountColorTolerance(clWhite, 150, 80, 380, 100, 10);
// Counts the "Now click the NUM_X digit.". This is used later on.

GetMousePos(X, Y);
if (FindText(Tx, Ty, Pin[I], UpCharsEx, 30, 100, 383, 319)) then
begin
H := High(Boxes);
for J := 0 to H do
if IntInBox(Tx, Ty, Boxes[J]) then
begin
with Boxes[J] do
if PinScreen then
MouseBox(x1, y1, x2, y2, 1);
Break;
end;
end else
begin
H := High(Boxes);
for J := 0 to H do
if IntInBox(X, Y, Boxes[J]) then
begin
with Boxes[J] do
if PinScreen then
MouseBox(x1, y1, x2, y2, 1);
Break;
end;
end;

Wait(100);
while (CountColorTolerance(clWhite, 150, 80, 380, 100, 10) = ColorCount) do
Wait(500);

Wait(RandomRange(300, 600));

if InGE then
begin
Result := True;
Exit;
end;
end;

WaitFunc(@InGE, 50, 300);

ClickContinue(True, True);
while not FindColor(Tx, Ty, 0, 7, 460, 69, 474) do
begin
Wait(500);
if not LoggedIn then
Exit;
end;
Inc(Tries);

if Tries > 2 then
begin
srl_Warn('InPin', '''' + Pin + ''' is not the correct Pin', warn_AllVersions);
ClosePinScreen;
Exit;
end;

end;
Result := InGE;
end;

function OpenGENPCEx: Boolean; //Ripped out of the SRL - Slightly edited version of Home's OpenBankNPC
var
NPCBox :TBox;
Colors, NPCArray :TPointArray;
ATPA: T2DPointArray;
MSNPC, NPCPoint :TPoint;
TempCTS, C, HiNPC, II, I :Integer;
begin
Result := False;
Result := (InGE) or (PinScreen);
If Result then Exit;

NPCArray := GetMinimapDots('NPC');
HiNPC := High(NPCArray);

If Length(NPCArray) = 0 then Exit;
SortTPAFrom(NPCArray, Point(MMCX, MMCY));
for I := 0 to HiNPC do
begin
NPCPoint := MMToMS(NPCArray[I])
If NPCPoint = Point(-1, -1) then Continue;
NPCBox := IntToBox(NPCPoint.X - 40, NPCPoint.Y - 40, NPCPoint.X + 40, NPCPoint.Y + 40)
If PixelShift(NPCBox, 200) > 500 then Continue;

TempCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.13, 1.52);
FindColorsTolerance(Colors, 6852026, NPCBox.X1, NPCBox.Y1, NPCBox.X2, NPCBox.Y2, 13);
ATPA := TPAToATPAEx(Colors, 15, 20);
SortATPASize(ATPA, True);

for II := 0 to High(ATPA) do
begin
MSNPC := MiddleTPA(ATPA[II]);
MMouse(MSNPC.X, MSNPC.Y, 3, 3);
If WaitUpTextMulti(['rand Exchange clerk'], 200) then
begin
Mouse(MSNPC.X, MSNPC.Y, 1, 1, False);
If WaitOptionMulti(['xchange G'], 300) then
MarkTime(c);
Repeat
Wait(RandomRange(50, 100));
Until (InGE) or (PinScreen) or (TimeFromMark(C) > 4500);
if (Players[CurrentPlayer].Pin <> '') then
InPinGE(Players[CurrentPlayer].Pin);
Result := (InGE) or (PinScreen);
If Result then
begin
ColorToleranceSpeed(TempCTS);
Exit;
end
else
ColorToleranceSpeed(TempCTS);
end;
end;
end;
end;

procedure ClickBack;
var
i: integer;
begin
For i := 0 to 2 do
If (isBuyOpen or isSellOpen) then
begin
Mouse(45, 298, 10, 10, True); //Clicks the arrow to get back
Wait(Random(1000));
end else
break;
end;

function isInGE: boolean;
var
i: integer;
begin
If InGE then
begin
result := True
end else
begin
result := False
end;
For i := 0 to 4 do
begin
If InGE then
begin
Break;
end else
SetAngle(True);
MakeCompass(Random(360));
OpenGENPCEx;
Wait(1000 + Random(500));
end;
If not InGE then
begin
Writeln('Could not find a Grand Exchange Clerk. Make sure you start near one');
TerminateScript;
end;
end;

function GetNumerals(const s: string): string; //Credit to Echo_
var
i, j: Integer;
numArray: array of string;
begin
numArray := ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
for i := 1 to High(s) do
for j := 0 to High(numArray) do
begin
if not (s[i] = numArray[j]) then Continue;
Result := Result + s[i];
end;
end;

function GetMidPrice: integer;
begin
result := StrToInt(GetNumerals(GetTextAtExWrap(296, 186, 440, 199, 0, 10, 1, 6400255, 5, 'UpCharsEx')));
end;

function GetMidPrice1: integer;
begin
result := StrToInt(GetNumerals(GetTextAtExWrap(296, 186, 440, 199, 0, 10, 1, 6400255, 5, 'UpCharsEx')));
end;

function GetQuantity: integer;
begin
result := StrToInt(GetNumerals(GetTextAtExWrap(98, 183, 211, 200, 0, 10, 1, 6400255, 5, 'UpCharsEx')));
end;

function BoughtFor: integer;
begin
result := StrToInt(GetNumerals(GetTextAtExWrap(117, 287, 327, 300, 0, 10, 1, 39372, 5, 'StatChars')));
end;

function SoldFor: integer;
begin
result := StrToInt(GetNumerals(GetTextAtExWrap(117, 287, 327, 300, 0, 10, 1, 39372, 5, 'StatChars')));
end;

Procedure SetPrice(State, Percentage, Price: extended);
var
i, i1: integer;
decimal: Extended;
begin
If State = 0 then
begin
decimal := round(GetMidPrice * ((100 - Percentage) / 100))
end else
begin
If State = 1 then
begin
decimal := round(GetMidPrice1 * ((100 + Percentage) / 100))
end else
If State = 2 then
begin
decimal := Price
end;
end;
For i := 0 to 4 do
begin
If (GetMidPrice = decimal) then
begin
Break;
end else
If not isSetOpen(0) then
begin
writeln('Could not find the set price box. Terminating');
TerminateScript;
end else
for i1 := 0 to 4 do
begin
Mouse(385, 222, 10, 10, True); //Clicks on the '...' to enter a custom price
wait(1500 + Random(500));
If (GetTextAtEx(124, 393, 10, UpCharsEx, False, False, 0, 10, 0, 810, False, tr_AllChars) = ('Enter the price you wish to sell for: |')) or (GetTextAtEx(124, 393, 10, UpCharsEx, False, False, 0, 10, 0, 810, False, tr_AllChars) = ('Enter the price you wish to buy for: |')) then
begin
TypeSendEx(FloatToStr(decimal), True);
Wait(500 + Random(500));
If (GetMidPrice = decimal) then
begin
break;
end;
end else
writeln('Failed to set price');
end;
end;
If isConfirmBoxVisible then
begin
Mouse(263, 290, 10, 10, True); //Clicks confirm
end else
begin
writeln('Could not detect the confirm box, terminating.');
TerminateScript;
end;
end;

Procedure SetQuantity(Quantity: integer);
var
i, i1: integer;
begin
For i := 0 to 4 do
begin
If (GetQuantity = Quantity) then
begin
Break;
end else
begin
If not isSetOpen(1) then
begin
writeln('Could not find the set quantity box. Terminating');
TerminateScript;
end else
begin
for i1 := 0 to 4 do
begin
Mouse(238, 221, 10, 10, True); //Clicks on the '...' to enter a custom price
wait(1000 + Random(500));
If (GetTextAtEx(124, 393, 10, UpCharsEx, False, False, 0, 10, 0, 810, False, tr_AllChars) = 'Enter the amount you wish to purchase: |') or (GetTextAtEx(124, 393, 10, UpCharsEx, False, False, 0, 10, 0, 810, False, tr_AllChars) = 'Enter the amount you wish to sell: |') then
begin
TypeSendEx(IntToStr(Quantity), True);
Wait(500 + Random(500));
If (GetQuantity = Quantity) then
begin
break;
end;
end else
writeln('Could not detect the text');
end;
end;
end;
end;
end;

Procedure SetToAll;
begin
If isSetOpen(2) then
begin
Mouse(194, 220, 5, 5, True);
wait(1000 + Random(500));
end else
Writeln('Could not find the set to All box');
end;

procedure ItemCollection;
var
i: integer;
begin
For i := 0 to 2 do
begin
If isCollectionBoxEmpty1 then
begin
break;
end else
begin
Mouse(463, 293, 10, 10, True); //clicks on the second item to collect it
Wait(500 + Random(500));
If isCollectionBoxEmpty2 then
begin
break;
end;
end;
end;
For i := 0 to 4 do
begin
If not InGE then
begin
Mouse(416, 296, 10, 10, True); //Clicks on the first item to collect it
Wait(500 + Random(500));
end else
begin
break;
end;
end;
end;

procedure GEBuyOrSellAtEx(State, Spot: integer); //0 is Buy, 1 is Sell
var
x, y, i, XB, YB, XS, YS: integer;
begin
Case Spot of
1: begin
XB := 72;
YB := 152;
XS := 140;
YS := 146;
end;
2: begin
XB := 227;
YB := 151;
XS := 290;
YS := 152;
end;
end;
If State = 0 then
begin
x := XB
y := YB
end else
begin
x := XS
y := YS
end;
If InGE and (not isBuyOpen) or (not isSellOpen) then
For i := 0 to 4 do
begin
Mouse(x, y, 5, 5, True);
Wait(1000 + random (500));
If isBuyOpen or isSellOpen then
break;
end;
end;

function FindHigh(Spot, Colour: integer; Percentage: extended; Item: string): integer;
var
x, y, i, i1, n, c, x1, y1: integer;
isFound: boolean;

begin
If isBuyOpen or isSellOpen then
begin
ClickBack;
end;
While not isInGE do
begin
isInGE;
end;
For i := 0 to 4 do
begin
If GEIsSpotFree(Spot) then
begin
break;
end else
begin
GERecoverAtEx(Spot, True);
end;
end;
For i := 0 to 2 do
begin
If isBuyOpen then
begin
break;
end;
If InGE then
begin
GEBuyOrSellAtEx(0, Spot);
Wait(500 + Random(500));
end else
begin
writeln('Not in GE');
TerminateScript;
end;
end;
If not isBuyOpen then
begin
Writeln('Could not get the buying screen open');
TerminateScript;
end;
For i := 0 to 2 do
begin
If isItemSearchOpen then
begin
break;
end else
begin
Mouse(125, 116, 10, 10, True);
Wait(1000 + Random(500));
end;
end;
i1 := 0
While (isFound = False) or (i1 < 6) do
begin
inc(i1)
isFound := False
If not (GetTextAtEx(25, 453, 10, SmallChars, False, False, 0, 10, 16777215, 810, False, tr_AllChars) = '*') then
begin
For i := 0 to 15 do
begin
TypeSendEx(chr(8), false);
If (GetTextAtEx(25, 453, 10, SmallChars, False, False, 0, 10, 16777215, 810, False, tr_AllChars) = '*') then
break;
end;
end;
TypeSendEx(Item, false);
Wait(2000 + Random(500));
n := 342
While n < 440 do
begin
If GetTextAtEx(65, n, 10, SmallChars, False, False, 0, 10, 23200, 810, False, tr_AllChars) = Item then
begin
isFound := True
x1 := 65 + 30
y1 := n + 6
Break;
end;
n := n + 16
end;
If isFound = True then
begin
break;
end;
If (n > 440) then
Writeln('Item not found in searchbox.');
end;
If not FindColorTolerance(x, y, Colour, 102, 95, 144, 130, 20) then //looks for the colour in the item icon thing
For i := 0 to 2 do
begin
Mouse(x1, y1, 10, 3, True); //Clicks on the item in the list
Wait(1000 + Random(1000));
If FindColorTolerance(x, y, Colour, 102, 95, 144, 130, 20) then
begin
break;
end else
writeln('Could not detect the items colour in the item slot');
end;
If not FindColorTolerance(x, y, Colour, 102, 95, 144, 130, 20) then
begin
TerminateScript;
end;
SetQuantity(1);
SetPrice(1, Percentage, 0);
MarkTime(c)
While not InGE do
begin
Wait(500);
If TimeFromMark(c) > 30000 then
begin
Writeln('Could not get to the GE main screen');
TerminateScript;
end;
end;
While not GEFinishedAt(Spot) do //Waits for the offer to complete
begin
Wait(500 + Random(500));
end;
If (GEFinishedAt(Spot)) then
For i := 0 to 5 do
begin
If isBuyOpen then
begin
break;
end else
begin
Mouse(103, 139, 20, 20, True); // Click on the trade offer once complete
Wait(1500 + random(1000));
end;
end;
If not isBuyOpen then
begin
Writeln('Could not get to the collection screen');
TerminateScript;
end;
BoughtFor1 := BoughtFor
SellPrice := BoughtFor1 - 1;
ItemCollection;
result := SellPrice
end;

function FindLow(Spot, Colour: integer; Percentage: extended): integer;
var
c, x, y, i: integer;

begin
While not isInGE do
begin
isInGE;
end;
For i := 0 to 4 do
begin
If GEIsSpotFree(Spot) then
begin
break;
end else
begin
GERecoverAtEx(Spot, True);
end;
end;
For i := 0 to 2 do
begin
If isSellOpen then
begin
break;
end;
If InGE then
begin
GEBuyOrSellAtEx(1, Spot);
Wait(500 + Random(500));
end else
begin
writeln('Not in GE');
end;
end;
If not isSellOpen then
begin
Writeln('Could not get the buying screen open');
TerminateScript;
end;
If not (FindColorTolerance(x, y, Colour, 103, 95, 143, 129, 20)) then //looks for the colour in the item icon thing
For i := 0 to 3 do
begin
If FindColorTolerance(x, y, Colour, MIX1, MIY1, MIX2, MIY2, 20) then
begin
If FindColorTolerance(x, y, Colour, 103, 95, 143, 129, 20) then
begin
break;
end;
Mouse(x, y, 5, 10, True); //Clicks on the item's coords
Wait(200 + Random(250));
end;
end;
SetQuantity(1);
SetPrice(0, Percentage, 0);
MarkTime(c)
While not InGE do
begin
Wait(500);
If TimeFromMark(c) > 30000 then
begin
Writeln('Could not get to the GE main screen');
TerminateScript;
end;
end;
While not GEFinishedAt(Spot) do //Waits for the offer to complete
begin
Wait(500 + Random(500));
end;
If (GEFinishedAt(Spot)) and (FindColorTolerance(x, y, 1999423, 38, 162, 169, 180, 20)) then
For i := 0 to 5 do
begin
If isSellOpen then
begin
break;
end else
begin
Mouse(103, 139, 20, 20, True); // Click on the trade offer once complete
Wait(1500 + random(1000));
end;
end;
If not isSellOpen then
begin
Writeln('Could not get to the collection screen');
TerminateScript;
end;
SoldFor1 := SoldFor
BuyPrice := SoldFor1 + 1;
ItemCollection;
result := BuyPrice
end;

Function FlipBuyPrice(Spot, Limit, Colour: integer; Item: string): integer;
var
x, y, i, n, c, i1, x1, y1: integer;
isFound: boolean;
begin
While not isInGE do
begin
isInGE;
end;
For i := 0 to 4 do
begin
If GEIsSpotFree(Spot) then
begin
break;
end else
begin
GERecoverAtEx(Spot, True);
end;
end;
For i := 0 to 2 do
begin
If isBuyOpen then
begin
break;
end;
If InGE then
begin
GEBuyOrSellAtEx(0, Spot);
Wait(500 + Random(500));
end else
begin
writeln('Not in GE');
end;
end;
If not isBuyOpen then
begin
Writeln('Could not get the buying screen open');
TerminateScript;
end;
For i := 0 to 2 do
begin
If isItemSearchOpen then
begin
break;
end else
begin
Mouse(125, 116, 10, 10, True);
Wait(1000 + Random(500));
end;
end;
i1 := 0
While (isFound = False) or (i1 < 6) do
begin
inc(i1)
isFound := False
If not (GetTextAtEx(25, 453, 10, SmallChars, False, False, 0, 10, 16777215, 810, False, tr_AllChars) = '*') then
begin
For i := 0 to 15 do
begin
TypeSendEx('', true);
If (GetTextAtEx(25, 453, 10, SmallChars, False, False, 0, 10, 16777215, 810, False, tr_AllChars) = '*') then
break;
end;
end;
TypeSendEx(Item, true);
Wait(2000 + Random(500));
n := 342
While n < 440 do
begin
If GetTextAtEx(65, n, 10, SmallChars, False, False, 0, 10, 23200, 810, False, tr_AllChars) = Item then
begin
isFound := True
x1 := 65 + 30
y1 := n + 6
Break;
end;
n := n + 16
end;
If isFound = True then
begin
break;
end;
If (n > 440) then
Writeln('Item not found in searchbox.');
end;
If not FindColorTolerance(x, y, Colour, 102, 95, 144, 130, 20) then //looks for the colour in the item icon thing
For i := 0 to 2 do
begin
Mouse(x1, y1, 10, 3, True); //Clicks on the item in the list
Wait(1000 + Random(1000));
If FindColorTolerance(x, y, Colour, 102, 95, 144, 130, 20) then
begin
break;
end else
writeln('Could not detect the items colour in the item slot');
TerminateScript;
end;
SetQuantity(Limit);
SetPrice(2, 0, BuyPrice);
MarkTime(c);
While not InGE do
begin
Wait(500);
If TimeFromMark(c) > 30000 then
begin
Writeln('Could not get to the GE main screen1');
TerminateScript;
end;
end;
While not GEFinishedAt(Spot) do //Waits for the offer to complete
begin
Wait(500 + Random(500));
If not LoggedIn then
LoginPlayer;
isInGE;
end;
If (GEFinishedAt(Spot)) and (FindColorTolerance(x, y, 1999423, 38, 162, 169, 180, 20)) then
For i := 0 to 5 do
begin
If isBuyOpen then
begin
break;
end else
begin
Mouse(103, 139, 20, 20, True); // Click on the trade offer once complete
Wait(1500 + random(1000));
end;
end;
If not isBuyOpen then
begin
Writeln('Could not get to the collection screen');
TerminateScript;
end;
Result := (BuyPrice * Limit);
ItemCollection;
MarkTime(c)
While not InGE and isBuyOpen do
begin
Wait(500 + Random(500));
If TimeFromMark(c) > 30000 then
begin
Writeln('Could not get to the GE main screen2');
TerminateScript;
end;
end
end;

function FlipSellPrice(Spot, Colour, Limit: integer): integer;
var
x, c, y, i: integer;

begin
While not isInGE do
begin
isInGE;
end;
For i := 0 to 4 do
begin
If GEIsSpotFree(Spot) then
begin
break;
end else
begin
GERecoverAtEx(Spot, True);
end;
end;
For i := 0 to 2 do
begin
If isSellOpen then
begin
break;
end;
If InGE then
begin
GEBuyOrSellAtEx(1, Spot);
Wait(500 + Random(500));
end else
begin
writeln('Not in GE');
end;
end;
If not isSellOpen then
begin
Writeln('Could not get the buying screen open');
TerminateScript;
end;
If not (FindColorTolerance(x, y, Colour, 103, 95, 143, 129, 20)) then //looks for the colour in the item icon thing
For i := 0 to 3 do
begin
If FindColorTolerance(x, y, Colour, MIX1, MIY1, MIX2, MIY2, 20) then
begin
If FindColorTolerance(x, y, Colour, 103, 95, 143, 129, 20) then
begin
break;
end;
Mouse(x, y, 5, 10, True); //Clicks on the item's coords
Wait(200 + Random(250));
end;
end;
SetToAll;
SetPrice(2, 0, SellPrice);
MarkTime(c);
While not InGE do
begin
Wait(500);
If TimeFromMark(c) > 30000 then
begin
Writeln('Could not get to the GE main screen1');
TerminateScript;
end;
end;
While not GEFinishedAt(Spot) do //Waits for the offer to complete
begin
Wait(500 + Random(500));
If not LoggedIn then
LoginPlayer;
isInGE;
end;
If (GEFinishedAt(Spot)) and (FindColorTolerance(x, y, 1999423, 38, 162, 169, 180, 20)) then
For i := 0 to 5 do
begin
If isSellOpen then
begin
break;
end else
begin
Mouse(103, 139, 20, 20, True); // Click on the trade offer once complete
Wait(1500 + random(1000));
end;
end;
If not isSellOpen then
begin
Writeln('Could not get to the collection screen');
TerminateScript;
end;
Result := (SellPrice * Limit);
ItemCollection;
MarkTime(c)
While not InGE and isSellOpen do
begin
Wait(500 + Random(500));
If TimeFromMark(c) > 30000 then
begin
Writeln('Could not get to the GE main screen4');
TerminateScript;
end;
end
end;

Function ifBuyPrice: boolean;
begin
If ((FindHigh(ITEM1_SPOT, ITEM1_COLOUR, ITEM1_PERCENTAGEABOVE, ITEM1_Name) - FindLow(ITEM1_SPOT, ITEM1_COLOUR, ITEM1_PERCENTAGEBELOW)) > 0) then
begin
result := true;
incprofit := true;
end else
result := false;
incprofit := false;
end;

procedure Progress_Report;
begin
ClearDebug;
Writeln('[---------------HT BaaFlys Grand Exchange Flipper---------------|');
Writeln('[Ran for: ' + TimeRunning + ']');
Writeln('[Total profit: ' + (IntToStr(Profit2)) + ']');
Writeln('[Profit per hour: ' + FloatToStr((3600 * Profit2) / (GetTimeRunning / 1000)) + ']');
end;

procedure Loop;

begin
repeat
If ifBuyPrice then
begin
writeln('Profitable - proceeding to buy')
FlipBuyPrice(ITEM1_SPOT, ITEM1_LIMIT, ITEM1_COLOUR, ITEM1_NAME);
FlipSellPrice(ITEM1_SPOT, ITEM1_COLOUR, ITEM1_LIMIT);
end else
begin
writeln('No profit - breaking');
Wait(round((ITEM1_REFRESH * 60000) + Random(5000)));
end;
Profit := ((SellPrice * ITEM1_LIMIT) - (BuyPrice * ITEM1_LIMIT)) - (BoughtFor1 - SoldFor1);
IncEx(Profit2, Profit);
Progress_Report;
until not LoggedIn
end;

begin
ClearDebug;
SetupSRL;
MouseSpeed := 10;
Smart_Server := 120;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
Profit := 0;
DeclarePlayers;
If not Loggedin then
begin
LoginPlayer;
Wait(4000 + Random(1000));
end;
Loop;
writeln('Logged out. Stopping script.');
TerminateScript;
end.

Shuttleu

2011-12-31 11:41:36

yes, although you seems to have a lot more begin and ends than needed

~shut

Main

2011-12-31 11:43:02

Very nice, complicated enough and you used tpa, dtm and very decent standards.

Yes!

HT BaaFly

2011-12-31 11:58:47

@ Shuttleu: the if then else function doesn't seem to work properly for me if i don't have the begins and ends everywhere. personally I think it makes the script look neater and you can see exactly what each statement does without much effort. thanks for your comment :)

@Main thanks a lot for the comment. just one thing, TPA is ripped from the srl :S I hope you still don't change your mind :P

jakeyboy29

2011-12-31 12:08:52

yea, as good as anything i could do, and youve been here a while too!

HT BaaFly

2011-12-31 12:12:13

thanks for the nice comment :)

Shuttleu

2011-12-31 12:31:47

From: HT BaaFly
@ Shuttleu: the if then else function doesn't seem to work properly for me if i don't have the begins and ends everywhere. personally I think it makes the script look neater and you can see exactly what each statement does without much effort. thanks for your comment :)

@Main thanks a lot for the comment. just one thing, TPA is ripped from the srl :S I hope you still don't change your mind :P


if you dont have a begin/end then make sure you dont put a semi-colon on the end
so this
function isSetOpen(State: integer): boolean;
var
x, y:integer;
begin
SetPriceBox := DTMFromString('mwQAAAHic42RgYLjLwsBwBorfQPEdKD4NxG+BOIaJgSEQiNOhGMQOAOIMJogcCKdHewNNYwRjMTExOBsVEwbYdOE0BQC2mgyY');
If State = 0 then
begin
Result := FindDTM(SetPriceBox, x, y, 370, 209, 404, 233);
end else
If State = 1 then
begin
Result := FindDTM(SetPriceBox, x, y, 220, 209, 254, 233);
end else
If State = 2 then
begin
Result := FindDTM(SetPriceBox, x, y, 179, 209, 213, 233);
end;
FreeDTM(SetPriceBox);
end;
can be changed to this
function isSetOpen(State: integer): boolean;
var
x, y:integer;
begin
SetPriceBox := DTMFromString('mwQAAAHic42RgYLjLwsBwBorfQPEdKD4NxG+BOIaJgSEQiNOhGMQOAOIMJogcCKdHewNNYwRjMTExOBsVEwbYdOE0BQC2mgyY');
if State = 0 then
Result := FindDTM(SetPriceBox, x, y, 370, 209, 404, 233)
else
if State = 1 then
Result := FindDTM(SetPriceBox, x, y, 220, 209, 254, 233)
else
if State = 2 then
Result := FindDTM(SetPriceBox, x, y, 179, 209, 213, 233);
FreeDTM(SetPriceBox);
end;

notice there is no semi-colon on the end of the line above "else"

~shut

HT BaaFly

2011-12-31 13:35:34

Oh, alright, I get it now, thanks a lot :)

Dynamite

2011-12-31 13:38:29

Are you going to be active?

HT BaaFly

2011-12-31 14:24:29

as long as this community stays active, I will :P

Dynamite

2011-12-31 14:43:43

Then it's a yes from me.

-Boom

HT BaaFly

2011-12-31 14:58:49

thanks, bro

Sabzi

2011-12-31 15:05:54

Fine, fine, yes. :)

HT BaaFly

2011-12-31 15:13:43

much appreciated :D

Scaper

2011-12-31 22:18:28

looks like you will be getting in with flying colors :)

Silent

2012-01-01 05:21:19

From: Shuttleu
if you dont have a begin/end then make sure you dont put a semi-colon on the end

[Snipped]

notice there is no semi-colon on the end of the line above "else"

~shut


Not gonna' lie, I didn't even know this. Learn something new every day eh?
Anyway:


Would love to see even more activity from you though!

HT BaaFly

2012-01-01 06:16:57

thanks for all the votes :)
Can the person that voted no explain to me what I have done wrong so that in the future I can improve on this aspect? thank you :P

Daniel

2012-01-01 06:37:58

No. Just kidding, yes.

HT BaaFly

2012-01-01 06:58:24

why is that?

Shuttleu

2012-01-01 07:00:15

he is playing with you

highlight his post and you will see

~shut

HT BaaFly

2012-01-01 07:02:59

haha thanks shuttleu but that doesn't help much :/ still don't know why he voted no

WT-Fakawi

2012-01-01 07:03:01

yaah.

HT BaaFly

2012-01-01 07:04:00

From: WT-Fakawi
yaah.


thanks, bud

Shuttleu

2012-01-01 07:04:42

tbh, at this point in time, you dont have much chance of not getting in

~shut

HT BaaFly

2012-01-01 07:05:55

From: Shuttleu
tbh, at this point in time, you dont have much chance of not getting in

~shut


still, i'm curious to know why I was voted no. he could have something interesting for me to learn, who knows :P

in that case, nvm :S

Shuttleu

2012-01-01 07:07:07

From: HT BaaFly
still, i'm curious to know why I was voted no. he could have something interesting for me to learn, who knows :P

in that case, nvm :S

might be a she… ;)
From: HT BaaFly
haha thanks shuttleu but that doesn't help much :/ still don't know why he voted no


he didnt vote no, he voted yes
however dont expect the person who said no to explain, some people are just like that

~shut

HT BaaFly

2012-01-01 07:33:36

From: Shuttleu
might be a she… ;)


he didnt vote no, he voted yes
however dont expect the person who said no to explain, some people are just like that

~shut


I've misinterpreted this, haha xD

Before Daniel's post, I wrote asking the person that voted no to explain why and when daniel replied with no, I assumed he was the person that voted against me and and refused to explain why

big misunderstanding, sorry

edit: also, in the English language, when the gender of the person is unknown, it is acceptable to use the male pronoun ;)

Main

2012-01-01 07:39:53

This guy should be a example for all the new members. perhaps we should have thread that documents every one that has became srl member at in a specific month and let the non srl members see that they do have a lot of chance of getting it:P

HT BaaFly

2012-01-01 07:44:11

you're making me blush :redface:

Hobbit

2012-01-03 15:41:58

Poll is quite obvious, so welcome!

:)