SRL Archive - OSR Help

Trade Accepter


Nig

2012-07-16 14:49:37

I am trying to come up with a very simple script that accepts trades. All I want it to do is when it gets a trade offer clicks it, accepts the first trade window when something is offered, and then accepts the second trade window.

I figured I'd start with something unique and simple, and this will also be useful to be for certain skilling tasks.

I read the tutorials and I have a very very limited understanding of scripting here, but I hard there is a built in trade function in Simba.

If I could get any help/suggestions I would appricate it!

I have seen some "begging" scripts and I have tried to learn off of those but they all seem outdated and I think they have just made me amazingly confused.

I have found this which is apparently a code to accept trades, but I have only run Simba and I'm not even sure what the difference is but I think this is Scar? And it may be outdated I really don't have a clue but I figured this would be a good starting point:


procedure TradeIn; // Thanks MasterKill, Rikjess, and Hy71194!!!
begin
repeat
begin
if (not (FindColorTolerance (x, y, 8388736, 23, 437, 294, 459, 5))) then
begin
exit;
end;
if (FindColorTolerance (x, y, 8388736, 23, 437, 294, 459, 5)) then
begin
MMouse(x,y,0,0);
Wait(200+Random(300));
if IsUpTextMultiCustom(['ccept', 'rade', 'Accept']) then
Mouse(x, y, 1, 1, True);
begin
TradeTimeTicking := 0
Wait(10000+Random(5000));
end;
end;
end;
if (not (FindColorTolerance (x, y, 3358280, 31, 34, 82, 50, 5))) then
begin
WriteLn('Trading: Error!');
MFF(MMCX + Random(10), MMCY + Random(10), 7, 7); // MiniMap 'blind click' so just in case you get a trade somehow, you wont get a NoGameTab.
Inc(TradesError);
Inc(ReportVars[2]);
SRLRandomsReport;
exit;
end;
if (FindColorTolerance (x, y, 3358280, 31, 34, 82, 50, 5)) then
begin
WriteLn('Trading! Now wait for an Accept. Max Wait: 25 sec.');
repeat
if (FindColorTolerance (x, y, 16777215, 180, 296, 341, 317, 5)) then
begin
WriteLn('Other player accepted! Now we''ll accept too!');
Mouse(256, 164, 6, 6, True);
Wait(2000);
if (FindColorTolerance (x, y, 4214871, 30, 65, 64, 73, 5)) then
begin
WriteLn('We made it to the seccond window!');
WriteLn('Now wait for an second accept. Max Wait 20 sec.');
Wait(1500);
TradeTimeTicking := 0
repeat
if (FindColorTolerance (x, y, 16776960, 301, 38, 303, 42, 5)) then
begin
WriteLn('Accepted! all we need to do now is say thx :D');
Mouse(223, 309, 3, 3, True);
case random (5) of
0: TypeSend('ty');
1: TypeSend('thx');
2: TypeSend('thanks for your kindness');
3: TypeSend('thank you');
4: TypeSend('thanks');
end;
WriteLn('Trade sloved!');
Inc(TradeWin);
Inc(ReportVars[0]);
SRLRandomsReport;
Wait(100+Random(500));
exit;
end;
if (not (FindColorTolerance (x, y, 4214871, 30, 65, 64, 73, 5))) then
begin
WriteLn('The noob is not giving anything ... Decline.');
case random (5) of
0: TypeSend('hit accept pl0x');
1: TypeSend('give me stuff');
2: TypeSend('no thanks');
3: TypeSend('hit accept');
4: TypeSend('-.-');
end;
Inc(TradeBad);
Inc(ReportVars[1]);
SRLRandomsReport;
exit;
end;
if (FindColorTolerance (x, y, 4214871, 30, 65, 64, 73, 5)) then
begin
Wait(1000);
TradeTimeTicking := TradeTimeTicking + 1
end;
if ( TradeTimeTicking = 20 ) then
begin
WriteLn('Took to long... Now Decine.');
Mouse(297, 310, 2, 2, True);
case random (5) of
0: TypeSend('i dont have time for you');
1: TypeSend('no thanks');
2: TypeSend('-.-');
3: TypeSend('no thanks');
4: TypeSend('get lost');
end;
Inc(TradeBad);
Inc(ReportVars[1]);
SRLRandomsReport;
exit;
end;
until(false);
end;
end;
TradeTimeTicking := TradeTimeTicking + 1
Wait(1000);
if (not (FindColorTolerance (x, y, 3358280, 31, 34, 82, 50, 5))) then
begin
WriteLn('The noob is not giving anything ... Decline.');
case random (5) of
0: TypeSend('hit accept');
1: TypeSend('accept');
2: TypeSend('-.-');
3: TypeSend('???');
4: TypeSend('go away');
end;
Inc(TradeBad);
Inc(ReportVars[1]);
SRLRandomsReport;
exit;
end;
if ( TradeTimeTicking = 25 ) then
begin
WriteLn('Took to long ... Decine');
Mouse(258, 217, 5, 5, True);
case random (5) of
0: TypeSend('-.-');
1: TypeSend('hit accept');
2: TypeSend('nah');
3: TypeSend('no thanks');
4: TypeSend('get lost');
end;
Inc(TradeBad);
Inc(ReportVars[1]);
SRLRandomsReport;
exit;
end;
until (false);
end;
until (false);
Exit; // So the script doesn't "hang" for some reason.
end;

Harry

2012-07-16 15:09:21

Simba and SCAR are about the same.

That snippet above I think I wrote a couple years ago. Outdated for sure due to lots of RS chatbox and trade window changes. So no that won't really work.

PS: I deleted your other thread, please keep it to one thread.

Nig

2012-07-16 15:15:50

Okay thanks, do you think I could find a way to update it? I really don't know where to start

Abu

2012-07-16 15:19:26

From: Nig
Okay thanks, do you think I could find a way to update it? I really don't know where to start


Go through the beginner tutorials on the site.

EDIT: Tbh, shouldn't be too hard at all to update this, in fact it's a very good starting point to learn.

Nig

2012-07-16 15:21:27

I spent about 2 days reading and to be honest I'm massively confused, I'll try to re-read everything but any help/suggestions is appricated

Footy

2012-07-16 19:54:47

When I get some time tomorrow, I can write you a trade accepter. Just to make sure, you want it to accept the trade, wait until an item is added into the trade, then accept both windows? I think Its do-able.

Andres

2012-07-16 23:12:25

So this is for begging? I just don't see the practicality. Just curious ;)