SRL Archive - News and General

Exception in Script: Unable to find file 'SRL/SRL.scar' used from ' HELP!!!!!


10wnu9

2012-01-19 17:51:30

Jesus this is driving me insane, although I'm only a day new to this :duh:!

Well, got alot of scripts working, I used to use RSBUDDY until the reflection bot clutterfluster so now I resort to the handicraft of you awesome scripters.

Ok so I always get the error :- Exception in Script: Unable to find file 'SRL/SRL.scar' used from ''

What am I doing or what is going wrong..

:google: would be so funny right now but seriously can you help me :f:!

Thanks My sincere runescape botters.


Oh and sorry if this is the wrong section, I'm new :P!

kevin33

2012-01-19 17:53:00

Whatever script you are using isnt updated to SRL5. What script are you using????

Deadly Serious

2012-01-19 17:56:07

Change all the ".scar" to ".simba"

10wnu9

2012-01-19 17:56:23

Oh geez, can I downgrade XD, all scripts I want are now screwed :).

YoHoJo

2012-01-19 17:57:35

Post in the script thread and ask the creator to update it to SRL 5, or you can do it yourself.
Change all .scar to .simba, and try again, and tell us what error you get.
Should only take about 5 minutes to upgrade a script form srl 4 to 5 and have it working again.

kevin33

2012-01-19 17:57:45

Well post on the scripts thread asking for an update or post one on this thread and I will try to help you
E. Ninjad by yoho

10wnu9

2012-01-19 18:30:49

Ahhhhhhhhhh what the hell :duh:

I am so stupid or simba hates me.

I can't get it to load!?

YoHoJo

2012-01-19 18:38:47

What does that mean…?
What error are you getting, or what exactly is the problem?

kevin33

2012-01-19 18:39:19

From: 10wnu9
Ahhhhhhhhhh what the hell :duh:

I am so stupid or simba hates me.

I can't get it to load!?


Well let us know what you need help with lol. Post the script and anything that doesnt work. Like errors and the likes.

10wnu9

2012-01-19 18:40:04

[Error] (1:1): Unexpected end of file at line 0
Compiling failed.

get this on some too for feck sake.

YoHoJo

2012-01-19 18:40:53

copy/paste the code here, put Simba tags around it.

10wnu9

2012-01-19 18:42:44

Damn I wanna be good, make a script, but jesus they take too long.

Now I wan't to use a script and they don't load.

Arrgh…I was getting this Exception in Script: Unable to find file 'SRL/SRL.scar' used from ''

And I converted all SCARS I seen to Simba and The script is…

http://villavu.com/forum/attachment.php?attachmentid=12705&d=1325283215

But theres more than that, that's a flip merchant.

kevin33

2012-01-19 18:43:10

You need to restate all your procedures and functions in your main loop at the end of the script, FreeSRL and DTMs and the likes, and make sure the last thing you have is a "end."
An end with a period. All other ends in the script must end with a ;

10wnu9

2012-01-19 18:43:47

I'm not getting what you mean, It's either I feel like I'm stupid so I want to refuse what you say or I'm just stupid..

10wnu9

2012-01-19 18:45:02

I reckon I should quit botting and get on with school work?

I am useless.

kevin33

2012-01-19 18:45:15

This compiles:
But this needs to be converted to SRL5

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.

10wnu9

2012-01-19 18:47:02

This is making me so pissed off my PS3 might be on the lawn when I wake up.

kevin33

2012-01-19 18:48:11

I will try to convert it for you hold on. YOHO might beat me to it

Kyle Undefined

2012-01-19 18:49:38

If you have TV, I can walk you through it.

10wnu9

2012-01-19 18:51:05

Meh, Guy's your so helpful.

I wish I was good, I won't give in I suppose.

I want to make a script Within the next 3 years.

YoHoJo

2012-01-19 18:54:56

Watch the video tutorials in my sig, you'll be scipting withing a few hours.

Also, listen/respond to our posts, we are trying to help you get a script running!

kevin33

2012-01-19 18:56:01

