Results 1 to 3 of 3

Thread: Quick help needed

  1. #1
    Join Date
    May 2007
    Location
    in a pineapple under the sea
    Posts
    1,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Quick help needed

    SCAR Code:
    program New;
    {.include SRL\SRL.scar}

    var
      x,y,tx,ty,i,a,food1color,food2color:integer;
      Minotaur: array [0..3] of integer;
      Note: array [0..3] of integer;
      var p: array of Tpoint;

    const
      eathp = 10;


    Procedure DeclarePlayers;

      Begin
         NumberOfPlayers( 1 ); // DO NOT TOUCH!
         CurrentPlayer :=( 0 ); // DO NOT TOUCH!

         Players[0].Name :='';
         Players[0].Pass :='';
         Players[0].Nick :='';
         Players[0].Active:=True;
      End;

    procedure setupcolors;
    begin
      Minotaur[0]:= 8753039;
      Minotaur[1]:= 2171172;
      Minotaur[2]:= 1579034;
      Minotaur[3]:= 5460826;

      Note[0]:= 7115681;
      Note[1]:= 8103864;
      Note[2]:= 7510697;
      Note[3]:= 7708334;

      food1color:= 1666249;
      food2color:= 1400499;
    end;

    function FindMinotaur:boolean;
    var l,m,TestColor,red,green,blue,ClickColor:integer;
    begin
      Wait(50);
      Status('Finding Minotaur');
      l:=GetArrayLength(Minotaur);
      if l>0 then
      begin
        for i:= 0 to l-1 do
        begin
          FindColorsSpiralTolerance(tx,ty,p,Minotaur[i],MSX1,MSY1,MSX2,MSY2,0);
          m:=GetArrayLength(p);
          if m>0 then
          begin
            for a:= 0 to m-1 do
            begin
              if findcolortolerance(tx,ty,Minotaur[a],MSX1,MSY1,MSX2,MSY2,0)then
              begin
                MMouse(tx,ty,0,0);
                if isuptext('ttack Minotaur')then
                begin
                  GetmousePos(x,y);
                  result:=true;
                  if i>0 then
                  begin
                    m:=Minotaur[i-1];
                    Minotaur[i-1]:= Minotaur[i];
                    Minotaur[i]:= m;
                  end;
                  exit;
                end;
              end;
            end;
          end;
        end;
      end;
      FindColorsSpiralTolerance(tx,ty,p,10266792,MSX1,MSY1,MSX2,MSY2,25);
      l:=GetArrayLength(p);
      if l>0 then
      begin
        for i:= 0 to l-1 do
        begin
          TestColor:=GetColor(p[i].x,p[i].y);  //Additional autocoloring to reduce wrong points.  (Optional)
          red:=(TestColor mod 256);
          green:=((TestColor/256) mod 256);
          blue:=((TestColor/256) / 256);
          if ((green-blue)<=46) then if ((green-blue)>=24) then
          if ((red-green)>=26) then if ((red-green)<=51) then
          if ((red-blue)>55) then if ((red-blue)<=94) then
          begin
            Wait(20);
            ClickColor:=GetColor(p[i].x,p[i].y);
            MMouse(p[i].x,p[i].y,1,1);
            if isuptext('ttack')then
            begin
              GetMousePos(x,y);
              result:=true;
              FindColorsSpiralTolerance(x,y,p,ClickColor,MSX1,MSY1,MSX2,MSY2,0);
              if GetArrayLength(p)<20 then  //Make sure that the color is somewhat rare, and doesn't take up half the screen
              begin
                a:=GetArrayLength(Minotaur);
                for i:= 0 to a-1 do
                begin
                  if ClickColor=Minotaur[i] then  //If color is already in the array...
                  begin
                    if i>0 then
                    begin  // Move it up one spot in the array search priority
                      m:=Minotaur[i-1];
                      Minotaur[i-1]:=Minotaur[i];
                      Minotaur[i]:=m;
                    end;
                    exit;
                  end;
                end;
                // if it's not in the array yet, then add it to the end of the array
                SetArrayLength(Minotaur,a+1);
                Minotaur[a]:=ClickColor;
                Writeln(IntToStr(ClickColor)+' added to Minotaur Color array');
              end;
              exit;
            end;
          end;
        end;
      end;
    end;


    function FindNote:boolean;
    var l,m,TestColor,red,green,blue,ClickColor:integer;
    begin
      Wait(50);
      Status('Finding Note');
      l:=GetArrayLength(Note);
      if l>0 then
      begin
        for i:= 0 to l-1 do
        begin
          FindColorsSpiralTolerance(tx,ty,p,Note[i],MSX1,MSY1,MSX2,MSY2,0);
          m:=GetArrayLength(p);
          if m>0 then
          begin
            for a:= 0 to m-1 do
            begin
              if findcolortolerance(tx,ty,Note[a],MSX1,MSY1,MSX2,MSY2,0)then
              begin
                MMouse(tx,ty,0,0);
                if isuptext('ake')then
                begin
                  GetmousePos(x,y);
                  result:=true;
                  if i>0 then
                  begin
                    m:=Note[i-1];
                    Note[i-1]:= Note[i];
                    Note[i]:= m;
                  end;
                  exit;
                end;
              end;
            end;
          end;
        end;
      end;
      FindColorsSpiralTolerance(tx,ty,p,7510697,MSX1,MSY1,MSX2,MSY2,25);
      l:=GetArrayLength(p);
      if l>0 then
      begin
        for i:= 0 to l-1 do
        begin
          TestColor:=GetColor(p[i].x,p[i].y);  //Additional autocoloring to reduce wrong points.  (Optional)
          red:=(TestColor mod 256);
          green:=((TestColor/256) mod 256);
          blue:=((TestColor/256) / 256);
          if ((green-blue)<=46) then if ((green-blue)>=24) then
          if ((red-green)>=26) then if ((red-green)<=51) then
          if ((red-blue)>55) then if ((red-blue)<=94) then
          begin
            Wait(20);
            ClickColor:=GetColor(p[i].x,p[i].y);
            MMouse(p[i].x,p[i].y,1,1);
            if isuptext('ake')then
            begin
              GetMousePos(x,y);
              result:=true;
              FindColorsSpiralTolerance(x,y,p,ClickColor,MSX1,MSY1,MSX2,MSY2,0);
              if GetArrayLength(p)<20 then  //Make sure that the color is somewhat rare, and doesn't take up half the screen
              begin
                a:=GetArrayLength(Note);
                for i:= 0 to a-1 do
                begin
                  if ClickColor=Note[i] then  //If color is already in the array...
                  begin
                    if i>0 then
                    begin  // Move it up one spot in the array search priority
                      m:= Note[i-1];
                      Note[i-1]:= Note[i];
                      Note[i]:= m;
                    end;
                    exit;
                  end;
                end;
                // if it's not in the array yet, then add it to the end of the array
                SetArrayLength(Note,a+1);
                Note[a]:=ClickColor;
                Writeln(IntToStr(ClickColor)+' added to Note Color array');
              end;
              exit;
            end;
          end;
        end;
      end;
    end;

    procedure fight;
    begin
      if not(LoggedIn)then exit;
      if not(FindFight)then
      begin
        if FindMinotaur then
        begin
          Mouse(x,y,0,0,True);
          FFlag(0);
        end;
      end;
    end;

    procedure pickup;
    begin
      if not(LoggedIn)then exit;
      if not(FindFight)then
      begin
        if FindNote then
        begin
          Mouse(x,y,0,0,True);
          FFlag(0);
        end;
      end;
    end;

    procedure eat;
    var ate:boolean;
    begin
      while FindFight do
      begin
        if not(LoggedIn)then exit;
        GameTab(2);
        if (GetHp <= EatHp)then
        begin
          GameTab(4);
          Wait(10 + Random(20));
          if (FindColorTolerance(x,y,food1color,MIX1,MIY1,MIX2,MIY2,10)) or
             (FindColorTolerance(x,y,food2color,MIX1,MIY1,MIX2,MIY2,10)) then
          begin
            MMouse(x,y,0,0);
            if (IsUpText('Eat')) then
            begin
              GetMousePos(x, y);
              Mouse(x, y, 3, 2, True);
              //AutoResponder;
              ate:=true;
            end;
          end;
          if not ate then
          begin
            logout;
            writeln('Ran out of food...')
            terminatescript;
          end;
        end;
      end;
    end;

    begin
      setupsrl;
      setupcolors;
      DeclarePlayers;
      LoginPlayer;
      repeat
        fight;
        pickup;
        Eat;
      until(false);
    end.


    when i go to run it says [Runtime Error] : Could not call proc in line 47 in script C:\Program Files\SCAR 3.12\Scripts\Minotaur killer.scar

    line 47:
    SCAR Code:
    l:=GetArrayLength(Minotaur);
    [SIZE="4"][CENTER][URL="http://www.youtube.com/watch?v=5YsGJz3j4os"]LOL u mad bro?[/URL][/CENTER][/SIZE]

  2. #2
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    meh, talked on msn, might be fixed now

    what i was thinking:

    there is no lenght to get when the lenght allready is declared in the vars.

    correct me if i'm wrong

  3. #3
    Join Date
    May 2007
    Location
    in a pineapple under the sea
    Posts
    1,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    its fixed thank you
    [SIZE="4"][CENTER][URL="http://www.youtube.com/watch?v=5YsGJz3j4os"]LOL u mad bro?[/URL][/CENTER][/SIZE]

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Just a quick question? Did I say quick?
    By SeanJohn in forum OSR Help
    Replies: 3
    Last Post: 01-28-2009, 12:03 AM
  2. Help needed
    By godspower55 in forum OSR Help
    Replies: 5
    Last Post: 10-16-2008, 06:52 PM
  3. A lil help needed
    By anime1161 in forum OSR Help
    Replies: 10
    Last Post: 02-02-2008, 05:59 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
  •