Results 1 to 8 of 8

Thread: Text.

  1. #1
    Join Date
    Apr 2015
    Location
    Falador
    Posts
    41
    Mentioned
    2 Post(s)
    Quoted
    18 Post(s)

    Default Text.

    So I'm attempting to make auto replies to noobs or autoer reporter that ask questions while in game.
    For example. You're botting smithing and here comes a player. He says "what's your smithing lvl". And the bot should look for lvl then typesend back "70". but script can't seen to get the text in the chatbox right -.-

    For Instance
    in game chatbox line 8 is "lol nope"
    Simba Code:
    writeln(getchatboxtext(8,clblue));
    Script would return 4U4 l$op instead of lol nope like in game.

    I want it to be like this so it get the correct text from the game and reply.
    Simba Code:
    if GetChatBoxText(8,clblue) = ('lvl')then reply70;



    Do I need to load a specific text file or what to make simba read right?
    How is what the in game text look like.


    =RSPS botter=

  2. #2
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Try this:

    Simba Code:
    function getchat(const line:integer):string;
    var
      texttpas, textatpa:t2dpointarray;
      texttpa:tpointarray;
      textcolors:tintegerarray;
      i:integer;
    begin
      textcolors := [128, 16711680, 0, 255, 16711935, 16776960, 16777215, 8388736];
      setLength(texttpas, length(textcolors));
      for i := 0 to high(textcolors) do
        findColors(texttpas[i], textcolors[i], 7, 402 + (line * 14), 495, 413 + (line * 14));
      texttpa := mergeAtpa(texttpas);
      textatpa := splittpaex(texttpa, 1, 10);
      SortATPAFromFirstPointX(textatpa, Point(0, 0));
      result := getTextATPA(textatpa, 3, 'smallchars07');
    end;

  3. #3
    Join Date
    Apr 2015
    Location
    Falador
    Posts
    41
    Mentioned
    2 Post(s)
    Quoted
    18 Post(s)

    Default

    Quote Originally Posted by rj View Post
    Try this:

    Simba Code:
    function getchat(const line:integer):string;
    var
      texttpas, textatpa:t2dpointarray;
      texttpa:tpointarray;
      textcolors:tintegerarray;
      i:integer;
    begin
      textcolors := [128, 16711680, 0, 255, 16711935, 16776960, 16777215, 8388736];
      setLength(texttpas, length(textcolors));
      for i := 0 to high(textcolors) do
        findColors(texttpas[i], textcolors[i], 7, 402 + (line * 14), 495, 413 + (line * 14));
      texttpa := mergeAtpa(texttpas);
      textatpa := splittpaex(texttpa, 1, 10);
      SortATPAFromFirstPointX(textatpa, Point(0, 0));
      result := getTextATPA(textatpa, 3, 'smallchars07');
    end;
    I don't know how to read this -.- you mind give me some description of it?
    like what do i need to put anything in textcolor etc?

    -I got an out of bounds error when putting this in the loop:
    writeln(getchat(8));

  4. #4
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by The Legendary View Post
    I don't know how to read this -.- you mind give me some description of it?
    like what do i need to put anything in textcolor etc?

    -I got an out of bounds error when putting this in the loop:
    writeln(getchat(8));
    Wat server is this for

    findColors(texttpas[i], textcolors[i], 7, 402 + (line * 14), 495, 413 + (line * 14));

    401 is the top x were the chatbox starts, 495 is the top y

  5. #5
    Join Date
    Apr 2015
    Location
    Falador
    Posts
    41
    Mentioned
    2 Post(s)
    Quoted
    18 Post(s)

    Default

    Quote Originally Posted by rj View Post
    Wat server is this for

    findColors(texttpas[i], textcolors[i], 7, 402 + (line * 14), 495, 413 + (line * 14));

    401 is the top x were the chatbox starts, 495 is the top y

    I can't seen to make it work on it, even after changing those i still got an out of bound error
    This is for emps world can be found at https://emps-world.net/index.php

  6. #6
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by The Legendary View Post

    I can't seen to make it work on it, even after changing those i still got an out of bound error
    This is for emps world can be found at https://emps-world.net/index.php
    Are you running classic or opengl?

  7. #7
    Join Date
    Apr 2015
    Location
    Falador
    Posts
    41
    Mentioned
    2 Post(s)
    Quoted
    18 Post(s)

    Default

    Quote Originally Posted by rj View Post
    Are you running classic or opengl?
    Classic, because simba is blind with opengl mode.
    make sure to re-size the client to the smallest size allowed

  8. #8
    Join Date
    Apr 2015
    Location
    Falador
    Posts
    41
    Mentioned
    2 Post(s)
    Quoted
    18 Post(s)

    Default

    @rj Can you help me with this?
    As you can see the first chatline is always correct but not the rest.


    Simba Code:
    program pm;
        {$I SRL/SRL.simba}
    function kgetchat(const line:integer):string;
    var
      texttpas, textatpa:t2dpointarray;
      texttpa:tpointarray;
      textcolors:tintegerarray;
      i:integer;
    begin
      textcolors := [128, 16711680, 0, 255, 16711935, 16776960, 16777215, 8388736];
      setLength(texttpas, length(textcolors));
      for i := 0 to high(textcolors) do
        findColors(texttpas[i], textcolors[i], 7, 12 + (line * 14), 495, 399 + (line * 14));
      texttpa := mergeAtpa(texttpas);
      textatpa := splittpaex(texttpa, 1, 10);
      SortATPAFromFirstPointX(textatpa, Point(0, 0));
      result := getTextATPA(textatpa, 3, 'smallchars07');
    end;
          Begin
    ClearDebug;
    SetupSRL;
    ActivateClient;
    Wait(1000);
    writeln(kgetchat(1));
    writeln(kgetchat(2));
    writeln(kgetchat(3));
    writeln(kgetchat(4));
    writeln(kgetchat(5));
    writeln(kgetchat(6));
    writeln(kgetchat(7));
    writeln(kgetchat(8));
    end.

    Debug:
    Code:
    SRL Compiled in 16 msec
    Madara: Buying b gloves
    MadaTa[BuyV$VoVest
    VdV:V$VV9aI 1m
    VdV:V$V#9aI 1m
    VV:VV9eaaId1msfast boots' lava cape cash
    VVVV9aeaId1smfast boots' lava cape cash
    V:VV! 9aeaId1smfast boots' lava cape cash
    V:VV9eaetIa 1dsmfast boots' lava cape cash
    Successfully executed.
    EDIT: I still need help with this and I check this topic multiple times a day ;[
    Last edited by The Legendary; 05-21-2015 at 05:53 PM. Reason: Telling others I still need help

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
  •