Results 1 to 8 of 8

Thread: Scar Math inttostr help

  1. #1
    Join Date
    Sep 2006
    Posts
    322
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default Scar Math inttostr help

    SCAR Code:
    Writeln('The Answer Is: ' + IntToStr(Result))
      SendKeys(IntToStr(Result));

    The send keys just sends "))))))))))"


    Am i doing something wrong?
    "SRL is the best SCAR community in the World, with the most talented programmers: adjust your volume."
    -Wizzup?

  2. #2
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Post whole function please.
    I do visit every 2-6 months

  3. #3
    Join Date
    Sep 2006
    Posts
    322
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    SCAR Code:
    Function Solve: integer;
    begin
      For I:=0 To 3 Do
      Begin
        If FindBitmapToleranceIn(Maths[i],x,y,629, 104, 686, 147, 50) Then
        Begin
          Case I Of
          0:Begin
             Writeln('Add');
             Result := (FindTopNumber + FindBottomNumber);
            End;
          1:Begin
             Writeln('Subtract');
             Result := (FindTopNumber - FindBottomNumber);
            End;
          2:Begin
             Writeln('Multiply');
             Result := (FindTopNumber * FindBottomNumber);
            End;
          3:Begin
             Writeln('Divide');
             Result := (FindTopNumber / FindBottomNumber);
            End;
          End;
        End;
      End;
      Writeln('The Answer Is: ' + IntToStr(Result))
      SendKeys(IntToStr(Result));
    end;

    edit: seen like 10+ people viewed who know scar well, and no reply
    Last edited by uncfan1119; 10-30-2009 at 07:03 PM.
    "SRL is the best SCAR community in the World, with the most talented programmers: adjust your volume."
    -Wizzup?

  4. #4
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    What are you trying to accomplish with this? Is there a link we can use to run the script on?

    By looking at the code, it looks the you're trying to find a certain operator, and when you find it, preform the equation. I thing you might want a 'break;' after finding a certain operator. I have noidea (lol) on what could be causing scar do print '))))))'

    Sorry I haven't been able to help you on msn man. I've just been really busy with school lately.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  5. #5
    Join Date
    Oct 2009
    Location
    Melb, Australia
    Posts
    179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is a bug with the current version of SCAR (SendKeys), but is apparently fixed in the next version.
    Read post #5: http://www.villavu.com/forum/showthread.php?t=52460
    But your result of ")))))))" would mean you're getting a result of "0" every time, meaning the function was unable to find the numbers/math symbol to calculate anything.

  6. #6
    Join Date
    Jul 2008
    Location
    US
    Posts
    104
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm just gonna guess your playing a math game or something... I'm pretty sure you can't just use any font. You might have to make bitmaps of 0-9 and make it, if one is found, give a value. It would take some crazy TPA's and sorting from left to right for that. Not bad. But you'll prolly have to read up on them alot...

    P.S.

    Sort by TPA[I].X, from least to greatest. Times the values by multiples of 10 based on how many digits you have.

    I'll help you with this if you need me too.

  7. #7
    Join Date
    Oct 2009
    Location
    Melb, Australia
    Posts
    179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    He already made bitmaps of the numbers, which is used in the FindTopNumber and FindBottomNumber functions.

  8. #8
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    are you sure that FindTopNumber and FindBottomNumber work? Because that looks like the easiest answer to your problem. When SCAR prints out the number in the WriteLn() What # does it produce?

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
  •