SRL Archive - Senior Scripts and Snippets

Grand Exchange Include


pwnaz0r

2008-10-25 19:35:02

Ok this is some work I did on a GE Include, that was requested. I heard after I started working on it that munk was almost done with one, but now so am I :). So for now I will just post it here for comments. Updating regularly…

//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- ยป Grand Exchange Routines --//
//-----------------------------------------------------------------//


type
TGrandExchangeBox = record
IsOpen: boolean;
Coords, BuyCoords, SellCoords: TBox;
end;



//By: Boreas and Pwnaz0r
function FindGEClerkEx(CheckUpText:boolean): boolean;
var
pPoints, mPoints: TPointArray;
bpoints,bpoints3: TPointArray;
cPoints, bpoints2: T2DPointArray;
i: integer;
begin
//SetAngle(true);
FindColorsTolerance(bPoints, 1315861, MSX1, MSY1, MSX2, MSY2, 5);
bPoints2:= SplitTPA(bPoints, 2);
SortATPAFromSize(bpoints2,200,false);
SetLength(bPoints3, Length(bpoints2));

bPoints3[0]:= bpoints2[0][(length(bpoints2[0])-1)];
writeln(inttostr(bpoints3[0].x)+' '+inttostr(bpoints3[0].y))
//terminatescript;

FindColorsTolerance(pPoints, 4860728, MSX1, bpoints3[0].y, MSX2, MSY2, 15);

if (Length(pPoints) < 1)then
exit;

cPoints:= SplitTPAEx(pPoints, 14, 24);
SetLength(mPoints, Length(cPoints));

for i:= 0 to High(cPoints) do
try
mPoints[I]:= MiddleTPA(cPoints[I]);
except
end;

bpoints3[0].y:=bpoints3[0].y;
SortTPAFrom(mpoints,bpoints3[0]);

SortTPAFrom(mPoints, Point(Round(MSX2/2), Round(MSY2/2)));
for I:= 0 to High(mPoints) do
begin
result:=true;
if CheckUpText then
begin
MMouse(mPoints[I].x, mPoints[I].y, 0, 0);
result:= IsUpText('rand');
end;
if (result)then
begin
Mouse(mPoints[I].x, mPoints[I].y, 0, 0, false);
result:= ChooseOption('Exchange'); //must be full word.
if (result)then break;
end;
end;
end;

// BY: Pwnaz0r
function FindGEClerk: boolean;
begin
result:= (FindGEClerkEx(true));
if not (result)then
result:= (FindGEClerkEx(false));
end;

// By: Pwnaz0r
function GrandExchangeScreen: boolean;
begin
result:= FindTextTpa(39116, 10, 250, 29, 317, 52, 'xchange', UpChars, Nothing);
end;

// By: Pwnaz0r
function SellScreen: boolean;
begin
result:= FindTextTpa(39116, 10, 97, 69, 125, 91, 'ell', UpChars, Nothing);
if Result then
Writeln('Sell Screen.');
end;

// By: Pwnaz0r
function BuyScreen: boolean;
begin
result:= FindTextTpa(39116, 10, 101, 74, 120, 87, 'uy', UpChars, Nothing);
if Result then
Writeln('Buy Screen.');
end;

// By: Pwnaz0r
procedure MainScreen;
begin
if BuyScreen or SellScreen then
Mouse(37, 290, 21, 14, true);
wait(800);
end;


//By: Pwnaz0r
function GrandExchangeBox(Num: integer): TBox;
var
SPoint: TPoint;
begin
if not (GrandExchangeScreen)then exit;
MainScreen;
if not (InRange(Num, 1, 6))then
exit;
if (Num >= 4)then
begin
SPoint:= Point(34, 204)
Num:= Num - 3;
end else
SPoint:= Point(34, 84);

// Main Coords
Result.X1:= (Round(SPoint.X + ((Num-1) * (17 + 138))));
Result.Y1:= SPoint.Y;
Result.X2:= Result.X1 + 138;
Result.Y2:= Result.Y1 + 108;

end;

