SRL Archive - General Botting Help

Cannot find the bitmap


Mark xd

2014-05-03 07:31:12

Hello,

I want the bot to click a bitmap but the script stops before it clicks the bitmap.

my script looks like this:

Program new;
{$i RSPS/srlRSPS.simba}


var
_server:_rsps_server;
X,Y:Integer;
Counter: Integer;
trade:Integer;
begin
_server.init(498, 'Server')
end;
Procedure thiev;
begin

Counter := 0;
repeat
if FindColorTolerance(X, Y, 5283759, 1, 1, 774, 537, 5) then
begin
Counter := Counter + 1;
mmouse(X, Y,1,1);
wait(2875); // waits.
ClickMouse(X, Y, mouse_Left);// clicks
wait(150);
end;
Until(Counter > 3);

if FindColorTolerance(X, Y, 2107, 1, 1, 774, 537, 5) then
begin
mmouse(X, Y,1,1);
wait(800); // waits.
ClickMouse(X, Y, mouse_Right);// clicks
end;
if FindBitmapToleranceIn(trade, X, Y, 1, 1, 774, 537, 145) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;

end;
Begin
MouseSpeed := 15;
trade := BitmapFromString(10, 9, 'meJz7/x8EGBgY3ENiMdF/UmT/IwE' +
'8sgxggFUWIoVLL1W4QAS3BZMLAAwNg2Q=');
thiev;
FreeBitmap(trade);
end.

it is for clicking "trade" after he right clicked the npc.

all regards, mark

rj

2014-05-03 08:47:28

You have 2 main loops:

 begin
_server.init(498, 'Server')
end;

and


Begin
MouseSpeed := 15;
trade := BitmapFromString(10, 9, 'meJz7/x8EGBgY3ENiMdF/UmT/IwE' +
'8sgxggFUWIoVLL1W4QAS3BZMLAAwNg2Q=');
thiev;
FreeBitmap(trade);
end.

Remove the first one and add
 _server.init(498, 'Server')

To the one at the buttom

Also, it would probably be easier to do use waitOptionMulti which waits for text in the right click menu and clicks it:

Program new;
{$i RSPS/srlRSPS.simba}


var
_server:_rsps_server;
X,Y:Integer;
Counter: Integer;

Procedure thiev;
begin

Counter := 0;
repeat
if FindColorTolerance(X, Y, 5283759, 1, 1, 774, 537, 5) then
begin
Counter := Counter + 1;
mmouse(X, Y,1,1);
wait(2875); // waits.
ClickMouse(X, Y, mouse_Left);// clicks
wait(150);
end;
Until(Counter > 3);

if FindColorTolerance(X, Y, 2107, 1, 1, 774, 537, 5) then
begin
mmouse(X, Y,1,1);
wait(800); // waits.
ClickMouse(X, Y, mouse_Right);// clicks
end;
if _server.waitOptionMulti(['theiv'], 1200) then
wait(250);

end;
Begin
_server.init(498, 'Server');
MouseSpeed := 15;
thiev;
end.






I'll be out of town until 12 hours from now, so I won't be able to respond to any RSPS include related questions until then

Mark xd

2014-05-03 09:18:06

no you didn't understand the bitmap is for trading a npc but thanks for the fasst reply! :)

rj

2014-05-03 09:21:29

From: Mark xd
no you didn't understand the bitmap is for trading a npc but thanks for the fasst reply! :)


Ok then you can do

  if _server.waitOptionMulti(['Trade'], 1200) then

Mark xd

2014-05-03 11:02:06

cool that works, any idea why it didn't work with bitmap?