Lol a lot of the functions need to be changed because they are old and not combatible according to my computer alot more to do then I thought. May take a little longer Soz Never dealt with all these diffet procedures and functions for the ge.

10wnu9

2012-01-19 18:58:01

Yeah, Kevin IS being really helpful, He is trying to re-script it if you get me, and I'll Check your sig stuff out tomorrow I am too tired for the stress tonight, I already tried scripting, managed to make it spam hello then gave in, I will never make like a Woodcutting script this month fully functioning!?

10wnu9

2012-01-19 18:59:02

Kevin Your doing more than enough, In my eyes you could well be a admin :'D! :spot:

kevin33

2012-01-19 19:03:06

Lol I try. Just need Yohos or Kyles help here. Ill post a pic but the grand exchange tab pops up and tells me I need to fix it?? Never seen this before or had to tamper with he function list.

[ATTACH]13221[/ATTACH]

Kyle Undefined

2012-01-19 19:03:37

If you TV'd me, it would of been setup 20 minutes ago :p

Kevin, add a "}" at the end of the stars.

kevin33

2012-01-19 19:04:16

No idea what TV is and therefore I dont have it :p

10wnu9

2012-01-19 19:05:02

Right, Rookie talking, Delete an asterix, one of the highlighted one's tell me where that get's you, I had the same problem.

Kyle Undefined

2012-01-19 19:05:08

TV = TeamViewer, also, check my post above for your fix. I was talking to the guy who made the thread. :)

10wnu9

2012-01-19 19:06:05

Ignore me Kyle is better!!!

kevin33

2012-01-19 19:07:50

Actually yes I do have teamviewer. I just got it a couple days ago lol. Hence I dont know the TV abbreviation
Also thanks

Kyle Undefined

2012-01-19 19:11:39

I was talking to 10wnu9 about TV, since he was having the issue :p

kevin33

2012-01-19 19:13:02

LOL I know but still I felt I should know what it was so I know for next time.

10wnu9

2012-01-19 19:16:33

Haha, don't get to heat' up about it :), anyway's hows It going Kev? You've been so helpful!

kevin33

2012-01-19 19:18:02

1 error and I think were good.
[Error] C:\Simba\Includes\srl/srl/misc/grandexchange.simba(634:29): Type mismatch at line 633
Compiling failed.

function GESell(Price, Quantity: string; InvSpot: integer): boolean;
var
free :integer;
MouseItem: boolean;
begin
if not InGE then exit;
if not GEFindFreeSpot(free) then exit;

if GESellAt(free) then
begin
wait(100+Random(100));
MouseItem(InvSpot, true);
wait(200+Random(100));
GESetPrice(Price);
wait(200+Random(100));
GESetQuantity(Quantity);
wait(200+Random(100));
Result := GEConfirmOffer;
end;
end;

10wnu9

2012-01-19 19:19:37

Hmmm, So now what XD.

You've worked so hard, Have a break?

Dude go get a cuppa or a nice can or whatever your taste prefers.

Can we Solve this issue?

kevin33

2012-01-19 19:21:01

Kyle will come to the rescue lol. And Im good. Thats all I do for now. Help ppl on the forums. Exams soon so cant script atm.

10wnu9

2012-01-19 19:22:23

Thank's, You are a Beast.

Maybe add me if we can on this forum?

Contacts for support, I promise I won't bug you though.

10wnu9

2012-01-19 19:23:26

Thank's, You are a Beast.

Maybe add me if we can on this forum?

Contacts for support, I promise I won't bug you though.

Kyle Undefined

2012-01-19 19:23:56

I don't get that error when compiling the merch script you posted, what did you change?

kevin33

2012-01-19 19:25:05

Lol its fine. I dont mind. Hopefully this script will work for you after its fixed. IDK if this all will fix it because so far all I have fixed has been the FunctionList lol. Maybe it needs to be fixed to make the script work in SRL5 but we will have to wait and see.