//By : pwnaz0r
function BoxOpen(Num: integer): boolean;
var
GEBox: TBox;
X, Y: integer;
begin
GEBox:= GrandExchangeBox(Num);
result:= not FindColor(X, Y, 0, GEBox.X1 + 18, GEBox.Y1 + 80, GEBox.X1 + 133, GEBox.Y1 + 94);
//Writeln('Box '+IntToStr(Num)+' open : '+BoolToStr(Result));
end;

//by Pwnaz0r;
function BoxInfo(Num: integer): TGrandExchangeBox;
begin
result.Coords:= GrandExchangeBox(Num);
result.IsOpen:= BoxOpen(Num);

//Buy Coords
Result.BuyCoords.X1:= Result.Coords.X1 + 16;
Result.BuyCoords.Y1:= Result.Coords.Y1 + 45;
Result.BuyCoords.X2:= Result.BuyCoords.X1 + 44;
Result.BuyCoords.Y2:= Result.BuyCoords.Y1 + 42;

//Sell Coords
Result.SellCoords.X1:= Result.Coords.X1 + 79;
Result.SellCoords.Y1:= Result.Coords.Y1 + 45;
Result.SellCoords.X2:= Result.SellCoords.X1 + 44;
Result.SellCoords.Y2:= Result.SellCoords.Y1 + 42;
end;

function GEBoxInfos: array of TGrandExchangeBox;
var
I: integer;
begin
SetArrayLength(result, 7);
for I:= 1 to 6 do
result[I]:= BoxInfo(I);
end;

function FindOpenBox: integer;
var
I: integer;
begin
result:= -1;
for I:= 1 to 6 do
if BoxOpen(I)then
begin
result:= I;
exit;
end;
end;

procedure ConfirmOffer;
var
I: integer;
begin
I:= 0;
repeat
Inc(i);
Mouse(206, 276, (320 - 206), (313 - 276), true);
wait(800);
until((not (BuyScreen)) and (not (SellScreen)));
end;

procedure Ge_AdjQuantityPrice(Quantity :integer; Price: string);
var
mark: integer;
begin
if ((not(BuyScreen)) and (not(SellScreen)))then
exit;
if Quantity <> 0 then
begin
Mouse(222, 212, (251 - 222), (230 - 212), true);

mark:= GetSystemTime;
repeat
if ((GetSystemTime - Mark) >= 5000)then
begin
Writeln('Error setting quantity.');
Typesend('');
exit;
end;
until(FindTextTpa(0, 0, 210, 393, 261, 409, 'amount', UpChars, Nothing));

TypeSend(IntToStr(Quantity));
end;

case Lowercase(Price) of
'max','maximum': Mouse(379, 211, (407-379), (230-211), true);
'none','market': Mouse(325, 211, (354-325), (230-211), true);
'min','minimum': Mouse(273, 211, (302-273), (231-211), true);
end;
end;

// quantity = 0 = all.
// price = Min, Market, Max

function GESellItem_Number(Num, Quantity: integer; Price: string): boolean;
var
I: integer;
Box: TGrandExchangeBox;
Mark: integer;
begin
if not ExistsItem(Num)then
begin
Writeln('Item '+IntToStr(Num)+' does not exist.');
exit;
end;
if not (GrandExchangeScreen)then exit;
I:= FindOpenBox;

if (I = -1) then
exit;

Box:= BoxInfo(I);
Mouse(Box.SellCoords.X1, Box.SellCoords.Y1, (Box.SellCoords.X2 - Box.SellCoords.X1), (Box.SellCoords.Y2 - Box.SellCoords.Y1), true);
mark:= GetSystemTime;
repeat
if ((GetSystemTime - Mark) >= 5000)then
begin
Writeln('Error selling item.');
exit;
end;
until(SellScreen);

MouseItem(Num, true);
mark:= GetSystemTime;
repeat
if ((GetSystemTime - Mark) >= 5000)then
begin
Writeln('Error selling item.');
exit;
end;
until(not FindTextTpa(39116, 10, 213, 69, 263, 84, 'hoose', UpChars, Nothing));

Ge_AdjQuantityPrice(Quantity, Price);
ConfirmOffer;
result:= true;
end;

