Results 1 to 10 of 10

Thread: ][Runtime Error] : Exception: Canvas does not allow drawing

  1. #1
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default ][Runtime Error] : Exception: Canvas does not allow drawing

    SCAR Code:
    Function SuccessFullClick(mousex, mousey, ranx, rany: Integer; left: Boolean): Boolean;
    var
      a, b, c: Integer;
    begin
      MMouse(mousex, mousey, ranx, rany);
      Wait(60 + Random(30));
      GetMousePos(b, c);
      HoldMouse(b + 1, c, left);
      repeat
        Wait(20 + Random(30));
        a := a + 1;
      until (a > 4);
      GetMousePos(b, c);
      ReleaseMouse(b, c, left);
     
      If(FindColor(b, c, 255, b-10, c-10, b+10, c+10))Then    //line 704
        Result:= True;
    End;

    Code:
    [Runtime Error] : Exception: Canvas does not allow drawing in line 704 in script
    i know that it has to do a negative number in
    SCAR Code:
    If(FindColor(b, c, 255, b-10, c-10, b+10, c+10))

    so i will have to change how the variables are declared but i cant not see what is returning as a negative so im not to sure what to change

    any help or ideas would be appreciated



  2. #2
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Hmm... Not sure if its completely the negatives, but just use a quick check:

    SCAR Code:
    If B < 10 then B:= 10;

    etc.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  3. #3
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    wherewould i add that to check?



  4. #4
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Just before the color finding. I think it's trying to search outside the RS window for the color.

  5. #5
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by bullzeye95 View Post
    Just before the color finding. I think it's trying to search outside the RS window for the color.
    thanks il let u know how it goes

    EDIT:
    Code:
    If B < 10 then B:= 10;
    still gave the same error so does that mean that it is not trying to search outside the screen and it is infact a negative number creating this error?



  6. #6
    Join Date
    Jun 2007
    Location
    #SRL
    Posts
    200
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    program New;

    Function SuccessFullClick(mousex, mousey, ranx, rany: Integer; left: Boolean): Boolean;
    var
      a, b, c: Integer;
    begin
      MMouse(mousex, mousey, ranx, rany);
      Wait(60 + Random(30));
      GetMousePos(b, c);
      HoldMouse(b + 1, c, left);
      repeat
        Wait(20 + Random(30));
        a := a + 1;
      until (a > 4);
      GetMousePos(b, c);
      ReleaseMouse(b, c, left);

      If(FindColor(b, c, 255, b-10, c-10, b+10, c+10))Then    //line 704
        Result:= True;
    End;

    begin
      if(SuccessFullClick(254, 213,5,5,True)) then
      begin
        Writeln('yay');
      end;
    end.

    then:

    SCAR Code:
    Successfully compiled
    yay
    Successfully executed

    worked for me, try redownloading your SCAR
    Quote Originally Posted by IRC
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 43
    <Wizzup> shit
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 3
    <Wizzup> 1
    <Wizzup> offblast

  7. #7
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    It depends on where you locate your mouse (If you put it in top left corner, I'm confident it would give you an error). Also, if it was near the top, then it could also be y being negative, so you might want to try adding the same, except change the 2 'x' s to 'y' s.

  8. #8
    Join Date
    Jun 2007
    Location
    #SRL
    Posts
    200
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    if you have SCAR 3.13 it may be the problem, there was a lot of instability which is now fixed in 3.14
    Quote Originally Posted by IRC
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 43
    <Wizzup> shit
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 3
    <Wizzup> 1
    <Wizzup> offblast

  9. #9
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    i have scar 3.14 and srl 11 it works in the script just every now and then it causes the canvas error the script works with it



  10. #10
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    Try
    Except
    End;

    FTW

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 03-29-2008, 06:32 PM
  2. Replies: 4
    Last Post: 02-02-2008, 10:04 AM

Posting Permissions

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