Kyle- Ok well I switched the top to simba instead of scar. Then I guess I changed something in the grandexchange function list.
I added MouseItem: boolean; to the variables in the list (the last function)
Now I get same error for the wait above it.

10wnu9

2012-01-19 19:27:19

Maybe we should let this go for now?

I'll get back to you someother day?

Kyle Undefined

2012-01-19 19:31:29

Change your grandexchange.simba with this:

//------------------------------------------------------------------------//
//-- SRL Resource Library --//
//-- ? Grand Exchange Routines --//
//------------------------------------------------------------------------//
// * function InGE: boolean; // * by Rasta Magician
// * function GEIsMember: boolean; // * by Rasta Magician
// * function GESellMenu: boolean; // * by Rasta Magician
// * function GEBuyMenu: boolean; // * by Rasta Magician
// * procedure GEMenuExit; // * by Rasta Magician
// * function GESpotToTBox(spot: integer): TBox; // * by Rasta Magician
// * function GEIsSpotFree(spot: integer):boolean; // * by Rasta Magician
// * function GEFinishedAt(spot: integer): boolean; // * by Rasta Magician
// * procedure GERecoverAtEx(spot: integer; abort:boolean); // * by Rasta Magician
// * procedure GERecoverAt(spot: integer); // * by Rasta Magician
// * procedure GERecoverFinishedAt(spot: integer); // * by Rasta Magician
// * procedure GEAbortAll; // * by Rasta Magician
// * procedure GERecoverAll; // * by Rasta Magician
// * procedure GERecoverFinished; // * by Rasta Magician
// * function GEFindFreeSpot(var spot:integer): boolean; // * by Rasta Magician
// * function GESellAt(spot: integer): boolean; // * by Rasta Magician
// * function GEBuyAt(spot: integer): boolean; // * by Rasta Magician
// * function GESetPrice(value: string): boolean; // * by Rasta Magician
// * procedure GESetQuantity(Q: string); // * by Rasta Magician
// * function GEConfirmOffer: boolean; // * by Rasta Magician
// * function GEBuy(What, Price, Quantity: string): boolean; // * by Rasta Magician
// * function GESell(Price, Quantity: string; InvSpot: integer): boolean; // * by Rasta Magician

{*******************************************************************************
function InGE: boolean;
By: Rasta Magician
Description: Checks if we are in GE
*******************************************************************************}
function InGE: boolean;
var
x, y, GEIN: integer;
begin
GEIN := DTMFromString('78DA636C6360607067C00A1861F47422D4EC2' +
'242CD3722D4F0311256A345580D00826F04BE');
Result := FindDTM(GEIN,x,y,127, 61,393, 75);
FreeDTM(GEIN);
end;

{*******************************************************************************
function GEIsMember: boolean;
By: Rasta Magician
Description: Checks if it is a member account using GE
*******************************************************************************}
function GEIsMember: boolean;
begin
if not InGE then exit;
if GetColor(411, 167) <> srl_outline_black then
if GetColor(410, 155) <> 5199452 then
begin
Result := true;
exit;
end;

if GetColor(411, 167) <> 5199452 then //to avoid jagex moving 1px
if GetColor(410, 155) <> srl_outline_black then
begin
Result := true;
exit;
end;

Result := false;
end;

{*******************************************************************************
function GESellMenu: boolean;
By: Rasta Magician
Description: Checks if we are in the sell menu
*******************************************************************************}
function GESellMenu: boolean;
begin
if not InGE then exit;
Result := (GetColor(187, 73) = 45055);
end;

{*******************************************************************************
function GEBuyMenu: boolean;
By: Rasta Magician
Description: Checks if we are in the buy menu
*******************************************************************************}
function GEBuyMenu: boolean;
begin
if not InGE then exit;
Result := (GetColor(186, 74) = 61385);
end;

{*******************************************************************************
procedure GEMenuExit;
By: Rasta Magician
Description: Exits the Buy or Sell menu
*******************************************************************************}
procedure GEMenuExit;
var i, x:integer;
begin
if not InGE then exit;
if not GESellMenu then
if not GEBuyMenu then
exit;