function GESellItem_Name(Name: string; Quantity: integer; Price: string): boolean;
var
I: integer;
begin
for I:= 1 to 28 do
if ExistsItem(I)then
begin
MMouseItem(I);
wait(800);
if IsUpText(Name)then
if GESellItem_Number(I, Quantity, Price)then
begin
result:= true;
exit;
end;
end;
end;

function ItemsToClaim(Box: TGrandExchangeBox): boolean;
var
X, Y: integer;
begin
MainScreen;
try
if (GetColor(Box.Coords.X1 + (321 - 168), Box.Coords.Y1 + (168 - 84))= 1048714)then
result:= true;
if not (result)then
if (GetColor(Box.Coords.X1 + (321 - 168), Box.Coords.Y1 + (168 - 84))= 1999423)then
result:= true;
except
Writeln('ERROR FINDING COLORS');
end;
end;

procedure ClaimItem(Box: TGrandExchangeBox);
var
aBool: Boolean;
Mark: integer;
begin
if (InvFull)then
exit;
if not (BuyScreen) or (SellScreen)then
begin
if not(ItemsToClaim(Box))then
exit;
Mouse(Box.Coords.X1, Box.Coords.Y1, 138, 108, true);
end;

Mark:= GetSystemTime;
repeat
if ((GetSystemTime - Mark) >= 5000)then
begin
Writeln('Error selling item.');
exit;
end;
until(SellScreen) or (BuyScreen);

MMouse(402, 283, (435-402), (312-283));
wait(500);
if IsUpText('ollec')then
Mouse(402, 283, (435-402), (312-283), true);

MMouse(451, 284, (483-451), (312-284));
wait(500);
if IsUpText('ollec')then
Mouse(451, 284, (483-402), (312-284), true);
end;

procedure ClaimAllItems;
var
I, T, Col, Mark: integer;
cBox: TGrandExchangeBox;
mPoint: TPoint;
cPoints: TPointArray;
begin
if InvFull then exit;
for I:= 1 to 6 do
begin
for T:= 1 to 2 do
begin
case T of
1: Col:= 1048714;
2: Col:= 1999423
end;
cBox:= BoxInfo(I);
FindColorsTolerance(cPoints, Col, cBox.Coords.X1, cBox.Coords.Y1, cBox.Coords.X2, cBox.Coords.Y2, 10);
if (Length(cPoints) > 50)then
begin
mPoint:= MiddleTPA(cPoints);
Mouse(mPoint.x, mPoint.y, 5, 0, true);

Mark:= GetSystemTime;
repeat
if ((GetSystemTime - Mark) >= 5000)then
begin
Writeln('Error selling item.');
exit;
end;
until(SellScreen) or (BuyScreen);


MMouse(402, 283, (435-402), (312-283));
wait(500);
if IsUpText('ollec')then
Mouse(402, 283, (435-402), (312-283), true);

wait(1000);
if(not(BuyScreen) and not(SellScreen))then
exit;

MMouse(451, 284, (483-451), (312-284));
wait(500);
if IsUpText('ollec')then
Mouse(451, 284, (483-402), (312-284), true);

end;
end;
end;
end;



{function AbortItem(Box: TGrandExchangeBox): boolean;
var
Mark: integer;
begin
if not Box.IsOpen then
begin
Mouse(Box.Coords.X1, Box.Coords.Y1, 138, 108, true);

mark:= GetSystemTime;
repeat
if ((GetSystemTime - Mark) >= 5000)then
begin
Writeln('Error selling item.');
exit;
end;
until(SellScreen);

Mouse(358, 280, 10, 12, true);
end;

end; }


Boreas

2008-10-25 20:10:07

Here's another one. The last one I sent you assumed you're coming from the south. This one will work either side.

Edit: Changed the clerk ordering. Works everywhere except directly left or right of bankers.

function FindGEClerkEx(CheckUpText:boolean): boolean;
var
pPoints, mPoints: TPointArray;
bpoints,bpoints3: TPointArray;
cPoints, bpoints2: T2DPointArray;
i,t: integer;
begin
//SetAngle(true);
t:=getsystemtime;
FindColorsTolerance(bPoints, 1315861, MSX1, MSY1, MSX2, MSY2, 5);
bPoints2:= SplitTPA(bPoints, 2);
SortATPASize(bpoints2,true);
SetLength(bPoints3, Length(bpoints2));

