Jump to content
shadowrecon

How to use chat.scar lib??

Recommended Posts

Okay so i was trying to use the chatbox to determine the state of the bot, and iwanted to use the function

GetChatTextEx(Chatbox line, Text color); i set it up like this

 

procedure CheckStatus;

begin

if(GetChatTextEx(7, 0) = 'You Swing') then

WriteLn('Chopping Tree...')

else

WriteLn('Trying to find Tree...');

end;

 

then also set it up like this

 

procedure CheckStatus;

var

s: String;

begin

s := GetChatTextEx(7, 0);

if(s = 'You Swing') then

WriteLn('Chopping Tree...')

else

WriteLn('Trying to find Tree...');

end;

 

Both Procedures just write the else line. Ive messed with chat box lines, and collors with no luck can anyone tell

me a good way to read the chat box current line?

 

Thank You.

Link to comment
Share on other sites

program New;

{$DEFINE RS2}
{$DEFINE OSI_Color_Anti_Randoms}

{$I OSI\OSI.scar}

procedure ScriptTerminate;
begin
 FreeOSI;
end;

begin
 SetUpOSI;
 ActivateClient;
 Wait(3000);
 // Break stuff down into logical pieces to compensate for OCR fails
 // example You swing your pickaxe -> ['You s', 'swing', 'ing yo', 'ickax']
 // Do not use pieces that will get false matches such as 'a' or 'you'
 // Don't forget ChooseOption(Multi) trims 'y', ' ', 'A', 'i'

 WriteLn(BoolToStr(StrInStrMulti(['You s', 'swing', 'ing yo', 'ickax'], GetChatTextEx(7, clBlack))));
end.

Link to comment
Share on other sites

I tried just copying you example to see how it works and got a compiler error on StrInStrMulti() Tried setting it as a string variable but then just got a type mismatch, any thoughts?

 

After some messing around, i got it to say 'Welcome to Runescape.' but when i compared it to another string it would do anything.Then i tried cutting a tree and then it went back to the

··.... ... i -...... i....- So i was okay if thats the data your gonna out put i tried comparing that to a string containing the same thing and it didnt do anything either.. even tho its not saying what i want it to if i could find a way to compare the strings then i could use the data.. its just comparing that data because we are clearly getting data.

 

---------- Post added at 06:47 AM ---------- Previous post was at 04:10 AM ----------

 

Okay so after some more messing around, i think whats going on is there is a bunch of 'white space' because i took the welcome to runescape string, used the Right() function to recall the last 2 char and stored them into another string instance. and i then compared that string instance to ' ' (just 2 blank spaces) and it returned true or equal so im gonna play around with it and figure out how much white space there is and trim it off the strings and see if that will make a difference.

 

---------- Post added at 07:05 AM ---------- Previous post was at 06:47 AM ----------

 

So after messing with it for a little while i used the TrimOthers() and Lowercase() function and i found i can compare the string i want to find vs the string i got aslong as it doesnt contain a Y in the start?? it works great for the welcome to runescape but if i try to use it with you swing ect. it gives me gibberish.. any ideas? i know you made a comment that scar doesnt recognize y's?

Edited by shadowrecon
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...