m0u53m4t
2007-03-26 17:24:34
Used for about 2 hours non stop, this will auto buy all the coal you can afford, then sell it again for whatever higher price you specify.
Edit the script as little to make it run all day buying and selling. You makes tonnes of cash :f:
As its normally run Fally East, you don't really need antirandoms, I've never had a random in a bank:
Edit the script as little to make it run all day buying and selling. You makes tonnes of cash :f:
As its normally run Fally East, you don't really need antirandoms, I've never had a random in a bank:
{.include srl\srl.scar}
{.include srl\srl\Misc\trade.scar}
{.include srl\srl\skill\fighting.scar}
Const BuyOrSell = 'buy';
Const BuyGpEach = 150;
Const SellGpEach = 180;
Const SellBatch = 150; //How many coal to sell at a time? 150 Recommended
Const StartPlayer = 0; // Determines who will play first
Procedure DeclarePlayers;
begin
HowManyPlayers :=1; // Set Number of Players here.
NumberOfPlayers(HowManyPlayers); // Sets the Players Array Length;
CurrentPlayer:=StartPlayer; // CurrentPlayer = Array Index
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Loc :='Loc1';
Players[0].Skill:='Mining';
Players[0].Active:=True;
writeln('You have currently ' +inttostr(HowManyPlayers)+' Players set to run. The starting player is '+ players[currentplayer].name);
End;
Var
NotedCoalBmp,UnNotedCoalBmp,CoalOffer,Sales,Bought,Spent,GpEach:Integer;
SellerName,LastChat,TheWord:String;
Correct:Boolean;
Procedure Proggy;
Begin
ClearDebug
Writeln('Completed ' + inttostr(sales) + ' trades.')
Writeln('Bought ' + inttostr(bought) + ' coal.')
Writeln('Spent ' + inttostr(spent) + 'gp.')
end;
Procedure SayThanks;
Begin
Wait(1000+Random(200))
LastChat := GetNewChatMsg
Writeln(LastChat)
If LastChat = 'accepted trade.' then
Begin
Case Random(10) of
0: TypeSend('ty ' + SellerName)
1: TypeSend('ty')
2: TypeSend('Thx')
3: TypeSend('Thanks')
End;
Sales := Sales + 1
Bought := Bought + CoalOffer
Spent := Spent + (CoalOffer *BuyGpEach)
Proggy
End;
End;
Function RightAmount2: Boolean;
Begin
If (CheckItem(True,'Coal')= CoalOffer) then Result := True
End;
Function RightAmount1: Boolean;
Begin
If (CoinAmount('your trade') = (BuyGpEach * CoalOffer)) then Result := True;
End;
Function RightAmount3: Boolean;
Begin
If (CoinAmount('trade') = (SellGpEach * 150)) then Result := True;
End;
Function RightAmount4: Boolean;
Begin
If (CheckItem(True,'Coins') = (SellGpEach * 150)) then Result := True;
End;
Procedure OfferGp(GpCount :integer);
Begin
If ((Not (CoinAmount('your trade') = (BuyGpEach * CoalOffer))) and (TradeScreen or TradeScreen2)) Then
Begin
If Not (CoinAmount('your trade') = 0) then
Begin
Mouse(50,90,13,13,False)
If not ClickOption('Remove All',1) then Popup('Remove All')
Wait(500+random(500))
End;
ClickAllItemsColorTolWait('Offer X',1424108,5,1000+random(500))
Wait(1000+random(500))
TypeSend(IntToStr(GpCount))
Wait(1300+random(500))
End;
End;
Procedure OfferCoal(CoalCount :integer);
Begin
If Not (AmountBmp('your trade',NotedCoalBmp,10)=CoalCount) then
Begin
If (AmountBmp('your trade',NotedCoalBmp,10)>0) then
Begin
Mouse(50,90,13,13,False)
If not ClickOption('Remove All',1) then Popup('Remove All')
Wait(500+random(500))
End;
ClickAllItemsColorTolWait('Offer X',1583144,5,1000+random(500))
Wait(1000+random(500))
TypeSend(IntToStr(CoalCount))
Wait(1000+random(500))
End;
End;
Function WaitForOffer: Integer;
Begin
While AmountBmp('trade',NotedCoalBmp,10) < 1 do
begin;
If AmountBmp('trade',UnNotedCoalBmp,10) > 0 then Begin; Decline; TypeSend('Notes only soz'); End;
If not TradeScreen then exit;
Wait(200+Random(100))
end;
Result := AmountBmp('trade',NotedCoalBmp,10)
End;
Procedure BuyCoal;
Begin
Correct := False
if TradeScreen then
Begin
SellerName := GetTraderName
Repeat
Repeat
If AmountBmp('trade',UnNotedCoalBmp,10) > 0 then Decline
Wait(100+random(100))
CoalOffer := WaitForOffer
OfferGp(CoalOffer*BuyGpEach)
If Not Waiting then Correct := RightAmount1
If Not(TradeScreen or TradeScreen2) then Exit;
Until Correct
Accept
Wait(100+random(100))
If Not(TradeScreen or TradeScreen2) then Exit;
Until TradeScreen2
If RightAmount2 then Accept
If Not RightAmount2 then Decline
While Waiting do Wait(100+Random(100))
SayThanks
End;
End;
Procedure SellCoal;
Begin
Correct := False
if TradeScreen then
Begin
SellerName := GetTraderName
Repeat
OfferCoal(SellBatch)
Repeat
If Not Waiting then Correct := RightAmount3
Wait(100+random(100))
If Not(TradeScreen or TradeScreen2) then Exit;
Until Correct
If Not Waiting then Accept
Wait(100+random(100))
If Not(TradeScreen or TradeScreen2) then Exit;
Until TradeScreen2
If RightAmount4 then Accept
If Not RightAmount4 then Decline
While Waiting do Wait(100+Random(100))
SayThanks
End;
End;
function AcceptTrade2: Boolean;
//only works with last line, turn public chat off
var
timeout: Integer;
fx, fy: Integer;
begin
if FindColor(Fx, Fy, 8388736, 23, 418, 182, 425) then
begin
Mouse(Fx + Random(140),Fy, 3, 10, True);
Flag
MarkTime(timeout);
repeat
Wait(500 + Random(100))
if (TimeFromMark(timeout) > 3000) then
Exit;
until (TradeScreen);
Result := True;
end;
end;
Procedure MyAntiBan;
begin
Status('Doing antiban')
Case Random(11) of
0: AntiBan
1: RandomRClick
2: PickUpMouse
3: IdleTime(1000,5000,1.0)
4: Mouse(MSCX, MSCY,25,25,True)
5: RandomMovement
6: BoredHuman
7: BoredHuman
8: BoredHuman
9: BoredHuman
10: Wait(Random(15000))
End;
end;
Procedure TalkSale;
Var
Phrase:String;
I:Integer;
Begin
If Random(30) = 0 then MyAntiBan
If TheWord = 'buy' then GpEach := BuyGpEach
If TheWord = 'sell' then GpEach := SellGpEach
If Random(3) = 0 then Phrase := 'flash2:'
If Random(3) = 0 then Phrase := Phrase + 'Wave:'
Phrase := Phrase + TheWord
If Random(2) = 0 then Phrase := Phrase + 'ing'
If Random(5) = 0 then Phrase := Phrase + ' noted'
Phrase := Phrase + ' coal'
If Random(2) = 0 then For i := 0 to Random(3) do Phrase := Phrase + '!'
Phrase := Phrase + ' ' + IntToStr(GpEach) + 'ea'
For i := 0 to Random(3) do Phrase := Phrase + '!'
typesend(Phrase)
Wait(1000+random(2500))
End;
Procedure FillMem;
begin
NotedCoalBmp:= BitmapFromString(21, 2, 'z78DA558D490E04310803BF14CC9A6' +
'3D6FF3FA9D3C31CD22021835CB8EE5826E52D2223942EC10191C5' +
'13A12A40D72E8EA5218299CEBF7F9F061C4E913AEF8D6A314B9DA' +
'C4D550E5F06A16033E1CF9F5F2ECAC1B60C6EF03BDDF46C72C8C1' +
'F4A1EAEB4747A37ECFDB9394B3566E77EEA0B67C3FFA4E349B');
UnnotedCoalBmp:= BitmapFromString(30, 1, '483E33000001100E084637234A3925' +
'4D3C28503F2A56442D5A462E56442D00000130202000000115150' +
'E202012232317232317000001302020302020483E334940340000' +
'01503F2A5A462E72593B7D6141826644826644000001');
LoadCoinBmp
End;
Procedure Setup;
Begin
TheWord := BuyOrSell
SetupSRL
FillMem
ActivateClient
DeclarePlayers
If Not LoggedIn then LoginPlayer
SetChat('Hide', 1);
SetChat('Hide', 1);
SetChat('Off', 2);
SetChat('Off', 2);
SetChat('On', 3);
SetChat('On', 3);
ClearDebug
Writeln('Welcome to m0u53m4ts coal buyer!')
End;
begin
Setup
Repeat
Repeat
TalkSale
If Not (BankScreen or TradeScreen or TradeScreen2) then FindNormalRandoms
FindTalk
If InFight then RunTo('E',True)
Until TradeScreen or TradeScreen2 or FindColorTolerance(x,y,8388736,21,420,228,430,3)
If AcceptTrade2 then
If Lowercase(TheWord) = 'buy' then BuyCoal
If Lowercase(TheWord) = 'sell' then SellCoal
If Not ((Lowercase(TheWord) = 'sell') or (Lowercase(TheWord) = 'buy')) Then Begin; Writeln('TheWord isnt set right'); TerminateScript; End;
Until CoinAmount('inv') < 10000
Writeln('Buying done!')
TheWord := 'sell';
Repeat
Repeat
TalkSale
Until TradeScreen or TradeScreen2 or FindColorTolerance(x,y,8388736,21,420,228,430,3)
If AcceptTrade2 then
If Lowercase(TheWord) = 'buy' then BuyCoal
If Lowercase(TheWord) = 'sell' then SellCoal
If Not ((Lowercase(TheWord) = 'sell') or (Lowercase(TheWord) = 'buy')) Then Begin; Writeln('TheWord isnt set right'); TerminateScript; End;
Until AmountBmp('inv',NotedCoalBmp,10) < 150
Writeln('Buying done!')
end.