SRL Archive - General Botting Help

Not runescape related, - Can I post here?


queenOkaos

2014-01-25 06:23:39

Hi,

I am a newbie and not sure whether this is the right place to put it my query about a Simba script I am writing. It has nothing to do with Runescape and I need help, very basic things probably for a couple of people in here.

I would appreciate some help please.

So right now I am asking whether this is the right place or not because I do not want to go against the forum rules.

Thanks for your attention.

Flight

2014-01-25 07:30:07

I don't see why not. Post your issues / questions here and we'll try to lend a hand.

queenOkaos

2014-01-25 07:43:18

From: Flight
I don't see why not. Post your issues / questions here and we'll try to lend a hand.



Thank you very much.

So here it goes.

This is the script I have right now :

program Addpoints;

Var
x, y: Integer;
Picture1: Integer;
Picture2: Integer;
PictureSubmit: Integer;

procedure LoadPicture1;
Begin
Picture1 := BitmapFromString(7, 7, 'meJzjXl/JjYF41xRjIv6VeUAUeWQW' +
'hAFEJttaBJZlLrl39NrHJ8WnlwHZUYemA9lCi1PMNtacfHMHyO65v' +
'AVIAtkiC+KBKGBnB5ALEnl922J9udjcKAiK29O76eEpveXZQDYATv' +
'JMaA==');

end;

Procedure LoadPicture2;
Begin
Picture2 := BitmapFromString(17, 16, 'meJxzMJV3IBHZm1AHhftYTu6qSY' +
'5wwyprZ4wF/f/55fj+LUAyKcINU9YWGwIqzor3ntFf/+zBTSwKjOT' +
'QkKed9tf3L4FagOjN03uhXhZoCmwwUE5y8M1LJyFagAwgF12NITqq' +
'yE+4cGI/3JYQLws0BdaoKD7M7fKZI63VWXC/WGOoQVN/7fyx4oxQi' +
'BV7t65auXAapjIrA1kIyk4KQlYPcVV5XgJcARxZgpGrjRYwYGuKEu' +
'DqgWygiCVMAQrSB6H+9mp4KEHQ6kVTDu7cAJFFQxZg9Oz+zYUzupC' +
'1AD0CFDx7bB8aunn5tIWe7OzJHY/vXEFWD0H9raWYCGh7U1UuMK4h' +
'oUokAgDsEwsq');
end;

Procedure LoadPictureSubmit;
Begin
PictureSubmit := BitmapFromString(10, 14, 'meJxrlNnSiA9tohWS3YgXrUVD/2' +
'8/+A8DjbKrkNH/2/fP34YK7gCRy+DovOyy7/8/Nta/QBJcDEc7ZBf' +
'///ACrBcuOB8ZnZed////B4il9z/8b5SbjRWdl5v9///7RrlpeNEk' +
'OHq9atJroC/kriEJ9sHRDrm+/x8ega3bDxEBAC7Xz98=');
end;

Procedure ClickPic1;
begin
If (FindBitmap(Picture1, x, y)) Then
begin
Writeln('Found Picture1');
MoveMouse(x, y);
ClickMouse(x, y,mouse_Left);
Wait(1000);
MoveMouse(400, 890);
ClickMouse(400,890,mouse_Left); // This makes the mouse click back into Simba (Only way this worked for Picture1)
Wait(1000);
end Else
begin
Writeln('Picture1 NOT Found');
Wait(1000);
end;
end;

Procedure ClickPicSubmit;
begin
If (FindBitmap(PictureSubmit, x, y)) Then
begin
Writeln('Found PictureSubmit');
MoveMouse(x, y);
Wait(1000);
MoveMouse(x - 120,y - 35);
Wait(1000);
ClickMouse(x,y,mouse_Left);
Wait(1000);
MoveMouse(x,y);
Wait(1000);
ClickMouse(x,y,mouse_left);
Wait(1000);
end Else
begin
Writeln('PictureSubmit NOT Found');
Wait(1000);
end;
end

Procedure ClickPic2;
begin
If (FindBitmap(Picture2, x, y)) Then
begin
Writeln('Found Picture2');
MoveMouse(x, y);
ClickMouse(x, y,mouse_Left);
Wait(2000);
MoveMouse(1600,800);
ClickMouse(1600, 800, mouse_Left);
Wait(1000);
ClickPicSubmit;
Wait(1000);
MoveMouse(550,300);
ClickMouse(550,300, mouse_Left);
Wait(1000);
MoveMouse(1600,200);
ClickMouse(6100,200, mouse_Left);
Wait(1000);
MoveMouse(650,460);
ClickMouse(650, 460,mouse_Left);
Wait(2000);
end Else
begin
Writeln('Picture2 NOT Found');
Wait(1000);

end;
end;

