shadowrecon Posted December 31, 2011 Share Posted December 31, 2011 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. Quote Link to comment Share on other sites More sharing options...
Wanted Posted December 31, 2011 Share Posted December 31, 2011 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. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted January 1, 2012 Author Share Posted January 1, 2012 (edited) 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 January 1, 2012 by shadowrecon Quote Link to comment Share on other sites More sharing options...
Wanted Posted January 1, 2012 Share Posted January 1, 2012 You need to update your OSI.... and figure out how to use StrInStr because using other methods that don't involve Pos() or something better are not good ways to compare strings. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted January 2, 2012 Author Share Posted January 2, 2012 I wasnt using StrInStr() that was from your example, and i made sure my OSI was up to date. I was simply just simply saving the results of GetChatBox to a String Var. and printing out that sting. I take a look at the StrToStr(); Function and see how it works. Quote Link to comment Share on other sites More sharing options...