SRL Archive - RuneScape Private-Server Scripts

Help with rsps script


henryuscola

2015-03-06 21:20:14

Hello everyone,
I've been having trouble getting a simple script to basically find this Bitmap and after finding this bitmap it is in a place and when it is in this place it should be finding some color to attack and click on it. how do u think i should do this
heres i have


unction attack: integer;
var
x, y, Pit: integer;
begin
if FindBitmapToleranceIn(Pit, X, Y, 737, 263, 795, 335, 145) then
MoveMouse(x, y);
writeLn('inside pit') then
if findColorTolerance(x, y, 3035181, 20, 59, 768, 413, 5) then
begin
writeLn('target found');
MoveMouse(x, y);
wait(2000);
ClickMouse(x, y, MOUSE_LEFT);
wait(2000)
end else writeln('target not found, not in pit');
end;



P.s sorry i have no idea how to post simba code in its own seperate text box.

KeepBotting

2015-03-06 21:28:36

For Simba code, you use SIMBA tags, like:
 
without the spaces obviously


function attack: integer;
var
x, y, Pit: integer;
begin
if FindBitmapToleranceIn(Pit, X, Y, 737, 263, 795, 335, 145) then //We we find this bitmap, then...
begin
MoveMouse(x, y); //Move the mouse to where we found it (don't click or anything though)
writeLn('inside pit');
end;

if findColorTolerance(x, y, 3035181, 20, 59, 768, 413, 5) then //If we find this color(?)
begin
writeLn('target found'); //I guess the above color is of a monster to attack?
MoveMouse(x, y); //Move the mouse, wait 2 seconds and then click? I hope the target isn't moving...
wait(2000);
ClickMouse(x, y, MOUSE_LEFT);
wait(2000)
end else writeln('target not found, not in pit');
end;

Looks like you have a functional function (why is this a function btw? You've set it to return an integer but never assign a result) here. What's it not doing that you want it to?

henryuscola

2015-03-06 22:37:32

Hi , thanks for looking at my code yes when it finds the bitmap it moves mouse to it then I want it to search for a color to attack only if it's inside the pit. So far my script searches for the target color everywhere and not where the bitmap is found. I only want it to search for target colors when bitmap is found.

KeepBotting

2015-03-07 09:38:08

From: henryuscola
Hi , thanks for looking at my code yes when it finds the bitmap it moves mouse to it then I want it to search for a color to attack only if it's inside the pit. So far my script searches for the target color everywhere and not where the bitmap is found. I only want it to search for target colors when bitmap is found.


Easiest way to do that would be to tell the function to exit if the first bitmap isn't found, like so:

function attack: integer;
var
x, y, Pit: integer;
begin
if FindBitmapToleranceIn(Pit, X, Y, 737, 263, 795, 335, 145) then //We we find this bitmap, then...
begin
MoveMouse(x, y); //Move the mouse to where we found it (don't click or anything though)
writeLn('inside pit');
end else exit; //I've added this bit here.
//If the bitmap is not found, we'll exit the routine.

if findColorTolerance(x, y, 3035181, 20, 59, 768, 413, 5) then //If we find this color(?)
begin
writeLn('target found'); //I guess the above color is of a monster to attack?
MoveMouse(x, y); //Move the mouse, wait 2 seconds and then click? I hope the target isn't moving...
wait(2000);
ClickMouse(x, y, MOUSE_LEFT);
wait(2000)
end else writeln('target not found, not in pit');
end;

henryuscola

2015-03-11 12:50:11

From: KeepBotting
Easiest way to do that would be to tell the function to exit if the first bitmap isn't found, like so:

function attack: integer;
var
x, y, Pit: integer;
begin
if FindBitmapToleranceIn(Pit, X, Y, 737, 263, 795, 335, 145) then //We we find this bitmap, then...
begin
MoveMouse(x, y); //Move the mouse to where we found it (don't click or anything though)
writeLn('inside pit');
end else exit; //I've added this bit here.
//If the bitmap is not found, we'll exit the routine.

if findColorTolerance(x, y, 3035181, 20, 59, 768, 413, 5) then //If we find this color(?)
begin
writeLn('target found'); //I guess the above color is of a monster to attack?
MoveMouse(x, y); //Move the mouse, wait 2 seconds and then click? I hope the target isn't moving...
wait(2000);
ClickMouse(x, y, MOUSE_LEFT);
wait(2000)
end else writeln('target not found, not in pit');
end;



Hey thanks for your help so far this part of the script runs well but I've been having problems with DTMs like it finds the Dtms after first run but if I run the script again it doesn't detect the dtms ? Any ideas? I figured using dtms will make the script more efficient and less buggy but idk.

KeepBotting

2015-03-11 16:21:04

From: henryuscola
Hey thanks for your help so far this part of the script runs well but I've been having problems with DTMs like it finds the Dtms after first run but if I run the script again it doesn't detect the dtms ? Any ideas? I figured using dtms will make the script more efficient and less buggy but idk.


What kinds of things are you attempting to detect with DTMs? They work fine for stuff like sprites or deformable aspects (inventory items etc) but 3d models or things that deform a lot aren't going to work

henryuscola

2015-03-11 20:36:31

From: KeepBotting
What kinds of things are you attempting to detect with DTMs? They work fine for stuff like sprites or deformable aspects (inventory items etc) but 3d models or things that deform a lot aren't going to work

Still no luck with them, I want to detect some icons on the minimap such as trees. Now when I test to show matching dtms it will show them but when running the script it's like it just skips through the procedure and ignores the dtms