Results 1 to 6 of 6

Thread: 1st script is broken

  1. #1
    Join Date
    Nov 2008
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    1st script is broken

    [Runtime Error] : Exception: Canvas does not allow drawing in line 21 in script

    i am working on my first script and when i run it it get the error above
    SCAR Code:
    program autofighter;
    {.include SRL/SRL.scar}
    var
    mcolor1,mcolor2,kills,nkills,x,y:integer;

    procedure setup;
    begin
    mcolor1:=7239286;
    mcolor2:=9344137;
    nkills:=5;
    end;

    procedure fight;
    begin
    repeat
    if FindColorSpiralTolerance(x, y, mcolor1, 1, 1,520,390,15) or FindColorSpiralTolerance(x, y, mcolor2, 1, 1,520,390,15) then
    Mouse(x,y,3,3,false);
    if FindColorSpiralTolerance(x, y, 65535, x+100, Y+100,x-100, Y-100,1) then
    Mouse(x,y,3,3,true);
    Kills:= kills + 1
    sleep(5000);
    until(kills=nkills)
    end;

    begin
    setup;
    fight;
    end.

    any ideas?

  2. #2
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    its something to do with the -100's and +100's
    swap them around and it works
    SCAR Code:
    {.include SRL/SRL.scar}
    var
    mcolor1,mcolor2,kills,nkills,x,y:integer;

    procedure setup;
    begin
    mcolor1:=7239286;
    mcolor2:=9344137;
    nkills:=5;
    end;

    procedure fight;
    begin
    repeat
    if FindColorSpiralTolerance(x, y, mcolor1, 1, 1,520,390,15) or FindColorSpiralTolerance(x, y, mcolor2, 1, 1,520,390,15) then
    Mouse(x,y,3,3,false);
    if FindColorSpiralTolerance(x, y, 65535, x-100, Y-100,x+100, Y+100,1) then
    Mouse(x,y,3,3,true);
    Kills:= kills + 1
    sleep(5000);
    until(kills=nkills)
    end;

    begin
    setupsrl;
    setup;
    fight;
    end.
    oh and add SetupSRL;

    ~shut

  3. #3
    Join Date
    Nov 2008
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks that made it work, and add setupsrl? where to the includes?

  4. #4
    Join Date
    Jul 2007
    Location
    's-Gravenpolder, Holland
    Posts
    204
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Haha ^^ SetupSRL is not something you put in your includes

    Shuttleu already put it in your script for you. It goes into the beginning of your mainloop

    SCAR Code:
    begin
    setupsrl; // <<< There
    setup;
    fight;
    end.

  5. #5
    Join Date
    Feb 2007
    Posts
    849
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It runs the include, making things like declare players and in built randoms work.
    ________________________________________
    14:19 < cycrosism> I wonder what she would have done without it
    14:19 < cycrosism> without me*
    Cycrosism is now an it.
    Quote Originally Posted by Dervish View Post
    /Facedesk.

  6. #6
    Join Date
    Aug 2008
    Posts
    58
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Kills:= kills + 1
    to
    SCAR Code:
    Inc(kills);

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Is the SVN Broken?
    By boberman in forum News and General
    Replies: 3
    Last Post: 12-10-2007, 10:03 PM
  2. Broken PS2
    By Birfday_Cake in forum News and General
    Replies: 17
    Last Post: 10-01-2007, 02:33 AM
  3. Need someone with a broken axe.
    By Jason2gs in forum OSR Help
    Replies: 7
    Last Post: 02-28-2007, 05:15 PM
  4. I am Broken.......
    By Serial_KillaZ in forum Blogs and Writing
    Replies: 4
    Last Post: 05-06-2006, 10:29 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
  •