Results 1 to 19 of 19

Thread: ID's? Explain Please.

  1. #1
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default ID's? Explain Please.

    I am seeing all these things about ID's and I see them in the includes folder but I can't seem to find a tutorial or thread that explains them or how to use them. Someone want to dirrect me or explain to me how to use them. They seem to be useful rather than colors.
    Last edited by Sir R. M8gic1an; 12-11-2010 at 05:07 PM.
    Still learning to code in Simba.

  2. #2
    Join Date
    Feb 2009
    Location
    Irvine, CA
    Posts
    2,873
    Mentioned
    8 Post(s)
    Quoted
    138 Post(s)

    Default

    In reflection, IDs are assigned to different things. For example, a monkfish will have a certain ID, where as a death rune will have a different ID. The same is true for objects and NPCs (objects being things like doors, ladders, the rock you mine pure/rune essence from, et cetera). IDs are specific to one type, but generic to all items of that type; that means that every monkfish has the same ID, but no other item will have the same ID as a monkfish. Again, the same holds true for objects and NPCs. Using item, NPC, and object IDs, reflection can be used to accurately click things with much ease. I recommend using reflection as a backup; here's an example of good usage of reflection:

    Simba Code:
    function ClickSomeItem: Boolean;
    var
      ItemBitmap, x, y, i: Integer;
    begin
      Itembitmap := BitmapFromString(10, 15, 'adsfasdf');
      if FindBitmapToleranceIn(ItemBitmap, x, y, MIX1, MIY1, MIX2, MIY2, 5) then
      begin
        MMouse(x, y, 9, 14);
        if WaitUptext('Item''s uptext', 800) then
        begin
          ClickMouse2(false);
          Result := WaitOption('option text here', 800);
        end else
        begin
          Result := False;
          FreeBitmap(ItemBitmap);
        end;
      end else
      begin
        Writeln('couldnt find bitmap, attempting reflection');
        Result := R_ClickItemID(12345, False, 'option text here');
      end;
      FreeBitmap(ItemBitmap);
    end;

  3. #3
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So if you have a rock you want to mine for example. Would each different type of rock like mithril, iron, or coal have a different ID. Using the R_ClickItemID it is able to search for that item then left click or right click and choose and option. If each different ore I.E iron or mithril how do you find out what the ID's are that you should use?

    Another question not really related to this but is there a way to search for an item (Which I can do easily) and then count that item. This item is a stacking item.
    Last edited by Death12652; 12-11-2010 at 05:01 PM.
    Still learning to code in Simba.

  4. #4
    Join Date
    Jun 2008
    Posts
    219
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    best way to find ids are to use the grand exchange website. for example, irons ore page is http://services.runescape.com/m=item...tem.ws?obj=440. see the 440 at the end, that is the id number for iron ore.

  5. #5
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I don't see this 440 your talking about?

    Oh nevermind I see it now. Its in the address bar.
    Still learning to code in Simba.

  6. #6
    Join Date
    May 2007
    Location
    Everywhere
    Posts
    1,428
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    If you havent seen: http://villavu.com/forum/showthread.php?p=756983
    Great place to start


    There's a difference between NPC ID's, invi ID's and object ID's

    For Inventory:
    This is where R_ClickItemID's come in, it's specific for inventory

    For NPC's
    Use
    Simba Code:
    NPCs := SortNPCs(FindNPCs); // declare NPCs: TNPCArray;

    For objects:
    Objects are things that are not NPC's, nor items. They are things in runescape that do not have a yellow dot on the minimap. A rock is one of them.
    Search my tutorial for objects

    You can't use R_ClickItemIDs for NPCs or Objects because they appear on the mainscreen, you need to get the NPC, get it's tile, and then use TP := TileToMS (Tile, height); to get it's point on the mainscreen (Tpoints ftw)

    GL!

  7. #7
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks that helps a lot, now I can start my next script, maybe I'll add an all reflection one and a not all reflection in my script wen I release version 1. I like reflection but it seems to make scripting so easy. Can you answer my other question. The counting items at the top?
    Still learning to code in Simba.

  8. #8
    Join Date
    May 2007
    Location
    Everywhere
    Posts
    1,428
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    R_CountItemID (one of the count items) would count them, I don't think I've ever had to use it when I had stacked items, so that'd be interesting to try out.

    Feel free to either use color or reflection. Reflection makes it much easier, but it also makes your scripts run for a very long time. In addition, without reflection, randoms will make your life quite hell and cause early termination.
    Reflection can also be just as hard as color I made a fletcher that only fletches one thing next to a bank, opens it, deposits and withdraws more logs to cut. It ended up being 800 lines with failsafes and all. Quite a big challenge still if you ask me

  9. #9
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes I agree with you that it does take a long time but I like to learn all the aspects of scripting not just reflection. Although reflection does make my life easier I like to user DTM's and Bitmaps when making my script. I don't want everyone to think that I can only use reflection to script. And I will try the count items but I would think that only counts the amount according to you inventory slots not the stacked amount?

    Hey I read your tutoiral (again) and I am going to use the TileToMS as a failsafe but you know how you have this...

    var TP : TPoint;
    begin
    TP := TileToMS (Tile(3433,4433), 0); // Assuming we're near that tile...
    MMouse (TP.x, TP.y, 3, 3);
    if GetUpText ('ree') then ChopTree; // This isn't really part of the demonstration, but an example of where you go from hereend;
    I don't quite get why but when I have GetUpText('urnace') I get an invalid number of parameters?

    You know why?
    Last edited by Death12652; 12-11-2010 at 05:44 PM.
    Still learning to code in Simba.

  10. #10
    Join Date
    Feb 2008
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I can't get NPC finding to work (for archery ticket vendor,) his ID is 694, but when I convert his tile to MS it's always off, or is there another way of going about finding an NPC without using his tile?

  11. #11
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    from my fishing script

    Simba Code:
    if FindNPC({ID here}, TheSpot) then
      begin
        if (not(TileonMS(TheSpot.Tile, 10))) then
        begin
          SpotPos:= TileToMM(TheSpot.Tile);
          Mouse(SpotPos.x, SpotPos.y, 5, 5, True);
          Wait(500+Random(500));
          R_Flag;
          Wait(500+Random(500));
        end;
        SpotPos:= TileToMS(TheSpot.Tile, 10);
        Mouse(SpotPos.x, SpotPos.y, 5, 5, False);
        R_ChooseOption('Lure Fishing spot');
        Wait(500+Random(500));
        R_Flag;
        Wait(1000+Random(1000));
      end
    you should be able to work it out from that
    TheSpot is a TNPC
    SpotPos is a TPoint

    ~shut

  12. #12
    Join Date
    Feb 2008
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Weird, I was using similar code but it would move to the wrong spot half the time... maybe it sees the NPC on the new tile before the character physically moves there... sigh.

  13. #13
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by Feroc1ty View Post
    Weird, I was using similar code but it would move to the wrong spot half the time... maybe it sees the NPC on the new tile before the character physically moves there... sigh.
    nope, it will see the NPC on the tile is is on when the function gets called not where it will be after walking

    ~shut

  14. #14
    Join Date
    May 2007
    Location
    Everywhere
    Posts
    1,428
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Feroc1ty View Post
    I can't get NPC finding to work (for archery ticket vendor,) his ID is 694, but when I convert his tile to MS it's always off, or is there another way of going about finding an NPC without using his tile?
    Is it on a second floor? You may need to play around with GetPlaneIndex and TileToMSEx, and using Height as well. If not, try height = 0


    Quote Originally Posted by death12652 View Post
    Yes I agree with you that it does take a long time but I like to learn all the aspects of scripting not just reflection. Although reflection does make my life easier I like to user DTM's and Bitmaps when making my script. I don't want everyone to think that I can only use reflection to script.
    IMO depends on the end product. If my script can work for a long time and return to me the amount of experience that I want while solving randoms/getting flagged, I will choose that no matter what script type it is. If a color script owns a reflection script, I will 101% use the color script all the time. Depends on if you care about the end product or not.
    IMO if you use reflection a tiny bit, you might as well go the full way since if it breaks, you're doomed. If you can do 100% color, then I highly recommend going to color over reflection since color doesn't usually change. Just my views

    And I will try the count items but I would think that only counts the amount according to you inventory slots not the stacked amount?
    One thing you could do is use is grab the child component stack, that'd give you the stack amount. Interface 149, 0, (slot here + 1) I believe.

    I don't quite get why but when I have GetUpText('urnace') I get an invalid number of parameters?

    You know why?
    Use R_IsUpText or R_IsUpTextMulti, I shouldn't have put GetUpText

  15. #15
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay thanks, so your saying that using a 100% reflection or a 100% color would be better than using color and reflection. In my script it uses color finding, but reflection walking, and for failsafes to the colors as a last resort it uses reflection object finding.
    Still learning to code in Simba.

  16. #16
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    personally, i use a combination of color and reflection

    take a look at my vine vanquisher, it uses color to find the vines, and a combination to find the nest and reflection for everything else

    ~shut

    EDIT: on the other hand, my fisher is 100% reflection

  17. #17
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah I have been using yours and a couple others for examples.
    Still learning to code in Simba.

  18. #18
    Join Date
    May 2007
    Location
    Everywhere
    Posts
    1,428
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by death12652 View Post
    Okay thanks, so your saying that using a 100% reflection or a 100% color would be better than using color and reflection. In my script it uses color finding, but reflection walking, and for failsafes to the colors as a last resort it uses reflection object finding.
    yeah

    My logic is this:
    - If you use any reflection, one should go 100% since reflection breaking nukes the script.
    - If you use reflection as a backup, that's always good -- but that means that the goal is to keep it running for as long as possible, and thus you'd want to use more efficient methods to achieve this. Going 100% reflection does achieve this.
    - If it is 99% color and 1% ref, and if ref breaks and you can still do it in color without reflection, then there's no need to put reflection in if it's that stable, better just to whore out color failsafes to compensate for reflection.

    As long as one part is dependent, the whole program would fall if reflection falls.

  19. #19
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So I tried R_CountItemID(2); not sure if I did it right but I went to runescape.com and got the ID from the address bar. And I don't know if thats the ID of and object or of your inventory. Cause I need the count the amount of the item in your inventory. If I did do it right then it doesn't count stacked items becuase it outputed 1.

    Nevermind I think this will work.

    GetItemStackSizeAt();

    Edit: I kinda have an understanding of this but I have one last question. I am looking at Travelers miner and I want to know where he is getting his ID's at? He has a lot of them for each type of ore and I was wandering where he got them?
    Last edited by Death12652; 12-26-2010 at 03:04 AM.
    Still learning to code in Simba.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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