MMouse(40, 291, 18, 9);

for i:= 0 to 5 do
begin
wait(100);
if IsUpText('ack') then break;
end;

if IsUpText('ack') then
begin
GetMousePos(x, i);
Mouse(x, i, 0, 0, true);
for i:= 0 to 5 do
begin
wait(150);
if not GESellMenu then
if not GEBuyMenu then
break;
end;
end;

end;

{*******************************************************************************
function GESpotToTBox(spot: integer): TBox;
By: Rasta Magician
Description: Returns the coords of a box in GE
*******************************************************************************}
function GESpotToTBox(spot: integer): TBox;
var
i, x1, x2, y1, y2: integer;
begin
{
box width: 140
box height: 112
gap hor: 16
gap ver: 8
}
if spot > 3 then
i := spot - 3 - 1
else
i := spot - 1 ;

x1 := 32 + (16 + 140)*i;
x2 := 172 + (16 + 140)*i;

if spot > 3 then
i := 1
else
i := 0;

y1 := 82 + (112 + 8)*i;
y2 := 194 + (112 + 8)*i;

Result := IntToBox(x1, y1, x2, y2);
end;

{*******************************************************************************
function GEIsSpotFree(spot: integer):boolean;
By: Rasta Magician
Description: Checks if a spot is available for buying/selling
*******************************************************************************}
function GEIsSpotFree(spot: integer):boolean;
var TB: TBox;
begin
if not InGE then exit;
if spot > 2 then
if not GEIsMember then
exit;

TB := GESpotToTBox(spot);
Result := (GetColor(TB.x1 + 9, TB.y2 - 30) <> 0);
writeln('coords: '+IntToStr(TB.x1+9)+', '+ IntToStr(TB.y2 -30));
end;

{*******************************************************************************
function GEFinishedAt(spot: integer): boolean;
By: Rasta Magician
Description: Checks if a trade has been concluded at spot: spot
*******************************************************************************}
function GEFinishedAt(spot: integer): boolean;
var TB: TBox;
begin
if not InGE then exit;
if spot > 2 then
if not GEIsMember then exit;

if not GEIsSpotFree(spot) then
begin
TB := GESpotToTBox(spot);
Result := ( GetColor(TB.x1 + 103, TB.y2 - 20) = 1999423 );
end;
end;

{*******************************************************************************
procedure GERecoverAtEx(spot: integer; abort:boolean);
By: Rasta Magician
Description: Collects the items traded received at a certain spot
Aborts the trade is boolean abort is set to true
*******************************************************************************}
procedure GERecoverAtEx(spot: integer; abort:boolean);
var
TB: TBox;
i, x, y: integer;
begin
if not InGE then exit;
if GEIsSpotFree(spot) then exit;
if spot > 2 then
if not GEIsMember then
exit;

TB := GESpotToTBox(spot);
MouseBox(TB.x1, TB.y1, TB.x2, TB.y2, 1);
wait(200);

for i:= 0 to 10 do
begin
if (GESellMenu)or(GEBuyMenu) then
break;
wait(150);
end;

if abort then
if (GetColor(359, 312) <> 1999423) then
begin

MMouse(364, 285, 5, 5); //moving to button
wait(100);

for i:= 0 to 5 do // waiting text
begin
if IsUpText('bort') then break;
wait(100);
end;

if IsUpText('bort') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
end;

for i:= 0 to 10 do //waiting until aborted
begin
wait(100);
if (GetColor(202, 309) = 1048714) then break;
end;
wait(200+Random(300));
end;

//collecting spot 1 //
MMouse(416, 299, 5, 5);

for i:= 0 to 5 do // waiting text
begin
if IsUpText('ollect') then break;
wait(100);
end;

if IsUpText('ollect') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
end;

wait(100+Random(200));

//collecting spot 1 //

if (GetColor(467, 298) <> 2176579) then // spot 2
begin
MMouse(467, 298, 5, 5);

for i:= 0 to 5 do // waiting text
begin
if IsUpText('ollect') then break;
wait(100);
end;

