PDA

View Full Version : Help =D



AFools
03-19-2017, 08:34 AM
Could someone please help or point me in the right direction as too how i extract information from portals in the pest control mini-game



{$DEFINE SMART}
{$i Reflection/Reflection.Simba}

procedure debugit;
var
ParentWidget, ChildWidget: TReflectWidget;
I, J, S, ChildWidth: Integer;

begin
Reflect.Setup;
for I := 0 to 1000 do
for J := 0 to 1000 do
begin
if (not ParentWidget.Exists(I, J)) then
Continue;
ParentWidget.GetWidget(I, J);
if (not ParentWidget.HasChild) then
begin
Writeln('Parent => ' + ToStr(I) + ', ' + 'Child => ' + ToStR(J) + ' => ' + 'Text => ' + ParentWidget.GetText);
ParentWidget.Free;
Continue;
end;
ChildWidth := Reflect.Smart.GetArraySize(ParentWidget.Reference, Widget_Children, 0);
for S := 0 to ChildWidth do
begin
ChildWidget.GetChild(ParentWidget, S);
Writeln('Parent => ' + ToStr(I) + ', ' + 'Child => ' + ToStR(J) + ' => ' + ' ChildWidget => ' + ToStr(S) + ' => ' + 'Text => ' + ChildWidget.GetText);
ChildWidget.Free;
end;
ParentWidget.Free;
end;
end;

begin

debugit;
wait(1000);

end

I have used the debug; but it only outputs - > Parent => 162, Child => 43 => ChildWidget => 0 => Text => The yellow, south-eastern portal shield has dropped!

Which is in regards to text.

I was wondering if health and portal (shield) status could be extracted?

Kasi
03-19-2017, 01:24 PM
Main screen objects aren't widgets. Dreambot has a nice reflection debugger. Also, https://villavu.com/forum/showthread.php?t=112438 seems okay.

Citrus
03-19-2017, 01:53 PM
Main screen objects aren't widgets. Dreambot has a nice reflection debugger. Also, https://villavu.com/forum/showthread.php?t=112438 seems okay.
I think he's talking about the portal status info that shows up in the top right of your mainscreen while you're in the minigame. I don't think that's a mainscreen object?

This:
http://i.imgur.com/Ua49krv.png

AFools
03-19-2017, 01:59 PM
Main screen objects aren't widgets. Dreambot has a nice reflection debugger. Also, https://villavu.com/forum/showthread.php?t=112438 seems okay.

I am aware of ineedbot debugger. Somebody suggested it was possible.

I may have a look at dreambot.

jstemper
03-19-2017, 03:49 PM
I am aware of ineedbot debugger. Somebody suggested it was possible.

I may have a look at dreambot.

this is ripped from kristi's pc script.
function TPortal.getHealth : Integer;
var
PortalHealth : TReflectWidget;
begin
if Length(Portals) = 0 then
Exit;
PortalHealth.GetWidget(408, Self.WidgetChild);
if (PortalHealth.GetText = '') then
Exit;
Result := StrtoInt(PortalHealth.GetText());
Self.Health := Result;
PortalHealth.Free();
end;
You should be able to figure it out by searching for container index of 408 in widget debugger results and seeing which child values correspond to the portal health(s)

e; Just by looking at the script it looks like the child widgets are 14, 15, 16 and 17

Kasi
03-19-2017, 07:16 PM
I think he's talking about the portal status info that shows up in the top right of your mainscreen while you're in the minigame. I don't think that's a mainscreen object?

This:
http://i.imgur.com/Ua49krv.png

ah yeah, those look like widgets, never played Pest Control.