* 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.