SRL Archive - OSR Help

50 Pixel Offset Problem


VastlySuperior

2012-08-01 02:13:53

Ok, I`m Currently Using Simba 991 and SMART 7.2

Latest Plugins and Latest RSL,Latest SPS and the works.

But I keep getting this 50 pixel offset error when clicking on a object that I find. Included you will see a Picture off what I mean.


It was suggested that it was the code I`m using to find the mouse position after finding the object. (GetMousePos(x,y);) Apparently GetMousePos do not work correctly at this moment. Can someone suggest an alternative way to get the x y coordinates after finding an object because in the mean time my character has moved nearer to the object.

        If FindObjTPA(x, y, 9079697, 6, 1, 15, 60, 50, ['ott']) then
Begin
WriteLn('Found Wheel');
While IsMoving do
Begin
Wait(100);
End;
Case random(2) of
0: Begin
WriteLn('Right Clicked Potters Wheel The First Time');
GetMousePos(x,y); // Get Mouse Current Position
mouse(x, y, 5, 5, False); // Right Click To Bring Up Options
WaitOption('Form', 500); // Wait A Certain X Amount Of Seconds Before Clicking Option
Wait(1000 + random(400));
While IsMoving do
Begin
Wait(100);
End;
End;
1: Begin
WriteLn('Left Clicked Potters Wheel The First Time');
GetMousePos(x,y); // Get Mouse Current Position
mouse(x, y, 5, 5, True); // Left Click On Potters Wheel
Wait(1000 + random(400));
While IsMoving do
Begin
Wait(50);
End;
WriteLn('We Have Clicked The Potters Wheel The First Time');
WriteLn('We are now waiting for the Options Screen to appear.');
WriteLn('Waiting Now for 1 second');
End;
End;
End;

Thanks

shstiger2009

2012-08-01 02:16:00

You don't need to use GetMousePos at all.

Just do this:

if FindObjTPA() then
MMouse (x, y, 5, 5);
ClickMouse2(False);
WaitOption('Form', 500);

YoHoJo

2012-08-01 02:18:12

Talked to brandon yesterday, he basically said for every cord you pick yourself you need to manually -50 from the Y axis. Or call some SetBar (I forgot the name) functions.

CephaXz

2012-08-01 02:18:59

GetMousePos(x,y);

You did say this gets your current mouse position, that replaced the one you found with FindObjTPA. So your mouse function will only click at that?

shstiger2009

2012-08-01 02:30:20

From: YoHoJo
Talked to brandon yesterday, he basically said for every cord you pick yourself you need to manually -50 from the Y axis. Or call some SetBar (I forgot the name) functions.


I just checked for this function in the include.

To the OP: Call "SetBar" AFTER SetupSRL in your script. See what happens, I don't have time to test as it's bed time for me! Good luck.

Brandon

2012-08-01 02:55:06


Function ClickedSomeObject: Boolean;
var
X, Y: Integer;

begin
if (FindObjectTPA(X, Y, 9079697, 6, 1, 15, 60, 50, ['ott'])) then
begin
MMouse(X, Y, 5, 5); //x, y already contain the position of the object found. Just move the mouse to it..
ClickMouse2(MOUSE_RIGHT); //menu is brought up..
Result := WaitOptionMulti(['', '', ''], 600);
end;
end;

VastlySuperior

2012-08-01 04:36:31

From: Brandon

Function ClickedSomeObject: Boolean;
var
X, Y: Integer;

begin
if (FindObjectTPA(X, Y, 9079697, 6, 1, 15, 60, 50, ['ott'])) then
begin
MMouse(X, Y, 5, 5); //x, y already contain the position of the object found. Just move the mouse to it..
ClickMouse2(MOUSE_RIGHT); //menu is brought up..
Result := WaitOptionMulti(['', '', ''], 600);
end;
end;


@Brandon, I`m really glad you responded, because I`m on a very short fuse at the moment, this is driving me up the walls. I already Implemented that code as well, and it still don`t find the wheel to click on it.

I have deleted and reinstalled simba now 3 times, Nothing I do, gets rid of this problem.

Here is my code to setup the client. I don`t know if I`m doing something wrong here. I have now Included the 3 options for the navbar. Tested them all with the same results.

I have looked at setbar, but I can`t for the life of me see how that will set the offset.

As I understand it SRL_DisableNavBar; should offset the cleintarea so that it ignores the bar and starts with the clientarea right under the bar and then all coordinates is supposed to function normally. Yes?

But is still does not find the correct coordinates, It just moves 50 pixels off the wheel and hover there.

Is there any other setting we should set before continuing normally with our scripts. According to my understanding it should not even be necessary for me to call the SRL_DisableNavBar;. It should work now out off the box so to say.

Here is my Code for the setup:

procedure setupclient;
var
x,y: integer;
begin
writeln('start bot client');
{$IFDEF SIMBAMAJOR980}
SMART_SERVER := server;
SMART_MEMBERS := TRUE;
SMART_SIGNED := TRUE;
SMART_SUPERDETAIL := FALSE;
{$ELSE}
SRL_SIXHOURFIX := TRUE;
SMART_FIXSPEED := TRUE;
{$ENDIF}

cleardebug;
setupsrl;
// SRL_EnableNavBar;
SRL_DisableNavBar;
// SRL_ResetNavBar;
objdtm_setup;
objdtm_debug := true;
declareplayers;
if not (loggedin) then
loginplayer;
wait(4000+random(400));
sps_setup(runescape_surface,['10_8', '10_9', '9_8', '9_9']);
if (not SMART_DebugSetup) then
SMART_SetupDebug();
end;


If you want I can Pm you the script I`m trying to write so that you can look at the complete script. It is still buggy and a real rough draft. But then you will be able to tell me if I call srl or something incorrectly. I know it must be something real simple and stupid where i make the mistake.

I`m just starting to script so my knowledge of srl and pascal is very limited at the moment.

I just do`nt know what to do anymore and it is frustrating the hell out of me.


E. I have sorted the problem out. Apparently the colors of the wheel has changed.
Also when enabling the SRL_EnableNavBar; it ignores the bar and start after the bar with the clientarea.