bPoints3[0]:= bpoints2[0][(length(bpoints2[0])-1)];
bpoints3[0].y:=bpoints3[0].y+40;
//writeln(inttostr(bpoints3[0].x)+' '+inttostr(bpoints3[0].y))

if MSCY > bpoints3[0].y then
FindColorsTolerance(pPoints, 4860728, MSX1, bpoints3[0].y, MSX2, MSY2, 20)
else
FindColorsTolerance(pPoints, 4860728, MSX1, MSY1, MSX2, bpoints3[0].y, 20);

if (Length(pPoints) < 1)then
begin
Writeln('DUH');
exit;
end;
cPoints:= SplitTPA(pPoints, 3);
SortATPAFromSize(cPoints,100,true);
if length(cpoints)>6 then SetLength(cPoints,6);
SetLength(mPoints, Length(cPoints));
for i:= 0 to High(cPoints) do
begin

try
mPoints[I]:= cpoints[i][0];//MiddleTPA(cPoints[I]);
except
Writeln('DUH '+IntToStr(I));
end;
//writeln('Length: '+inttostr(length(cpoints[i]))+' '+inttostr(mpoints[i].x)+' '+inttostr(mpoints[i].y));
end;

SortTPAFrom(mpoints,bpoints3[0]);
if length(mpoints)>6 then SetLength(mpoints,6);
SortTPAFrom(mpoints,Point(MSCX,MSCY));

//writeln(inttostr(getsystemtime-t));

//terminatescript;
for I:= 0 to High(mPoints) do
begin
result:=true;
if CheckUpText then
begin
MMouse(mPoints[I].x, mPoints[I].y, 0, 0);
result:= IsUpText('rand');
end;
if (result)then
begin
Mouse(mPoints[I].x, mPoints[I].y, 0, 0, false);
result:= ChooseOption('xchan');
if (result)then break;
end;
end;
end;

mastaraymond

2008-10-25 20:10:29

Tags please

pwnaz0r

2008-10-25 20:29:12

I tagged :p sorry edited it to tag, then wrote more code, and forgot to press save.

Boreas

2008-10-25 21:12:32

function FindGEClerkEx(CheckUpText:boolean): boolean;
var
pPoints, mPoints: TPointArray;
bpoints,bpoints3: TPointArray;
cPoints, bpoints2: T2DPointArray;
i,t: integer;
begin
//SetAngle(true);
t:=getsystemtime;
FindColorsTolerance(bPoints, 1315861, MSX1, MSY1, MSX2, MSY2, 5);
bPoints2:= SplitTPA(bPoints, 2);
SortATPASize(bpoints2,true);
SetLength(bPoints3, Length(bpoints2));

bPoints3[0]:= bpoints2[0][(length(bpoints2[0])-1)];
bpoints3[0].y:=bpoints3[0].y+40;
//writeln(inttostr(bpoints3[0].x)+' '+inttostr(bpoints3[0].y))

if MSCY > bpoints3[0].y then
FindColorsTolerance(pPoints, 4860728, MSX1, bpoints3[0].y, MSX2, MSY2, 20)
else
FindColorsTolerance(pPoints, 4860728, MSX1, MSY1, MSX2, bpoints3[0].y, 20);

if (Length(pPoints) < 1)then
begin
Writeln('DUH');
exit;
end;
cPoints:= SplitTPA(pPoints, 3);
SortATPAFromSize(cPoints,100,true);
if length(cpoints)>6 then SetLength(cPoints,6);
SetLength(mPoints, Length(cPoints));
for i:= 0 to High(cPoints) do
begin

try
mPoints[I]:= cpoints[i][0];//MiddleTPA(cPoints[I]);
except
Writeln('DUH '+IntToStr(I));
end;
//writeln('Length: '+inttostr(length(cpoints[i]))+' '+inttostr(mpoints[i].x)+' '+inttostr(mpoints[i].y));
end;
SortTPAFrom(mpoints,Point(MSCX,MSCY));
if length(mpoints)>3 then SetLength(mpoints,3);
SortTPAFrom(mpoints,bpoints3[0]);
if length(mpoints)>2 then SetLength(mpoints,2);
SortTPAFrom(mpoints,Point(MSCX,MSCY));