if IsUpText('ollect') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
end;

wait(100+Random(200));

end;

for i:=0 to 10 do
begin
wait(150);
if not GESellMenu then
if not GEBuyMenu then
break;
end;

GEMenuExit; //just if something went wrong
end;

{*******************************************************************************
function procedure GERecoverAt(spot: integer);
By: Rasta Magician
Description: Recovers items at spot: spot, does not abort the trade
*******************************************************************************}
procedure GERecoverAt(spot: integer);
begin
GERecoverAtEx(spot, false);
end;

{*******************************************************************************
procedure GERecoverFinishedAt(spot: integer);
By: Rasta Magician
Description: Recovers items at spot: spot if the trade is concluded
*******************************************************************************}
procedure GERecoverFinishedAt(spot: integer);
begin
if not InGE then exit;
if GEFinishedAt(spot) then
GERecoverAtEx(spot, false);
end;

{*******************************************************************************
procedure GEAbortAll;
By: Rasta Magician
Description: Aborts and recovers all current trades
*******************************************************************************}
procedure GEAbortAll;
var
i:integer;
begin
for i:= 1 to 6 do
GERecoverAtEx(i, true);
end;

{*******************************************************************************
procedure GERecoverAll;
By: Rasta Magician
Description: Recovers all current trades, does not abort
*******************************************************************************}
procedure GERecoverAll;
var
i:integer;
begin
for i:= 1 to 6 do
GERecoverAt(i);
end;

{*******************************************************************************
procedure GERecoverFinished;
By: Rasta Magician
Description: Recovers all finished trades
*******************************************************************************}
procedure GERecoverFinished;
var
i:integer;
begin
for i:= 1 to 6 do
GERecoverFinishedAt(i);
end;

{*******************************************************************************
function GEFindFreeSpot(var spot:integer): boolean;
By: Rasta Magician
Description: Finds a free spot to trade in
*******************************************************************************}
function GEFindFreeSpot(var spot:integer): boolean;
var
i:integer;
begin
if not InGE then exit;

Result := false;
spot := 0;

for i:= 1 to 6 do
if GEIsSpotFree(i) then
begin
spot := i;
Result := true;
break;
end;
end;

{*******************************************************************************
function GESellAt(spot: integer): boolean;
By: Rasta Magician
Description: Presses the sell button at spot: spot
*******************************************************************************}
function GESellAt(spot: integer): boolean;
var
TB: TBox;
x, y: integer;
begin
if not InGE then exit;
if not GEIsSpotFree(spot) then
begin
writeln('space is not free!');
exit;
end;

TB := GESpotToTBox(spot);
MMouse(TB.x1 + 100, TB.y1 + 65, 5, 5);
wait(150+Random(75));

if IsUpText('ell') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
end;

for x:= 0 to 9 do
begin
wait(100);
if GESellMenu then break;
end;

Result := GESellMenu;
end;

{*******************************************************************************
function GEBuyAt(spot: integer): boolean;
By: Rasta Magician
Description: Presses the buy button at spot: spot
*******************************************************************************}
function GEBuyAt(spot: integer): boolean;
var
TB: TBox;
x, y: integer;
begin
if not InGE then exit;
if not GEIsSpotFree(spot) then
begin
writeln('space is not free!');
exit;
end;

TB := GESpotToTBox(spot);
MouseBox(TB.x1 + 35, TB.y1 + 50, TB.x1 + 65, TB.y1 + 80, 3);
wait(150+Random(75));

if IsUpText('Buy') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
end;

for x:= 0 to 9 do
begin
wait(100);
if GEBuyMenu then break;
end;

Result := GEBuyMenu;
end;

{*******************************************************************************
function GESetPrice(value: string): boolean;
By: Rasta Magician
Description: Sets the price of an item.
'0', 'min' - Minimum Value
'1', 'med' - Market Value
'2', 'max' - Max value
Other - Exact value
*******************************************************************************}
function GESetPrice(Value: Variant): boolean;
begin

