Results 1 to 6 of 6

Thread: my cowkill script so far

  1. #1
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default my cowkill script so far

    my script so far..

    SCAR Code:
    program New;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fighting.scar}
     
    var
    x,y,i,TheRoadColor,cowskilled: integer;
    cowcolor: array [0..3] of integer;
     
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 4;
      CurrentPlayer := 0;
      NumberOfPlayers(HowManyPlayers);
     
      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := '';
      Players[0].Active := true;
     
      Players[1].Name := '';
      Players[1].Pass := '';
      Players[1].Nick := '';
      Players[1].Active := False;
     
      Players[2].Name := '';
      Players[2].Pass := '';
      Players[2].Nick := '';
      Players[2].Active := False;
     
      Players[3].Name := '';
      Players[3].Pass := '';
      Players[3].Nick := '';
      Players[3].Active := False;
    end;
     
    function randclick(item , option:string): boolean;
    begin
      if isuptext(item) then
      begin
        case random(4) of
          0,1,2: mouse(x,y,10,10,true);
          3: begin
               mouse(x,y,10,10,false);
               chooseoption(option);
             end;
        end;
        Result := true;
      end;
    end;
     
     
    procedure killdacow;
    begin
      Writeln('now to own some cows');
      CowColor[0] := 12238787;
      CowColor[1] := 2307389;
      CowColor[2] := 9812173;
      CowColor[3] := 2765117;
      if not(loggedin) then Exit;
      makecompass('s');
      setangle(true);
      if findcolortolerance(x,y,Cowcolor[i],0,0,518,339,4) then
      begin
        mmouse(x,y,10,10);
        wait(100);
        if isuptext('ow')=true then
        begin
          randclick('ow','ttack');
          flag;
          wait(100+random(1000));
          if infight then
          begin
            repeat
              wait(500);
            until (not(InFight));
          end;
          cowskilled:=cowskilled+1
        end;
      wait(500);
      end;
    end;
     
    //stolen off men_tal's script, thanks bud
    procedure CollectHide;
    var hidebmp:integer;
    var acc:extended;
    begin
      hidebmp := BitmapFromString(6, 5, 'z78DA7331747674767419522400C' +
           '8192CA7');
     
      FindDeformedBitmapToleranceIn( hidebmp, x, y, MSX1, MSY1, MSX2, MSY2, 20, 1, True, acc)
      if acc >= 0.9 then
      begin
        mouse(x, y, 0, 0, false);
        ChooseOption('ide');
        freebitmap(hidebmp)
      end;
    end;
     
    procedure ToPen;
    var
    z:integer;
    begin
      Z:=0
      Makecompass('n');
      TheRoadColor := findfallyroadColor;
      Wait(500);
      if radialwalk(TheRoadColor,180,270,40,1,1) then
      begin
        wait(500);
        end else Exit;
          repeat
            radialroadwalk(TheRoadColor,165,200,50,1,1);
            Writeln('lalala');
            wait(200);
          until(findsymbolin(x,y,'tree',628,8,704,165));
        mouse(x + 10,y,10,5,true);
        flag;
        if findcolortolerance(x,y,235,628,8,705,117,20) then
        begin
          mouse(x,y + 5,5,5,true);
          flag;
          wait(500);
        end;
        if findcolorSpiraltolerance(x,y,5467001,0,0,516,338,10) then
        begin
          randclick('ate','pen');
          Z:= Z + 1;
       end else exit;
    end;
     
    procedure ToBank;
    begin
    end;
     
    begin
      SetupSRL;
      activateclient;
      declareplayers;
      if not(loggedin) then loginplayer;
      Cowskilled:=0
      repeat
        ToPen;
        repeat
          KilldaCow;
          collecthide;
        until(invfull);
      until(false);
    end.

    test it if you'd like and give feedback, really just need to transfer script to my other house
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  2. #2
    Join Date
    Oct 2006
    Location
    I'm also from Michigan!
    Posts
    563
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    couldve thrown it in pastebin

    anyways, It looks pretty good so far. Finish it, add failsafes and standards and you should apply with it.

  3. #3
    Join Date
    Aug 2007
    Location
    Georgia, U.S.
    Posts
    890
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    woah. your standards are really bad. i fixed them for you.

    SCAR Code:
    program New;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fighting.scar}

    var
    x,y,i,TheRoadColor,cowskilled: integer;
    cowcolor: array [0..3] of integer;

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 4;
      CurrentPlayer := 0;
      NumberOfPlayers(HowManyPlayers);

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

      Players[1].Name := '';
      Players[1].Pass := '';
      Players[1].Nick := '';
      Players[1].Active := False;

      Players[2].Name := '';
      Players[2].Pass := '';
      Players[2].Nick := '';
      Players[2].Active := False;

      Players[3].Name := '';
      Players[3].Pass := '';
      Players[3].Nick := '';
      Players[3].Active := False;
    end;

    function randclick(item , option:string): boolean;
    begin
      if isuptext(item) then
      begin
        case random(4) of
          0,1,2: mouse(x,y,10,10,true);
          3: begin
               mouse(x,y,10,10,false);
               chooseoption(option);
             end;
        end;
        Result := true;
      end;
    end;


    procedure killdacow;
    begin
      Writeln('now to own some cows');
      CowColor[0] := 12238787;
      CowColor[1] := 2307389;
      CowColor[2] := 9812173;
      CowColor[3] := 2765117;
      if not(loggedin) then Exit;
      makecompass('s');
      setangle(true);
      if findcolortolerance(x,y,Cowcolor[i],0,0,518,339,4) then
      begin
        mmouse(x,y,10,10);
        wait(100);
        if isuptext('ow')=true then
        begin
          randclick('ow','ttack');
          flag;
          wait(100+random(1000));
          if infight then
          begin
            repeat
              wait(500);
            until (not(InFight));
          end;
          cowskilled:=cowskilled+1
        end;
      wait(500);
      end;
    end;

    //stolen off men_tal's script, thanks bud
    procedure CollectHide;
    var hidebmp:integer;
    var acc:extended;
    begin
      hidebmp := BitmapFromString(6, 5, 'z78DA7331747674767419522400C' +
           '8192CA7');

      FindDeformedBitmapToleranceIn( hidebmp, x, y, MSX1, MSY1, MSX2, MSY2, 20, 1, True, acc)
      if acc >= 0.9 then
      begin
        mouse(x, y, 0, 0, false);
        ChooseOption('ide');
        freebitmap(hidebmp)
      end;
    end;

    procedure ToPen;
    var
    z:integer;
    begin
      Z:=0
      Makecompass('n');
      TheRoadColor := findfallyroadColor;
      Wait(500);
      if radialwalk(TheRoadColor,180,270,40,1,1) then
      begin
        wait(500);
        end else Exit;
          repeat
            radialroadwalk(TheRoadColor,165,200,50,1,1);
            Writeln('lalala');
            wait(200);
          until(findsymbolin(x,y,'tree',628,8,704,165));
        mouse(x + 10,y,10,5,true);
        flag;
        if findcolortolerance(x,y,235,628,8,705,117,20) then
        begin
          mouse(x,y + 5,5,5,true);
          flag;
          wait(500);
        end;
        if findcolorSpiraltolerance(x,y,5467001,0,0,516,338,10) then
        begin
          randclick('ate','pen');
          Z:= Z + 1;
       end else exit;
    end;

    procedure ToBank;
    begin
    end;

    begin
      SetupSRL;
      activateclient;
      declareplayers;
      if not(loggedin) then loginplayer;
      Cowskilled:=0
      repeat
        ToPen;
        repeat
          KilldaCow;
          collecthide;
        until(invfull);
      until(false);
    end.

    other than that it isn't that bad for a first script.

  4. #4
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks skilld i was just going to do that when i finished, to clean it up and will do munk
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  5. #5
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    You might want to do a for-loop in KillDaCow so it loops through all the colours
    I made a new script, check it out!.

  6. #6
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol i'm home, thanks markus that would solve one of my main problems, but now at school i jammed the hell out of my finger so i can't type for shit, or...it hurts really bad to type

    thanks, hopefully this script will be a super success
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

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
  •