Results 1 to 6 of 6

Thread: Tiny Mistake

  1. #1
    Join Date
    Jan 2007
    Posts
    248
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Tiny Mistake

    Hey, I have a whole new error, and its within the Main Loop (end) of my script. Just wonderin if anybody can fix it? Thanks.

    SCAR Code:
    // New redo of Godfather Inc. PowerMiner*** VERS. Alpha~
    // Next Vers 'beta' will have anti randoms atleast... And Some SRL includes
    //Has an auto color function NOTE: defualt color = iron
    program PowerMiner;
    {.include SRL/srl.scar}
    const
    rockcolor= 2305614; //color of rock (will use this to auto color)
    nextrock= 3000; // time to wait b4 next click. (1000 = 1 second)
    loads= 2; //number of loads to powermine
    var
     i,xD,yD,full,drop,ore,x1,y1,loadz: integer;
     MineCol: array [0..3] of integer;
    Function GetRockColor(MineCol: array [0..3] of integer): integer;

    begin
      if (FindColorTolerance(xD, yD, rockcolor, 20, 25, 490, 315, 2)) then
      begin
        MineCol[0] := GetColor(x+3,y+3);
        MineCol[1] := GetColor(x-3,y-3);
        MineCol[2] := GetColor(x-3,y+3);
        MineCol[3] := GetColor(x+3,y-3);
        i := Random(3) + 1;
        result := MineCol[i];
      end;
    end;

    Procedure MineRock;
    var xR,yR: integer;
     begin
     repeat
      If FindColorTolerance(xR,yR,MineCol[i],20,25,490,315,2) then
       Mouse(xR,yR,4,4,true);
      wait(nextrock);
      until(findbitmap(full,x1,y1));
      end;
    Procedure LoadBitDTM;
    begin
    full := BitmapFromString(16, 12, 'z78DA73B27434B5' +
           '307442220D908013862C0AE9E8E864E14880C43019934D0209361' +
           '3C5854822C8F692693EA66BF19B86D7BF44998F2B344834CD096F' +
           '3C620262621C7F4A202A7C70F89754712A9B8FE1E6C1EF7E5CB14' +
           '36A6EC29F129C8C2C2DCD4D212401F391546211C7EF1224350043' +
           '29FB94');

    drop := BitmapFromString(14, 8, 'z78DA33753135313177C3014CC' +
           '1B298247EF5C82206480097C9C4A8C754834B2FF1E243C54C626C' +
           '21C63D98B64048031C809838C2A59E1812BFAB20240010BE9F4F');
           
    ore := DTMFromString('78DA6314656060E06540038C482490960012A' +
           'C04D44813A14606487010618E3001350A4042820873A408A801F9' +
           '5D9C801A012021805F0D00FF840186');

           end;
    Procedure SetVariable;
     begin
        loadz:= 0;
      if FindBitmap(full,x1,y1) then
        loadz:= loadz+1;
     end;

    Procedure DropOre;
    var x1,y1,x2,y2,x3,y3: integer;
     Begin
      If FindBitmap(full,x1,y1) then
       begin
        repeat
      FindDTM(ore,x2,y2,555,200,740,465);
      Mouse(x2,y2,4,4,false);
      wait(600+random(125));
      FindBitmap(drop,x3,y3);
      Mouse(x3+6,y3+3,4,4,true);
        until not(FindDTM(ore,x2,y2,555,200,740,465))
      end;
     end;
       
    begin  //**MainLoop**
    SetupSRL;
    ActivateClient;
    GetRockColor(MineCol);
    MouseSpeed:= 8+random(2);
    LoadBitDTM;
     repeat
     SetVariable;
     MineRock;
     DropOre;
     until(loadz>loads);
    end.

    The error i get [Runtime Error] : Type Mismatch in line 79 in script. Just wondering if any of yall kno how to fix it. Thanks.

  2. #2
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It compiles right, i dont know what your talking about.

  3. #3
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yeah sorry dude, can't really help you. it compiles right for me too. almost everybody has a different computer so some people get different errors, your going to have to try to find a scripter who gets the same error on there computer.

  4. #4
    Join Date
    Feb 2006
    Location
    Locked in RAM's closet !
    Posts
    2,001
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    ill take a look at it.

    EDIT : found problem fixing for you.

    SCAR Code:
    // New redo of Godfather Inc. PowerMiner*** VERS. Alpha~
    // Next Vers 'beta' will have anti randoms atleast... And Some SRL includes
    //Has an auto color function NOTE: defualt color = iron
    program PowerMiner;
    {.include SRL/srl.scar}

    const
      rockcolor= 2305614; //color of rock (will use this to auto color)
      nextrock= 3000; // time to wait b4 next click. (1000 = 1 second)
      loads= 2; //number of loads to powermine
     
    var
     i, xD, yD, drop, ore, loadz : Integer;
     MineCol: array [0..3] of integer;
     
    Function GetRockColor : Integer;

    begin
      if (FindColorTolerance(xD, yD, rockcolor, 20, 25, 490, 315, 2)) then
      begin
        MineCol[0] := GetColor(x+3,y+3);
        MineCol[1] := GetColor(x-3,y-3);
        MineCol[2] := GetColor(x-3,y+3);
        MineCol[3] := GetColor(x+3,y-3);
        i := Random(3) + 1;
        result := MineCol[i];
      end;
    end;

    Procedure MineRock;
    var xR,yR: integer;
     begin
     repeat
      If FindColorTolerance(xR,yR,MineCol[i],20,25,490,315,2) then
       Mouse(xR,yR,4,4,true);
      wait(nextrock);
      until(InvFull = True);
      end;
    Procedure LoadBitDTM;
    begin
    drop := BitmapFromString(14, 8, 'z78DA33753135313177C3014CC' +
           '1B298247EF5C82206480097C9C4A8C754834B2FF1E243C54C626C' +
           '21C63D98B64048031C809838C2A59E1812BFAB20240010BE9F4F');

    ore := DTMFromString('78DA6314656060E06540038C482490960012A' +
           'C04D44813A14606487010618E3001350A4042820873A408A801F9' +
           '5D9C801A012021805F0D00FF840186');

           end;
    Procedure SetVariable;
     begin
        loadz:= 0;
      if (InvFull = True) then
        loadz:= loadz+1;
     end;

    Procedure DropOre;
    var x2,y2,x3,y3: integer;
     Begin
      If (InvFull = True) then
       begin
        repeat
      FindDTM(ore,x2,y2,555,200,740,465);
      Mouse(x2,y2,4,4,false);
      wait(600+random(125));
      FindBitmap(drop,x3,y3);
      Mouse(x3+6,y3+3,4,4,true);
        until not(FindDTM(ore,x2,y2,555,200,740,465))
      end;
     end;

    begin  //**MainLoop**
    SetupSRL;
    ActivateClient;
    GetRockColor;
    MouseSpeed:= 8+random(2);
    LoadBitDTM;
     repeat
     SetVariable;
     MineRock;
     DropOre;
     until(loadz>loads);
    end.


    What I did:

    you were declaring minecol 2 times... once its a global var (a var that can be used in any proc in your script(these are your global vars var
    i, xD, yD, drop, ore, loadz : Integer;
    MineCol: array [0..3] of integer) you do not need to declare it again... as you can see in your func it says Function GetRockColor : Integer; now. see how the var isn't being declared again.

    also your full bitmap i deleted... there is a InvFull proc in SRL much easier..

    Please next time standardize your script better

    no more error.

    yeah sorry dude, can't really help you. it compiles right for me too. almost everybody has a different computer so some people get different errors, your going to have to try to find a scripter who gets the same error on there computer.
    I have yet to find a case where the computer was the problem(unless the computer is like window 95 junked)

    yes if you compiled it it worked fine but if you pressed play(do not need RS open) and let it run on your desktop... the runtime error would have appeared. hint the name runtime error (which r pains in the asses to fix half the time.)

    hopfully you didnt think i flamed ya there




    ctrl + f9 compiles all scar scripts you have open but does not run them,
    f9 runs all scar script you currently have open.
    Darky has stopped by to say hello :).
    10-21-2010
    Updated-
    10-09-2012

  5. #5
    Join Date
    Jan 2007
    Posts
    248
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks dude
    EDIT: this is kinda getting depressin, but anyhow my script doesnt do shit :S Wonder why.

  6. #6
    Join Date
    Feb 2006
    Location
    Locked in RAM's closet !
    Posts
    2,001
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    lol i didnt read the code but lemme see what you got agian

    edit:

    SCAR Code:
    // New redo of Godfather Inc. PowerMiner*** VERS. Alpha~
    // Next Vers 'beta' will have anti randoms atleast... And Some SRL includes
    //Has an auto color function NOTE: defualt color = iron
    program PowerMiner;
    {.include SRL/srl.scar}

    const
      rockcolor= 2305614; //color of rock (will use this to auto color)
      nextrock= 3000; // time to wait b4 next click. (1000 = 1 second)
      loads= 2; //number of loads to powermine

    var
     i, drop, ore, loadz : Integer;
     MineCol: array [0..3] of integer;

    Function GetRockColor : Integer;

    begin
      if (FindColorTolerance(x, y, rockcolor, 20, 25, 490, 315, 2)) then
      begin
        MineCol[0] := GetColor(x+3,y+3);
        MineCol[1] := GetColor(x-3,y-3);
        MineCol[2] := GetColor(x-3,y+3);
        MineCol[3] := GetColor(x+3,y-3);
        i := 3 - Random(3);
        result := MineCol[i];
      end;
    end;

    Procedure MineRock;
    var xR,yR: integer;
     begin
     repeat
      If FindColorTolerance(xR,yR,MineCol[i],20,25,490,315,2) then
       Mouse(xR,yR,4,4,true);
      wait(nextrock);
      until(InvFull = True);
      end;
     
    Procedure LoadBitDTM;
    begin
    drop := BitmapFromString(14, 8, 'z78DA33753135313177C3014CC' +
           '1B298247EF5C82206480097C9C4A8C754834B2FF1E243C54C626C' +
           '21C63D98B64048031C809838C2A59E1812BFAB20240010BE9F4F');

    ore := DTMFromString('78DA6314656060E06540038C482490960012A' +
           'C04D44813A14606487010618E3001350A4042820873A408A801F9' +
           '5D9C801A012021805F0D00FF840186');

           end;
           
    Procedure SetVariable;
     begin
      if (InvFull = True) then
        loadz:= loadz+1;
     end;

    Procedure DropOre;
    var x2,y2,x3,y3: integer;
     Begin
      If (InvFull = True) then
       begin
        repeat
      FindDTM(ore,x2,y2,555,200,740,465);
      Mouse(x2,y2,4,4,false);
      wait(600+random(125));
      FindBitmap(drop,x3,y3);
      Mouse(x3+6,y3+3,4,4,true);
        until not(FindDTM(ore,x2,y2,555,200,740,465))
      end;
     end;

    begin  //**MainLoop**
    SetupSRL;
    ActivateClient;
    GetRockColor;
    MouseSpeed:= 8+random(2);
    LoadBitDTM;
    loadz:= 0;
     repeat
     SetVariable;
     MineRock;
     DropOre;
     until(loadz>loads);
    end.

    ok you had:

    SCAR Code:
    begin
      if (FindColorTolerance(xD, yD, rockcolor, 20, 25, 490, 315, 2)) then
      begin
        MineCol[0] := GetColor(x+3,y+3);
        MineCol[1] := GetColor(x-3,y-3);
        MineCol[2] := GetColor(x-3,y+3);
        MineCol[3] := GetColor(x+3,y-3);
        i := 3 - Random(3);
        result := MineCol[i];
      end;
    end;

    I changed it so the var were right


    SCAR Code:
    begin
      if (FindColorTolerance(x, y, rockcolor, 20, 25, 490, 315, 2)) then
      begin
        MineCol[0] := GetColor(x+3,y+3);
        MineCol[1] := GetColor(x-3,y-3);
        MineCol[2] := GetColor(x-3,y+3);
        MineCol[3] := GetColor(x+3,y-3);
        i := 3 - Random(3);
        result := MineCol[i];
      end;
    end;

    now it gets the color near where it found the rockcolor x, y ... do you see what i mean...if not ask.
    Darky has stopped by to say hello :).
    10-21-2010
    Updated-
    10-09-2012

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Mistake in manual
    By cathering_ in forum SRL Site Discussion
    Replies: 0
    Last Post: 10-05-2007, 07:13 PM
  2. mistake
    By sweetleaf in forum RuneScape News and General
    Replies: 0
    Last Post: 06-14-2007, 01:57 AM
  3. mistake in SCAR
    By Killerdou in forum News and General
    Replies: 4
    Last Post: 02-24-2007, 05:57 AM
  4. TIny Mistake
    By TheGodfather in forum OSR Help
    Replies: 2
    Last Post: 02-15-2007, 11:33 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
  •