//writeln(inttostr(getsystemtime-t));

//terminatescript;
for I:= 0 to High(mPoints) do
begin
result:=true;
if CheckUpText then
begin
MMouse(mPoints[I].x, mPoints[I].y, 0, 0);
result:= IsUpText('rand');
end;
if (result)then
begin
Mouse(mPoints[I].x, mPoints[I].y, 0, 0, false);
wait(200+random(100));
result:= ChooseOption('xcha');
if (result)then break;
end;
end;
end;

Pretty quiet now. Only problem is sometimes the ChooseOption gets talk to.

The Claw

2008-10-25 21:32:30

Cool, but whats the point of it? I mean, if I was going to be using the GE advisor, I wouldnt have it go and buy and sell stuff automatically

munk

2008-10-25 21:56:07

ah! I just did some work on mine after I read that :p

oh well, here it is:


// Grand Exchange Handling functions

function exchangeScreen:boolean;
begin
// result:=FindTextTpa(39116,3,243,31,291,55,'xch',upChars,nothing);
result:=getColor(245,36)=39116;
end;

function OfferScreen:boolean;
var
x,y:integer;
begin
// result:=findTextTpa(39116,3,96,61,183,97,'ffer',upChars,nothing);
result:=findText(x,y,'ffer',upChars,96,61,183,97);
end;

function waitForOfferScreen(maxWait:integer):boolean;
var
t:integer;
begin
if not(exchangeScreen) then exit;
marktime(t);
repeat
wait(100+random(100));
result:=offerScreen;
if timeFromMark(t)>maxWait then exit;
until(result);
end;


function GEslotBox(slot:integer):Tbox;
begin
result.x1:=-122+(156*(slot mod 3));
if slot>3 then result.y1:=204 else result.y1:=84;
result.x2:=result.x1+139;
result.y2:=result.y1+109;
end;

function GEtOfferPrice(slot:integer):integer;
var // NOTE: If using offerscreen, slot paramater is irrelevant.
p:TpointArray;
box,box2:Tbox;
begin
if not(exchangeScreen) then exit;
if offerScreen then
begin
findColorsTolerance(p,6400255,289,175,446,205,0);
if length(p)>0 then
begin
box2:=getTPAbounds(p);
result:=strtointdef(getnumbers(trim(getTextAtEx(Box2.x1-1,Box2.y1-1,0,upChars,false,false,0,2,6400255,15,true,tr_AlphaNumericChars))),0);
// writeln(inttostr(result));
end;
end else
begin
box:=GEslotBox(slot);
findColorsTolerance(p,6011837,box.x1,box.y1+22,box.x2,box.y2,0);
if length(p)>0 then
begin
box2:=getTPAbounds(p);
result:=strtointdef(getnumbers(trim(getTextAtEx(Box2.x1-1,Box2.y1-1,0,statChars,false,false,0,2,6011837,15,true,tr_AlphaNumericChars))),0);
// writeln(inttostr(result));
end;
end;
end;

function GEtOfferQuantity(slot:integer):integer;
var // NOTE: If using offerscreen, slot paramater is irrelevant.
p:TpointArray;
box,box2:Tbox;
begin
if not(exchangeScreen) then exit;
if offerScreen then
begin
findColorsTolerance(p,6400255,75,177,235,206,0);
if length(p)>0 then
begin
box2:=getTPAbounds(p);
result:=strtointdef(getnumbers(trim(getTextAtEx(Box2.x1-1,Box2.y1-1,0,upChars,false,false,0,2,6400255,15,true,tr_AlphaNumericChars))),0);
// writeln(inttostr(result));
end;
end else
begin
// move mouse over item
// grab amount from popup

end;
end;

