Results 1 to 9 of 9

Thread: A few reflection questions

  1. #1
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default A few reflection questions

    • How do you find monsters using Reflection?
    • How do you find items using Reflection, on the ground and in your inventory
    • How do you change gametab?
    • Can you still use cases if you use reflection?


    All I know how to at the moment with reflection is walk lol

    Thanks

    ~ToF
    Jus' Lurkin'

  2. #2
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    1,124
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Have you looked in the respective .scar files? inventory.scar / characters.scar ?
    And yes, you can still use cases with reflection, reflection does not change the structure of how you would script.

    For gametab, I would just use SRL.

  3. #3
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    first two, idk.. last two, there normal srl

    (pretty sure you wanna know about only reflection.. but srl works good )

  4. #4
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    I have, just didnt understand it all to be honest, heh.

    I'll take another browse.
    Jus' Lurkin'

  5. #5
    Join Date
    Sep 2006
    Location
    include srl/srl.scar ( aussie)
    Posts
    2,875
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    * How do you find monsters using Reflection?
    * How do you find items using Reflection, on the ground and in your inventory
    * How do you change gametab?
    * Can you still use cases if you use reflection?


    ************************************************
    * How do you find monsters using Reflection?
    ************************************************

    I think your talking about NPC's?
    The best way to find out all this, is to read the include.

    NPC finding is simple..

    SCAR Code:
    if FindNPC('NPC',XX) then

    NPC is the name of your NPC, XX in just declared n the var as a TNPC

    Info on TNPC =

    SCAR Code:
    TNPC = record
        Tile, MS, MM: TPoint;
        Index, NPCType, height, animation: integer;
        HPRatio, TurnDirection: integer;
        Name : string;
        InFight, IsMoving: boolean;
      end;

    Example code of clicking a NPC.

    SCAR Code:
    if FindNPC('Strange Plant',XX) then
      begin
        Wait(200+Random(100));
        P:= TileToMS(xx.Tile, Round(xx.Height / 2));
        Mouse(p.X,p.Y,3,3,false);
        ChooseOption('ick')
      end;

    P would be declared a TPoint.


    ************************************************
    * How do you find items using Reflection, on the ground and in your inventory
    ************************************************

    Its simple again.

    For Ground Items..
    Example Code For picking up any birds nest.

    SCAR Code:
    function FindNest : Boolean;
    var
      Items: array of TGroundItem;
      I: Integer;
    begin
      FindGroundItems(Items,[5071,5072,5073,5074,5075,7413],7);

      for I := 0 to High(items) do
        Mouse(Items[I].Ms.x,Items[I].Ms.y, 0, 0, False);
      Result:= ChooseOption('ick');
      Flag;
    end;

    Has youc an see its a simple array and it will Return how many different items it found, in this code example it would pick them all up.

    The best way to get the Ids Imho is use rsbot debugging system.

    Info on TGroundItem:

    SCAR Code:
    Type
      TGroundItem = Record
        MS, Tile: TPoint;
        ID, StackSize: Integer;
      End;


    For Inv Items..

    SCAR Code:
    function WhatAxe: String;
    var
      i: integer;
      z,x: TIntegerArray;
      p: Integer;

    begin
      z:= [2134,23423,3422,3422,23423];
      for I:= 0 to High(z) - 1 do
      begin
        if InventoryContains(z[I],x) then
        begin
          p := I;
          Break;
        end;
      end;
      Case P of
        0: Result:= 'iron';
        1: Result:= 'steel';
        2: Result:= 'mith';
        3: Result:= 'addy';
        4: Result:= 'rune';
      end;
    end;

    As you can see it works basicly the same way was Ground items just ids, you can get the Ids again from the Rsbot Debugging system.

    ********************************************
    ********************************************

    Use Normal gametab changing method , why would you use reflection for one 1 click and what your clicking is ALWAYS in the same place ?

    Cases? Ofc you can use cases its still the same Pascal System...


    Hope i helped.

  6. #6
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    ^.^ Thanks NicbaZ Rep++

    I've decided to start working on a [Ref]Pest Controller

    xD
    Jus' Lurkin'

  7. #7
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    * Can you still use cases if you use reflection?
    I shit my pants when I saw that.

  8. #8
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    n3ss3s... why?
    Jus' Lurkin'

  9. #9
    Join Date
    Sep 2006
    Location
    include srl/srl.scar ( aussie)
    Posts
    2,875
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Because its still the same Scripting engine?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. reflection and non reflection scripts?
    By randy marsh in forum SRL Site Discussion
    Replies: 8
    Last Post: 01-08-2009, 04:05 PM
  2. some c++ questions
    By sherlockmeister in forum C/C++ Help and Tutorials
    Replies: 2
    Last Post: 03-25-2008, 01:25 AM

Posting Permissions

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