Results 1 to 3 of 3

Thread: Help with Functions

  1. #1
    Join Date
    Jun 2007
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Help with Functions

    I'm a bit stumped. I've been away for a couple of years from the SRL community now and it is pretty impressive how much a lot of things have improved so I would like to congratulate and thank those involved. Now I'm more eager than ever to finally get a good grasp on this stuff.
    So basically, I'm trying to detect text in the upper left hand corner of OSRS using functions from Slacky's OCR-engine. I don't understand what I'm doing wrong so I was hoping someone would be able to point me in the right direction.

    Here is what I have so far:
    Simba Code:
    1 program new;
    2 {$loadlib rstext.dll}
    3 var UpFont:TCharsN;
    4
    5 function ClientATIA(x1,y1,width,height: Integer): T2DIntegerArray;
    6 var bmp:Integer;
    7 begin
    8   bmp := BitmapFromClient(x1,y1,x1+width,y1+height);
    9   Result := GetBitmapAreaColors(bmp, 0,0,width,height);
    10   FreeBitmap(bmp);
    11 end;
    12
    13 Function RS_IsUpTextMulti(Textarr:TstringArray): Boolean
    14 begin
    15   ocr_SetClient(ClientATIA(7,7,500,16));
    16   Result := ocr_IsTextMulti(Textarr, UpFont);
    17 end;
    18
    19 var
    20   Textarr:TstringArray;
    21 begin
    22 ocr_LoadFont(AppPath + 'Fonts\UpChars07_s\', UpFont);
    23 if RS_IsUpTextMulti[('Bank'), ('ank')]
    24 then
    25 writeln('It worked');
    26 end.
    The error I am getting is this:
    Error: No default value for parameter 1 found at line 23

    Is paramater 1 that it is referring to the string array? I'm assuming not since it's there. I'm either missing something obvious or I am completely off and am going to look like a fool. But hopefully I can understand this eventually.
    Last edited by living dead; 08-01-2015 at 02:49 AM.

  2. #2
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by living dead View Post
    Is paramater 1 that it is referring to the string array? I'm assuming not since it's there. I'm either missing something obvious or I am completely off and am going to look like a fool. But hopefully I can understand this eventually.
    You need round brackets around the square ones on line 23.

  3. #3
    Join Date
    Jun 2007
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    You need round brackets around the square ones on line 23.
    Wow... I've been trying to figure this out for literally 2 hours now -_- thank you very much! Looks like everything is working now.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •