Results 1 to 5 of 5

Thread: Tut request on a findobj tut!

  1. #1
    Join Date
    Aug 2006
    Posts
    151
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Tut request on a findobj tut!

    Well i still dont get findobj im sure its not hard i just cant find anyone willing to take the time to teach me how to use it and im sure itd be easy to make a quick tut on this it would benifit the comunity greatly thnx if anyone takes this into consideration!

  2. #2
    Join Date
    Jan 2007
    Location
    Toronto.
    Posts
    150
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Here's a brief explaination of what FindObj is:

    SCAR Code:
    FindObj(var cx, cy: Integer; Text: String; color, tolerance: Integer)

    SCAR Code:
    cx, cy

    Think of them as x, y.

    SCAR Code:
    Text: String;

    Name of the object, e.g "Willow", "Oak".

    SCAR Code:
    color: Integer;

    Color of the object your searching for.

    SCAR Code:
    tolerance: Integer;

    Basicly the tolerance when searching for the color.

  3. #3
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah, there are a lot of different "Findobj" type procedures, but they all pretty much work in the same way. They do a simple FindColorTolerance type search for the color and tolerance you specify. Then once they find the colors, they move the mouse over the colors and check the uptext. If the uptext matches the text you put in, then the function finishes and results as True. If the uptext doesn't match, then it moves the mouse to the next color that matches. If none of the points match the uptext, then the function returns False.

    Different variants search in different ways. Some spiral out from the center. Some scan the screen from left-top to right-bottom.

  4. #4
    Join Date
    May 2006
    Location
    West Coast
    Posts
    820
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    1: If the function finds the object, it will store the coordinates in the variables x,y.

    Code:
    If(FindObject(x,y,--
    2: Now this part searchs for the Uptext the object produces upon mouseover(When you move the mouse over the object, text appears in the upper-left corner of rs = uptext fyi.) In this case: 'Rock'(It has the single quotes around it because its a string of course )

    Code:
    If(FindObject(x,y, 'Rock'--
    3: Now you are looking for color, and of course with the new Runescape engine made by JaGeX, You will not be able to use the same color every time, So you will definetly need a tolerance level of above 10. So now it should look like this:

    Code:
    if(FindObj(x,y, 'rock', 234965, 15)
    4: Now what this complete function will do is: If it finds a object on the RS mainscreen, with the color of 234965 and a Tolerance of 15. Now you are stuck here, what do you need? First you need to close your round (Add another ) at the end). Secondly you need to do something if this actually happens(finding the rock) So now you are going to add a then after the close round. Now it should look like this:

    Code:
    if (FindObj(x,y, 'rock', 234965, 15)) then
    After this you will need to execute some code, such as, if you want to click on the rock, then do this:


    Code:
    if (FindObj(x,y, 'rock', 234965, 15)) then
    mouse(x,y,0,0,true);
    If this code finds the object, then it will move the mouse and click where the coordinates were stored(X and Y variables) by the findobj function.

    That should get you somewhere. Best of luck to your scripting.

    PS: I wrote this before bed, so if it still doesnt make sense or I messed up somewhere, just post that you dont understand, and Ill make a better post on the weekend .

  5. #5
    Join Date
    Aug 2006
    Posts
    151
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    wow thnx u all were a big help and some one should consider making something under the tut section on this since i actualy spent alot of time trying to figure this out until i finally bothered to post this thnx i think i got it now!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. FindObj help
    By daddyproboot in forum OSR Help
    Replies: 6
    Last Post: 08-17-2007, 03:48 PM
  2. FindObj help
    By Xirx in forum OSR Help
    Replies: 7
    Last Post: 06-12-2007, 09:38 PM
  3. findobj?
    By omgh4x0rz in forum OSR Help
    Replies: 15
    Last Post: 02-10-2007, 12:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •