Jump to content
Wanted

Text.scar testing

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

If you use SRL with SCAR it will probably work...

 

Of course it will, it's the exact same code written by you xD

 

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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"

 

:D

 

Dual-AA-12-Shotguns-FPSRussia.jpg

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 xDhttps://github.com/OSI1/OSI1/commit/662ccb3e20d4fb910354e4cf981a7f15945a2878 that was a nasty little bug :(

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

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...