Code:
{.include srl/srl.scar}
{.include srl/srl/misc/amount.scar}
//PLAYER SETUP:
//autoretal off
//atleast 150k on each acc
//chat effects off
//chats: off, off, on
const
TimePerPlayer = 400000;
BuyPrice = 15;
SellPrice = 20;
var
PlayerStartMark:longint;
AcceptedDtm:integer;
Procedure DeclarePlayers;
Begin
HowManyPlayers := 2;
NumberOfPlayers( HowManyPlayers );
Players[0].Name :=' ';
Players[0].Pass :='';
Players[0].Nick :='';
Players[1].Name :=' ';
Players[1].Pass :='';
Players[1].Nick :='';
end;
procedure SetupScript;
begin
AcceptedDtm:=DTMFromString('78DA633CC4C0C0D0C8C8800DC04419416A5A0' +
'9A83905241A08A8390D243A08A8B945845D4F8950F31E48B41150' +
'F30B48B41350F31F4834E356C30EA2F91809AB1160C4EB1E4E102' +
'DC388D75F60356A44A80924C22E2746BC7E07ABB160C41B5F2035' +
'005E4811B7');
end;
procedure SetupPlayer;
begin
end;
procedure sm(x,y,rx,ry:integer;l:boolean);
var
ex,ey:integer;
begin
MMouse(x,y,rx,ry);
getmousepos(ex,ey);
wait(100+random(50));
ClickMouse(ex,ey,l);
end;
function ClickTrade:boolean;
begin
if(FindColor(x,y,8388736,24, 421, 186, 425)) then begin
Result:=True;
MMouse(54, 423,2,1);
wait(100+random(100));
getmousepos(x,y);
ClickMouse(x,y,true);
end;
end;
function WhatTradeScreen:integer;
begin
if
(getcolor(232, 181)=0) and
(getcolor(486, 42)=65536) and
(getcolor(92, 68)=65535) and
(getcolor(359, 73)=65535) then
begin
Result:=1;
end else begin
if
(getcolor(326, 316)=0) and
(getcolor(481, 46)=65536) and
(getcolor(342, 74)=65535) and
(getcolor(73, 74)=0) and
(getcolor(99, 52)=16777215) and
(getcolor(144, 55)=255) then
begin
Result:=2;
end else begin
Result:=0;
end;
end;
end;
function Accepted:boolean;
begin
Result:=FindDtm(AcceptedDtm,x,y,123, 286,438, 323);
end;
function AcceptTrade:boolean;
begin
if(WhatTradeScreen=1) then MMouse(260, 194,5,2);
if(WhatTradeScreen=2) then MMouse(223, 310,5,1);
if(not(WhatTradeScreen=0)) then Result:=True else Result:=False;
if Result then begin
getmousepos(x,y);
wait(100+random(50));
ClickMouse(x,y,true);
end;
end;
function TheirOffer(var item:string;var amt:LongInt):boolean;
begin
if(WhatTradeScreen=1) then begin
Result:=True;
if(FindColorTolerance(x,y,1614021, 327, 84,354, 101,5)) then item:='coin';
if(FindColorTolerance(x,y,1738976, 327, 84,354, 101,5)) then item:='mind';
amt:=Amount('trade',1);
end;
end;
function NumberOf(item:string):integer;
begin
if(item='coin') then Result:=Amount('inv',1)-1;
if(item='mind') then Result:=Amount('inv',2)-1;
end;
procedure OfferItem(item:string;amount:integer);
begin
if(item='coin') then sm(584, 228,2,2,false)
else sm(627, 227,2,2,false);
getmousepos(x,y);
wait(100+random(50));
if(ChooseOption(x,y,'Offer X'))then begin
repeat
wait(30+random(50));
until(not(FindColor(x,y,16711680,22, 436,438, 446)));
TypeSend(inttostr(amount));
wait(100+random(100));
end;
end;
procedure CheckRands;
begin
FindNormalRandoms;
if(FindFight)then begin
RunAwayDirection('S');
wait(5000+random(5000));
RunBack;
end;
GameTab(4);
end;
var
clicked:boolean;
procedure TryBuy;
var
ti:string;
ta,ta2,no:integer;
begin
TypeSend('cyan:buying minds '+inttostr(BuyPrice)+'ea - '+Players[CurrentPlayer].Name);
if not ClickTrade then begin
clicked:=false;
Exit;
end;
wait(1000+random(100));
if not(WhatTradeScreen=1 ) then Exit;
repeat
SleepAndMoveMouse(50+random(100));
TheirOffer(ti,ta);
until((ti='mind')or(WhatTradeScreen=0));
if(WhatTradeScreen=0) then Exit;
if(NumberOf('coin')>=ta*BuyPrice) then begin
OfferItem('coin',ta*BuyPrice);
no:=ta*BuyPrice;
TheirOffer(ti,ta2);
if(ta2=ta)and(ti='mind') then AcceptTrade else Exit;
end else begin
no:=NumberOf('coin');
if no>=99999 then no := no- (no mod 1000);
no := no - (no mod BuyPrice);
OfferItem('coin',no);
end;
repeat
SleepAndMoveMouse(50+random(100));
if(WhatTradeScreen=0) then Exit;
if(Accepted) then begin
TheirOffer(ti,ta);
if (ti='mind')and(no<=ta*BuyPrice) then begin
AcceptTrade;
wait(500+random(500));
end;
end;
until(WhatTradeScreen=2);
AcceptTrade;
end;
procedure RemoveItem(amount:integer);
begin
sm(50, 90,2,2,false);
wait(100+random(50));
getmousepos(x,y);
if ChooseOption(x,y,'X')then begin
repeat
wait(30+random(50));
until(not(FindColor(x,y,16711680,22, 436,438, 446)));
TypeSend(inttostr(amount));
wait(100+random(100));
end;
end;
procedure TrySell;
var
ti:string;
ta,ta2,no,nno:integer;
begin
TypeSend('cyan:selling minds '+inttostr(SellPrice)+'ea - '+Players[CurrentPlayer].Name);
if not ClickTrade then begin
clicked:=false;
Exit;
end;
wait(1000+random(100));
if not (WhatTradeScreen=1)then exit;
no:=NumberOf('mind')-(NumberOf('mind')mod 1000);
OfferItem('mind',no);
repeat
SleepAndMoveMouse(50+random(100));
TheirOffer(ti,ta);
until((ti='coin')or(WhatTradeScreen=0));
if(WhatTradeScreen=0) then Exit;
if(not(ta>=no*SellPrice)) then begin
nno:=no-(no*SellPrice-ta)/SellPrice;
RemoveItem((no*SellPrice-ta)/SellPrice);
no:=nno;
end;
TheirOffer(ti,ta2);
if(not(ti='coin'))and(ta2=ta)then Exit;
AcceptTrade;
repeat
TheirOffer(ti,ta);
if Accepted then begin
if (ta>=no*SellPrice)and(ti='coin') then AcceptTrade;
end;
SleepAndMoveMouse(50+random(100));
if(WhatTradeScreen=0) then Exit;
until(WhatTradeScreen=2);
AcceptTrade;
end;
begin
SetupSRL;
SetupScript;
BenMouse:=False;
MouseSpeed:=10;
DeclarePlayers;
ActivateClient;
wait(500);
repeat
LoginPlayer;
SetupPlayer;
MarkTime(PlayerStartMark);
repeat
if not (NumberOf('mind')>10000) then begin
repeat
clicked:=true;
TryBuy;
if clicked then begin
while(WhatTradeScreen=2)do SleepAndMoveMouse(100+random(100));
SleepAndMoveMouse(1000+random(500));
end;
CheckRands;
until not LoggedIn or (TimeFromMark(PlayerStartMark)>=TimePerPlayer)or (NumberOf('mind')>10000);
end;
if not (NumberOf('mind')<1000) then begin
repeat
clicked:=true;
TrySell;
if clicked then begin
while(WhatTradeScreen=2)do SleepAndMoveMouse(100+random(100));
SleepAndMoveMouse(1000+random(500));
end;
CheckRands;
until not LoggedIn or (TimeFromMark(PlayerStartMark)>=TimePerPlayer)or (NumberOf('mind')<1000);
end;
until(not(LoggedIn))or(TimeFromMark(PlayerStartMark)>=TimePerPlayer);
NextPlayer(LoggedIn);
until(False);
end.