Results 1 to 3 of 3

Thread: Weird Problem with Cow killer

  1. #1
    Join Date
    Dec 2006
    Location
    Australia
    Posts
    698
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default Weird Problem with Cow killer

    Ok guys nearly done, all the walking sorted hopefully. But it has a weird error, it gets to the cow field and just constantly looking for a cow in a weird way can some one have a look over it?

    Note this is going to be my members application script eventually so if you have problems with it now. Tell me so i can sort it out.

    SCAR Code:
    program Skinner;
    {
          #####   ##    ##                                      ###
       ######  /#### #####                                       ###
      /#   /  /  ##### #####                        #             ##
     /    /  /   # ##  # ##                        ##             ##
         /  /    #     #                           ##             ##
        ## ##    #     #      /##  ###  /###     ######## /###    ##       /###
        ## ##    #     #     / ###  ###/ #### / ######## / ###  / ##      / #### /
        ## ##    #     #    /   ###  ##   ###/     ##   /   ###/  ##     ##  ###/
        ## ##    #     #   ##    ### ##    ##      ##  ##    ##   ##    ####
        ## ##    #     ##  ########  ##    ##      ##  ##    ##   ##      ###
        #  ##    #     ##  #######   ##    ##      ##  ##    ##   ##        ###
           /     #      ## ##        ##    ##      ##  ##    ##   ##          ###
       /##/      #      ## ####    / ##    ##      ##  ##    /#   ##     /###  ##
      /  #####           ## ######/  ###   ###     ##   ####/ ##  ### / / #### /
     / #   ##                #####    ###   ###     ##   ###   ##  ##/     ###/
     #  #
      ##    #######      /
          /       ###  #/         #
         /         ##  ##        ###
         ##        #   ##         #
          ###          ##
         ## ###        ##  /##  ###   ###  /###   ###  /###     /##  ###  /###
          ### ###      ## / ###  ###   ###/ #### / ###/ #### / / ###  ###/ #### /
            ### ###    ##/   /    ##    ##   ###/   ##   ###/ /   ###  ##   ###/
              ### /##  ##   /     ##    ##    ##    ##    ## ##    ### ##
                #/ /## ##  /      ##    ##    ##    ##    ## ########  ##
                 #/ ## ## ##      ##    ##    ##    ##    ## #######   ##
                  # /  ######     ##    ##    ##    ##    ## ##        ##
        /##        /   ##  ###    ##    ##    ##    ##    ## ####    / ##
       /  ########/    ##   ### / ### / ###   ###   ###   ### ######/  ###
      / #    #####       ##   ##/   ##/   ###   ###   ###   ### #####    ###
      #  #
      #  #
       ##

    Thanks for downloading Me_ntal's skinner, Please email me your progress reports
    [email]thyess@gmail.com[/email] or post them on the thread. Update planned to improve the walking
    and slaughtering of cows.

    Special Thanks to
                Pentti,
                JAD,
                WT-fawki
                Wizzup
                Nielsie95
                Boreas
                ~Alex~
    and anyone at the SRL forums.

    To run:
    1. Either start in the bank or the cow field.
    2. Make sure your player is weilding a weapon. (hand combat coming)
    3. Focus and press play.
    4. Post your progress reports and tell me how to improve

                                    ~Mental~
    }


    {.include SRL/SRL.scar}
    {.include SRL/SRL/Skill/Fighting.scar}

    var {counters}
      toll, logd, bankd, xet, KillingAttempts, killd, CArray, hidecolor, MissedColor, HitColor: integer;
    var {Colors}
      CowColor: array[1..4] of integer;
    var
      HideDTM: integer;

    const cowpatience = 40000;

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

      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := ''; {3-4 letters of your name}
      Players[0].Skill := ''; {Fight Mode: attack, deffence, strength and even}
      Players[0].Active := True; {Use player?}
      Players[0].integer2 := ; {how many cows?}
    end;

    {======================================================================
                                 Colors
    =======================================================================}


    procedure CowColors;
    begin
      MissedColor := 16728128;
      HitColor := 192;
      CowColor[1] := 3620687;
      CowColor[2] := 6975347;
      CowColor[3] := 1843500;
      CowColor[4] := 4941444;
      hidecolor := 11185588;
      HideDTM := DTMFromString('78DA6314656060286740013BD7AF67F80FA41' +
        '981F83F103082D46432A001462412488B018916026AD831EDC250' +
        'A30024AA09A89105123904D47001893AFC6A0049030AF5');
    end;

    {======================================================================
                                 Randoms                                 //
                                 WT-Fawki
    =======================================================================}


    function FindFastRandoms: Boolean; {By Wt-Fakawi}
    var
      i: Integer;
    begin
      for i := 1 to 8 do
      begin
        case I of
          1: if FindDead then
              Result := True;
          2: if FindMod then
              Result := True;
          3: if FindMime then
              Result := True;
          4: if FindMaze then
              Result := True;
          5: if FindQuiz then
              Result := True;
          6: if FindDemon then
              Result := True;
          7: begin
              if NoGameTab then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'No GameTab';
                Logout;
                Exit;
              end;
            end;
          7: begin
              if InBlack then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'InBlack';
                Logout;
                Exit;
              end;
            end;
          8: RC;
        end;
        wait(1);
      end;
    end;

    procedure RunRandoms;
    begin
      FindFastRandoms;
      FindNormalRandoms;
    end;


    {======================================================================
                                 Anti-Ban                                //
    =======================================================================}


    procedure WereHuman;
    begin
      if not (LoggedIn) then Exit;
      begin
        case Random(31) of
          0: HoverSkill('attack', false);
          5: AlmostLogout;
          10: begin
              GameTab(1 + Random(12));
              Wait(1500 + Random(500));
              GameTab(4);
            end;
          15: HoverSkill('random', false);
          20: begin
              case random(10) of
                0: TypeSend('Attack lvls?');
                3: TypeSend('Strength levels');
                5: TypeSend('defence lvls');
                7: TypeSend('prayer levels');
                9: TypeSend('hp?');
              end;
            end;
          25: begin
              GameTab(Random(5));
              Wait(1500 + Random(500));
              GameTab(4);
            end;
          30: begin
              GameTab(1);
              Wait(1500 + Random(500));
              GameTab(4);
            end;
        end;
      end
    end;

    {======================================================================
                           Checks If were infight                        //
                                  Wt-Fawki
    =======================================================================}


    function InFightAt(x, y: Integer): Boolean;
    var
      dx, dy: Integer;
    begin
      if (FindColor(dx, dy, GreenStatusColor, x - 20, y - 10, x + 20, y + 10)) or
        (FindColor(dx, dy, RedStatusColor, x - 20, y - 10, x + 20, y + 10)) or
        (FindColor(dx, dy, MissedColor, x - 20, y - 10, x + 20, y + 10)) or
        (FindColor(dx, dy, HitColor, x - 20, y - 10, x + 20, y + 10)) then
        Result := True;
    end;

    {======================================================================
                                Checks Hp Level
    =======================================================================}


    function DangerRange: boolean;
    begin
      if (GetHp <= (4 + Random(3))) then
        Result := True
    end;

    {======================================================================
                               Get Combat Level                           //
    =======================================================================}


    function getcombatlevelb: integer;
    var
      Curtab, i: integer;
      Cmblvl: string;
    begin
      CurTab := getcurrenttab;
      gametab(1);
      Cmblvl := GetTextAtEx(671, 230, 100, StatChars, False, True, 0, 5, -1, 2, True, tr_Digits);
      if (Trim(Cmblvl) = '') then
        for i := 1 to 5 do
        begin
          Cmblvl := GetTextAtEx(671 + i, 230, 100, StatChars, False, True, 0, 5, -1, 2, True, tr_Digits);
          if (Trim(Cmblvl) <> '') then Exit;
        end;
      if (not (Trim(Cmblvl) = '')) then
        result := StrToInt(Trim(Cmblvl));
      wait(500 + random(200));
      gametab(Curtab);
    end;

    {======================================================================
                                   Player Report                         //
    =======================================================================}


    procedure PlayerReport;
    var i: integer;
    begin
      for I := 0 to HowManyPlayers - 1 do
      begin
        WriteLn(Players[i].Name + ' = ' + booltostr(Players[i].Active));
        WriteLn('Att ' + inttostr(Players[i].level[1]) + ', Str ' + inttostr(Players[i].level[2]) + ', Def ' + inttostr(Players[i].level[3]));
        WriteLn('Cmb ' + inttostr(Players[i].integer1) + ', Hps ' + inttostr(Players[i].level[8]) + ', Pry ' + inttostr(Players[i].level[5]));
        WriteLn('Worked For: ' + IntToStr(Players[i].Worked) + ' min, Killed : ' + IntToStr(Players[i].Killed) + ', Loc: ' + Players[i].loc);
        WriteLn('Banked: ' + IntToStr(Players[i].Banked) + ' loads');
        WriteLn('');
        Writeln('================================================================');
      end
    end;

    {======================================================================
                                   Progress Report                       //
    =======================================================================}


    procedure ProgressReport;
    begin
      writeln('');
      WriteLn('================================================================');
      WriteLn('|                        Me_ntals Skinner                       |');
      Writeln('================================================================');
      Writeln('  Worked For ' + TimeRunning);
      Writeln('  Logged In ' + InttoStr(logd));
      Writeln('  Banked ' + InttoStr(bankd));
      writeln('  Kills  ' + InttoStr(killd));
      Writeln('================================================================');
    end;

    {======================================================================
                                   Introduction                          //
    =======================================================================}


    procedure Introd;
    begin
      repeat
        wait(250);
        cleardebug;
        xet := xet - 1;
        writeln('               Me_ntals Skinner');
        writeln('');
        writeln('             Loading please wait');
        writeln('                      ' + inttostr(xet));
      until (xet = 0)
        cleardebug;
      if (xet = 0) then
        writeln('                    Here We ago');
      writeln('                 ~Mentals Skinner~');
    end;

    {======================================================================
                                Even Combat                              //
                        Idea Stolen From GS by Wt-Fawki
    =======================================================================}


    procedure evenlevels;
    begin
      GetAllLevels;
      if (Players[CurrentPlayer].level[1] < Players[CurrentPlayer].level[2]) and
        (Players[CurrentPlayer].level[1] < Players[CurrentPlayer].level[3]) then
      begin
        SetFightMode(1);
        exit;
      end;
      if (Players[CurrentPlayer].level[2] < Players[CurrentPlayer].level[1]) and
        (Players[CurrentPlayer].level[2] < Players[CurrentPlayer].level[3]) then
      begin
        SetFightMode(2);
        exit;
      end;
      if (Players[CurrentPlayer].level[3] < Players[CurrentPlayer].level[1]) and
        (Players[CurrentPlayer].level[3] < Players[CurrentPlayer].level[2]) then
      begin
        SetFightMode(3);
        exit;
      end;
    end;

    {======================================================================
                                   Set Combat                            //
    =======================================================================}


    procedure Combattype;
    begin
      if Lowercase(Players[CurrentPlayer].Skill) = 'attack' then SetFightMode(1);
      if Lowercase(Players[CurrentPlayer].Skill) = 'strength' then SetFightMode(2);
      if Lowercase(Players[CurrentPlayer].Skill) = 'defence' then SetFightMode(4);
      if Lowercase(Players[CurrentPlayer].Skill) = 'auto' then evenlevels;
      if Lowercase(Players[CurrentPlayer].Skill) = 'even' then evenlevels;
    end;

    {======================================================================
                          Waits While Attacking Cows
                           Modified Verison from Gs
    =======================================================================}


    procedure patience;
    var cowwait: integer;
    begin
      marktime(cowwait);
      repeat
        Wait(3500 + Random(1000));
        RunRandoms;
        if (((TimeFromMark(cowwait) > ((cowpatience / 2) + random((cowpatience / 2))))) or (DangerRange)) then exit;
      until (not (InFight));
    end;

    {======================================================================
                                 Attack Cows                             //
    =======================================================================}


    function SlaughterCow: Boolean;
    var CBx, CBy: Integer;
    begin
      for CArray := 1 to 4 do
      begin
        if (FindColorSpiralTolerance(CBx, CBy, CowColor[CArray], MSX1, MSY1, MSX2, MSY2, 15)) then
        begin
          MMouse(CBx, CBy, 0, 0);
          if (IsUpTexti('Cow')) then
          begin
            KillingAttempts := KillingAttempts + 1
              Mouse(CBx, CBy, 0, 0, True);
            Flag;
            wait(5000 + random(4000));
            if (InChatMulti('alr', 'und ', ' att')) then
            begin
              Result := True;
              Exit;
            end;
            if (InChatMulti('ome', 'one ', ' ing')) then
            begin
              Result := False;
              Exit;
            end;
          end;
        end;
        if (KillingAttempts = 50) then
        begin
          WriteLn('Too Busy World');
          TerminateScript;
        end;
      end;
    end;

    {======================================================================
                              Walks to Field                             //
    =======================================================================}


    procedure ToField;
    var i: integer;
    begin
      i := 0
        RadialRoadWalk(findfallyRoadColor, 270, 180, 50, 1, 1);
      flag;
      i := i + 1
        RadialRoadWalk(findfallyRoadColor, 200, 170, 65, 1, 1);
      flag;
      i := i + 1
        RadialRoadWalk(RoadColor, 200, 170, 65, 1, 1);
      flag;
      i := i + 1
        if (FindSymbol(x, y, 'tree')) then Mouse(x, y, 5, 5, true);
      flag;
      i := i + 1
        if (RadialWalkEx(x, y, MMCX, MMCY, 234, 10, 115, 90, 60)) then Mouse(x, y, 5, 5, true);
      flag;
      i := i + 1
        if i = 5 then exit;
    end;

    {======================================================================
                                Walks To bank                            //
    =======================================================================}


    procedure ToBank;
    var i: integer;
    begin
      i := 0
        if (RadialWalkEx(x, y, MMCX, MMCY, 234, 10, 220, 70, 60)) then Mouse(x, y, 5, 5, true);
      flag;
      i := i + 1
        if (FindSymbol(x, y, 'tree')) then Mouse(x, y, 5, 5, true);
      flag;
      i := i + 1
        RadialWalk(6579307, 300, 270, 55, 1, 1); //road
      flag;
      i := i + 1
        RadialRoadWalk(findfallyRoadColor, 375, 350, 60, 1, 1); //fally
      flag;
      i := i + 1
        RadialRoadWalk(findfallyRoadColor, 355, 380, 60, 1, 1);
      flag;
      i := i + 1
        RadialWalk(9547703, 20, 70, 45, 1, 1); //fallybank
      flag;
      i := i + 1
        if i = 5 then exit;
    end;

    {======================================================================
                                Collects Hide
    =======================================================================}


    procedure CollectHide;
    begin
      if (FindColorTolerance(x, y, 12566471, msx1, msy1, msx2, msy2, 20)) then
      begin
        mmouse(x, y, 3, 3)
          if (isuptext('ake')) then
        begin
          mouse(x, y, 0, 0, false);
          ChooseOption(x, y, 'ide');
        end;
      end;
    end;

    {======================================================================
                                Banks Hide                              //
    =======================================================================}


    procedure BankHides;
    var bx, by: integer;
    begin
      if (FindDTM(HideDTM, bx, by, 552, 203, 742, 469)) then
      begin
        Mouse(x, y, 1, 1, false);
        Wait(100 + Random(100));
        ChooseOption(x, y, 'All');
        bankd := bankd + 1;
        CloseBank;
        DropAll;
      end;
    end;

    {======================================================================
                           Finds and Opens the Bank                    //
                  Modified verison of openbankglass by wizzup?
    =======================================================================}


    procedure OpenAccount;
    var BB: TPoint;
    begin
      if (FindColorTolerance(BB.x, BB.y, 10594993, MSX1, MSY1, MSX2, MSY2, 4)) then
      begin
        MMouse(BB.x, BB.y, 4, 4);
        if (IsUpTextMulti('ank', 'booth', 'ooth')) then
        begin
          Mouse(BB.x, BB.y, 0, 0, False);
          Wait(100);
          ChooseOption(BB.x, BB.y, 'uickly');
          FFlag(0);
          Wait(2000 + Random(500));
          BankHides;
        end;
      end
      else
      begin
        if (FindObj(BB.x, BB.y, 'ank', 10594993, 14)) then
        begin
          Mouse(BB.x, BB.y, 0, 0, False);
          Wait(50);
          ChooseOption(BB.x, BB.y, 'uickly');
          FFlag(0);
          Wait(2000 + Random(500));
          BankHides;
        end;
      end;
    end;



    {======================================================================
                             Determines Where we are                    //
    =======================================================================}


    function WereAtBank: Boolean;
    begin
      if FindSymbol(x, y, 'bank') then
      begin
        mouse(x, y, 0, 0, true);
        flag;
        Players[currentplayer].loc := 'bank';
        result := true
          WriteLn('Were at Bank')
      end;
    end;

    {======================================================================
                                   Setup's
    =======================================================================}


    procedure SetupScript;
    begin
      DeclarePlayers;
      CowColors;
      ClearDebug;
      ClearReport;
      MouseSpeed := 20;
      KillingAttempts := 0;
      toll := 0;
      bankd := 0;
      killd := 0;
      logd := 0;
      Introd;
      wait(1000);
      ActivateClient;
    end;

    procedure SetupPlayer;
    begin
      logd := logd + 1;
      HighestAngle;
      CombatType;
      SetChat('on', 1);
      SetChat('friends', 2);
      SetChat('off', 3);
      MakeCompass('N');
    end;

    {======================================================================
                                   Main Loop
    =======================================================================}


    begin
      SetupSRL;
      xet := 10;
      SetupScript;
      repeat
        if (not (LoggedIn)) then loginplayer;
        SetupPlayer
          repeat
          if (WereAtBank = true) then
          begin
            Tofield;
            writeln('started at bank, starting walk');
          end else
          begin
            repeat
              if (SlaughterCow) then
              begin
                KillingAttempts := 0;
                Patience;
                CollectHide;
                werehuman;
                RunRandoms;
                if (DangerRange = True) then break;
              end;
            until ((InvFull))
          end;
          ToBank;
          RunRandoms;
          OpenAccount;
          RunRandoms;
          ToField;
          Combattype;
          SetRun(True);
        until (toll >= Players[CurrentPlayer].integer2)
          if (toll >= Players[CurrentPlayer].integer2) then
        begin
          GetAllLevels;
          Players[currentplayer].integer1 := getcombatlevelb;
          ProgressReport;
          PlayerReport;
          SRLRandomsReport;
          LogOut;
          NextPlayer(True);
          toll := 0;
          SetupPlayer;
        end;
      until False;
    end.

  2. #2
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    look nice and easy to read, kinda familiair Good work. I see one function I dont know:
    ....if (IsUpTexti('Cow')) then...

    I think this script will work.
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  3. #3
    Join Date
    Dec 2006
    Location
    Australia
    Posts
    698
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    holy crap i cant believe it was a simple mistake, thanks alot mate.

    And yes it was designed to compete with yours, i dont know if you updated yours? but yeah i have a range of ideas to implent and want this to be pretty good.

    And thanks its a huge compliment with you saying thats its goodwork, a long way off member good but. Maybe after a few updates and its more reliable than yeah.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Weird Scar Problem
    By chrsk13 in forum News and General
    Replies: 4
    Last Post: 04-26-2008, 03:18 PM
  2. Weird problem
    By peterspliid in forum News and General
    Replies: 2
    Last Post: 06-26-2007, 12:56 PM
  3. umm... help me with a weird problem...
    By ub3r |<1||3r*1337* in forum News and General
    Replies: 7
    Last Post: 05-06-2006, 10:57 PM

Posting Permissions

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