Wanted Posted November 6, 2011 Share Posted November 6, 2011 https://github.com/OSI1/OSI1/commit/0b9fd9ab1852fd7cb1a08c9b56ca7c7b364bcc34 I fixed a super annoying bug in ChooseOption, also there's no thread for Text.scar so have at it people * function GetUpText: string; By: Freddy1990 * function IsUpText(Text: string): Boolean; By: Freddy1990 * function IsUpTextMulti(Text: TStringArray): Boolean; By: Freddy1990 * function OptionBoxExistsEx(var OptionBoxTPA: TPointArray): Boolean; By: Wanted * function OptionBoxExists: Boolean; By: Wanted * function OptionsExistsEx(Options: TStringArray; Colors: T2DIntegerArray; var InBox: TBoxArray): TBooleanArray; By: Wanted * function AllOptionColors: TIntegerArray; By: Wanted * function AllOptionColors2D(ResultLength: LongInt): T2DIntegerArray; By: Wanted * function OptionExistsMulti(Options: TStringArray): Boolean; By: Wanted * function OptionExists(Option: string): Boolean; By: Wanted * function ChooseOptionMultiEx(Options: TStringArray; Colors: T2DIntegerArray; TypeC: ClickActions): Boolean; By: Wanted * function ChooseOptionMulti(Options: TStringArray): Boolean; By: Wanted * function ChooseOption(Option: string): Boolean; By: Wanted Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted November 10, 2011 Share Posted November 10, 2011 IsUpText is case sensitive. Be aware of that people!!! Threw me for a loop when it failed to find "bronze bar" when the in game uptext was "Withdraw-1 Bronze bar / 7 more options". Quote Link to comment Share on other sites More sharing options...
Wanted Posted November 11, 2011 Author Share Posted November 11, 2011 IsUpText is case sensitive. Be aware of that people!!! Threw me for a loop when it failed to find "bronze bar" when the in game uptext was "Withdraw-1 Bronze bar / 7 more options". I think IsUpText has always been case sensitive. Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted November 11, 2011 Share Posted November 11, 2011 Really? Don't think I ever noticed it before. Live and learn. Quote Link to comment Share on other sites More sharing options...
Wanted Posted November 11, 2011 Author Share Posted November 11, 2011 SRL 4: {******************************************************************************* function IsUpText(UpText: String): Boolean; By: Freddy1990 Description: Returns up text that might be to the right *******************************************************************************} function IsUpText(UpText: string): Boolean; begin Result := (Pos(UpText, GetUpText) > 0); end; OSI 1 {=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= function IsUpText(Text: string): Boolean; Contributors: Freddy1990 Description: Returns true if uptext is found. Date Created: August 7th, 2011. By Freddy1990. RS2 Build 660. Last Modified: August 7th, 2011. By Freddy1990. RS2 Build 660. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=} function IsUpText(Text: string): Boolean; begin Result := (Pos(Text, GetUpText) > 0); end; :-P Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted November 11, 2011 Share Posted November 11, 2011 I must have always been doing a getuptext, then do my own comparison before. (memory is a little fuzzy sometimes when you get old and senile). Quote Link to comment Share on other sites More sharing options...
KingKong Posted November 11, 2011 Share Posted November 11, 2011 Dunno where this goes, but in SRL getuptext didn't return the uptext properly. Eg: It returned ?-Ir?n ?re instead of 1-Iron ore. Does this happen with OSI as well? Quote Link to comment Share on other sites More sharing options...
Wanted Posted November 11, 2011 Author Share Posted November 11, 2011 Dunno where this goes, but in SRL getuptext didn't return the uptext properly. Eg: It returned ?-Ir?n ?re instead of 1-Iron ore. Does this happen with OSI as well? No, what you're experiencing is Simba OCR Fail. Quote Link to comment Share on other sites More sharing options...
FHannes Posted November 11, 2011 Share Posted November 11, 2011 Dunno where this goes, but in SRL getuptext didn't return the uptext properly. Eg: It returned ?-Ir?n ?re instead of 1-Iron ore. Does this happen with OSI as well? If you use SRL with SCAR it will probably work... Quote Link to comment Share on other sites More sharing options...
Wanted Posted November 13, 2011 Author Share Posted November 13, 2011 If you use SRL with SCAR it will probably work... Of course it will, it's the exact same code written by you Edit: https://github.com/OSI1/OSI1/commit/309d81cbbed026f1f4858344910b457457b78d4d I've decided to do with IsUpText the same thing I did to ChooseOption and add in highly optimized waiting so that it waits for the text to exist before leaving the function. Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted December 7, 2011 Share Posted December 7, 2011 Got around to cleaning up/testing some banking functions I had written for an earlier version of OSI, and discovered ChooseOption seems to work differently now. Before it would choose the first matching option if multiple options were a "match". I am quite certain of that: I had these routines working flawlessly with OSI. Now it seems to always select the last one. Example: (To really show see this in action first manually Withdraw-X and select 100). Bank your items and try ChooseOption('ithdraw-1'). There are two (or three) matching options (withdraw-1, withdraw-10, withdraw-100). It will always choose the last one in the list, which is not what you want. Sigh. Quote Link to comment Share on other sites More sharing options...
Wanted Posted December 7, 2011 Author Share Posted December 7, 2011 Got around to cleaning up/testing some banking functions I had written for an earlier version of OSI, and discovered ChooseOption seems to work differently now. Before it would choose the first matching option if multiple options were a "match". I am quite certain of that: I had these routines working flawlessly with OSI. Now it seems to always select the last one. Example: (To really show see this in action first manually Withdraw-X and select 100). Bank your items and try ChooseOption('ithdraw-1'). There are two (or three) matching options (withdraw-1, withdraw-10, withdraw-100). It will always choose the last one in the list, which is not what you want. Sigh. I've noticed that too, I'll try and fix that tonight. ---------- Post added at 09:34 PM ---------- Previous post was at 07:25 PM ---------- Turns out that was an interesting bug. It would find the first option down (as I coded it to) but then it was getting replaced by the 2nd one done. Analytic thinking ftw. I added a simple line of code in two places: for I := 0 to H do for II := 0 to HH do if (not (Result[iI])) then // THIS LINE if (Pos(Options[iI], Lines[i]) > 0) then I'll commit to OSI later tonight. "This should not be problem" Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted December 7, 2011 Share Posted December 7, 2011 Cool. I'll check it out in the morning. When you nod off and smash headfirst into your keyboard it is a sign to go to bed. Quote Link to comment Share on other sites More sharing options...
Wanted Posted December 7, 2011 Author Share Posted December 7, 2011 Cool. I'll check it out in the morning. When you nod off and smash headfirst into your keyboard it is a sign to go to bed. https://github.com/OSI1/OSI1/commit/8f26222802e39c97a69887716e13e7c3fd3e33ef Calling it quits for tonight (1am) hoping to get more stuff done tomorrow, but fixed what you were talking about here. Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted December 7, 2011 Share Posted December 7, 2011 Did you push a change to smart or anything. suddenly today smart is giving me no end of problems. Blamed it on my work laptop until I got home and encountered the same issues. I have scar (on the left) and the smart window (on the right) running side by side. When it should be right-clicking on an item in the bank (inside of smart) it right-clicks way over in the middle of the scar window, bringing up scar's right-click menu. Quote Link to comment Share on other sites More sharing options...
Wanted Posted December 8, 2011 Author Share Posted December 8, 2011 Did you push a change to smart or anything. suddenly today smart is giving me no end of problems. Blamed it on my work laptop until I got home and encountered the same issues. I have scar (on the left) and the smart window (on the right) running side by side. When it should be right-clicking on an item in the bank (inside of smart) it right-clicks way over in the middle of the scar window, bringing up scar's right-click menu. Turns out Flag was using improper use of ResetDC after all https://github.com/OSI1/OSI1/commit/662ccb3e20d4fb910354e4cf981a7f15945a2878 that was a nasty little bug Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted December 8, 2011 Share Posted December 8, 2011 What fun thing to track down that must have been. Quote Link to comment Share on other sites More sharing options...
Wanted Posted December 8, 2011 Author Share Posted December 8, 2011 What fun thing to track down that must have been. Actually the chooseoption was pretty hard. My method of isolating finds the problem pretty fast, at least when it's something like that. Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted December 8, 2011 Share Posted December 8, 2011 Sigh. Started to put together a script to show you that it is not fixed for me. And then I realized... All my current problems track back to the fact I am using ClickMouse which appears to be broken (for me at least). If I tell it to right click it actually right-clicks over on SCAR and not within the SMART client as expected. Fun, fun, fun, FUUUUUUUUN. Quote Link to comment Share on other sites More sharing options...
Wanted Posted December 8, 2011 Author Share Posted December 8, 2011 Sigh. Started to put together a script to show you that it is not fixed for me. And then I realized... All my current problems track back to the fact I am using ClickMouse which appears to be broken (for me at least). If I tell it to right click it actually right-clicks over on SCAR and not within the SMART client as expected. Fun, fun, fun, FUUUUUUUUN. There is no wrapper for Clickmouse in Smart.scar... however there is a SmartClickMouse which I'll create a wrapper for now. Normal OSI Mouse is working fine though, correct? (with OSI you updated ofc) Quote Link to comment Share on other sites More sharing options...