SRL Archive - OSR Help

FindObjCustom not working


armthehomeless

2013-05-20 03:03:48

I am trying to do YoHo's "Scripting Tutorial #2 " and I am running into an issue with finding the trees/displaying the "hooray" line.

Function ChopDown:Boolean;
var
x, y: integer;
Begin
WriteLn('goodluck');
If FindObjCustom(x, y, ['Chop', 'down'], [4485263, 3496050, 4551830, 3957890, 3826303, 4155527, 3825532, 4089477, 2770265, 4683416], 10) Then
WriteLn('Hooray!');
End;

Begin
SetupSRL;
DeclarePlayers;
//Repeat
ChopDown;
//Until(false);
End.



It compiles/runs then hovers over the various trees(decently well) but doesn't actually "find" them, it just keeps looking until I end up manually stopping it. Any help would really be appreciated!

t4q

2013-05-20 03:56:35

goodluck
Hooray!
Successfully executed.

it worked for me

armthehomeless

2013-05-20 23:40:42

Really? I am running it in 07 scape if that changes anything(forgot to mention this at the top).

Sk1nyNerd

2013-05-21 01:36:19

From: armthehomeless
Really? I am running it in 07 scape if that changes anything(forgot to mention this at the top).


are u using the OSR include or the P07 include? if its P07 u have to make a slight edit to the FindObjCustom >> P07_FindObjCustom

Sjoe

2013-05-21 01:59:13

Include SRL correctly: {$I SRL-OSR/SRL.Simba}

also DeclarePlayers; goes infront of SetupSRL; in the mainloop on Oldschool


This could be an potential uptext issue.
Here is what we do to test it :


  1. Uncomment {$Define Smart8}
  2. Hover your mouse above the tree, make sure u got the uptext on RS.
  3. Drag the green crosshair from Simba onto your RS Client.
  4. Then play this snippet:


begin
DeclarePlayers;
SetupSRL;
ActivateClient;
Wait(2000);
Writeln(GetUptext);
end.
See if this outputs the correct uptext in your debug, else there are uptext problems.

armthehomeless

2013-05-21 02:53:59

From: Sjoe
Include SRL correctly: {$I SRL-OSR/SRL.Simba}


This fixed it. I completely forgot about having to fix that line. You are a life saver <3

t4q

2013-05-21 04:22:04

From: armthehomeless
Really? I am running it in 07 scape if that changes anything(forgot to mention this at the top).

I was using it in EOC :p
You can run it there too