Results 1 to 5 of 5

Thread: Find text in chat window... How do I do this?

  1. #1
    Join Date
    Oct 2006
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Find text in chat window... How do I do this?

    Hi all, I am a new member so please help me!

    I know a little scar, I have successfully made a gnome agility training script. However, my script still needs antirandoms, antibans (easy to put in, i can do it later). Hower, my script tends to misclick about 20% of the time, for example, I know how to get and check the text at the upper left corner of teh rs screen and check for items and their options. However, sometimes, it tends tomisclick due to lag and stuff, so it messes up, thinking that it successfully clicked the item.

    But I know a way to fix that. For example, when you walk across the log, it says in the chat window: You walk across the slippery log... or something like that.

    If I can find a way to get that text and confirm that that text was said, (which means a successful click), then I can fix my script.

    -------------------------------------------------------------------------------

    My question is: How do I get and read text in the chat window (not player typed text), just normal text?

    -------------------------------------------------------------------------------

    Please help me. If I can find out how to do this, my script will be foolproff (it even has human text and mouse functions)!.


    If I can find a way to do this, I promise to give back to the community.

    Thanks in advance!!

  2. #2
    Join Date
    Sep 2006
    Posts
    161
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    InChat and InChatMulti are functions that return booleans, true if they found your phrase.
    InChat takes one string and InChatMulti takes three. They return true if the entire string is found anywhere on the most recent status/chat line.

    For your example, use something like

    repeat
    WalkAcrossLog;
    until (InChatMulti('cros', 'log', lipp'));

    You should run that check with your choice of three (relatively unique) slices of the chat text.

    EDIT: To clarify. These are functions that return a True/False value, and so you use them with conditionals like ifs or the checks in a loop structure. You don't need to look for the entire message, but the message must contain your entire string.

    EDIT further: InChatMulti is true if any one of the three is found.


    Wow. I've been away quite a while. Real life, yea, way unpredictable. Sorry, y'all, if I've caused any inconvenience.

  3. #3
    Join Date
    Oct 2006
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Omg! Thanks soo much! I've also found a function called: FindChatText

    That searches for the text anywhere in the chat window, I'll use either one where appropriate.

    Also, what if I want to find _player typed_ chat strings... For example, anti ban functions...

    For example, If someone types in "agility lvls?", I'll search for the keyword "agility" and "lvls" and make an auto response.

    Also, how do I find player typed strings that are _not_ in the chat window, but the main playing window. (I might need to do this if the chat window gets too crowded to get the messeges from doing obstacles).

    One last thing... After this is done (probably in two or three days at the max), where could I post my script (so that everyone can use it)?
    My script is wicked, lol, people actually respond to my stuff and I babble some more stuff (automatically).

  4. #4
    Join Date
    Sep 2006
    Posts
    161
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I think you use FindChat for that.


    Wow. I've been away quite a while. Real life, yea, way unpredictable. Sorry, y'all, if I've caused any inconvenience.

  5. #5
    Join Date
    Oct 2006
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hey, thanks a lot for the answers, however, I have one more question.

    When I use InChat, it prints out the last line of text in the chat (lilke it's supposed to). However, it misses some characters almost all the time.

    For example, I examined a manole and it said this in my rs chat:
    "There's a cover over this manhole."

    When I used InChat, this is what it printed out:
    "t re's a cover over this manhole."

    So, it missed some characters. Any thoughts on how I can fix this?

    Thanks in advance!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Getting text from text window?
    By Gone Fishing in forum OSR Help
    Replies: 8
    Last Post: 04-24-2008, 07:33 PM
  2. Find text in game chat.
    By Kosaki in forum OSR Help
    Replies: 9
    Last Post: 01-06-2008, 02:07 PM
  3. what is the best way to find chat text
    By jhildy in forum OSR Help
    Replies: 7
    Last Post: 05-20-2007, 09:57 PM
  4. Clicking Skill up text in MC window
    By Bramble in forum OSR Help
    Replies: 2
    Last Post: 12-05-2006, 04:49 PM

Posting Permissions

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