Results 1 to 11 of 11

Thread: Dialogue to Text

  1. #1
    Join Date
    Nov 2014
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default Dialogue to Text

    Hey I would like to know how to convert dialogue in the chat box like this:

    question.PNG

    into a variable that can be read?

    I'm trying to make a calculator.


    so far I only have this and i was looking at the aerolib github but..yea

    Code:
    Procedure idkWhatImDoing;
    Begin
    if (DoConversationEx(['What','hat is'], false)) then
      Begin
    
      End;
    
        if (DoConversationEx(['Correct','ect ans'], false)) then
          Begin
            clickToContinue;
            writeln('Finished conversation');
          End;
    
    
    End;

  2. #2
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    Is the question always static (ie What is x + y)?

    Or do the questions jump between addition, subtraction, division & multiplication?

  3. #3
    Join Date
    Nov 2014
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Dan the man View Post
    Is the question always static (ie What is x + y)?

    Or do the questions jump between addition, subtraction, division & multiplication?
    Always static, and the numbers are always 0 to 9

  4. #4
    Join Date
    Nov 2014
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    I'm not trying to make it very pretty just trying to make a script that works. I was going to make it type in all possible solutions to 0-9 addition, it was the only thing i could think of tbh. Their only form of deterrent is that question and there's no penalty for solving it wrong. There's only 0-18 or 19 solutions to the problem in total
    Last edited by Eddymanman; 08-31-2017 at 02:03 AM.

  5. #5
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by Eddymanman View Post
    I'm not trying to make it very pretty just trying to make a script that works. I was going to make it type in all possible solutions to 0-9 addition, it was the only thing i could think of tbh. Their only form of deterrent is that question and there's no penalty for solving it wrong. There's only 0-18 or 19 solutions to the problem in total
    That looks like the 'CharsNPC07' font. Simba should have no problem reading it.
    http://docs.villavu.com/simba/scriptref/ocr.html

    edit: I see that there are no numbers in font, and Simba isn't reading the text correctly in my tests. You can try adding them yourself or using Tesseract.
    Last edited by Citrus; 08-31-2017 at 02:51 AM.

  6. #6
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

  7. #7
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by Eddymanman View Post
    op
    I got it to work by adding '+', '6', and '7' to the 'CharsNPC07' font folder. The new bitmaps are attached below.
    Simba Code:
    program new;

    procedure Question;
    var
      bmp: Int32;
      b: TBox;
      tpa: TPointArray;
      atpa: T2DPointArray;
    begin
      bmp := LoadBitmap(AppPath + 'question.png');
      SetTargetBitmap(bmp);

      if FindColors(tpa, 0, 200, 50, 320, 70) then
      begin
        b := GetTPABounds(tpa);
        WriteLn(GetTextAtEx(b.x1, b.y1, b.x2, b.y2, 0, 5, 1, 0, 0, 'CharsNPC07'));
      end;

      SetDesktopAsClient;
      FreeBitmap(bmp);
    end;

    begin
      ClearDebug;
      Question;
    end.
    Progress Report:
    What is 7 + 6?
    Successfully executed.

    CharsNPC07.zip

  8. #8
    Join Date
    Nov 2014
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Citrus View Post
    I got it to work by adding '+', '6', and '7' to the 'CharsNPC07' font folder. The new bitmaps are attached below.
    Simba Code:
    program new;

    procedure Question;
    var
      bmp: Int32;
      b: TBox;
      tpa: TPointArray;
      atpa: T2DPointArray;
    begin
      bmp := LoadBitmap(AppPath + 'question.png');
      SetTargetBitmap(bmp);

      if FindColors(tpa, 0, 200, 50, 320, 70) then
      begin
        b := GetTPABounds(tpa);
        WriteLn(GetTextAtEx(b.x1, b.y1, b.x2, b.y2, 0, 5, 1, 0, 0, 'CharsNPC07'));
      end;

      SetDesktopAsClient;
      FreeBitmap(bmp);
    end;

    begin
      ClearDebug;
      Question;
    end.
    Progress Report:
    What is 7 + 6?
    Successfully executed.

    CharsNPC07.zip


    im running you code as is and im getting


    Code:
     What is m I S?
    Successfully executed.
    Last edited by Eddymanman; 09-04-2017 at 09:14 AM.

  9. #9
    Join Date
    Nov 2014
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    nvm had to restart my simba

  10. #10
    Join Date
    Mar 2012
    Posts
    107
    Mentioned
    2 Post(s)
    Quoted
    49 Post(s)

    Default

    Using widgets in reflection you can easily obtain the information, every time. There's a guide to widgets and debugger floating around here as well. Run debugger when you have the dialogue up and the exact text should appear in one of the widgets that it prints out. Then, if you read the widgets guide you should know how to do the rest.

  11. #11
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by Eddymanman View Post
    nvm had to restart my simba
    Haha yeah I forgot to do that while I was testing it. Fonts are loaded when Simba is started. Glad you got it working!

    Quote Originally Posted by One Kid View Post
    Using widgets in reflection you can easily obtain the information, every time. There's a guide to widgets and debugger floating around here as well. Run debugger when you have the dialogue up and the exact text should appear in one of the widgets that it prints out. Then, if you read the widgets guide you should know how to do the rest.
    It's a private server.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •