Jump to content
Wanted

OSI 2 UpText, Options, and Drop functions

Recommended Posts

https://github.com/OfficialSCARInclude/OSI2/commit/f3ba05c92d67ee49c17827cf03af88d671dc934a

 

OCR

 

Finished all the OCR functions really, I'm conisdering putting the stuff that was in Amount.scar in OCR instead of splitting it up between all of it's files.

 

Also I'm still debating on whether or not I want to pursue using FindText instead of GetText at all and other color options.

 

For now

 

[sCAR]{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Official SCAR Include

Runescape 07

OCR Routines

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

* function GetUpText: String;

By: Freddy

* function UpTextContainsMulti(Text: TStringArray): Boolean;

By: Freddy & Wanted.

* function UpTextContains(Text: string): Boolean;

By: Freddy & Wanted.

* function FindOptionsBox(var OptionsBox: TBox): Boolean;

By: Wanted

* function OptionBoxExists: Boolean;

By: Wanted

* function GetAllOptionsBox: TBox;

By: Wanted

* function GetNumberOptions(AllOptionsBox: TBox): Integer;

By: Wanted

* function GetOptionBox(Index: Integer; AllOptionsBox: TBox): TBox;

By: Wanted

* function GetOptionBoxMulti(Indexes: TIntegerArray; AllOptionsBox: TBox): TBoxArray;

By: Wanted

* function GetAllOptionBoxes(AllOptionsBox: TBox): TBoxArray;

By: Wanted

* function GetOption(Index: Integer; AllOptionsBox: TBox): string;

By: Wanted

* function GetAllOptions(AllOptionsBox: TBox): TStrArray;

By: Wanted

* function OptionsContainsMulti(Options: TStrArray; AllOptionsBox: TBox): TBoolArray;

By: Wanted

* function OptionsContains(Option: string; AllOptionsBox: TBox): Boolean;

By: Wanted

* function ChooseOptionMultiEx(Options: TStrArray; TypeC: ClickActions): Boolean;

By: Wanted

* function ChooseOptionMulti(Options: TStrArray): Boolean;

By: Wanted

* function ChooseOption(Option: string): Boolean;

By: Wanted

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}[/sCAR]

 

[sCAR]{$DEFINE RS07}

{$DEFINE OSI_RS07_Color_Anti_Randoms}

 

{$I OSI\OSI.scar}

{$I OSI\Divi\Misc\Debug.scar}

 

procedure ScriptTerminate;

begin

FreeOSI;

end;

 

//var

// TBA: TBoxArray;

// T: LongInt;

// B: TBox;

 

begin

SetUpOSI;

Wait(2000);

//T := GetSystemTime;

//WriteLn(GetUpText); //Use Bucket / 2 more options (31 ms)

//WriteLn(UpTextContainsMulti(['se B', 'ucket', '2 more'])); //True (32 ms)

//WriteLn(UpTextContains('ucket')); //True (32 ms)

//WriteLn(FindOptionsBox(B)); // True (31 ms)

//B := GetOptionBox(2, GetAllOptionsBox); // (16 ms)

//TBA := GetOptionBoxMulti([0, 1], GetAllOptionsBox); // (0 ms)

//TBA := GetAllOptionBoxes(GetAllOptionsbox);

//WriteLn(GetOption(0, GetAllOptionsbox)); // Talk-to Freaky Forester (63 ms)

 

//WriteLn(TSAToString(GetAllOptions(GetAllOptionsBox)));

// [0] Talk-to Freaky Forester, [1] Walk here, [2] Examine Freaky Forester, [3] Cancel,

// (171 ms)

//ChooseOptionMulti(['Examine', 'Cancel']);

//ChooseOptionMulti(['stir', 'fry']);

//DropItem(26, True);

DropItems([0, 1, 2, 3], True);

//WriteLn('(' + IntToStr(GetSystemTime - T) + ' ms)');

//DebugBox(B);

//DebugTBA(TBA);

end.[/sCAR]

 

79800777.png

 

Inventory

 

Finished all of Inventory pretty much. Just added the drop functions now that I have ChooseOption out of the way. Also Added GetInvSlotsBounds which is basically GetInvSlotBound(Multi)

 

[sCAR] * function GetInvSlotsBounds(Slots: TIntegerArray): TBoxArray;

By: Wanted[/sCAR]

 

[sCAR] * function GetDropPattern(Which: Integer): TIntegerArray;

By: Wanted

* function DropItem(Slot: Integer; CheckIT: Boolean): Boolean;

By: Wanted

* function DropItemsPEx(Slots, Pattern: TIntegerArray; Exclude, CheckIT: Boolean): Integer;

By: Wanted

* function DropItemsEx(Slots: TIntegerArray; Exclude, CheckIT: Boolean): Integer;

By: Wanted

* function DropItems(Slots: TIntegerArray; CheckIT: Boolean): Integer;

By: Wanted

* function DropAllExclude(Exclude: TIntegerArray; CheckIT: Boolean): Integer;

By: Wanted

* function DropAll(CheckIT: Boolean): Integer;

By: Wanted[/sCAR]

 

Explanation of my drop functions here http://forums.scar-divi.com/showthread.php?527-OSI-Banking-additions-and-other-stuff-12-12-2011&p=2666&highlight=drop#post2666

 

 

That's all for now. I haven't had much time since the last release to work on OSI but I still got an incredible amount done because most of the code already existed in OSI 1 I just had to tweak it.

 

More good stuff coming soon!

 

-Wanted

Edited by Wanted
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...