Cstrike
2010-10-16 15:52:40
So far it seems that we can only get the model ID's from interface components… but not children components
I tried playing around with the code but it just caused a FATAL ERROR all the time
This is what I tried:
When I run the above I get this:
Is there any way for me to grab that number? It would not only help with randoms but also allow much more advanced banking functions that we just can't do right now.
This is the original function:
And I want to get the component ID of
Interface 763, Child 93, Component 6 when I open the bank. I think it's child 93… either way, when I debugged the interface with RSBot, I was running the correct numbers for sure.
EDIT:
This apparently is closer to working (Zephyrs' procedure I borrowed):
How can I change that to a useable number? I probably need to do some java integer conversion code but I don't know how to.
It's supposed to return something like 331.
EDIT3: When I change it to this:
EDIT4: Heres the image:
I tried playing around with the code but it just caused a FATAL ERROR all the time
This is what I tried:
function GetModelCompID(ParentI, ChildI, CompI: Integer): Integer;
var
Text, Child, Comp: Integer;
begin
Child := GetInterface(ParentI, ChildI);
Comp := SmartGetFieldArrayObject(Child, hook_interface_GetChildren, compI); //Getting the children components of the Child component
Result := SmartGetFieldInt(CompI, hook_interface_GetModelID); // This is probably the bad spot
SmartFreeObject(Child);
SmartFreeObject(Comp);
end; When I run the above I get this:
FATAL ERROR in native method: Bad JNI oop argumentIs there any way for me to grab that number? It would not only help with randoms but also allow much more advanced banking functions that we just can't do right now.
This is the original function:
{*******************************************************************************
Function GetModelID(ParentI, ChildI: Integer): Integer;
By: Drags111
Description: Returns the model ID of the interface.
*******************************************************************************}
function GetModelID(ParentI, ChildI: Integer): Integer;
var
Child: Integer;
begin
Child := GetInterface(ParentI, ChildI);
Result := SmartGetFieldInt(Child, hook_interface_GetModelID);
SmartFreeObject(Child);
end; And I want to get the component ID of
Interface 763, Child 93, Component 6 when I open the bank. I think it's child 93… either way, when I debugged the interface with RSBot, I was running the correct numbers for sure.
EDIT:
This apparently is closer to working (Zephyrs' procedure I borrowed):
function GetComponentID(ParentI, ChildI, CompI: Integer): Integer;
var
Text, Child, Comp: Integer;
begin
Child := GetInterface(ParentI, ChildI);
Comp := SmartGetFieldArrayObject(Child, hook_interface_GetChildren, compI); //Getting the children components of the Child component
Text := SmartGetFieldObject(Comp, hook_interface_GetModelID);
Result := Text;
SmartFreeObject(Text);
SmartFreeObject(Comp);
SmartFreeObject(Child);
end; EDIT2: Now I'm getting this result: 140877408How can I change that to a useable number? I probably need to do some java integer conversion code but I don't know how to.
It's supposed to return something like 331.
EDIT3: When I change it to this:
function GetComponentID(ParentI, ChildI, CompI: Integer): Integer;
var
Text, Child, Comp: Integer;
begin
Child := GetInterface(ParentI, ChildI);
Comp := SmartGetFieldArrayObject(Child, hook_interface_GetChildren, compI); //Getting the children components of the Child component
Text := SmartGetFieldInt(Comp, hook_interface_GetModelID);
Result := Text;
SmartFreeObject(Text);
SmartFreeObject(Comp);
SmartFreeObject(Child);
end; My result is now 0.EDIT4: Heres the image: