Results 1 to 5 of 5

Thread: CheckPrayer;

  1. #1
    Join Date
    Jan 2015
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default CheckPrayer;

    Hello, I've been writing this combat script for RSC, one part of the script is to check for prayer.
    But I ran into some trouble using SCAR 1.13 and I've decided to switch over to Simba, since the SCAR scene has been dead for over a decade and its hard to get help.

    Code:
    var
       intPray, MinPray: integer;
       CurrentPray: string;
    
    Procedure CheckPrayer;
    begin
    MinPray := 30
    MoveMouse(425, 20);
    wait(300);
    CurrentPray := GetTextAt(318, 138);
    intPray := StrToInt(Copy(CurrentPray, 1, 2))
    if(intPray < 30) then
       begin
       writeln('Hello!');
       end;
    end;
    
    
    begin
    repeat
    CheckPrayer;
    until(1=0)
    end.
    If you google "Runescape Classic font" you will see the RSC fonts and the stats tab that I'm speaking of, sadly I can't post pictures..

    MoveMouse(425, 20); - Clicks on the stats tab.
    CurrentPray := GetTextAt(318, 138); - Scans (318, 138) within the stats tab and returns "Prayer: 24/24" with writeln()

    This next bit is where Im having issues.
    When I convert String to Integer(StrToInt) and assign it to intPray, i still can't use it for making conditionals, such as if(intPray < 30).

    Can someone guide me in the right direction of porting this to Simba? How do I make Simba read the RSC font, etc.

    I would be very thankful!

  2. #2
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Have you checked intPray?
    Simba Code:
    writeln(intPray);

    I don't about reading fonts, but this works fine for me:
    Simba Code:
    program test;

    procedure test();
    var
      intPray: integer;
      currentPray: string;
    begin
      currentPray := '24/24';
      writeln(currentPray);
      currentPray := explode('/', currentPray)[0];
      intPray := strToIntDef(currentPray, 0);
      writeln(intPray);
      if (intPray < 30) then
      begin
        writeln('hello');
      end;
    end;

    begin
      test();
    end.

    Progress Report:
    24/24
    24
    hello
    Last edited by Citrus; 11-10-2016 at 02:48 PM.

  3. #3
    Join Date
    Jan 2015
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Citrus View Post
    Have you checked intPray?
    Simba Code:
    writeln(intPray);
    Hmm yeah, well it seems that writeln only allows string. I think its better to switch completely to Simba, but I dont know how to make Simba read the RSC font. :/

    EDIT: writeln(intPray) returns

    HTML Code:
    Line 14: [Error] (14:17): Type mismatch in script
    Last edited by barrylol; 11-10-2016 at 02:50 PM.

  4. #4
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by barrylol View Post
    Hmm yeah, well it seems that writeln only allows string. I think its better to switch completely to Simba, but I dont know how to make Simba read the RSC font. :/
    I don't know what font RSC uses, but if you can read it with SCAR I'd think you'd be able to do it with Simba. Does SCAR have a fonts folder or something?

    e: Looks like you might be able to just copy the font. Drop it in Simba's "Fonts" folder. https://villavu.com/forum/showthread.php?t=52816
    Last edited by Citrus; 11-10-2016 at 02:57 PM.

  5. #5
    Join Date
    Jan 2015
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Citrus View Post
    e: Looks like you might be able to just copy the font. Drop it in Simba's "Fonts" folder
    Thanks a lot buddy! I will be checking that out!

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
  •