View Full Version : Ground Items
HarryJames
03-29-2011, 08:33 PM
What would be the best way to find an item on the floor? (It can't be a red dot on MM), I have tried both NewGroundItem and FindGroundItem.
If needs be, I could use colour (FindColorSpiralTolerence).
The object I am trying to find, is 'Berries'. (ID 329)!
Thanks, HarryJames.
Brandon
03-29-2011, 08:42 PM
What would be the best way to find an item on the floor? (It can't be a red dot on MM), I have tried both NewGroundItem and FindGroundItem.
If needs be, I could use colour (FindColorSpiralTolerence).
The object I am trying to find, is 'Berries'. (ID 329)!
Thanks, HarryJames.
Edited:
Procedure GrabGroundItem1;
var
Snape: TGroundItem;
TP: TPoint;
begin
Snape.ID:= 231;
Snape.Stack:= 1;
Snape.Tile:= Tile(2540, 3765);
If(FindGroundItem(Snape)) then
begin
writeln('Snape Found');
TP:= TileToMS(Snape.Tile, 1);
Repeat
MMouse(TP.x, TP.y, 1,1);
Mouse(TP.x, TP.y, 1, 1, False);
If(R_ChooseOption('Take Snape grass')) then
begin
WaitToMove(500);
s:= R_InvCount;
end;
Until((R_InvCount = s));
end else
begin
writeln('Cannot Find Snape Grass');
WaitToMove(500);
end;
end;
HarryJames
03-29-2011, 08:51 PM
[--Objects--]
ID: -1, Tile(-1,-1)
[--Objects2--]
ID: -1, Tile(-1,-1)
Type: -1
My hooks are up to date, and I'm stood on the Berries, so I don't know what the problem is!
masterBB
03-29-2011, 09:07 PM
I use:
function PickUpItem(item:TGroundItem; itemName:String; stackAble:Boolean):Boolean;
var
mcoords:TPoint;
x,y:Integer;
invItem:TInvItem;
begin
if(R_InvFull and (not(R_ItemExists(item.ID,invItem)) and stackAble) or not( stackAble)) then
Exit;
if not(TileOnMs(item.Tile,0)) then
PositionOn(item.Tile); //similar to walk to tile
mcoords := TileToMs(item.Tile,0);
Mouse(mcoords.x,mcoords.y,0,0,False);
if(R_waitOption(itemName,500)) then
Result := R_ChooseOption(itemName);
wait(300+random(200));
waitTilIdle; //you don't have this function
wait(300+random(200));
end;
function PickUpItems:Boolean;
var
items:TGroundItemArray;
begin
items := GetItemsNear(8);
for i:=0 to High(items) do
case items[i].ID of
deathID:
PickUpItem(items[i],'eath',true);
gcharmID:
PickUpItem(items[i],'old charm',true);
sharkID:
PickUpItem(items[i],'hark',true);
lobsterID:
PickUpItem(items[i],'obster',true);
bloodID:
PickUpItem(items[i],'lood',true);
earthID:
PickUpItem(items[i],'earth',true);
brineID:
PickUpItem(items[i],'abre',false);
bonesID:
if not(R_InvFull) then
PickUpItem(items[i],'ones',false);
end;
end;
HarryJames
03-29-2011, 09:43 PM
Thanks for the help guys, it's much appreciated!
masterBB
03-29-2011, 09:58 PM
But is your problem solved?
pyroryan
03-29-2011, 10:49 PM
If this is still an issue, please send me a PM or message me on MSN with details of where this occurs. If you post here, I might not see it so PM or MSN is the best way.
HarryJames
03-29-2011, 10:58 PM
function CollectBerries : boolean;
var
GroundItems : TGroundItemArray;
BerryTile : TTile;
x, y, i : integer;
begin
GroundItems := [];
GroundItems := GetItemsNear(3);
for i := 0 to High(GroundItems) do
begin
if GroundItems[i].ID = 239 then
begin
BerryTile := TileToMS(GroundItems[i].Tile, 0);
MMouse(BerryTile .x, BerryTile .y, 2, 2);
if OptionExists('Take') Or R_WaitUpTextMulti(['Take', 'White'], RandomRange(100, 250)) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Result := True;
Exit;
end else
begin
Result := False;
Exit;
end;
end;
end;
end;
Well I have that, so any improvements would be taken :)
masterBB
03-29-2011, 11:16 PM
very few improvements
function CollectBerries : boolean;
var
GroundItems : TGroundItemArray;
BerryTile : TTile;
x, y, i : integer;
begin
GroundItems := GetItemsNear(3);
for i := 0 to High(GroundItems) do
if GroundItems[i].ID = 239 then
begin
BerryTile := TileToMS(GroundItems[i].Tile, 0);
MMouse(BerryTile .x, BerryTile .y, 2, 2);
if OptionExists('Take') Or R_WaitUpTextMulti(['Take', 'White'], RandomRange(100, 250)) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Result := True;
end else
Result := False;
Exit;
end;
end;
Bixby Sayz
05-12-2011, 01:13 AM
Is there no way to get the name of the ground item from the client? Would make it a lot easier to write a generic pickup routine you could use anywhere.
Brandon
05-12-2011, 02:26 AM
Is there no way to get the name of the ground item from the client? Would make it a lot easier to write a generic pickup routine you could use anywhere.
Well the thing is... You already know the ground item's name.. All the codes above already show the ID of the ground items and in order to know the ID, You'd need to find the name and search it on runescape.com ge database.. if its not tradeable and you used RSBot or Simba code to find the ID, you had to have known the name of the item you were looking for..
If you mean that you need the name for a failsafe for picking up then you would do something like:
IsUpText().. that would let you know if the mouse is hovering over the item.. if it is and the uptext is correct then you can do something like: ChooseOption or ChooseOptionMulti. Which will definitely choose the right option and not misclick.
If you know the ID but not the name (I highly doubt this) then you would do:
Item = FindGroundItems (ID) or whatever and then you would do Item.name... that will get you the item name Im sure.
Bixby Sayz
05-12-2011, 12:26 PM
If you know the ID but not the name (I highly doubt this) then you would do:
I can think of a lot of examples where it would be faster/a hell of a lot easier to code to simply get the name from the ground item.
For example: One of my scripts will drop an item, pick up a rewardbox, deal with it, then pick up the dropped item.
In this case its a cooker and the dropped item could be any of the raw fish, any of the cooked fish, or any of the burnt fish. That is how many names I have to code for?
Brandon
05-12-2011, 02:04 PM
I can think of a lot of examples where it would be faster/a hell of a lot easier to code to simply get the name from the ground item.
For example: One of my scripts will drop an item, pick up a rewardbox, deal with it, then pick up the dropped item.
In this case its a cooker and the dropped item could be any of the raw fish, any of the cooked fish, or any of the burnt fish. That is how many names I have to code for?
If Im correct I believe that the random solver always drops the first item in the invent inorder to pick up the box, then solve it and pick that item back up... you know the item is in the first slot, so you get the ID of the item in the first slot and then drop it.. and pick up the box, solve the box, then pick up the item by ID..
Its in-efficient to pick up an item by name as it can sometimes get mixed up, and its slower than grabbing by ID.
So get ground items and pick up only the items by ID that you want..
Jakkle
05-12-2011, 02:27 PM
I'm really glad I seen this thread it has helped me out alot :) thanks for all that have posted the pickup ground item functions. I now understand where i was going wrong :D
I personally prefer using IDs rather than names.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.