Procedure FreeBmps;
begin
FreeBitmap(Picture1);
FreeBitmap(Picture2);
FreeBitmap(PictureSubmit);
end;

begin
ClearDebug;
MoveMouse (650,460);
ClickMouse(650,460,mouse_Left);
repeat
LoadPicture1;
LoadPicture2;
LoadPictureSubmit;
ClickMouse(370 ,580, mouse_Left);
ClickPic1;
ClickPic2;
FreeBmps;
until(false);
end.


and it is supposed to :

Look for picture 1
continue looking for picture one until it finds Picture 2
When picture 2 comes along we look for Picture Sumbit.
if it does not find picture submit, it has to continue, BUT

and the problem lies here,


If it finds Picture Submit he has to look again to find picture submit until it does not find it….


Can anyone help me to obtain this please?

Hope I have explained myself good enough and thank you in advance.

queenOkaos

2014-01-27 09:23:31

No luck.?!?!?!…. and I thought that this would have been an easy task for some :(

Olly

2014-01-27 12:49:29

You mean, something like this?

if (FindBitmap(submit, x, y)) then
begin
writeln('found submit, waiting until it dissapears');

repeat
wait(1000);
until (not FindBitmap(submit, x, y));
end;

queenOkaos

2014-01-27 18:00:24

I think that will work, but will only to be able to test it tomorrow…

Many thanks.

Another thing which is bugging me is Picture 1. I have taken a screen shot of the picture,cropped a small piece and saved it as bmp. The I converted it into a string and use that in my script. Pic 2 and Picture Submit work brilliantly but Picture 1, many times works and sometimes it does not. Any good ideas how I should solve the problem please?

Turpinator

2014-01-27 20:47:19

From: queenOkaos

Another thing which is bugging me is Picture 1. I have taken a screen shot of the picture,cropped a small piece and saved it as bmp. The I converted it into a string and use that in my script. Pic 2 and Picture Submit work brilliantly but Picture 1, many times works and sometimes it does not. Any good ideas how I should solve the problem please?


use an even smaller portion of the image? Use something like 'findbitmaptolerance()'?

queenOkaos

2014-01-30 12:12:59

From: Turpinator
use an even smaller portion of the image? Use something like 'findbitmaptolerance()'?


When scripting like this:


Procedure ClickPic1;
begin
If (FindBitmapTolerance(Picture1, x, y)) Then
begin
Writeln('Found Picture1');
MoveMouse(x, y);
ClickMouse(x, y,mouse_Left);

I am getting this error :

Unknown declaration "FindBitmapTolerance" at line 40, column 7

Turpinator

2014-01-30 12:23:01

From: queenOkaos
When scripting like this:

Procedure ClickPic1;
begin
If (FindBitmapTolerance(Picture1, x, y)) Then
begin
Writeln('Found Picture1');
MoveMouse(x, y);
ClickMouse(x, y,mouse_Left);


I am getting this error :

Unknown declaration "FindBitmapTolerance" at line 40, column 7


something like findbitmaptolerance()

sorry. the actual function is
function FindBitmapToleranceIn(bitmap: integer; var x, y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer): Boolean;

queenOkaos

2014-01-30 14:08:56

From: Turpinator
sorry. the actual function is
function FindBitmapToleranceIn(bitmap: integer; var x, y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer): Boolean;



I am still getting an error :

"Exception in Script: Closing parenthesis expected at line 40, column 39"

My script is like this and I cannot figure out what I am doing wrong :(


Procedure ClickPic1;
begin
If (FindBitmapToleranceIn(Picture1: integer; var x, y: Integer; 0, 0, 1000, 800: Integer; tolerance: Integer)): Boolean; Then
begin
Writeln('Found Picture1');
MoveMouse(x, y);

NKN

2014-01-30 14:13:22

From: queenOkaos
I am still getting an error :

"Exception in Script: Closing parenthesis expected at line 40, column 39"

My script is like this and I cannot figure out what I am doing wrong :(

Procedure ClickPic1;
begin
If (FindBitmapToleranceIn(Picture1: integer; var x, y: Integer; 0, 0, 1000, 800: Integer; tolerance: Integer)): Boolean; Then
begin
Writeln('Found Picture1');
MoveMouse(x, y);


Remove the :boolean

Turpinator

2014-01-30 14:17:51

Alright. before we go any further. use
 tages please. it makes everything so much easier to see.

and after that... read a few tutorials (on coding in general) because it seems it may be beneficial to you.


This...[simba]function FindBitmapToleranceIn(bitmap: integer; var x, y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer): Boolean;
… is the function declaration. Lets break it down.

function
okay. this tells us whether it is a function or a procedure…
(functions return values where as procedures do not)

FindBitmapToleranceIn
okay, this one is simple. its the name of the function… it has a meaningful name and tells us what it does.

(bitmap: integer; var x, y: Integer; xs, ys, xe, ye: Integer; tolerance: Integer)
These are the paramaters with their names, followed by the types.
But youll notice something special about x and y… it says 'var' infront of them? da hell? well that means the variable is passed by reference, and not by value as normally done! (ie its an in/out var)

: Boolean;
and this… this tells us what our function returns (procedures dont have this part) and as we can see… FindBitmapToleranceIn() returns a… boolean.

queenOkaos

2014-01-30 14:20:32

I tried this:

Integer; tolerance: Integer)) Then

and

Integer; tolerance: Integer)); Then
and

