Swatarianess
2011-12-14 09:28:31
No Failsafes. (except 1) yet…
Doesnt buy items properly yet…
Doesnt make mad amount of money yet…
Just taste of what i came up with in few 35mins of works – 3hrs :spot:
Its Teaser all it does is get GEman and buys whatever item. :/ Any way i can improve it?
Doesnt buy items properly yet…
Doesnt make mad amount of money yet…
Just taste of what i came up with in few 35mins of works – 3hrs :spot:
//----------------------------------------------------------------------------/|
// -- |
// -- Merchanting Bot v1 beta |
// -- |
// -- by Inf3cti0us |
// -- |
// -- Thanks to WT-Fakawi for this box design i moded slightly |
// -- |
// -- BETA 2 |
// -- |
// -- --- Only uses Colors --- |
//|----------------------------------------------------------------------------|
program MerchantBeta;
{.include SRL\SRL.scar}
var
x, y, ms, GEUP, FoundNPC: integer;
Item2Buy: String;
procedure DeclarePlayers;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := 'Username';
Players[0].Pass := 'Password';
Players[0].Nick := 'Nickname';
Players[0].Pin := 'Pincode';
Players[0].Strings[0]:= 'Rune scimi'; // Item to buy.
Players[0].Integers[0]:= 5; // Amount of Item to buy
Players[0].Integers[1]:= 500; // Buying price (Sell item 1gp or way lower then med to aquire whilest flipping)
Players[0].Integers[2]:= 550; // Selling price (buy higher med price of item)
Players[0].Active := true;
Item2Buy := Players[0].Strings[0];
end;
function FindNPC(var fx, fy: Integer): Boolean;
var
arP: TPointArray;
ararP: T2DPointArray;
tmpCTS, i, arL: Integer;
P: TPoint;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.23, 0.45);
if not(FindColorsTolerance(arP, 3217441, MSX1, MSY1, MSX2, MSY2, 3)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
FoundNPC := 0;
Exit;
end;
SortTPAFrom(arP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arP, 10, 10);
arL := High(ararP);
for i := 0 to arL do
begin
P := MiddleTPA(ararP[i]);
MMouse(P.x,P.y,4,4);
Wait(100 + Random(100));
if (IsUpText('rand_Exchange')) then
begin;
Result := True;
FoundNPC := 1;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
Writeln('Apparently nothing was found...');
Exit;
end;
GetMousePos(fx, fy);
end;
function AutoColor2: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(0);
if not (FindColorsTolerance(arP, 6920667, 0, 0, 764, 502, 0)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
GEUP := 1;
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);
if (R >= 218) and (R <= 220) and (G >= 152) and (G <= 154) and (B >= 104) and (B <= 106) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
GEUP := 0;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
Procedure FindGEMan;
var
x, y: integer;
begin
FindNPC(x,y)
wait(randomrange(200,500))
//if(FoundNPC = 1) then forward; << dunno why this didn't work
if(FoundNPC = 0) then
begin
writeln('Cannot find NPC...')
exit;
end;
end;
Procedure EnterTheGE;
begin
ClickMouse(x,y,0);
wait(250+random(500))
writeln('On menu up Need to click GrandEchange Menu setting...');
GetMousePos(x,y);
Wait(RandomRange(100,500))
MMouse(x-RandomRange(68,85),y+RandomRange(38,44),1,2);
writeln('Hovering over "Exchange" Clicked ');
wait(500+random(500))
ClickMouse(x,y,1);
end;
Procedure GEinterfaceOpen;
begin
SetupSRL;
ms := MouseSpeed;
MouseSpeed := 25 + RandomRange(-3, 3);
if LoggedIn then
begin
//if ( #Need to make it find the .bmp of the Backpack+ and backpack-
AutoColor2;
wait(randomrange(1500,5000))
if(GEUP = 1) then
begin
FindGEMan;
EnterTheGE;
wait(300+randomrange(400,500))
writeln('We have made it. Thinking of item to choose')
GEUP := 0;
end;
end;
if not LoggedIn then exit;
Writeln('Waiting now whilest GE interface is open...')
end;
procedure GettingItem;
begin
if(GEUP = 0) then
begin
writeln('We have GE Opened')
wait(500+RandomRange(300,500))
MMouse(71,156,4,4);
//writeln('On GE interface GEUP = '+ IntToStr(GEUP) + ' << Meaning...' )
ClickMouse(x,y,1);
wait(1000+RandomRange(500,1000))
//writeln('Buying: ' + + ' @' + IntToStr(Players[CurrentPlayer].Integers[1]))
MMouse(62,459,50,7)
wait(500+RandomRange(100,600))
ClickMouse(62,459,1);
wait(randomRange(100,200))
ClickMouse(62,459,1);
wait(500+randomRange(100,600))
//TypeSendEx(Item2Buy,True)
TypeSendEx(Players[CurrentPlayer].Strings[0],True)
wait(500+RandomRange(500,1000))
MMouse(67,355,80,5)
wait(300+RandomRange(200,700))
ClickMouse(x,y,1)
end;
end;
procedure BuyItem;
begin
end;
begin
DeclarePlayers;
GEinterfaceOpen;
GettingItem;
BuyItem;
end.Its Teaser all it does is get GEman and buys whatever item. :/ Any way i can improve it?