function GEtOfferItem(slot:integer):string;
var
p:TpointArray;
box,box2:Tbox;
begin
if not(exchangeScreen) then exit;
if offerscreen then
begin
findColorsTolerance(p,39372,204,65,471,94,0);
if length(p)>0 then
begin
box2:=getTPAbounds(p);
result:=trim(getTextAtEx(Box2.x1-1,Box2.y1-1,0,upChars,false,false,0,2,39372,15,true,tr_AlphaNumericChars));
// writeln(result);
end;
end else
begin
box:=GEslotBox(slot);
findColorsTolerance(p,39372,box.x1,box.y1+22,box.x2,box.y2,0);
if length(p)>0 then
begin
box2:=getTPAbounds(p);
result:=trim(getTextAtEx(Box2.x1-1,Box2.y1-1,0,statChars,false,false,0,2,39372,15,true,tr_AlphaNumericChars));
// writeln(result);
end;
end;
end;

function GEtMarketPrice:integer;
var
p:TpointArray;
box:Tbox;
begin
if not(offerScreen) then exit;
findColorsTolerance(p,39321,80,125,190,155,0);
if length(p)>0 then
begin
box:=getTPAbounds(p);
result:=strToIntDef(getNumbers(trim(getTextAtEx(Box.x1-1,Box.y1-1,0,statChars,false,false,0,2,39321,10,true,tr_AlphaNumericChars))),0);
// writeln('Market Price is '+inttostr(result)+'gp');
end;
end;

// valid params: 'max' 'min' '+1' '+10' '+1k' '+1000' '+#'(e.g. '+28','+500')
function GEsetOfferPrice(toWhat:string):boolean;
begin

end;

function GEsetOfferQuantity(toWhat:string):boolean;
begin

end;

function GEcollectOffer:boolean;
var
t:integer;
begin
if not offerScreen then exit;
repeat
if result then exit;
if (findColor(x,y,65535,400,280,436,314))
or (findColor(x,y,16777215,400,280,436,314))
or (findColor(x,y,8453888,400,280,436,314)) then
begin
mousebox(405,285,430,310,1);
wait(800+random(200));
end;
if (findColor(x,y,65535,450,280,485,314))
or (findColor(x,y,16777215,450,280,485,314))
or (findColor(x,y,8453888,450,280,485,314)) then
begin
mousebox(455,285,480,310,1);
wait(800+random(200));
end;
wait(500+random(500));
result:=not(offerScreen);
inc(t);
until(t>2);
end;

function GEopenOffer(slot:integer):boolean;
var
box:Tbox;
begin
if offerScreen then exit;
if not(exchangeScreen) then exit;
if not(GESlotEmpty) then
begin
box:=GEslotBox(slot);
mousebox(box.x1+5,box.y1+5,box.x2-5,box.y2-5,1);
result:=waitForOfferScreen(7000);
wait(100+random(100));
end;
end;

function GEofferStatus(slot:integer;var color:string):integer;
var
i:integer;
cols:TintegerArray;
box,bar:Tbox;
begin
cols:=[1999423,101318,1048714];
box:=GEslotBox(slot);
for i:=0 to high(cols) do
begin
findColorsTolerance(p,cols[i],box.x1,box.y1,box.x2,box.y2);
if length(p)>0 then
begin
if cols[i]=1048714 then
begin // offer was canceled.
result:=-1;
color:='Red';
exit;
end;
bar:=getTPAbounds(p);
result:=(bar.x2-bar.x1) div 123;
writeln(inttostr(result)+'% finished');
case cols[i] of
1999423: color:='Green';
101318: color:='Yellow';
end;
break;
end;
end;
end;

function GEofferFinished(slot:integer):boolean;
var
col:string;
begin
if not(exchangeScreen) then exit;
geOfferStatus(slot,col);
result:=(col='Green');
end;

function GEconfirmOffer:boolean;
var
i:integer;
begin
if not offerScreen then exit;
if findText(x,y,'onfir',upChars,220,278,280,309) then
begin
for i:=1 to 4 do
begin
mouse(x-5,y,40,10,true);
wait(1000+random(500));
if not offerScreen then
begin
result:=true;
exit;
end;
end;
end;
end;

function GEslotEmpty(slot:integer):boolean;
var
x,y:integer;
box:Tbox;
begin
if not(exchangeScreen) then exit;
box:=GEslotBox(slot);
result:=(FindText(x,y,'mpt',upChars,box.x1,box.y1-5,box.x2,box.y1+25))
and (not(findColor(x,y,65536,box.x1,box.y1,box.x2,box.y2)));
// if not result then writeln('slot '+inttostr(slot)+' is not empty!');
end;