Integer; tolerance: Integer)): Then
but none worked. Always the same error
"Exception in Script: Closing parenthesis expected at line 40, column 39"

Musn't that mean that there should be a parenthesis right after Picture 1??????

queenOkaos

2014-01-30 14:23:40

Sorry, I read Turpinator's message after I posted my previous one.

Mark

2014-01-30 14:42:06

this is how you would do it
If FindBitmapToleranceIn(Picture1, x, y, 0, 0, 1000, 800, 15)Then

this is just the functions calling parameters you dont have to define that there integers and wateva when actually calling
If (FindBitmapToleranceIn(Picture1: integer; var x, y: Integer; x1, y1, x2, y2: Integer; tolerance: Integer)): Boolean;

queenOkaos

2014-01-30 16:00:51

Ok Thanks. Like that it is working. But even though I have cropped a very small part of the pic, it is not found each time it shows?

Is there anything you need me to post so that maybe someone can pinpoint the problem?

Mark

2014-01-30 16:29:14

post your new code so we can see

queenOkaos

2014-01-31 09:06:40

From: Mark
post your new code so we can see


This is the cropped pic, my latest one.


procedure LoadPicture1;
Begin
Picture1 := BitmapFromString(7, 9, 'meJwTWpwiBEPSbUGW+rJAJLIgHo5k' +
'm/0s9GWBSGxuFBzJNXqZ68kAkfisUDhSKHc21ZUBIsnpAXCkGaJno' +
'iMNRNJTvCBINc3UWFsagoy0pDCRgSYWpK8hiYkAPJQs1w==');


end;

queenOkaos

2014-01-31 09:49:08

From: Olly
You mean, something like this?

if (FindBitmap(submit, x, y)) then
begin
writeln('found submit, waiting until it dissapears');

repeat
wait(1000);
until (not FindBitmap(submit, x, y));
end;


Unfortunately it is not working.

[ATTACH=CONFIG]22833[/ATTACH]

I had to stop the script manually because after the first submit the mouse did not move anymore and nothing happened.

queenOkaos

2014-01-31 10:11:33

From: queenOkaos
Unfortunately it is not working.

[ATTACH=CONFIG]22833[/ATTACH]

I had to stop the script manually because after the first submit the mouse did not move anymore and nothing happened.



Then after this I tried the script again where I knew there was going to be only one "submit" and it worked.The script continued after the "submit disappeared".

Therefore the problem lies where there are more than one "submit".

queenOkaos

2014-02-01 04:53:36

From: Mark
this is how you would do it
If FindBitmapToleranceIn(Picture1, x, y, 0, 0, 1000, 800, 15)Then

this is just the functions calling parameters you dont have to define that there integers and wateva when actually calling
If (FindBitmapToleranceIn(Picture1: integer; var x, y: Integer; x1, y1, x2, y2: Integer; tolerance: Integer)): Boolean;


From: queenOkaos
Ok Thanks. Like that it is working. But even though I have cropped a very small part of the pic, it is not found each time it shows?

Is there anything you need me to post so that maybe someone can pinpoint the problem?


With regards to this problem, I think I have solved it. I have increased the tolerance figure from 15 to 50 (originally I have tried 100 :)and it was finding my picture even when it was not showing :) ) But with 50 it seems that it has done the trick. Thank you all especially Mark who has pinned it.

I still have the problem with the loop involving PictureSubmit as explained in a post above

queenOkaos

2014-02-05 12:30:47

besides the other problem, I still have another question which is important to me.

Is it possible to select the Simba window to stay on top, as was possible with the other similar program Scar?

queenOkaos

2014-02-09 18:04:31

Is there a way where you can keep Simba window always on top of the other windows?

Ian

2014-02-09 18:10:11

From: queenOkaos
Is there a way where you can keep Simba window always on top of the other windows?


I think that depends on the OS, I remember in Xubuntu there was an option to set a window to stay on top always.

Take a look at this, there seems to be a program linked that does what you want. http://www.pcworld.com/article/218511/Windows.html

queenOkaos

2014-02-09 20:00:48

This is very interesting info. Thanks. It works with most of the windows I open, (different browsers) but unfortunately not with Simba window :(