if not InGE then exit;
if not GESellMenu then
if not GEBuyMenu then
exit;

if value = 'min' then value := 0;
if value = 'med' then value := 1;
if value = 'max' then value := 2;

wait(100+Random(50));

case value of
1: MouseBox(269, 208, 304, 232, 1); // min price
2: begin end; // market price
3: MouseBox(376, 210, 408, 233, 1); // max price
else begin
MouseBox(429, 209, 462, 234, 1);
wait(100+Random(100));
TypeSend(IntToStr(value));
wait(200+Random(100));
if IsChatBoxTextAnyLine('price range', clblack) then
begin
writeln('wrong price! Out of Price Range!');
GEMenuExit;
end;
end;
end;

Result := true;
end;

{*******************************************************************************
procedure GESetQuantity(Q: string);
By: Rasta Magician
Description: Sets the price of an item.
Options: '1', '10', '100', '1000'(buy), 'all'(sell),
Other - Exact Value
*******************************************************************************}
procedure GESetQuantity(Q: string);
var i:integer;
begin
if not InGe then exit;
if not GESellMenu then
if not GEBuyMenu then
exit;

case lowercase(Q) of
'1': Mouse(72, 220, 5, 5, true);
'10': Mouse(115, 219, 5, 5, true);
'100': Mouse(155, 220, 5, 5, true);
'all', '1000': Mouse(196, 222, 5, 5, true);
else begin
Mouse(238, 223, 5, 5, true);
for i:= 0 to 3 do
begin
wait(450);
if (GetColor(259, 428) = 8388608) then
if (GetColor(256, 400) = 0) then
break;
end;
TypeSend(Q);
end;
end;
end;

{*******************************************************************************
function GEConfirmOffer: boolean;
By: Rasta Magician
Description: Confirms an offer
Returns false if it wasn't able to do so
*******************************************************************************}
function GEConfirmOffer: boolean;
var x, y : integer;
begin
if not InGE then exit;
if not GESellMenu then
if not GEBuyMenu then
exit;

Result := true;

MMouse(215, 284, 96, 21);
wait(250+Random(100));
if IsUpText('ffer') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
wait(1000+Random(200));
end;

if GESellMenu or GEBuyMenu then
begin
writeln('could not confirm offer');
GEMenuExit;
Result := false;
end;

end;

{*******************************************************************************
function GEBuy(What, Price, Quantity: string): boolean;
By: Rasta Magician
Description: Buys an item from the GE
What (item name) has to be exact
Price: 'min', 'med', 'max', exact value
Quantity: '1', '10', '100', '1000', exact value
*******************************************************************************}
function GEBuy(What, Price, Quantity: string): boolean;
var
free, x, y:integer;
begin
if not InGE then exit;
if not GEFindFreeSpot(free) then exit;

if GEBuyAt(free) then
begin
wait(50+ Random(50));

if (GetColor(231, 362) <> 23200) then //checking for Item Search
begin
Mouse(125, 117, 7, 7, true);
wait(200+random(50));
end;

TypeSend(lowercase(What));
wait(150+Random(100));

if FindColor(x, y, 23200, 66, 348, 120, 354) then //if it finds our thing
begin
Mouse(x, y, 5, 3, true);
wait(100+Random(100));
end else begin
writeln('Wrong object name');
exit;
end;

wait(100+Random(100));
if not GESetPrice(Price) then exit;
wait(200+Random(100));
GESetQuantity(Quantity);
wait(200+Random(100));
Result := GEConfirmOffer;
end;
end;

{*******************************************************************************
function GESell(Price, Quantity: string; InvSpot: integer): boolean;
By: Rasta Magician
Description: Sells an item at GE
Price: 'min', 'med', 'max', exact value
Quantity: '1', '10', '100', 'all', exact value
InvSpot: the Invspot where you have your item
*******************************************************************************}
function GESell(Price, Quantity: string; InvSpot: integer): boolean;
var
free :integer;
begin
if not InGE then exit;
if not GEFindFreeSpot(free) then exit;