function GEmakeOffer(slot:integer;buy:boolean):boolean;
var
i,sx,sy:integer;
box:Tbox;
begin
if not(exchangeScreen) then exit;
if GEslotEmpty(slot) then
begin
box:=GEslotBox(slot);
if buy then
sx:=box.x1+15
else
sx:=box.x1+78;
sy:=box.y1+45;
for i:=1 to 3 do
begin
mouse(sx,sy,40,40,true);
result:=waitForOfferScreen(2000+random(1000));
if result then break;
end;
wait(100+random(400));
end;
end;

function closeGExchange:boolean;
var
i:integer;
begin
for i:=1 to 3 do
begin
result:=not(exchangeScreen);
if result then break;
mouse(478,35,12,12,true);
wait(1000+Random(1000));
end;
end;

EDIT: its not really finished, if you wanna try to finish some of it :D

Boreas

2008-10-25 22:27:18

Claw: I was thinking for item related scripts. Like selling the runes on the sudokuer, or buying bars and selling bolts, etc.

I got around the talk to thing with this

{*******************************************************************************
function ChooseOptionButNot(txt, nottxt: string; tries:integer): Boolean;
By: Wizzup? and Boreas
Description: Finds Popup menu, looks for option containing txt, but not nottxt, and then clicks on it. Gives up after finding tries number of txts with nottxts, or after going through all options.
*******************************************************************************}

function ChooseOptionButNot(txt, nottxt: string; tries:integer): Boolean;
var
B: TBox;
TPA: TPointArray;
X, Y, I, C, nx,ny,tried: Integer;
P: TPoint;

begin
Result := False;
GetClientDimensions(B.X2, B.Y2);
B.X1 := 0;
B.Y1 := 0;
FindColorsTolerance(TPA, 4674653, B.X1, B.Y1, B.X2, B.Y2, 0);
If Length(TPA) < 10 Then
Exit;
B.X2 := 0;
B.Y2 := 0;

P := TPA[0];
For I := 0 To High(TPA) - 1 Do
If TPA[I].X = TPA[I+1].X - 1 Then
Begin
If C > 5 Then
Begin
B.X1 := P.X;
B.Y1 := P.Y;
Break;
End Else
C := C + 1;
End
Else
Begin
P := TPA[I + 1];
C := 0;
End;
If I = Length(TPA) Then
Begin
WriteLn('Choose Option Menu Getting Failed');
Exit;
End;
InvertTPA(TPA);
C := 0;
P := TPA[0];
For I := 0 To High(TPA) - 1 Do
If TPA[I].X = TPA[I+1].X + 1 Then
Begin
If C > 5 Then
Begin
B.X2 := P.X;
B.Y2 := P.Y;
Break;
End Else
C := C + 1;
End Else
Begin
P := TPA[I + 1];
C := 0;
End;
If I = Length(TPA) Then
Begin
WriteLn('Choose Option Menu Getting Failed');
Exit;
End;
If FindText(X, Y, txt, upchars, B.X1, B.Y1, B.X2, B.Y2) Then
repeat
if not FindText(X, Y, txt, upchars, B.X1, B.Y1, B.X2, B.Y2) then
break;
if not FindText(nX,nY, nottxt, upchars, B.X1,Y,B.X2,Y+16) then
begin
Result := True;
Mouse(B.X1 + 5, y + 1, B.X2 - B.X1 - 5, 13, True);
exit;
end;
B.Y1:=Y+15;
tried:=tried+1;
until (tried>tries) or (B.Y1>B.Y2);
MMouse(B.X1 - 50, B.Y1 - 50, 40, B.Y2 - B.Y1);
Wait(200 + Random(100));

end;

We also need to find banker, and walk towards the GE.

pwnaz0r

2008-10-25 23:03:47

K, and yes, as Boreas said, It's just for things that would use it. It would be in misc also, so its not like it would always be included. I'm sure it could be used in a merchanter, however, I was thinking more about the Sudoker.

EDIT: what would be great is if there was something we could do that would tell us if offers were updated before we logged in. But to the best of me knowledge, yyou have to login before that information is sent.