PDA

View Full Version : AeroLib and lape reflection both not working when trying to grab text from chatbox



slayr288
07-10-2015, 08:44 PM
I need somebody to help me with getting the information from checking your task with the gem, it should work but when it grabs the line the string is something like this
Y. o. u.'re assigneH. to K. il.l. H. il.l. giants'. onl.y V-.V- more to go.

Also, when I try grabbing the line with reflection it returns nothing

Here is the code I'm using
function SetCurrentTask: Boolean;
var
slayGem: TReflectInvItem;
lastMessage: String;
i: Integer;
taskInfo: TStringArray;
messageNull: Boolean;
begin
if not slayGem.Find('Enchanted gem') then
begin
Result := false;
end else
begin
Reflect.Mouse.Move(slayGem.GetPoint, 1, 1);
wait(randomRange(50,150));
Reflect.Mouse.Click(mouse_right);
wait(randomRange(30,60));
Reflect.Text.ChooseOption('Chec');
wait(randomRange(200,300));
messageNull := true;
for i:=1 to 8 do
begin
//writeln(getChatBoxText(i, clBlack)); debug
if FindChatBoxText('assigned', i, clBlack) then
begin
messageNull := false;
lastMessage := getChatBoxText(i, clBlack);
end
end
//writeln(lastMessage); debug
if not messageNull then
begin
//writeln('here'); debug
lastMessage := ReplaceRegExpr('''', lastMessage, '"', True);
lastMessage := ReplaceRegExpr(lastMessage, 'You"re assigned to kill ', '', True);
lastMessage := ReplaceRegExpr(lastMessage, ' only ', '', True);
lastMessage := ReplaceRegExpr(lastMessage, ' more to go.', '', True);
taskInfo := SplitRegExprEx(';', lastMessage);
writeln(ToStr(taskInfo[0]));
writeln(ToStr(taskInfo[1]));
Result := True;
end
end
end

Hoodz
07-10-2015, 09:31 PM
I need somebody to help me with getting the information from checking your task with the gem, it should work but when it grabs the line the string is something like this
Y. o. u.'re assigneH. to K. il.l. H. il.l. giants'. onl.y V-.V- more to go.

Also, when I try grabbing the line with reflection it returns nothing

Here is the code I'm using
function SetCurrentTask: Boolean;
var
slayGem: TReflectInvItem;
lastMessage: String;
i: Integer;
taskInfo: TStringArray;
messageNull: Boolean;
begin
if not slayGem.Find('Enchanted gem') then
begin
Result := false;
end else
begin
Reflect.Mouse.Move(slayGem.GetPoint, 1, 1);
wait(randomRange(50,150));
Reflect.Mouse.Click(mouse_right);
wait(randomRange(30,60));
Reflect.Text.ChooseOption('Chec');
wait(randomRange(200,300));
messageNull := true;
for i:=1 to 8 do
begin
//writeln(getChatBoxText(i, clBlack)); debug
if FindChatBoxText('assigned', i, clBlack) then
begin
messageNull := false;
lastMessage := getChatBoxText(i, clBlack);
end
end
//writeln(lastMessage); debug
if not messageNull then
begin
//writeln('here'); debug
lastMessage := ReplaceRegExpr('''', lastMessage, '"', True);
lastMessage := ReplaceRegExpr(lastMessage, 'You"re assigned to kill ', '', True);
lastMessage := ReplaceRegExpr(lastMessage, ' only ', '', True);
lastMessage := ReplaceRegExpr(lastMessage, ' more to go.', '', True);
taskInfo := SplitRegExprEx(';', lastMessage);
writeln(ToStr(taskInfo[0]));
writeln(ToStr(taskInfo[1]));
Result := True;
end
end
end

they work for me (reflection)

slayr288
07-10-2015, 09:40 PM
they work for me (reflection)

The debug returns empty strings with this code, ignore the AeroLib functions
for i:=1 to 8 do
begin
writeln(Reflect.Chat.GetTextOnLine(i, false));
if FindChatBoxText('assigned', i, clBlack) then
begin
messageNull := false;
lastMessage := getChatBoxText(i, clBlack);
end
end

Hoodz
07-10-2015, 09:57 PM
The debug returns empty strings with this code, ignore the AeroLib functions
for i:=1 to 8 do
begin
writeln(Reflect.Chat.GetTextOnLine(i, false));
if FindChatBoxText('assigned', i, clBlack) then
begin
messageNull := false;
lastMessage := getChatBoxText(i, clBlack);
end
end

make your own with widgets, this one might still be broken.

slayr288
07-10-2015, 10:36 PM
make your own with widgets, this one might still be broken.

This returns absolutely nothing after testing 10000 combinations
function GetTextLine(line: Integer): String;
var
J, I: Integer;
ChatWidget, ChatChild: TReflectWidget;
begin
for J := 0 to 50 do
begin
for I:=0 to 200 do
begin
ChatWidget.GetWidget(Widget_Chat_Container, I);
ChatChild.GetChild(ChatWidget, J);
Result := Result + Reflect.Text.RemoveFormatting(ChatChild.GetText);
end
end
ChatWidget.Free;
ChatChild.Free;
end

Hoodz
07-10-2015, 11:16 PM
This returns absolutely nothing after testing 10000 combinations
function GetTextLine(line: Integer): String;
var
J, I: Integer;
ChatWidget, ChatChild: TReflectWidget;
begin
for J := 0 to 50 do
begin
for I:=0 to 200 do
begin
ChatWidget.GetWidget(Widget_Chat_Container, I);
ChatChild.GetChild(ChatWidget, J);
Result := Result + Reflect.Text.RemoveFormatting(ChatChild.GetText);
end
end
ChatWidget.Free;
ChatChild.Free;
end

check out what this returns: widget: (parent) 162, (parent's, child) 43, (child's child) 0

slayr288
07-10-2015, 11:28 PM
check out what this returns: widget: (parent) 162, (parent's, child) 43, (child's child) 0

function GetTextLine(line: Integer): String;
var
J, I: Integer;
ChatWidget, ChatChild, ChildChild: TReflectWidget;
begin
ChatWidget.GetWidget(Widget_Chat_Container, 162);
ChatChild.GetChild(ChatWidget, 43);
ChildChild.GetChild(ChatChild, 0);
Result := Result + Reflect.Text.RemoveFormatting(ChildChild.GetText);
ChatWidget.Free;
ChatChild.Free;
ChildChild.Free;
end

returns nothing, I'm not really sure how to use widgets so idk if that is right though

Flight
07-11-2015, 02:06 AM
In line 330 of Chat.simba (AeroLib > core > Chat.simba) change the 347 to 346, like so:

Result.Y := 346 + (14 * (textn - 1));

That should give you accurate results. It'll be fixed in an upcoming small revision for AL but if you'd like to fix it yourself now, that's how you do it.

slayr288
07-11-2015, 05:04 AM
In line 330 of Chat.simba (AeroLib > core > Chat.simba) change the 347 to 346, like so:

Result.Y := 346 + (14 * (textn - 1));

That should give you accurate results. It'll be fixed in an upcoming small revision for AL but if you'd like to fix it yourself now, that's how you do it.

Thanks, I'll test it tomorrow

pencilkill
10-09-2015, 02:44 AM
I need somebody to help me with getting the information from checking your task with the gem, it should work but when it grabs the line the string is something like this
Y. o. u.'re assigneH. to K. il.l. H. il.l. giants'. onl.y V-.V- more to go.

Also, when I try grabbing the line with reflection it returns nothing

Here is the code I'm using
function SetCurrentTask: Boolean;
var
slayGem: TReflectInvItem;
lastMessage: String;
i: Integer;
taskInfo: TStringArray;
messageNull: Boolean;
begin
if not slayGem.Find('Enchanted gem') then
begin
Result := false;
end else
begin
Reflect.Mouse.Move(slayGem.GetPoint, 1, 1);
wait(randomRange(50,150));
Reflect.Mouse.Click(mouse_right);
wait(randomRange(30,60));
Reflect.Text.ChooseOption('Chec');
wait(randomRange(200,300));
messageNull := true;
for i:=1 to 8 do
begin
//writeln(getChatBoxText(i, clBlack)); debug
if FindChatBoxText('assigned', i, clBlack) then
begin
messageNull := false;
lastMessage := getChatBoxText(i, clBlack);
end
end
//writeln(lastMessage); debug
if not messageNull then
begin
//writeln('here'); debug
lastMessage := ReplaceRegExpr('''', lastMessage, '"', True);
lastMessage := ReplaceRegExpr(lastMessage, 'You"re assigned to kill ', '', True);
lastMessage := ReplaceRegExpr(lastMessage, ' only ', '', True);
lastMessage := ReplaceRegExpr(lastMessage, ' more to go.', '', True);
taskInfo := SplitRegExprEx(';', lastMessage);
writeln(ToStr(taskInfo[0]));
writeln(ToStr(taskInfo[1]));
Result := True;
end
end
end

NPC chatbox with options returns nothing, Is it fixed ?