if GESellAt(free) then
begin
wait(100+Random(100));
MouseItem(InvSpot, mouse_Left);
wait(200+Random(100));
GESetPrice(Price);
wait(200+Random(100));
GESetQuantity(Quantity);
wait(200+Random(100));
Result := GEConfirmOffer;
end;
end;

Here's the merch script converted to SRL5:


program GEFlipper;
{$i srl/srl/misc/smart.simba}
{$i SRL/SRL.simba}
{$i srl/srl/misc/grandexchange.simba}
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, mouse_Right);
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, mouse_Left); //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(SRL_ANGLE_HIGH);
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, mouse_Left); //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, mouse_Left); //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, mouse_Left); //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, mouse_Left);
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, mouse_Left); //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, mouse_Left); //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, mouse_Left);
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, mouse_Left);
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, mouse_Left); //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, mouse_Left); // 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, mouse_Left); //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, mouse_Left); // 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, mouse_Left);
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, mouse_Left); //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, mouse_Left); // 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, mouse_Left); //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, mouse_Left); // 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.

kevin33

2012-01-19 19:39:09

Nice work. I sparked a change in the list lol. What did you change?

Kyle Undefined

2012-01-19 19:42:06

Mouse in GESell had the wrong param, needed to be mouse_Left and not True.

kevin33

2012-01-19 19:43:39

So it was what I had the problem with lol.
I actually did it properly.:spot:
U ninjad it lol. I was so close. Only had to change 1 more thing.

usb1y

2012-01-23 00:34:19

I get this error when trying to run any custom script but Draynors script works file 'C:\Simba\Includes\SRL/SRL/core/misc/smart.scar' please help ill +Rep

kevin33

2012-01-23 00:48:00

The error means the script is outdated. Needs to be converted to SRL5.
To do this change the Include statements at the top of the script to .simba instead of .scar
After this you may get other errors, post what they are and people will tell you how to fix them

It would help if I knew the script you were using so I could show you with pics. I am going to bed but if you need I will help you with this more tomorrow

Whatsjorick

2012-02-11 10:08:54

Successfully saved: C:\Simba\Scripts\AIO Fletcher V2.01.simba
Exception in Script: Unable to find file 'SRL/SRL/misc/smart.simba' used from ''

program AIOFletcher;
{$i SRL/SRL/misc/smart.simba}
{$i SRL/SRL.simba}
{$i SRL/SRL/Misc/Stats.simba}
{$i Reflection/Reflection.Simba}


What did i do wrong? I filled in everything like you said, but it doesn't work..

Kyle Undefined

2012-02-11 16:32:20

You don't have SRL 5, make sure you update your SRL.

Whatsjorick

2012-02-12 07:11:20

Still doesn't work. I also checked Tools>Update but it says ''No updates available!''
Help.. )=

No SRL update available.
No SPS update available.
No MSI update available.
Exception in Script: Unable to find file 'SRL/SRL/Misc/Stats.simba' used from ''

program AIOFletcher;
{$i SRL/SRL/misc/smart.simba}
{$i SRL/SRL.simba}
{$i SRL/SRL/Misc/Stats.simba}
{$i Reflection/Reflection.Simba}

What did i do wrong?

NickMystre

2012-02-12 07:14:05

Any script with reflection.simba will not work - reflection is dead!

This looks like an old script you are trying to run. Where did you find it ?

Whatsjorick

2012-02-12 07:46:15

Simba is released under the GPL license.
You are currently using version: 984
Compiled with FPC version 2.4.4

SRL 5 has been released. It is in the SRL updaters.

Update to Simba 984 for the uptext fixes.

No SRL update available.

Exception in Script: Unable to find file 'SRL/SRL/misc/smart.scar' used from ''

http://villavu.com/vb/showthread.php?t=61146 .. I changed .scar to .simba but that wouldn't work either..

Ranno

2012-03-25 02:22:29

I have same problem :S

Kyle Undefined

2012-03-25 18:15:46

You're using an outdated script.