Results 1 to 12 of 12

Thread: Need help with this line in 'Nielsie95's Tutorial Island Runner'

  1. #1
    Join Date
    Apr 2008
    Location
    Montana
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need help with this line in 'Nielsie95's Tutorial Island Runner'

    Ok here is what the error says

    Line 147: [Error] (12987:4): Unknown identifier 'IsUpTextMulti' in script C:\Program Files\SCAR 3.15\Scripts\tutisland.scar

    it came from this code which is prolly old cuz i don't have access to the newest ones yet.

    Code:
    {=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
    |           Nielsie95's Tutorial Island Runner              |
    |=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
    |                                                           |
    |        Will run the Tutorial Island for you               |
    |                                                           |
    |        Has all Skills and Character maker =]              |
    |                                                           |
    |=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
    |                                                           |
    |    Start Logged-In at the clothes picker.                 |
    |                                                           |
    |=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
    |                                                           |
    |    VERSION 0.33                                           |
    |                                                           |
    |    Updates done to Fighting, Mining and Speed. +Added     |
    |    GetDoorColor from Boreas.                              |
    |                                                           |
    |    V 0.31 = Faster/Less Waiting Version - Same as 0.3     |
    |                                                           |
    |    VERSION 0.30                                           |
    |                                                           |
    |    Updates done to Chopping, FM, Failsafes, Mining,       |
    |    Fighting and Maging parts. Also added Time writing     |
    |    in Report. +Added ClothesMaker from Smartz             |
    |                                                           |
    |    VERSION 0.20                                           |
    |                                                           |
    |    First version of the Tutorial Runner.                  |
    |                                                           |
    |=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
    
    program TutRunner;
    {.Include SRL\SRL.SCAR}
    {.include SRL\SRL\Skill\Fighting.scar}
    
    const SmartzCharMaker = True; //Want to use Smartz Random Clothes procedure?, False for my own procedure
    
    
    var MMArrow, TopMMArrow, MSArrow, TopMSArrow, PlzWait: integer;
        TotalTime: LongInt;
    
    procedure LoadBmps;
    begin
      MMArrow := BitmapFromString(15, 14, 'z78DAEDD24B0E80200C84E' +
           '12B3142425CB6E2DCFF485EC0C2E0236EECE25F7E49A129750672' +
           '6707DCD97C89FACB8FC98D563DEAA7727851DC688551E56B1C384' +
           'ABB5B80CE3597D9CA6F0E1A2B4CE9A57FC40BE6C0BF6D9EF8BA79' +
           '00C3A2078F');
    
      TopMMArrow := BitmapFromString(6, 5, 'z78DA737372B3343671C3' +
           '4F3ABA991B3A52421A80802184C42B8B0C0C71C90200FB5828A4');
    
      MSArrow := BitmapFromString(21, 23, 'z78DAEDD3310AC0200C85E' +
           '12B456D1147A3E6FE472A38554A4B6A0D8112877FF47B0802700F' +
           '35AA1838058163BAE90A7AA5929053D37FA6E7889C9ACEBAB350D' +
           'E9B56FB04A7E59E9EA16FD88A742F2E0C1B905248127D740537B0' +
           'DD7143A6E8FD974EB9E3BF5072E7DE61A9FB62C39DEB825B37C77' +
           '15C8E7800DECE700D');
    
      TopMSArrow := BitmapFromString(8, 5, 'z78DA737374333732721B' +
           '04A40108184248A25522034362540200128F35BE');
    
      PlzWait := BitmapFromString(63, 2, 'z78DA33303030707373' +
           '727474B27044212D1D4D2D0C0D3064A12260596412531CA708865' +
           'D386DC12B82451C6217316C8A5D4EA60BF186214E1B8976272E73' +
           '70B90DBFCB89F22972D862A41F9CE2148433A62CA9210F0080F3B' +
           '0CA');
    end;
    
    procedure NielsMakeChar;
    var tx, ty, c, i: integer;
    begin
      case Random(2) of
        0 : Wait(1);
        1 : Mouse(450, 290, 1, 1, True);
      end
      Wait(1000);
      for i := 0 to 6 do
      begin
        MMouse(45 +Random(15), 88 +(i*35), 1, 1);
        GetMousePos(tx, ty);
        for c := 0 to Random(8) do
        begin
          Mouse(tx, ty, 1, 1, True);
          Wait(500);
        end
      end;
      for i := 0 to 4 do
      begin
        MMouse(343 +Random(15), 88 +(i*35), 1, 1);
        GetMousePos(tx, ty);
        for c := 0 to Random(4) do
        begin
          Mouse(tx, ty, 1, 1, True);
          Wait(500);
        end
      end;
      Wait(1000);
      Mouse(260, 285, 2, 2, True);
      Wait(3000);
    end;
    
    procedure SmartzCharacter; //SmartzKid
    var
     b,i,x,y,n,k:integer;
     arrow:TPointArray;
     finished:boolean;
    begin
     for b := 0 to 1 do //get the 'Design' arrow coords
     begin
      for i := 0 to 6 do
      begin
       n:=getarraylength(arrow);
       setarraylength(arrow,n+1);
       arrow[n].y:=85 + ( i * 35 );
       arrow[n].x:=45 + ( b * 115 );
      end;
     end;
    
     for b := 0 to 1 do //get the 'Colour' arrow coords
     begin
      for i := 0 to 4 do
      begin
       n:=getarraylength(arrow);
       setarraylength(arrow,n+1);
       arrow[n].y:=97 + ( i * 35 );
       arrow[n].x:=353 + ( b * 115 );
      end;
     end;
    
     if(random(2)=0)then  //change gender to female
      Mouse(458,295,20,10,true);
    
     repeat
      n:=random(24); // choose a random arrow (not necessary, only left for ease of testing)
    
      repeat          //~
       n:=random(24);//~This code should try to click the 'Design' arrows first,
      until(n<i)    //~     instead of randomly clicking arrows
    
      x:=arrow[n].x;  //~Assign our x and y variables, just to shorten things below
      y:=arrow[n].y;  //~
    
      MMouse(x,y,8,8);
      if(IsUpTextMulti('ang','reco','olou'))then
      begin
       GetMousePos(b,n);
       HoldMouse(b,n,true);     //~
       wait(15+random(50));    //~ Realistic click
       ReleaseMouse(b,n,true);//~
       i:=i+1+random(3);
       k:=k+n;
      end;
      wait(250+random(500)); //a little time for our 'person' to 'decide' on their next move
      if(i>40) and (k>200)then  //quit after ~40 changes, the k>200 is to help gurantee recoloration of the person
       finished:=true;
     until(finished)
     Mouse(260, 285, 2, 2, True);
     Wait(3000);
    end;
    
    function FindMMArrow(var x, y: integer):Boolean;
    var c, tx, ty: integer;
    begin
      repeat
       Wait(50);
       c := c +1
      until ((c > 50) or (FindBitmapToleranceIn(TopMMArrow, tx, ty, MMX1, MMY1, MMX2, MMY2, 10)));
    
      if c > 50 then
      begin
        c := 0;
         repeat
          Wait(50);
          c := c +1
         until ((c > 50) or (FindBitmapToleranceIn(MMArrow, tx, ty, MMX1, MMY1, MMX2, MMY2, 10)));
        if c > 50 then
        begin
          WriteLn('Could not find the MMArrow');
          Result := False;
          Exit;
        end
      end
    
      Result := True;
      x := tx +4;
      y := ty +6;
    end;
    
    function FindMSArrow(var x, y: integer):Boolean;
    var c, tx, ty: integer;
    begin
      repeat
       Wait(50);
       c := c +1
      until ((c > 50) or (FindBitmapToleranceIn(TopMSArrow, tx, ty, MSX1, MSY1, MSX2, MSY2, 10)));
    
      if c > 50 then
      begin
        c := 0;
         repeat
          Wait(50);
          c := c +1
         until ((c > 50) or (FindBitmapToleranceIn(MSArrow, tx, ty, MSX1, MSY1, MSX2, MSY2, 10)));
        if c > 50 then
        begin
          WriteLn('Could not find the MSArrow');
          Result := False;
          Exit;
        end
      end
    
      Result := True;
      x := tx +4;
      y := ty +6;
    end;
    
    function FindFastMSArrow(var x, y: integer):Boolean;
    var c, tx, ty: integer;
    begin
      repeat
       Wait(50);
       c := c +1
      until ((c > 2) or (FindBitmapToleranceIn(TopMSArrow, tx, ty, MSX1, MSY1, MSX2, MSY2, 10)));
    
      if c > 2 then
      begin
        c := 0;
         repeat
          Wait(50);
          c := c +1
         until ((c > 2) or (FindBitmapToleranceIn(MSArrow, tx, ty, MSX1, MSY1, MSX2, MSY2, 10)));
        if c > 2 then
        begin
          Result := False;
          Exit;
        end
      end
    
      Result := True;
      x := tx +4;
      y := ty +6;
    end;
    
    function WalkToMMArrow: Boolean;
    var tx, ty: integer;
    begin
      if FindMMArrow(tx, ty) then
      begin
        MouseFindFlag(tx, ty, 1, 1);
        Flag;
        Result := True;
      end;
    end;
    
    function FindNpcByArrow(var x, y: integer; Name: String; RightClick: Boolean): Boolean;
    var c, tx, ty: integer;
    begin
      repeat
        if FindMSArrow(tx, ty) then
        begin
          MMouse(tx, ty +15, 4, 4);
          Wait(50);
          if IsUpTextMulti('Talk-to', 'to '+Name, Name) then
          begin
            if RightClick then
            begin
              GetMousePos(tx, ty);
              Mouse(tx, ty, 0, 0, False);
            end
            x := tx;
            y := ty;
            Result := True;
            Exit;
          end
        end else WalkToMMArrow;
       c := c +1;
      until(c > 50)
    
      Result := False;
      WriteLn('Could not find '+Name);
    end;
    
    function InTalk: Boolean;
    begin
      if FindColorTolerance(x, y, 128, 220, 360, 365, 370, 5) then
      Result := True;
    end;
    
    function TalkToNpcByArrow(name: String): Boolean;
    var c, tx, ty: integer;
    begin
      if not FindFastMSArrow(x, y) then WalkToMMArrow;
       repeat
        if FindNpcByArrow(tx, ty, Name, True) then
        begin
          ChooseOption(x, y, 'Talk-to');
          Flag;
          Wait(1200);
          if InTalk then
          begin
            WriteLn('We are talking to '+Name);
            Result := True;
            Exit;
          end
        end
        c := c +1
       until c > 10
    end;
    
    function PleaseWait: Boolean;
    begin
      if FindBitmapToleranceIn(PlzWait, x, y, MCX1, MCY1, MCX2, MCY2, 20) then Result := True;
    end;
    
    procedure HandleTalk;
    var c, i: integer;
    begin
      repeat
       c := c +1;
        repeat
         Wait(500);
         i := 0;
         if PleaseWait then
         repeat
           Wait(500);
           i := i +1
         until ((not (PleaseWait)) or (i > 7))
        until not ClickToContinue;
       Wait(1000);
       if not ClickToContinue then Break;
      until c > 10;
    end;
    
    function OpenDoor(Dir: String): Boolean;
    var tx, ty, i: integer;
    begin
      MakeCompass(Dir);
      LowestAngle;
      for i := 10 to 30 do
        if FindMSArrow(tx, ty) then
        begin
          MMouse(tx, ty +(i*2), 1, 1);
          Wait(50);
          if IsUpTextMulti('Open', 'Door', 'Open Door') then
          begin
            Mouse(tx, ty +(i*2), 0, 0, True);
            Flag;
            Break;
          end
        end
      Wait(2000);
      Result := True;
    end;
    
    function OpenDoorAt(DoorNumber: Integer): Boolean;
    var i, MovingAround, Emotes, TalkWithQuest, FinancialAdvise, Prayer, FinalInstruc: integer;
    begin
      Case DoorNumber of
        1 : begin
              MovingAround := BitmapFromString(100, 2, 'z78DAA553410EC020' +
                '08FBD2B664891E21D1FF3F690BF300C1228B1E1A53B12214AE749' +
                '793058F77F5CE8A3148C485468CEC357EBC461413AB1905971BC2' +
                'A1A094F319A26C3338D17475432FFA6AFCADA439656AF5CADFCAB' +
                'C8294277725C660D87783C07B0B1725F4A126E811E4C3EE2FFA02' +
                'FE8BF67046C054C6DECBCCEC3EBFA5E69DA3FCE6F907C84F182C');
    
              repeat
               OpenDoor('E');
               i := i +1;
              until ((FindBitMapToleranceIn(MovingAround, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
    
              if i > 10 then
              begin
                WriteLn('We got stuck on our first Door, Terminating..');
                TerminateScript;
              end
    
              WriteLn('We are through our first door!');
              MakeCompass('N');
              HighestAngle;
              FreeBitMap(MovingAround);
              Result := True;
              Exit;
            end
    
        2 : begin
              repeat
               OpenDoor('E');
               i := i +1;
              until ((not(FindColor(x, y, 0, 350, 590, 575, 600))) or (i > 10));
    
              if i > 10 then
              begin
                WriteLn('We got stuck on our second Door, Terminating..');
                TerminateScript;
              end
    
              WriteLn('We are through our second door!');
              MakeCompass('N');
              HighestAngle;
              FreeBitMap(MovingAround);
              Result := True;
              Exit;
            end
    
        3 : begin
              Emotes := BitmapFromString(41, 3, 'z78DA73B27434B5307422823' +
                '400023737274747270B476412539C289510937188434590D46071' +
                '092E17E275332EBD2824A97E21512501B7619840C077186EC66F2' +
                'FB25E2CA181194AC4B8197F5C10E30B4C5F63F802BF4A5CBA00F7' +
                '17AC44');
    
              repeat
               OpenDoor('E');
               i := i +1;
              until ((FindBitMapToleranceIn(Emotes, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
    
              if i > 10 then
              begin
                WriteLn('We got stuck on our 3rd Door, Terminating..');
                TerminateScript;
              end
    
              WriteLn('We are through the third door!');
              MakeCompass('N');
              HighestAngle;
              FreeBitMap(Emotes);
              Result := True;
              Exit;
            end
    
        4 : begin
              TalkWithQuest := BitmapFromString(175, 1, 'z78DA737' +
                '27474B270742282340003FCB258D4583A9A5A1842C5C16CE245C8' +
                '2349B0CBC8D2D2DC943CF7A09880D71C325D4E74F81370390E353' +
                '40F5B12CD21419CE8D4E8E4E4E86A6904154762E3D7EB445E8EC0' +
                '61174E7B31C521224824F1E2B85412AF1E53040057F5ED2B');
    
              repeat
               OpenDoor('N');
               i := i +1;
              until ((FindBitMapToleranceIn(TalkWithQuest, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
    
              if i > 10 then
              begin
                WriteLn('We got stuck on our 4th Door, Terminating..');
                TerminateScript;
              end
    
              WriteLn('We are through doornumber 4!');
              MakeCompass('N');
              HighestAngle;
              FreeBitMap(TalkWithQuest);
              Result := True;
              Exit;
            end
    
        5 : begin
              FinancialAdvise := BitmapFromString(77, 2, 'z78DA73B27434B' +
                '530340002373727301B99C4258EA90645A5A3A39385239424CB7C' +
                'A838B2393848FC2A51DC46BC5E4C5F208BE30F01B25C488C7A925' +
                '592189BC8B2C4AB24591C332431D309DEF483C516BCBEC6199B78' +
                '43985AB1497CDC618A0000027CD7B7');
    
              repeat
               OpenDoor('W');
               i := i +1;
              until ((FindBitMapToleranceIn(FinancialAdvise, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
    
              if i > 10 then
              begin
                WriteLn('We got stuck on our 5th Door, Terminating..');
                TerminateScript;
              end
    
              WriteLn('We are through doornumber 5!');
              MakeCompass('N');
              HighestAngle;
              FreeBitMap(FinancialAdvise);
              Result := True;
              Exit;
            end
    
        6 : begin
              Prayer := BitmapFromString(31, 3, 'z78DA3330303070737372747' +
                '4B27024863400AB37C0AB0B972C01714B47530B4308892982D30D' +
                'C8B2182A31CDC76232922E5CB2C4F8C8808890C47439516185A49' +
                '2800B8911273A1E316D07007A4D827E');
    
              repeat
               OpenDoor('W');
               i := i +1;
              until ((FindBitMapToleranceIn(Prayer, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
    
              if i > 10 then
              begin
                WriteLn('We got stuck on our 6th Door, Terminating..');
                TerminateScript;
              end
    
              WriteLn('We are through door 6!');
              MakeCompass('N');
              HighestAngle;
              FreeBitMap(Prayer);
              Result := True;
              Exit;
            end
    
        7 : begin
              FinalInstruc := BitmapFromString(88, 3, 'z78DAB594C10AC0' +
                '2008407FC90D06755458FFFF4983DCC1708AE5BA483CCA4A5F010' +
                '0B4468854902A5EE5E008CC050971CED3A3263EFF889C5F8C87DD' +
                '2DBE748BF8F9F59CF8CC454E78D7F3257D2CA3C5A757C97D13959' +
                'CADD2840FCA0AD0F65ADCBD45E424992EFFE683D1E52D3E489EF1' +
                '4157D87ACBAE8156CE888D19F776ACCDFC03912EEFF3E101FAAB7' +
                '5BF');
    
              repeat
               OpenDoor('N');
               i := i +1;
              until ((FindBitMapToleranceIn(FinalInstruc, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
    
              if i > 10 then
              begin
                WriteLn('We got stuck on our last(!) Door, Terminating..');
                TerminateScript;
              end
    
              WriteLn('We are through the last door (7)!');
              MakeCompass('N');
              HighestAngle;
              FreeBitMap(FinalInstruc);
              Result := True;
              Exit;
            end
      end;
      Result := False;
    end;
    
    function OpenGate(Dir: String; Gate3: Boolean): Boolean;
    var i, tx, ty: integer;
    begin
      MakeCompass(Dir);
      LowestAngle;
      if FindMSArrow(tx, ty) then
      begin
        for i := 0 to 30 do
        begin
          if Gate3 then MMouse(tx, ty +(30 +(i*2)), 1, 1) else MMouse(tx, ty +(5 +(i*2)), 1, 1);
          Wait(200);
          if IsUpTextMulti('Open', 'Gate', 'Open Gate') then
          begin
            GetMousePos(tx, ty);
            Mouse(tx, ty, 0, 0, True);
            Flag;
            break;
          end
        end
        Result := True;
        Wait(2000);
      end
    end;
    
    function OpenGateAt(GateNumber: Integer): Boolean;
    var i, FYN, Combat, Attacking: integer;
    begin
      Case GateNumber of
        1 : begin
              FYN := BitmapFromString(65, 2, 'z78DA33303030707' +
                '333C04B3A393A3A5938628A383939BA5A1A11A3171749895E62CC' +
                '74B27434B5304426718923CBE277032E59527561B10B1C9EC4905' +
                '8D4239909F51186EDB85C853F24C98B05F2EC25208E2B36897739' +
                '462C238B0300A16FB710');
    
              repeat
               OpenGate('W', False);
               i := i +1;
              until ((FindBitMapToleranceIn(FYN, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
    
              if i > 10 then
              begin
                WriteLn('We got stuck on our first Gate, Terminating..');
                TerminateScript;
              end
    
              WriteLn('We are through our first Gate!');
              MakeCompass('N');
              HighestAngle;
              FreeBitMap(FYN);
              Result := True;
              Exit;
            end
    
        2 : begin
              Combat := BitmapFromString(35, 2, 'z78DA33303030707373B2743' +
                '4B53084928E8E4E168E061071301B99245EDC00D9648838984D94' +
                '38D12228E2547239011F21B99964710C3763090D0CBD0084D7620' +
                '0');
    
              repeat
               OpenGate('E', True);
               i := i +1;
              until ((FindBitMapToleranceIn(Combat, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
    
              if i > 10 then
              begin
                WriteLn('We got stuck on our second Gate, Terminating..');
                TerminateScript;
              end
    
              WriteLn('We are through our second Gate!');
              MakeCompass('N');
              HighestAngle;
              FreeBitMap(Combat);
              Result := True;
              Exit;
            end
    
        3 : begin
              Attacking := BitmapFromString(58, 3, 'z78DA73727474B2703400' +
                '023737FCA41358A593A5A3A985215404CCC6248992859886643BB' +
                '2082E712C2A316DC42B8ECB6D448913ED42645D384303877B480E' +
                '5B0C57617109112EC76F0E16110CDB49085B22DC80DFE5F843099' +
                '7BD64A65BCC14454CBAC5EB36271CF90E57CC921A8F94842D0041' +
                '83F1E4');
    
              repeat
               OpenGate('E', True);
               i := i +1;
              until ((FindBitMapToleranceIn(Attacking, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
    
              if i > 10 then
              begin
                WriteLn('We got stuck on our third Gate, Terminating..');
                TerminateScript;
              end
    
              WriteLn('We are through our third Gate!');
              MakeCompass('N');
              HighestAngle;
              FreeBitMap(Attacking);
              Result := True;
              Exit;
            end
      end;
      Result := False;
    end;
    
    procedure Chop(HowMuch: Integer);
    var tx, ty, slot, c, i: Integer; ChopTime: LongInt;
    begin
      MarkTime(ChopTime);
      repeat
       HandleTalk;
       c := 0;
       Slot := 0;
       Slot := InventoryCount;
       if (TimeFromMark(ChopTime) > 180000) then
       begin
         WriteLn('Chopping took longer then 3 mins, Terminating..');
         TerminateScript;
       end
       if FindObjEx(tx, ty, 'Tree', MSX1 +20, MSY1 +20, MSX2 -50, MSY2 -20, 3170384, 15, 7, 7, 100, True) then
       begin
         Mouse(tx, ty, 1, 1, True);
         Flag;
          repeat
           Wait(1000);
           c := c +1;
          until ((InventoryCount > Slot) or (c > 15))
         if c <= 15 then
         begin
           WriteLn('We chopped a Tree');
           i := i +1;
           if (i >= HowMuch) then Exit;
         end
       end;
      until(i >= HowMuch)
    end;
    
    procedure MakeFire (HowMuch: Integer);
    var tx, ty, TinderBox, Log, i, c, slot: Integer; FireMaking: LongInt;
    begin
      TinderBox := BitmapFromString(9, 1, '9F94949F94949F94949D92' +
           '929A8F8F6242096242096242098B8281');
    
      Log := BitmapFromString(11, 1, '000001BE9B6DBC996CBA976B74' +
           '562A8A6C4187683F87683F87683F87683F87683F');
    
      MarkTime(FireMaking);
      if FindSymbol(tx, ty, 'Fish') then MouseFindFlag(tx +10, ty +5, 1, 1);
      Flag;
      GameTab(4);
      repeat
       ClickToContinue;
       Slot := 0;
       Slot := InvCount;
       if ((FindBitmapToleranceIn(TinderBox, x, y, MIX1, MIY1, MIX2, MIY2, 20)) and (FindBitmapToleranceIn(Log, x, y, MIX1, MIY1, MIX2, MIY2, 20))) then
       begin
         HandleTalk;
         if FindBitmapToleranceIn(TinderBox, tx, ty, MIX1, MIY1, MIX2, MIY2, 20) then Mouse(tx, ty, 1, 1, True);
         Wait(500);
         if ClickToContinue then ClickToContinue;
         if FindBitmapToleranceIn(Log, tx, ty, MIX1, MIY1, MIX2, MIY2, 20) then Mouse(tx, ty, 1, 1, True);
         Wait(1000);
         if PleaseWait then
         begin
           repeat
            Wait(1000);
            c := c +1;
           until ((not (PleaseWait)) or (c > 10))
           if InvCount < Slot then
           begin
             WriteLn('We made a fire');
             i := i +1;
             if (i >= HowMuch) then Exit;
           end
         end
         if (TimeFromMark(FireMaking) > 180000) then
         begin
           WriteLn('Makeing Fire took longer then 3 mins, Terminating..');
           TerminateScript;
         end
       end else break;
      until(i >= HowMuch);
    
      FreeBitmap(TinderBox);
      FreeBitmap(Log);
    end;
    
    function ThereIsFire(var WhereX, WhereY: integer): boolean;
    var acc,ref : Extended; XT, YT,times,tol,fire : Integer;
    begin
    
      Fire := BitmapFromString(1, 11, '3B3000F4C63FF8C83FF4C73EE6' +
           'BC39E6BC39BC922CE6BE45BC9E38BC9E3B352A00');
    
      ref:=0.8; tol:=1;
      for times:=1 to 4 do
      begin
        FindDeformedBitmapToleranceIn(Fire, XT, YT, MSCX-(25*times),MSCY-(25*times),MSCX+(25*times),MSCY+(25*times), tol, 2, True, acc);
        if (acc >= ref) then
        begin
          WhereX:=XT;
          WhereY:=YT;
          Result := True;
          WriteLn('Found Fire');
          FreeBitmap(Fire);
          Exit;
        end;
        ref := ref - 0.1;
        tol:=tol+10;
        wait(1);
      end;
      Result:=False;
      WriteLn('Couldnt Find Fire');
      FreeBitmap(Fire);
    end;
    
    procedure Fish(HowMuch: Integer);
    var FishSpotDTM, c, i, slot, tx, ty: Integer; Fishing: LongInt;
    begin
    
      FishSpotDTM :=  DTMFromstring('78DA63FCC4C0C070910105CC38F086410E483'  +
                    '342F98C1F31D5E4B52C4255F399083520BB2E10A1E6127E3500EE'  +
                    '831204');
    
      WalkToMMArrow;
      GameTab(4);
      MarkTime(Fishing);
      repeat
        ClickToContinue;
        if (FindMsDTM (tx, ty,  FishSpotDTM)) then
        begin
          MMouse (tx, ty, 5, 5);
          if IsUpText('et Fishing') then Mouse (tx, ty, 5, 5, True ) else
          begin
            if FindMSArrow(tx, ty) then
            begin
              MMouse(tx, ty -5, 1, 1);
              Wait(50);
              if IsUpTextMulti('Net Fishing spot', 'ishing spot', 'Net fish') then Mouse(tx, ty, 0, 0, True);
            end
          end
        end;
        Flag;
        Slot := 0;
        Slot := InvCount;
        c := 0;
        repeat
         Wait(1000);
         c := c +1;
        until ((InvCount > Slot) or (c > 15))
        if c <= 15 then
        begin
          i := i +1;
          WriteLn('We catched a fish');
        end
        if (TimeFromMark(Fishing) > 180000) then
         begin
           WriteLn('Fishing took longer then 3 mins, Terminating..');
           TerminateScript;
         end
      until(i >= HowMuch);
      FreeDtm(FishSpotDtm);
    end;
    
    procedure CookShrimp(HowMuch: Integer);
    var tx, ty, fx, fy, Shrimp, CookedShrimp, BurntShrimp, i: Integer; CookShrimpTime: LongInt;
    begin
    
      Shrimp := BitmapFromString(17, 3, 'z78DA7D4F410A043108FB925' +
           '5A3F658EDF4FF4F9A427B1B761542089A28D1AE467FB19E9C8941' +
           '914198AA0227B0AC5023CD2E56D05EE13E87750A64EB239EB32BC' +
           '4BB613A950FFF85DFDC9378785FAEA8913E8D13018BE2584E29FB' +
           '0A3F3327E5A2EA90BCF851BEFE57E198C1A5DBB95575389A356E3' +
           'CD403F7A317CB363F8F');
    
      CookedShrimp := BitmapFromString(23, 3, 'z78DA9D8F5D0AC0200' +
           'C83AFD49F68F5D139BDFF91E65606822F620B1F25849006A0E815' +
           '226EC816DDBF723F61CDF9142519EB3CCC9C92E91D761633E1382' +
           'B371B71B6A89D5A0AB04141A0367BCEB8365F3BF88F7E578D8973' +
           'EAA82CD680BF837B1ECE3C55C6');
    
      BurntShrimp := BitmapFromString(24, 4, 'z78DA9D905B0A03210C' +
           '45B794D755FBE958BBFF25D5312904A603A55E38487CE4289EA8A' +
           '8453130E81CFC1F61D6F540B1A78933EA0D82982B09F974D5D586' +
           '0D9DFA583125A5BC1F076CC5DD6A21BCBCC2856565D3CFC64E3F9' +
           '518B7259F6CE5264E37BFB3B5696D6513648775631DFA31EF8A95' +
           'AAA2225D9AB4FC96CC6BC76CF58B49D0FB6E86C9EEE8DD83454E2' +
           '1E6C9F3CB0DD9E4F23F773F76F5F1D537531C74EC');
    
      MarkTime(CookShrimpTime);
      if FindSymbol(tx, ty, 'Fish') then MouseFindFlag(tx +15, ty +7, 1, 1);
      Flag;
      Wait(3000);
      repeat
       if (TimeFromMark(CookShrimpTime) > 360000) then
       begin
         WriteLn('Cooking Shrimps took longer then 6 mins, Terminating..');
         TerminateScript;
       end
       ClickToContinue;
       if ((ThereIsFire(fx, fy)) and (FindBitmapToleranceIn(Shrimp, tx, ty, MIX1, MIY1, MIX2, MIY2, 20))) then
       begin
         HandleTalk;
         Mouse(tx, ty, 1, 1, True);
         ClickToContinue;
         ClickToContinue;
         Mouse(fx, fy, 1, 1, False);
         Wait(500);
         ChooseOption(x, y, 'Use');
         Flag;
         Wait(5000);
         if i = 0 then if ((FindBitmapToleranceIn(CookedShrimp, tx, ty, MIX1, MIY1, MIX2, MIY2, 20)) or (FindBitmapToleranceIn(BurntShrimp, tx, ty, MIX1, MIY1, MIX2, MIY2, 20))) then
         begin
           WriteLn('We cooked/burned a Shrimp');
           i := i +1;
         end
         if i = 1 then if (CountItemBmpTol(CookedShrimp, 20) > 1) or (CountItemBmpTol(BurntShrimp, 20) > 1) then
         begin
           WriteLn('We cooked/burned a Shrimp');
           i := i +1;
         end
         if i = 1 then if (CountItemBmpTol(CookedShrimp, 20) = 1) and (CountItemBmpTol(BurntShrimp, 20) = 1) then
         begin
           WriteLn('We cooked and burned a Shrimp');
           i := i +1;
         end
       end else
       begin
         if not FindBitmapToleranceIn(Shrimp, tx, ty, MIX1, MIY1, MIX2, MIY2, 20) then Break;
         WriteLn('We did not find a fire, we are making one');
         Chop(1);
         Wait(500);
         MakeFire(1);
         Wait(1000);
       end
      until(i >= HowMuch)
    
      FreeBitmap(Shrimp);
      FreeBitmap(CookedShrimp);
      FreeBitmap(BurntShrimp);
    end;
    
    procedure MakeDough(HowMuch: Integer);
    var px, py, bx, by, PotOfFlour, BucketOfWater, Dough, i, slot: Integer; DoughTime: LongInt;
    begin
    
      PotOfFlour := BitmapFromString(18, 3, 'z78DA758E5B0A43210C44B714' +
           'F318934F8DD7FD2FA9DEA68542DB0C041472E6187429D33DEDDF8' +
           '6AAB2F634E3EC66C4135B2703AE6005696336972CCCFBCA9EE4CF' +
           '5DFF4E06BE7E70A606A38709CFD8A1A139F240B3CF7D424387860' +
           '1829808E91E760915E7DBB95A1C3685CAFFE599723155CB5ACB4F' +
           '72F593B18EE279C9E28C6CD9C66DB13D9CFAAE2EDF68F272287E9' +
           '93F00F6A7451C');
    
      BucketOfWater := BitmapFromString(15, 2, '5C4615533F15493911493911' +
           '4939114939114F3C115E58588D838369501B6049185C461560491' +
           '8644D180000014939113F300E7B7B9B7B7B9B7B7B9B7B7B9B7B7B' +
           '9B615A5A847A7A6860604534114534116049185C4615000001');
    
      Dough := BitmapFromString(24, 1, 'AAA988AAA988AAA988AAA988A' +
           'AA988AAA988A6A685A5A483A1A1809D9C7D999879959476909073' +
           '8D8C7088886C7D7C6373735C6867535A59464D4D3E3C3C3000000' +
           '1564D42564D42');
    
      MarkTime(DoughTime);
      GameTab(4);
      repeat
       ClickToContinue;
       if ((FindBitmapToleranceIn(PotOfFlour, px, py, MIX1, MIY1, MIX2, MIY2, 20)) and (FindBitmapToleranceIn(BucketOfWater, bx, by, MIX1, MIY1, MIX2, MIY2, 20))) then
       begin
         Slot := InvCount;
         Mouse(px, py, 1, 1, True);
         Wait(500);
         Mouse(bx, by, 1, 1, True);
         Wait(3000);
         if ((FindBitmapToleranceIn(Dough, x, y, MIX1, MIY1, MIX2, MIY2, 20)) and (InvCount > Slot)) then
         begin
           WriteLn('We made dough');
           i := i +1;
         end
       end else Break;
       if (TimeFromMark(DoughTime) > 180000) then
       begin
         WriteLn('Making Dough took longer then 3 mins, Terminating..');
         TerminateScript;
       end
      until (i >= HowMuch)
    
      FreeBitmap(PotOfFlour);
      FreeBitmap(BucketOfWater);
      FreeBitmap(Dough);
    end;
    
    procedure CookBread(HowMuch: Integer);
    var dx, dy, tx, ty, BreadDough, Bread, i: Integer; CookBreadTime: LongInt;
    begin
    
      BreadDough := BitmapFromString(24, 1, 'AAA988AAA988AAA988AAA988A' +
           'AA988AAA988A6A685A5A483A1A1809D9C7D999879959476909073' +
           '8D8C7088886C7D7C6373735C6867535A59464D4D3E3C3C3000000' +
           '1564D42564D42');
    
      Bread := BitmapFromString(16, 2, '564D42000001A58715A28411A' +
           '28411A28411987C118E7411886E0E846B0E7C660E745F0E6D590E' +
           '604D094C3E093C3000000001A587159C7F11A284119F81119F811' +
           '19F81119F81119579118B7111846B0E78620E705B0E6451095B4B' +
           '094C3E09');
    
      MakeDough(HowMuch);
      GameTab(4);
      if not FindFastMSArrow(x, y) then WalkToMMArrow;
      MarkTime(CookBreadTime);
      repeat
       ClickToContinue;
       if FindBitmapToleranceIn(BreadDough, dx, dy, MIX1, MIY1, MIX2, MIY2, 20) then
       begin
         Mouse(dx, dy, 1, 1, True);
         Wait(100);
         if FindMSArrow(tx, ty) then
         begin
           MMouse(tx, ty -5, 1, 1);
           Wait(200);
           if IsUpTextMulti('Use Range', 'Use', 'Range') then
           begin
             Mouse(tx, ty, 0, 0, False);
             Wait(300);
             ChooseOption(x, y, 'Use');
             Flag;
             Wait(6000);
             if FindBitmapToleranceIn(Bread, tx, ty, MIX1, MIY1, MIX2, MIY2, 20) then
             begin
               WriteLn('We cooked bread');
               i := i +1;
             end
           end
         end
       end else Break;
       if (TimeFromMark(CookBreadTime) > 180000) then
       begin
         WriteLn('Cooking Bread took longer then 3 mins, Terminating..');
         TerminateScript;
       end
      until(i >= HowMuch)
    
      FreeBitmap(BreadDough);
      FreeBitmap(Bread);
    end;
    
    procedure ClimbDownLadder;
    var tx, ty, i, c: integer;
    begin
      MakeCompass('S');
      if not FindFastMSArrow(x, y) then WalkToMMArrow;
      repeat
       ClickToContinue;
       if FindMSArrow(tx, ty) then
       begin
         MMouse(tx, ty, 1, 1);
         Wait(200);
         if IsUpTextMulti('Climb-down Ladder', 'Ladder', 'down La') then
         begin
           Mouse(tx, ty, 0, 0, False);
           Wait(300);
           ChooseOption(x, y, 'Climb-down');
           c := 0;
            repeat
             if (FindColor(x, y, 16711680, 180, 360, 320, 375) or (GetColor(327, 374) = 16711680)) then Break;
             Wait(1000);
             c := c +1;
            until c > 9
            if (FindColor(x, y, 16711680, 180, 360, 320, 375) or (GetColor(327, 374) = 16711680)) then Break;
           i := i +1;
         end
       end
      until(i > 10)
      if i <= 10 then WriteLn('We are underground') else
      begin
        WriteLn('We are not underground, Terminating..');
        TerminateScript;
      end
      Mouse(665, 25, 1, 1, True);
      Wait(4000);
      Flag;
    end;
    
    procedure ClimbUpLadder;
    var tx, ty, i, c: integer;
    begin
      if not FindFastMSArrow(x, y) then WalkToMMArrow;
      repeat
       ClickToContinue;
       if GetColor(232, 371) = 16711680 then if GetColor(320, 440) = 0 then Break;
       if FindMSArrow(tx, ty) then
       begin
         MMouse(tx, ty +5, 4, 4);
         Wait(200);
         if IsUpTextMulti('Climb-up Ladder', 'Ladder', 'up La') then
         begin
           GetMousePos(tx, ty);
           Mouse(tx, ty, 0, 0, False);
           Wait(300);
           if ChooseOption(x, y, 'Climb-up') then
            repeat
             if GetColor(232, 371) = 16711680 then if GetColor(320, 440) = 0 then Break;
             Wait(1000);
             c := c +1;
            until c > 12
           i := i +1;
         end
       end
      until(i > 10)
      if i <= 10 then WriteLn('We are out the cave!') else
      begin
        WriteLn('We are still underground, Terminating..');
        TerminateScript;
      end
    end;
    
    procedure Prospect;
    var tx, ty, i, c, t: Integer; Prospecting: LongInt;
    begin
      MarkTime(Prospecting);
      repeat
       WalkToMMArrow;
       Wait(1000);
       Flag;
       i := 0
       repeat
        ClickToContinue;
        if c = 0 then if GetColor(325, 426) = 0 then if GetColor(280, 373) = 16711680 then Break;
        if c = 1 then if GetColor(302, 426) = 0 then if GetColor(291, 374) = 16711680 then Break;
        if FindMSArrow(tx, ty) then
        begin
          ClickToContinue;
          MMouse(tx, ty, 1, 1);
          Wait(200);
          if IsUpTextMulti('Mine Rocks', 'Mine', 'Rocks') then
          begin
            Mouse(tx, ty, 0, 0, False);
            Wait(300);
            if ChooseOption(x, y, 'Prospect') then
            begin
              Flag;
              Wait(500);
              if c = 0 then if GetColor(325, 426) = 0 then if GetColor(280, 373) = 16711680 then Break;
              if c = 1 then if GetColor(302, 426) = 0 then if GetColor(291, 374) = 16711680 then Break;
              if PleaseWait then
              begin
                t := 0;
                repeat
                 if not PleaseWait then Break;
                 Wait(1000);
                 t := t +1;
                until t > 9
                Wait(2000);
                if ClickToContinue then
                begin
                  WriteLn('We prospected an Ore');
                  Break;
                end
              end
              i := i +1;
            end;
          end
        end
       until(i > 10)
       if i > 10 then
       begin
         WriteLn('We got stuck while prospecting the ores, Terminating..');
         TerminateScript;
       end
       c := c +1
      until(c > 1);
      WriteLn('We prospected 2 ores');
      Wait(1500);
    end;
    
    procedure Mine(HowMuch: Integer);
    var tx, ty, Slot, i, c, t, YouManageTo: Integer;
    begin
    
      YouManageTo := BitmapFromString(97, 2, 'z78DAB552CB0AC030' +
        '08FB255B28AD4785FDFF2F8DDD1C12D176F39043D4101F444FA8C' +
        'AC5DD2285BC0D15D125165136EECA23154359C66A0833F57FEB67' +
        'EA7D2F54FE749F056FE04FE05F390FC85B9EDF9B1DF26E7674AF4' +
        'C6555E7C577E639F6F4E36BFA9F39D9EDC9EC377FE9004F');
    
      repeat
       GameTab(4);
       Slot := 0;
       Slot := InvCount;
       WalkToMMArrow;
       Wait(1000);
       Flag;
       i := 0
       repeat
        if (InvCount > Slot) then Break;
        if FindMSArrow(tx, ty) then
        begin
          ClickToContinue;
          MMouse(tx, ty, 1, 1);
          Wait(200);
          if IsUpTextMulti('Mine Rocks', 'Mine', 'Rocks') then
          begin
            Mouse(tx, ty, 0, 0, False);
            Wait(300);
            if ChooseOption(x, y, 'Mine') then
            begin
              Flag;
              Wait(500);
              if PleaseWait then
              begin
                t := 0;
                repeat
                 if not PleaseWait then Break;
                 Wait(1000);
                 t := t +1;
                until t > 9
                Wait(1000);
                GameTab(4);
                if (FindBitMapToleranceIn(YouManageTo, x, y, MCX1, MCY1, MCX2, MCY2, 20) or (InvCount > Slot)) then
                begin
                  WriteLn('We mined an Ore');
                  Break;
                end
              end
            end;
            ClickToContinue;
            i := i +1;
          end
        end
       until(i > 10)
       if i > 10 then
       begin
         WriteLn('We got stuck while mining the ores, Terminating..');
         TerminateScript;
       end
       c := c +1
      until(c >= HowMuch);
      WriteLn('We mined '+ IntToStr(HowMuch) +' ores');
    end;
    
    procedure Smelt(HowMuch: Integer);
    var i, ox, oy, tx, ty, Tin, Bar: Integer; Smelting: LongInt;
    begin
    
      Tin := BitmapFromString(29, 2, 'z78DA754F490E03210CFB521667' +
           'E1C8B0FCFF49650AAAB8944856141CDB215A8F39D96808F1C32C4' +
           'DC0A9218DBB4E8500A9558A11D61F7DF906547DD001CD3DD9183D' +
           '10C8999656282363E3CDB9F128039011CD014FF18292D52766B65' +
           '8B1365349569D9CBE3ADB5B9670257B501436D0D41DC65A767FEF' +
           '1E47D1A1C3ABBF227F526DFE8DBFAB97A333A646BC6E92E91D6DE' +
           '73C3843EDE87C00D9644776');
    
      Bar := BitmapFromString(18, 2, 'z78DA3336300242303044268D8C' +
           '0C9D0C5C4925CD0C4C2C8D9C2124C41C63B0F910D2D4C4C4D1D80' +
           '942228B93673B4E5BCC4C5C4C8C00C70F2C55');
    
      if not WalkToMMArrow then if FindSymbol(tx, ty, 'furnace') then MouseFindFlag(tx, ty, 1, 1);
      Flag;
      GameTab(4);
      MarkTime(Smelting);
      repeat
       if FindBitmapToleranceIn(Tin, ox, oy, MIX1, MIY1, MIX2, MIY2, 20) then
       begin
         Mouse(ox, oy, 1, 1, True);
         if FindMSArrow(tx, ty) then
         begin
           MMouse(tx, ty, 1, 1);
           Wait(200);
           if IsUpTextMulti('Use Furnace', 'Furnace', 'se Fur') then
           begin
             Mouse(tx, ty, 0, 0, True);
             Wait(6000);
             if FindBitmapToleranceIn(Bar, ox, oy, MIX1, MIY1, MIX2, MIY2, 20) then
             begin
               WriteLn('We melted a bar');
               i := i +1;
             end
           end
         end
       end else Break;
       if (TimeFromMark(Smelting) > 180000) then
       begin
         WriteLn('Smelting took longer then 3 mins, Terminating..');
         TerminateScript;
       end
      until(i >= HowMuch)
      FreeBitmap(Tin);
      FreeBitmap(Bar);
    end;
    
    procedure Smith(HowMuch: Integer);
    var bar, i, tx, ty: Integer; Smithing: LongInt;
    begin
    
      Bar := BitmapFromString(18, 2, 'z78DA3336300242303044268D8C' +
           '0C9D0C5C4925CD0C4C2C8D9C2124C41C63B0F910D2D4C4C4D1D80' +
           '942228B93673B4E5BCC4C5C4C8C00C70F2C55');
    
      WalkToMMArrow;
      GameTab(4);
      Wait(1000);
      Flag;
      MarkTime(Smithing);
      repeat
       if FindBitmapToleranceIn(Bar, tx, ty, MIX1, MIY1, MIX2, MIY2, 20) then if not FindColorTolerance(x, y, 16777215, tx -10, ty -10, tx +10, ty +10, 5) then Mouse(tx, ty, 1, 1, True) else Break;
       if FindMSArrow(tx, ty) then
       begin
         for i := 0 to 30 do
         begin
           MMouse(tx, ty + (5 +i), 1, 1);
           Wait(200);
           if IsUpTextMulti('Anvil', 'Use', 'nvil') then
           begin
             GetMousePos(tx, ty);
             Mouse(tx, ty, 0, 0, False);
             Wait(300);
             if not ChooseOption(x, y, 'Anvil') then Break else
             begin
               Wait(2000);
               Mouse(27, 66, 1, 1, True);
               Wait(5000);
               if not ClickToContinue then
               begin
                 WriteLn('We smithed a Dagger');
                 i := i +1;
                 Break;
               end
             end
           end
         end
       end
       if (TimeFromMark(Smithing) > 180000) then
       begin
         WriteLn('Smithing took longer then 3 mins, Terminating..');
         TerminateScript;
       end
      until(i >= HowMuch)
      FreeBitmap(Bar);
    end;
    
    procedure Wield(What: string);
    var tx, ty, Dagger, Shield, Sword, Arrows, Bow, Weapon: integer;
    begin
      Dagger := BitmapFromString(6, 9, 'z78DA65CD311603210804D02B' +
           '81084809EAFDAF1412B2C9EE738A69E6A34E8ED8E01DBCB77077F' +
           '2BE281A296B87ED1FE9D31DB94CADD5AC2C600307A404DB978C11' +
           '825C8684044030EB29CD3525075D2F73E306A64B276C9B1669C43' +
           '94D0BF819A500AB962DEB29EF6B755D0D1E94D24CB19D2BFC83E7' +
           '2F87F9E605A39D43F5');
    
      Shield := BitmapFromString(21, 5, 'z78DAA590410AC0200C04BFB' +
           '43131254751FAFF2755B09582A6B4750F730B3304E8238D92614A' +
           '62B09825566E123A03EF30299C2A8DB59399008F5C42E9D460970' +
           'BF3D15872F6FC6A78EDF54B52446DF03ED37A9C8666FFE8754B46' +
           '4E4A6E9F59F62EB53D9F1DB54F7BB0');
    
      Sword := BitmapFromString(6, 7, 'z78DA75CC510E80300803D02B9' +
           '532D8F8DCB279FF2349D42FA7FD21292F05DE6110421E34B1AB10' +
           'EC66FBB668156B7040EC6F415D1DE8DEB3BFE5BE5F669988F030E' +
           '1236DE8879412391199FA25D599C7A88A70D3DC6C475B29B58BF0' +
           '9627C63A3300');
    
      Arrows := BitmapFromString(10, 12, 'z78DA9D90490E80300C03BF' +
           '1467A1ED9102FFFF1248E110885A2172B0BA4D6D99E835D05D3A8' +
           'B9200879FD06CFC16B669E5AE2686438C1BEA9445D405BAF2EEAC' +
           'EB80454A052B62D4E4E2D15D138B9CCA292EF7FE95679ECAD9F85' +
           '29B54A6982DB3D9D14C99CBA0B1874B5C2FDD58BE67A3E8E86C6E' +
           '6CD006E53CB9B1EC38623FFCF6607F39D209E29E8E5A');
    
      Bow := BitmapFromString(15, 5, 'z78DA8D90D10E802008457F0916' +
           '083C5AF2FFBF14CBDA34D375DDCE83BB9C31005EC14A39648B37B' +
           '0E98C41412AE0C9298377FF13DBE0FCA03063E7FCBFE1D33426F0' +
           'EAB9D9EC993229D8DAA9C816538553B0DA5AE7658365D4383ACAB' +
           'C0727B6E51DA63901F2AE5BE5');
    
      case LowerCase(what) of
        'dagger' : Weapon := Dagger;
        'shield' : Weapon := Shield;
        'sword'  : Weapon := Sword;
        'arrows' : Weapon := Arrows;
        'bow'    : Weapon := Bow;
      end;
    
      GameTab(4);
      if FindBitmapToleranceIn(Weapon, tx, ty, MIX1, MIY1, MIX2, MIY2, 20) then
      begin
        Mouse(tx, ty, 1, 1, True);
        WriteLn('We wielded the '+What);
      end
      FreeBitmap(Dagger);
      FreeBitmap(Shield);
      FreeBitmap(Sword);
      FreeBitmap(Arrows);
      FreeBitmap(Bow);
    end;
    
    function ClickRat: Boolean;
    var RatPoints: TPointArray; i, ci: integer;
    begin
      FindColorsSpiralTolerance(MSCx, MSCY, RatPoints, 9213847, 90, 65, 420, 250, 20)
      for i := 0 to (GetArrayLength(RatPoints)-1) do
      begin
          if (Distance(RatPoints[ci].x, 0, RatPoints[i].x, 0) >= 10) and
            (Distance(0, RatPoints[ci].y, 0, RatPoints[i].y) >= 10) then
            ci := i
          else
          begin
            RatPoints[i].x := 0;
            RatPoints[i].y := 0;
          end;
        end;
      for i := 0 to (GetArrayLength(RatPoints)-1) do
      begin
        if (RatPoints[i].x <> 0) then
        begin
          MMouse(RatPoints[i].x, RatPoints[i].y, 0, 0);
          Wait(100);
          if IsUpText('ack') then
          begin
            if not IsFightAt(RatPoints[i].x, RatPoints[i].y) then
            begin
              Mouse(RatPoints[i].x, RatPoints[i].y, 0, 0, True);
              Result := True;
              Exit;
            end;
          end;
        end;
      end;
    end;
    
    procedure Fight;
    var WellDone, i, c: integer; WaitTime: LongInt;
    begin
    
      WellDone := BitmapFromString(56, 5, 'z78DAB553490AC0200CFC5' +
           '25B28E83181FAFF27B5D84B4A98382EF5304834DB64A22A573EB6' +
           'E794A2F5EE71E695411F6130A68826E9CDD588602DEFDD629633E' +
           'D1F4B9885EF6B86D5413E7D771E57F1C930597195F6E2895884BE' +
           'A8AA5821B63B833E2F5303FC63AA823117F1D9AB6DA846CF27AF4' +
           '0C6B77317A8E91B95C6F3FA834FEA27E204EC17DC38E0D5985D5C' +
           '0361BF0195C49065');
    
     repeat
      repeat
       if GetColor(256, 432) = 8388608 then Mouse(256, 432, 1, 1, True);
       if ClickRat then
       begin
         Flag;
         Wait(2000);
         if GetColor(307, 436) <> 8388608 then if GetColor(353, 400) <> 0 then Break;
         ClickToContinue;
       end
       c := c +1;
      until(c > 50)
    
      WriteLn('We are fighting');
      MarkTime(WaitTime);
       repeat
        Wait(1000);
        if GetColor(256, 432) = 8388608 then Break;
        if FindBitmapToleranceIn(WellDone, x, y, 115, 355, 205, 385, 30) then
        begin
          FreeBitmap(WellDone);
          WriteLn('Killed a rat');
          Exit;
        end;
        if not InFight then
        begin
          Wait(800);
          if not InFight then Break;
        end
       until (TimeFromMark(WaitTime) > 75000)
      i := i +1;
     until i > 5
     WriteLn('We took 6 tries to find a rat, but we did not found it');
     TerminateScript;
    end;
    
    function GetDoorColor: integer; //Boreas
    var Color,tmpx,tmpy,MinOfRange:integer;
    Length206,Length217,Length233,Length241:integer;
    Array206,Array217,Array233,Array241:array of tpoint;
    RangeOfOthers206,RangeOfOthers217,RangeOfOthers233,RangeOfOthers241:integer;
    tmpbool:boolean;
    begin
      for Color:=254 downto 200 do
      begin
        if not(((Color=206)or(Color=217)or(Color=233)or(Color=241))) then
        begin
          if FindColor(tmpx,tmpy,Color,mmx1,mmy1,mmx2,mmy2) then
          begin
            result:=Color;
            tmpbool:=true;
          end;
        end;
        if tmpbool then break;
      end;
      if not(tmpbool) then
      begin
        //writeln('its a drop dot color');
        FindColorsTolerance(Array206,206,mmx1,mmy1,mmx2,mmy2,0);
        Length206:=getarraylength(Array206);
        FindColorsTolerance(Array217,217,mmx1,mmy1,mmx2,mmy2,0);
        Length217:=getarraylength(Array217);
        FindColorsTolerance(Array233,233,mmx1,mmy1,mmx2,mmy2,0);
        Length233:=getarraylength(Array233);
        FindColorsTolerance(Array241,241,mmx1,mmy1,mmx2,mmy2,0);
        Length241:=getarraylength(Array241);
        RangeOfOthers206:=max(Length233,max(Length217,Length241))-min(Length233,min(Length217,Length241));
        RangeOfOthers217:=max(Length233,max(Length206,Length241))-min(Length233,min(Length206,Length241));
        RangeOfOthers233:=max(Length206,max(Length217,Length241))-min(Length206,min(Length217,Length241));
        RangeOfOthers241:=max(Length233,max(Length217,Length206))-min(Length233,min(Length217,Length206));
        MinOfRange:=min(RangeOfOthers206,min(RangeOfOthers217,min(RangeOfOthers233,RangeOfOthers241)));
        case MinOfRange of
          RangeOfOthers206: result:=206;
          RangeOfOthers217: result:=217;
          RangeOfOthers233: result:=233;
          RangeOfOthers241: result:=241;
        end;
      end;
    end;
    
    function OutGate(Color: integer): Boolean;
    begin
      if GetColor(647, 80) = Color then Result := True;
       if not Result then
      if GetColor(646, 85) = Color then Result := True;
       if not Result then
      if GetColor(646, 84) = Color then Result := True;
       if not Result then
      if GetColor(647, 78) = Color then Result := True;
       if not Result then
      if GetColor(647, 86) = Color then Result := True;
       if not Result then Result := False;
      if Result then WriteLn('We are out the Rat Cage!');
    end;
    
    procedure WalkToGate;
    var DoorColor, t, c, i, tx, ty: integer;
    begin
      repeat
        DoorColor := GetDoorColor;
        WriteLn('DoorColor '+inttostr(doorcolor));
        if c > 0 then if OutGate(DoorColor) then
        begin
          MakeCompass('N');
          HighestAngle;
          Exit;
        end
        if FindColor(tx, ty, DoorColor, MMX1, MMY1, MMX2, 115) then
        begin
          MouseFindFlag(tx, ty, -1, -1);
          Flag;
          MakeCompass('W');
          LowestAngle;
          for i := 0 to 30 do
           begin
             MMouse(205 +(i*3), 95 +(i*2), 1, 1);
             Wait(200);
             if IsUpTextMulti('Open', 'Gate', 'Open Gate') then
             begin
               GetMousePos(tx, ty);
               WriteLn('We found the gate using the DoorColor');
               Mouse(tx, ty, 0, 0, True);
               MakeCompass('N');
               t := 0
                repeat
                 t := t +1;
                 Wait(500)
                until((OutGate(DoorColor)) or (t > 8))
               if t <= 8 then
               begin
                 MakeCompass('N');
                 HighestAngle;
                 Exit;
               end else Break;
             end else c := c +1;
           end
        end else c := c +1
      until(c > 20)
      WriteLn('Could not find the Gate, Terminating..');
      TerminateScript;
    end;
    
    procedure RangeRat;
    var i, c, Moving: integer; WaitTime: LongInt;
    begin
      Moving := BitmapFromString(44, 5, 'z78DAB593C10E80200C43' +
           '7F494D4CE0B825F2FF9FA4110E23654B55E4D04347CAF60015D12' +
           '47AEB72AD52D4381A57B3EC69B5DAF680DFD4497EAA719FAEAA1C' +
           '79FB9E3C8103D260F84C65F80B07E8D363557DAB381DFA98D6253' +
           '8FEE02C8603DEE32C0EE10B417FB033A4C17738980EF3E9F7CCFC' +
           '7D6ABA980331DD4B0ECE2FABD513633738E2');
    
     if not FindObjEx(x, y, 'Attack' ,110, 85, 400, 230, 9213847, 30, 7, 7, 100, True) then WalkToMMArrow;
     MakeCompass('W');
    
     repeat
      repeat
       if ClickRat then
       begin
         Flag;
         Wait(3000);
         if GetColor(256, 432) = 8388608 then Mouse(256, 432, 1, 1, True) else Break;
       end
       c := c +1;
      until(c > 50)
    
      if c > 50 then
      begin
        WriteLn('We could not find a Rat to range, Terminating..');
        TerminateScript;
      end;
    
      WriteLn('We are ranging');
      MarkTime(WaitTime);
       repeat
        Wait(2000);
        if FindBitmapToleranceIn(moving, x, y, 210, 360, 305, 380, 30) then
        begin
          WriteLn('Ranged a Rat');
          MakeCompass('N');
          Exit;
        end;
       until (TimeFromMark(WaitTime) > 40000)
      i := i +1;
     until i > 5
     WriteLn('We took 6 tries to find a rat, but we did not found it');
     TerminateScript;
    end;
    
    function MyOpenBank: Boolean;
    var x, y, fs2: Integer;
    begin
      MakeCompass('S');
      if not BankScreen then
        repeat
          if (FindObjEx(x, y, 'Use Bank', MSX1, MSY1, MSX2, MSY2, 2171171, 5, 10, 10, 100, True)) then
            Mouse(x, y, 4, 4, False)
          else
            if (FindObjEx(x, y, 'Use Bank', MSX1, MSY1, MSX2, MSY2, 4276296, 10, 10, 10, 100, True)) then
              Mouse(x, y, 4, 4, False)
            else
              if (FindObjEx(x, y, 'Use Bank', MSX1, MSY1, MSX2, MSY2, 540501, 10, 10, 10, 100, True)) then
                Mouse(x, y, 4, 4, False);
          Wait(250);
          if (ClickOption('Use', 1)) then Result := True;
          Flag;
          fs2 := fs2 + 1;
        until (Result) or (fs2 > 5);
      MakeCompass('N');
    end;
    
    procedure CastStrikes;
    var tx, ty, i, c, Almost: integer; WaitTime: LongInt;
    begin
      Almost := BitmapFromString(34, 3, 'z78DA73727474B2703400023' +
           '73727301B99A45C9C804A4B47530B436492181350449074219374' +
           'F20BB29B71F9856871CC1020C1CDC4D84879BCE077330E710082B' +
           'D8EA3');
     repeat
      repeat
        ClickToContinue;
        if GetColor(602, 231) <> 16777215 then repeat Mouse(601, 238, 0, 0, True) until GetColor(602, 231) = 16777215
        if FindObjEx(tx, ty, 'Chicken' ,MSX1, MSY1, MSX2, MSY2, 857975, 30, 7, 7, 100, True)  then
        begin
          Mouse(tx, ty, 0, 0, False);
          if ChooseOption(x, y, 'Chicken') then Break;
        end else if c < 2 then MouseFindFlag(645, 80, -2, -2);
        Flag;
       c := c +1;
      until(c > 50)
    
      if c > 50 then
      begin
        WriteLn('We could not find a Chicken to mage, Terminating..');
        TerminateScript;
      end;
    
      WriteLn('We are fighting');
      MarkTime(WaitTime);
       repeat
        Flag;
        Wait(2000);
        if FindBitmapToleranceIn(Almost, x, y, 185, 360, 240, 380, 30) then Exit;
       until (TimeFromMark(WaitTime) > 4000)
      i := i +1;
     until i > 7
     WriteLn('We took 8 tries to kill a Chicken, but it did not work out..');
     TerminateScript;
    end;
    
    function MsToMin(Ms: LongInt): Integer;
    begin
      Result := (Ms/1000)/60;
    end;
    
    function MsToSec(Ms: LongInt): Integer;
    begin
      Result := Ms/1000;
    end;
    
    procedure RuneScapeGuide;
    var TempTime: LongInt;
    begin
      WriteLn('Making character');
      if SmartzCharMaker then SmartzCharacter else NielsMakeChar;
      WriteLn('Starting with the RuneScape Guide');
      MarkTime(TotalTime);
      MarkTime(TempTime);
      ClickToContinue;
      HighestAngle;
      TalkToNpcByArrow('RuneScape Guide');
      HandleTalk;
      GameTab(11);
      Wait(1000);
      Mouse(712, 226, 1, 1, True);
      Wait(1000);
      SetRun(True);
      ClickToContinue;
      TalkToNpcByArrow('RuneScape Guide');
      HandleTalk;
      WalkToMMArrow;
      OpenDoorAt(1);
      ClickToContinue;
      WriteLn('Ended the RuneScape Guide');
      AddToReport(' RuneScape Guide took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
      WriteLn(' ');
    end;
    
    procedure SurvivalExpert;
    var TempTime: LongInt;
    begin
      Mouse(665, 105, 1, 1, True);
      Flag;
      Wait(500);
      MarkTime(TempTime);
      WriteLn('Starting with the Survival Expert');
      TalkToNpcByArrow('Survival Expert');
      HandleTalk;
      GameTab(4);
      ClickToContinue;
      Chop(2);
      Wait(500);
      MakeFire(1);
      GameTab(2);
      TalkToNpcByArrow('Survival Expert');
      HandleTalk;
      Fish(2);
      ClickToContinue;
      CookShrimp(2);
      WriteLn('Ended the Survival Expert');
      AddToReport(' Survival Expert took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
      WriteLn(' ');
    end;
    
    procedure MasterChef;
    var TempTime: LongInt;
    begin
      WriteLn('Starting with Master Chef');
      MarkTime(TempTime);
      WalkToMMArrow;
      OpenGateAt(1);
      WalkToMMArrow;
      OpenDoorAt(2);
      SetRun(False);
      TalkToNpcByArrow('Master Chef');
      HandleTalk;
      CookBread(1);
      Wait(1000);
      GameTab(13);
      Wait(1500);
      WriteLn('Ended Master Chef');
      AddToReport(' Master Chef took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
      WriteLn(' ');
    end;
    
    procedure QuestGuide;
    var TempTime: LongInt;
    begin
      WriteLn('Starting with the QuestGuide');
      MarkTime(TempTime);
      WalkToMMArrow;
      OpenDoorAt(3);
      Wait(1500);
      GameTab(13);
      DoEmote(Random(5) +1);
      Wait(1000);
      DoEmote(Random(5) +1);
      Wait(1000);
      GameTab(12);
      SetRun(True);
      Wait(1500);
      Mouse(650, 30, -1, -1, True);
      Wait(3000);
      Flag;
      Mouse(675, 30, 1, 1, True);
      Wait(3000);
      Flag;
      if not WalkToMMArrow then
      begin
        Mouse(630, 38, 1, 1, True);
        Wait(3000);
        Flag;
      end
      OpenDoorAt(4);
      TalkToNpcByArrow('Quest Guide');
      HandleTalk;
      GameTab(3);
      Wait(3000);
      TalkToNpcByArrow('Quest Guide');
      HandleTalk;
      ClimbDownLadder;
      WriteLn('Ended the QuestGuide');
      AddToReport(' QuestGuide took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
      WriteLn(' ');
    end;
    
    procedure MiningInstructor;
    var TempTime: LongInt;
    begin
      WriteLn('Starting with the Mining Instructor');
      MakeCompass('N');
      //SetRun(False);
      MarkTime(TempTime);
      TalkToNpcByArrow('Mining Instructor');
      HandleTalk;
      Prospect;
      TalkToNpcByArrow('Mining Instructor');
      HandleTalk;
      Mine(2);
      Smelt(1);
      TalkToNpcByArrow('Mining Instructor');
      HandleTalk;
      Smith(1);
      WalkToMMArrow;
      WriteLn('Ended the Mining Instructor');
      AddToReport(' Mining Instructor took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
      WriteLn(' ');
    end;
    
    procedure CombatInstructor;
    var TempTime: LongInt;
    begin
      WriteLn('Starting with the Combat Instructor');
      MarkTime(TempTime);
      OpenGateAt(2);
      TalkToNpcByArrow('Combat Instructor');
      HandleTalk;
      GameTab(5);
      Wait(1000);
      Mouse(650, 430, 2, 2, True);
      Wait(2000);
      Wield('Dagger');
      ClickToContinue;
      Wait(2000);
      Mouse(485, 39, 1, 1, True);
      TalkToNpcByArrow('Combat Instructor');
      HandleTalk;
      GameTab(5);
      Mouse(593, 301, 1, 1, False);
      ChooseOption(x, y, 'Remove');
      Wait(1500);
      GameTab(4);
      Wait(1000);
      Wield('Sword');
      Wait(1000);
      Wield('Shield');
      Wait(1000);
      GameTab(1);
      Wait(2000);
      WalkToMMArrow;
      OpenGateAt(3);
      Fight;
      WalkToGate;
      TalkToNpcByArrow('Combat Instructor');
      HandleTalk;
      GameTab(4);
      Wait(2000);
      Wield('Arrows');
      Wait(1000);
      Wield('Bow');
      Wait(2000);
      RangeRat;
      Mouse(660, 40, 1, 1, True);
      Wait(2000);
      Flag;
      ClimbUpLadder;
      WriteLn('Ended the Combat Instructor');
      AddToReport(' Combat Instructor took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
      WriteLn(' ');
    end;
    
    procedure Bank;
    var TempTime: LongInt;
    begin
      WriteLn('Starting with the Bank');
      MarkTime(TempTime);
      WalkToMMArrow;
      MyOpenBank;
      Wait(2000);
      ClickToContinue;
      Wait(1000);
      Mouse(261, 399, 2, 2, True);
      Wait(3000);
      CloseBank;
      WalkToMMArrow;
      OpenDoorAt(5);
      WriteLn('Ended the Bank');
      AddToReport(' Bank took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
      WriteLn(' ');
    end;
    
    procedure FinancialAdvisor;
    var TempTime: LongInt;
    begin
      WriteLn('Starting with the Financial Advisor');
      MarkTime(TempTime);
      TalkToNpcByArrow('Financial Advisor')
      HandleTalk;
      WalkToMMArrow;
      OpenDoorAt(6);
      Mouse(670, 125, 3, 3, True);
      Flag;
      WalkToMMArrow;
      MakeCompass('E');
      if FindObjEx(x, y, 'Open', MSX1, MSY1, MSX2, MSY2, 2189191, 10, 3, 3, 100, True) then
      begin
        Mouse(x, y, 1, 1, False);
        ChooseOption(x, y, 'Open');
        Flag;
        Wait(1000);
      end
      WriteLn('Ended the Financial Advisor');
      AddToReport(' Financial Advisor took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
      WriteLn(' ');
    end;
    
    procedure BrotherBrace;
    var TempTime: LongInt;
    begin
      WriteLn('Starting with Brother Brace');
      MarkTime(TempTime);
      TalkToNpcByArrow('Brother Brace');
      HandleTalk;
      GameTab(6);
      Wait(2000);
      MakeCompass('N');
      TalkToNpcByArrow('Brother Brace');
      HandleTalk;
      GameTab(8);
      Wait(3000);
      GameTab(9);
      Wait(3000);
      TalkToNpcByArrow('Brother Brace');
      HandleTalk;
      WalkToMMArrow;
      OpenDoorAt(7);
      MouseFindFlag(685, 118, 2, 2);
      Flag;
      WriteLn('Ended Brother Brace');
      AddToReport(' Brother Brace took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
      WriteLn(' ');
    end;
    
    procedure MagicInstructor;
    var TempTime: LongInt;
    begin
      WriteLn('Starting with the Magic Instructor');
      MarkTime(TempTime);
      TalkToNpcByArrow('Magic Instructor');
      HandleTalk;
      GameTab(7);
      Wait(3000);
      HandleTalk;
      CastStrikes;
      TalkToNpcByArrow('Magic Instructor');
      Wait(1000);
      ClickToContinue;
      Wait(1000);
      Mouse(257, 397, 2, 2, True);
      Wait(1000);
      HandleTalk;
      Wait(5000);
      ClickToContinue;
      WriteLn('Ended the Magic Instructor in '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec, that means...');
      AddToReport(' Magic Instructor took '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
      Wait(100);
      WriteLn('We made it!! =] Total Time was: '+ IntToStr(Round(MsToMin(TimeFromMark(TotalTime)))) +' mins.');
      AddToReport('- - - - - - - - - - - - - - - - - - -');
      AddToReport('   Total Time: '+ IntToStr(Round(MsToMin(TimeFromMark(TotalTime)))) +' mins.');
      AddToReport('- - - - - - - - - - - - - - - - - - -');
      LogOut;
    end;
    
    procedure Nielsie95;
    begin
      ChangeReportWidth(320);
      AddToReport('- - - - - - - - - - - - - - - - - - -');
      AddToReport('   Nielsie95 Tut Island Runner 0.33');
      AddToReport('- - - - - - - - - - - - - - - - - - -');
      WriteLn(' ______       ___                                  _________        ');
      Wait(100);
      WriteLn('|      \     |   |          ___                   /         \       ');
      Wait(100);
      WriteLn('|       \    |   |         |   |                  |    __   |       ');
      Wait(100);
      WriteLn('|   |\   \   |   |__       |   |                  |   {__}  |______ ');
      Wait(100);
      WriteLn('|   | \   \  |   |  |____  |   |     _____        |         | _____}');
      Wait(100);
      WriteLn('|   |  \   \ |   |  |__  \ |   |    /  ___}       \_____    | |     ');
      Wait(100);
      WriteLn('|   |   \   \|   |  |__\  \|   |   {  {___              |   | |____ ');
      Wait(100);
      WriteLn('|   |    \       |  |_____||   |___\_ __  \       ______|   |___   \');
      Wait(100);
      WriteLn('|   |     \      |  |_____ |         | __} }     /          |___}  |');
      Wait(100);
      WriteLn('|___| ___  \_____| _| ___/ |_________| ___/      \__________/______/');
      Wait(100);
      WriteLn('       |utorial Island Runner                \/ersion 0.33');
      WriteLn(' ');
    end;
    
    begin
      ClearDebug;
      ClearReport;
      SetupSRL;
      ActivateClient;
      BenMouse := False;
      MouseSpeed := 13;
      LoadBmps;
      Nielsie95;
      RuneScapeGuide;
      SurvivalExpert;
      MasterChef;
      QuestGuide;
      MiningInstructor;
      CombatInstructor;
      Bank;
      FinancialAdvisor;
      BrotherBrace;
      MagicInstructor;
    end.
    anyone think they can help me get this to work or is it a lost cause cuz it's too old?

  2. #2
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Its outdated.

  3. #3
    Join Date
    Apr 2008
    Location
    Montana
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    dang it, how outdated? is it fixable or scrap?

  4. #4
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    I do think its updateable.. Ask Nielse95
    or try by yourself

  5. #5
    Join Date
    Apr 2008
    Location
    Montana
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    well i have been trying by myself for the past half hour with no success, the real reason i wanted this tut runner is because "QuickPowerMiner by Timothegreat" is not working...

    I have my guy in SE Varrock mine by the iron, with pick unequipped, everything seems to be set up ok but i just can't figure it out, gonna edit and post the code i have in there.

    Code:
    program Powerminer;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\Skill\Mining.scar}
    
    ////////////////////////////////////////////////////////////
    //      [SRL4] QuickPowerMiner by Timothegreat            //
    //                                                        //
    //                   Version 3.0 Pro                      //
    //                                                        //
    //                     ------------                       //
    //                     Instructions                       //
    //                     ------------                       //
    //                                                        //
    // 1. Setup your players by the ore you want to mine      //
    // 2. Fill out lines 23-60                                //
    // 3. Hit the play button                                 //
    // 4. Enjoy!                                              //
    //                 Autoresponder by Me                    //
    //                Gas Detection by Wizzup                 //
    ////////////////////////////////////////////////////////////
    
    const
      SRLStatsID = '';  // SRL Stats ID Number
      SRLStatsPW = '';  // SRL Stats Password
      UseResponder = True; // Use autoresponder? (recommended)
      SleepMode = True; // sleep mode? (single player)
      SleepFor = 2; // minutes to sleep (add random 5 minutes to it)
      RunDir = 'N'; // direction to run if in fight
                    // N for north, S for south, etc.
                    
    Procedure DeclarePlayers;
    Begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      Players[0].Name :='*******'; //obviously my name would go here
      Players[0].Pass :='*******'; //obviously my pass would go here
      Players[0].Nick :='***'; //3-4 letters from name
      Players[0].Active:= True;
      Players[0].Booleans[1]:= True; // True if new rocks. False if old. (new rocks have veins)
      Players[0].Booleans[2]:= False; // Pick equipped?
      Players[0].Strings[1]:= 'Iron'; // type of ore
      Players[0].Integers[1]:= 3; // # of loads
    
      Players[1].Name :='';
      Players[1].Pass :='';
      Players[1].Nick :=''; //3-4 letters from name
      Players[1].Active:= True;
      Players[1].Booleans[1]:= True; // True if new rocks. False if old.
      Players[1].Booleans[2]:= False; // Pick equipped?
      Players[1].Strings[1]:= 'Iron'; // type of ore
      Players[1].Integers[1]:= 3; // # of loads
    
      Players[2].Name :='';
      Players[2].Pass :='';
      Players[2].Nick :=''; //3-4 letters from name
      Players[2].Active:= True;
      Players[2].Booleans[1]:= True; // True if new rocks. False if old.
      Players[2].Booleans[2]:= False; // Pick equipped?
      Players[2].Strings[1]:= 'Iron'; // type of ore
      Players[2].Integers[1]:= 3; // # of loads
    
      Players[3].Name :='';
      Players[3].Pass :='';
      Players[3].Nick :=''; //3-4 letters from name
      Players[3].Active:= True;
      Players[3].Booleans[1]:= True; // True if new rocks. False if old.
      Players[3].Booleans[2]:= False; // Pick equipped?
      Players[3].Strings[1]:= 'Iron'; // type of ore
      Players[3].Integers[1]:= 3; // # of loads
    
    End;
    
    {---------------------DO NOT TOUCH BELOW THIS---------------------------}
    
    const
      oldclay = 5212840;
      oldcopper = 4483472;
      oldtin = 8553100;
      oldiron = 2437455;
      oldgold = 2081517;
      oldcoal = 2636603;
      oldmith = 6636869;
      oldaddy = 5202510;
    
      newclay = 5212840;
      newcopper = 5010848; //
      newtin = 7829376; //
      newiron = 3030370; //
      newgold = 2081517; // from rimmington
      newcoal = 2636603;
      newmith = 6636869;
      newaddy = 5202510;
    
    var
      x,y,cx,cy,orecolor,TLoads,Gasses,attempts,tol,levels,BrokenPicks,tempcolor,
      loads,ores,RespondedTimes:integer;
      done:boolean;
      Mincount:byte;
    
    procedure SetupScript;
    begin
      if (Players[CurrentPlayer].Booleans[1])then
      begin
        Mincount:= 1;
        tol:= 5;
        case lowercase(Players[CurrentPlayer].Strings[1]) of
          'clay'    : orecolor:= newclay;
          'copper'  : orecolor:= newcopper;
          'tin'     : orecolor:= newtin;
          'iron'    : orecolor:= newiron;
          'coal'    : orecolor:= newcoal;
          'mithril' : orecolor:= newmith;
          'mith'    : orecolor:= newmith;
          'adamant' : orecolor:= newaddy;
          'addy'    : orecolor:= newaddy;
        end;
      end else
      begin
        Mincount:= 4;
        tol:= 5;
        case lowercase(Players[CurrentPlayer].Strings[1]) of
          'clay'    : orecolor:= oldclay;
          'copper'  : orecolor:= oldcopper;
          'tin'     : orecolor:= oldtin;
          'iron'    : orecolor:= oldiron;
          'coal'    : orecolor:= oldcoal;
          'mithril' : orecolor:= oldmith;
          'mith'    : orecolor:= oldmith;
          'adamant' : orecolor:= oldaddy;
          'addy'    : orecolor:= oldaddy;
        end;
      end;
    end;
    
    var
      thechat,talkername,ZeText:string;
      GoodBye,YourName,General,Greetings,Crafting,Mining,Macroes:Array [0..10] of string;
      Funnies,Questions,Totals,Highest: Array [0..10] of String;
      ResponseTime: LongInt;
    
    {*******************************************************************************
    function DetermineHighest: String;
    By: Timothegreat
    Description: Determines your character's highest skill
    
    *******************************************************************************}
    
    function DetermineHighest: string;
    var
      h,i,skill: integer;
    begin
      for h:= 1 to 99 do
      begin
        for i:= 1 to 21 do
        begin
          if (Players[CurrentPlayer].level[i] >= h) then
          begin
            skill:= i;
          end;
        end;
      end;
      case skill of
        1 : result:= 'attack';
        2 : result:= 'strength';
        3 : result:= 'defence';
        4 : result:= 'range';
        5 : result:= 'prayer';
        6 : result:= 'magic';
        7 : result:= 'runecrafting';
        8 : result:= 'hitpoints';
        9 : result:= 'agility';
        10 : result:= 'herblore';
        11 : result:= 'thieving';
        12 : result:= 'crafting';
        13 : result:= 'fletching';
        14 : result:= 'slayer';
        15 : result:= 'mining';
        16 : result:= 'smithing';
        17 : result:= 'fishing';
        18 : result:= 'cooking';
        19 : result:= 'firemaking';
        20 : result:= 'woodcutting';
        21 : result:= 'farming';
      end;
    end;
    
    {*******************************************************************************
    function DetermineTotal: String;
    By: Timothegreat
    Description: Determines your character's total lvl
    
    *******************************************************************************}
    
    function DetermineTotal: string;
    var
      i,total: integer;
    begin
      for i:= 1 to 21 do
      begin
        Total:= Total + Players[CurrentPlayer].Level[i];
      end;
      result:= inttostr(Total+3);
    end;
    
    procedure SetupArrays;
    begin
      Greetings[0]:= 'Hi';
      Greetings[1]:= 'Hello';
      Greetings[2]:= 'Sup';
      Greetings[3]:= 'yo';
      Greetings[4]:= 'good day';
      Greetings[5]:= 'homey';
      Greetings[6]:= 'homeslice';//
      Greetings[7]:= 'ello';
      Greetings[8]:= 'Sup';
      Greetings[9]:= 'Hi';
      Greetings[10]:= 'Hey';
    
      Questions[0]:= 'ok i guess...you?';
      Questions[1]:= 'great';
      Questions[2]:= 'good';
      Questions[3]:= 'ok, u';
      Questions[4]:= 'fine';
      Questions[5]:= 'umm..ok';
      Questions[6]:= 'awesome';
      Questions[7]:= 'How are you';
      Questions[8]:= 'ow are u';
      Questions[9]:= 'ow r u';
      Questions[10]:= 'ow are you doing';
    
      General[0]:= 'idk';
      General[1]:= 'i dont know';
      General[2]:= 'wow..';
      General[3]:= 'hmmmmmmmmmmmmm';
      General[4]:= 'im black';
      General[5]:= 'poo';
      General[6]:= 'im captain underpants';
      General[7]:= 'Who';
      General[8]:= 'What';
      General[9]:= 'How';
      General[10]:= 'Why';
    
      Macroes[0]:= 'what the hell?';
      Macroes[1]:= 'omfg im not an autoer';
      Macroes[2]:= 'whatcha talkin bout willis';
      Macroes[3]:= 'bots are gone';
      Macroes[4]:= 'there arent bots anymore';
      Macroes[5]:= 'stupid potty bots';
      Macroes[6]:= 'il creampie some of these bots';
      Macroes[7]:= 'utoer';
      Macroes[8]:= 'bot';
      Macroes[9]:= 'acroer';
      Macroes[10]:= 'utoing';
    
      Funnies[0]:= 'lol';
      Funnies[1]:= 'rofl';
      Funnies[2]:= 'roflcopter';
      Funnies[3]:= 'lmao';
      Funnies[4]:= 'lmfao';
      Funnies[5]:= 'pwnt?';
      Funnies[6]:= 'wtf';
      Funnies[7]:= 'lol';
      Funnies[8]:= 'rofl';
      Funnies[9]:= 'lmao';
      Funnies[10]:= 'haha';
    
      YourName[0]:= 'ya?';
      YourName[1]:= 'what?';
      YourName[2]:= 'what you want?';
      YourName[3]:= 'yep?';
      YourName[4]:= '......?';
      YourName[5]:= 'im chuck norris';
      YourName[6]:= 'byah! rick james';
      YourName[7]:= Players[CurrentPlayer].Name;
      YourName[8]:= Players[CurrentPlayer].Nick;
      YourName[9]:= Players[CurrentPlayer].Name;
      YourName[10]:= Players[CurrentPlayer].Nick;
    
      GoodBye[0]:= 'later man';
      GoodBye[1]:= 'bye dude';
      GoodBye[2]:= 'cya later man';
      GoodBye[3]:= 'cya dude';
      GoodBye[4]:= 'k later';
      GoodBye[5]:= 'bye man';
      GoodBye[6]:= 'i love you';
      GoodBye[7]:= 'gtg';
      GoodBye[8]:= 'bye';
      GoodBye[9]:= 'brb';
      GoodBye[10]:= 'cya';
    
      Crafting[0]:= 'mine is '+inttostr(Players[CurrentPlayer].level[12]);
      Crafting[1]:= inttostr(Players[CurrentPlayer].level[12])+' you';
      Crafting[2]:= inttostr(Players[CurrentPlayer].level[12]);
      Crafting[3]:= 'almost '+inttostr(Players[CurrentPlayer].level[12]+1);
      Crafting[4]:= 'im almost'+inttostr(Players[CurrentPlayer].level[12]+1);
      Crafting[5]:= 'poopy only '+inttostr(Players[CurrentPlayer].level[12]);
      Crafting[6]:= 'okey im '+inttostr(Players[CurrentPlayer].level[12]);
      Crafting[7]:= 'crafting lvl';
      Crafting[8]:= 'crafting level';
      Crafting[9]:= 'craft lvl';
      Crafting[10]:= 'craft level';
    
      Mining[0]:= 'mine is '+inttostr(Players[CurrentPlayer].level[15]);
      Mining[1]:= inttostr(Players[CurrentPlayer].level[15])+' you';
      Mining[2]:= inttostr(Players[CurrentPlayer].level[15]);
      Mining[3]:= 'almost '+inttostr(Players[CurrentPlayer].level[15]+1);
      Mining[4]:= 'im almost'+inttostr(Players[CurrentPlayer].level[15]+1);
      Mining[5]:= 'poopy only '+inttostr(Players[CurrentPlayer].level[15]);
      Mining[6]:= 'okey im '+inttostr(Players[CurrentPlayer].level[15]);
      Mining[7]:= 'mining lvl';
      Mining[8]:= 'mine lvl'
      Mining[9]:= 'minin lev';
      Mining[10]:= 'mining level';
      
      Highest[0]:= 'mine is '+DetermineHighest;
      Highest[1]:= DetermineHighest+' you';
      Highest[2]:= DetermineHighest;
      Highest[3]:= DetermineHighest+' i guess';
      Highest[4]:= 'mines '+DetermineHighest;
      Highest[5]:= DetermineHighest;
      Highest[6]:= 'mines '+DetermineHighest+' u?';
      Highest[7]:= 'high lvl';
      Highest[8]:= 'biggest lvl'
      Highest[9]:= 'highest lvl';
      Highest[10]:= 'highest lev';
    
      Totals[0]:= 'mine is '+DetermineTotal;
      Totals[1]:= DetermineTotal+' you';
      Totals[2]:= DetermineTotal;
      Totals[3]:= DetermineTotal+' i guess';
      Totals[4]:= 'mines '+DetermineTotal;
      Totals[5]:= DetermineTotal;
      Totals[6]:= 'mines '+DetermineTotal+' u?';
      Totals[7]:= 'total lvl';
      Totals[8]:= 'totals lvl'
      Totals[9]:= 'total lev';
      Totals[10]:= 'totals lev';
    
    end;
    
    function TheLastChat: Boolean;
    var
      i: Integer;
      textP: TPoint;
    begin
      textP := TextCoords(8);
      talkername := LowerCase(Trim(GetTextAtEx(textP.x - 2, textP.y - 2, 0, SmallChars, False, False, 0, 1,
        0, 60, False, tr_allChars)))
      i := Pos(':', talkername)
      talkername:= ':'+talkername;
      talkername:=Between(':',':',talkername);
      if not(talkername = '') then
      begin
        Result := True;
      end;
    end;
    
    function CheckLastChatText(thetext:string): Boolean;
    var
      x, y: Integer;
      textP: TPoint;
    begin
      textP := TextCoords(8);
      if findcolor(x, y, 16711680, textp.x, textp.y, textp.x + 200, textp.y + 14) then
      begin
        thechat := LowerCase(Trim(GetTextAtEx(x - 3, textp.y - 2, 0, SmallChars, False,
          False, -1, 1, 16711680, 60, False, tr_allChars)));
        if (pos(thetext,thechat) <> 0) then
          Result := True;
        try
        if (pos(thetext,Capitalize(thechat)) <> 0) then
          Result := True;
        except
          writeln('stupid chat');
        end;
        try
        if (pos(Capitalize(thetext),Capitalize(thechat)) <> 0)then
          Result := True;
        except
          writeln('stupid chat');
        end;
      end;
    end;
    
    function Respondit(TheType:Array of String):boolean;
    var
      i,Response:integer;
    begin
      if not TheLastchat then exit;
      if (Capitalize(talkername) = Capitalize(Players[CurrentPlayer].Name))then exit;
      for i:= 7 to 10 do
      begin
        ZeText:= TheType[i];
        if CheckLastChatText(ZeText)then
        begin
          Response:= random(7);
          wait(random(500));
          TypeSend(TheType[Response]);
          RespondedTimes:= RespondedTimes + 1;
          ReportVars[3]:= ReportVars[3] + 1;
          SendSRLReport;
          SRLRandomsReport;
          Result:=true;
        end;
      end;
    end;
    
    function RespondAll:boolean;
    begin
      SetupArrays;
      result:= false;
      if (TimeFromMark(ResponseTime) < RandomRange(5000,7500))then exit;
      result:= RespondIt(Highest);
      if result then
      begin
        MarkTime(ResponseTime);
        exit;
      end;
      result:= RespondIt(Totals);
      if result then
      begin
        MarkTime(ResponseTime);
        exit;
      end;
      result:= RespondIt(Greetings);
      if result then
      begin
        MarkTime(ResponseTime);
        exit;
      end;
      if result then exit;
      case random(4)of
        0: result:= RespondIt(Funnies);
        1: wait(1);
        2: wait(1);
      end;
      if result then
      begin
        MarkTime(ResponseTime);
      end;
      if result then exit;
      result:= RespondIt(Crafting);
      if result then
      begin
        MarkTime(ResponseTime);
      end;
      if result then exit;
      result:= RespondIt(Mining);
      if result then
      begin
        MarkTime(ResponseTime);
      end;
      if result then exit;
      result:= RespondIt(Questions);
      if result then
      begin
        MarkTime(ResponseTime);
      end;
      if result then exit;
      result:= RespondIt(YourName);
      if result then
      begin
        MarkTime(ResponseTime);
      end;
      if result then exit;
      result:= RespondIt(Goodbye);
      if result then
      begin
        MarkTime(ResponseTime);
      end;
      if result then exit;
      result:= RespondIt(Macroes);
      if result then
      begin
        MarkTime(ResponseTime);
      end;
    end;
    
    var Mx, My, Ux, Uy : integer;
    MyTPoint1, MyTPoint2: TPoint;
    
    function PointOnCubicBezier(cp: TPointArray; t: Extended): TPoint;
    var
      ax, ay, bx, by, cx, cy,
      tSquared, tCubed, Curve: Extended;
    begin
      Curve:= 3.0; //average curve.
      cx := Curve * (cp[1].x - cp[0].x);
      bx := Curve * (cp[2].x - cp[1].x) - cx;
      ax := cp[3].x - cp[0].x - cx - bx;
    
      cy := Curve * (cp[1].y - cp[0].y);
      by := Curve * (cp[2].y - cp[1].y) - cy;
      ay := cp[3].y - cp[0].y - cy - by;
    
      tSquared := t * t;
      tCubed := tSquared * t;
    
      result.x := Round((ax * tCubed) + (bx * tSquared) + (cx * t) + cp[0].x);
      result.y := Round((ay * tCubed) + (by * tSquared) + (cy * t) + cp[0].y);
    end;
    
    
    function Spline(ex, ey: integer; CTRLP1, CTRLP2: TPoint): TPointArray;
    var
        theta, theta_Inc: extended;     sx, sy: integer;
        Dist: integer;
        CtrlPoints: Array [1..4] of TPoint; //Added, Control Points array.
    begin
      GetMousePos(sx, sy);
      Dist:= Distance(sx, sy, ex, ey);
      CtrlPoints[1]:= Point(sx, sy);
      CtrlPoints[2]:= CtrlP1;
      CtrlPoints[3]:= CtrlP2;
      CtrlPoints[4]:= Point(ex, ey);
      theta_inc:= 1.0 div Dist;
      theta:= 0.0;
      repeat
        theta_Inc:= MinE(1.0 - theta, theta_Inc); //This is the line to stop theta over 1.0
        theta:= theta + theta_Inc;
        SetLength(Result,Length(Result)+1);
        Result[High(result)]:= PointOnCubicBezier(ctrlpoints, theta);
      until(Theta >= 1.0);
      result[High(result)]:= Point(ex, ey); //This is a failsafe. High = Length - 1.
    end;
    
    procedure TimoMouse(x, y, rx, ry: integer; left, justmove:boolean);
    var
      P: TPointArray;
      I, tempx, tempy, b, c: integer;
    begin
      GetMousePos(mx,my);
      x:= x+random(rx);
      y:= y+random(ry);
      ux:=x;
      uy:=y;
      tempy:= my + y;
      tempx:= mx + x;
      if (mx > x) then
      begin
        if (my > y) then
        begin
          MyTPoint1.y:= tempy/2;
          MyTPoint1.x:= tempx/2;
          MyTPoint2.y:= tempy/3;
          MyTPoint2.x:= tempx/3;
        end else
        begin
          MyTPoint1.y:= tempy/3;
          MyTPoint1.x:= tempx/2;
          MyTPoint2.y:= tempy/2;
          MyTPoint2.x:= tempx/3;
        end;
      end else
      begin
        if (my > y) then
        begin
          MyTPoint1.y:= tempy/2;
          MyTPoint1.x:= tempx/3;
          MyTPoint2.y:= tempy/3;
          MyTPoint2.x:= tempx/2;
        end else
        begin
          MyTPoint1.y:= tempy/3;
          MyTPoint1.x:= tempx/3;
          MyTPoint2.y:= tempy/2;
          MyTPoint2.x:= tempx/2;
        end;
      end;
      P:= Spline(x, y, MyTPoint1, MyTPoint2);
      for i:= 0 to High(P) do
      begin
        MoveMouse(P[i].x, P[i].y);
        wait(randomrange(0, 2));
      end;
      if justmove then exit;
      Wait(60 + Random(30));
      GetMousePos(b, c);
      HoldMouse(b + 1, c, left);
      repeat
        Wait(20 + Random(30));
        I := I + 1;
      until (I > 4);
      GetMousePos(b, c);
      ReleaseMouse(b, c, left);
      Wait(100 + Random(100));
    end;
    
    procedure setchats;
    begin
      if not(LoggedIn)then exit;
      if not findcolortolerance(x,y,65280,138,490,155,499,2)then
      begin
        TimoMouse(x,y,2,2,false,false);
        ChooseOption('On');
      end;
    end;
    
    function GetMessage:string;
    
    begin
      Result := Trim(GetTextAtEx(30, 443 , 0, SmallChars, False,
      False, 0, 1, 0, 80, False, tr_AllChars));
    end;
    
    function GetMessage2:string;
    
    begin
      Result := Trim(GetTextAtEx(30, 429 , 0, SmallChars, False,
      False, 0, 1, 0, 80, False, tr_AllChars));
    end;
    
    function WhichLevel:string;
    Var TheLevel:string;
    begin
      if FindColor(x, y, 8388608, 14, 372, 495, 389) then
      begin
        TheLevel := GetTextAtEx(x + 4, y - 1, 0, NPCChars, false, false, 0, 2, 8388608, 60, false, tr_AllChars)
        Result := Trim(Between('ced a','evel',TheLevel))
      end;
    end;
    
    
    Function Level:boolean;
    begin
      Result:=FindColor(x, y, 8388608, 14, 372, 495, 389)
      if (result) then
      begin
        WriteLn('******** Advanced A '+WhichLevel+' Level ********');
        WriteFileString(TheFile, '******** Advanced A '+WhichLevel+' Level ********'
        + Chr(13))
        clicktocontinue;
        wait(2000)
        clicktocontinue;
        levels:=levels+1;
      end;
    end;
    
    procedure Dropit(slot1,slot2: integer);
    var
      i,beginslot,endslot: integer;
      DropPoint: Array [0..27] of TPoint;
    begin
      DropPoint[0]:= inttopoint(579,230);
      DropPoint[1]:= inttopoint(621,230);
      DropPoint[2]:= inttopoint(663,230);
      DropPoint[3]:= inttopoint(703,230);
      DropPoint[4]:= inttopoint(579,266);
      DropPoint[5]:= inttopoint(621,266);
      DropPoint[6]:= inttopoint(663,266);
      DropPoint[7]:= inttopoint(703,266);
      DropPoint[8]:= inttopoint(579,303);
      DropPoint[9]:= inttopoint(621,303);
      DropPoint[10]:= inttopoint(663,303);
      DropPoint[11]:= inttopoint(703,303);
      DropPoint[12]:= inttopoint(579,339);
      DropPoint[13]:= inttopoint(621,339);
      DropPoint[14]:= inttopoint(663, 336);
      DropPoint[15]:= inttopoint(705, 337);
      DropPoint[16]:= inttopoint(578, 371);
      DropPoint[17]:= inttopoint(620, 372);
      DropPoint[18]:= inttopoint(663, 372);
      DropPoint[19]:= inttopoint(704, 372);
      DropPoint[20]:= inttopoint(579, 407);
      DropPoint[21]:= inttopoint(621, 406);
      DropPoint[22]:= inttopoint(663, 407);
      DropPoint[23]:= inttopoint(706, 407);
      DropPoint[24]:= inttopoint(579, 444);
      DropPoint[25]:= inttopoint(620, 444);
      DropPoint[26]:= inttopoint(662, 443);
      DropPoint[27]:= inttopoint(705, 442);
      beginslot:= slot1 - 1;
      endslot:= slot2 - 1;
      for i:= beginslot to endslot do
      begin
        Mouse(DropPoint[i].X,DropPoint[i].Y,6,6,false);
        wait(random(10));
        ChooseOption('Drop');
        wait(random(100));
      end;
    end;
    
    Function w_WizzupGas(cx,cy: integer): Boolean;
    
    Var
       CTS, I, Le, T, Time: Integer;
       P, P2: TPointArray;
       C, C2: TIntegerArray;
       R, G, B: Integer;
       H, S, L: Extended;
       X, Y, Z: Extended;
       GP: TPoint;
    
    Begin
      Result := False;
    
      Time := GetSystemTime;
    
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.16, 0.46);
      GP.X := cx;
      GP.Y := cy;
      GP.Y := GP.Y - 20;
      FindColorsTolerance(P, 9083807, GP.x - 25, GP.y - 25, GP.X + 25, GP.Y + 25, 15);
      ColorToleranceSpeed(CTS);
      SetColorSpeed2Modifiers(0.2, 0.2);
    
      If Length(P) < 60 Then
        Exit;
    
      C := GetColors(P);
      C2 := C;
      ClearSameIntegers(C);
    
    
      If Length(C) < 40 Then // Maybe lower the value.
      //If Length(C) < 60 Then
      Begin
        Exit;
      End;
    
      WriteLn('Passed Color Diversity: ' + IntToStr(Length(C)));
      Writeln('Total colors found: ' + IntToStr(Length(P)));
    
      SetLength(C, 0);
      SetLength(C, Length(C2));
      SetLength(P2, Length(P));
    
      Le := High(C2);
    
      For I := 0 To Le Do
      Begin
        ColorToRGB(C2[i], R, G, B);
        //If ((R - G) <= 6) And (G - B > 7) Then
        If ((R - G) <= 10) And (G - B > 7) Then
        Begin
          ColorToHSL(C2[i], H, S, L);
          If (H > 11.5) And (H < 16.0) And (S < 16.0) And (S > 2.0) And (L > 42.0) And (L < 71.0) Then
          Begin
            ColorToXYZ(C2[i], X, Y, Z);
            If (X >= 18.0) And (X <= 45.0) And (Y >= 20.0)
                           And (Y <= 48.0) And (Z >= 15.0)
                           And (Z <= 47.0) And (Abs(X - Y) < 3.0)
                           And (Abs(X - Z) < 5.0) And (Abs(Y - Z) < 6.5)
                            Then
            Begin
              C[T] := C2[i];
              P2[T] := P[i];
              T := T + 1;
            End;
          End;
        End;
      End;
      SetLength(C, T);
    
      ClearSameIntegers(C);
    
      If Length(C) < 25 Then
      Begin
        Exit;
      End;
      WriteLn('Passed Color Diversity after filtering the colors: ' + IntToStr(Length(C)));
      Writeln('Total colors found, after filtering: ' + IntToStr(Length(P2)));
    
    
      Result := True;
      WriteLn('Gas Gave TRUE');
      writeln('Time taken: ' + IntToStr(GetSystemTime - Time));
    End;
    
    Function MKFindGas:boolean; // By MasterKill
    begin
      if not LoggedIn then Exit;
      if (FindColorTolerance (x, y, 10596274, 0, 0, 500, 500, 1))
      or (FindColorTolerance (x, y, 8950933, 0, 0, 500, 500, 1))
      or (FindColorTolerance (x, y, 9017755, 0, 0, 500, 500, 1))
      or (FindColorTolerance (x, y, 7900302, 0, 0, 500, 500, 1)) then result:= true;
    end;
    
    function noore:boolean;
    begin
      result:= (pos('no ore',GetMessage)<>0)
    end;
    
    function manage:boolean;
    begin
      result:= (pos('manage',GetMessage)<>0)
    end;
    
    function swing:boolean;
    begin
      if(pos('swing',GetMessage)<>0)then
      begin
        result:=true;
      end else
      begin
        if(pos('swing',GetMessage2)<>0)then
        begin
          if not(Manage)then
          begin
            if not(NoOre)then
            begin
              result:=true;
            end;
          end;
        end else
        begin
          result:=false;
        end;
      end
    end;
    
    function higherlvlrock:boolean;
    begin
      case lowercase(Players[CurrentPlayer].Strings[1]) of
        'clay'    : result:= false;
        'copper'  : result:= false;
        'tin'     : result:= false;
        'iron'    : result:= false;
        'coal'    : result:= true;
        'mithril' : result:= true;
        'mith'    : result:= true;
        'adamant' : result:= true;
        'addy'    : result:= true;
      end;
    end;
    
    function RunePick:integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 224;
      dtmMainPoint.y := 272;
      dtmMainPoint.AreaSize := 4;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 5984829;
      dtmMainPoint.Tolerance := 15;
    
      dtmSubPoints[0].x := 213;
      dtmSubPoints[0].y := 297;
      dtmSubPoints[0].AreaSize := 0;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 65536;
      dtmSubPoints[0].Tolerance := 0;
    
      dtmSubPoints[1].x := 214;
      dtmSubPoints[1].y := 297;
      dtmSubPoints[1].AreaSize := 0;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 65536;
      dtmSubPoints[1].Tolerance := 0;
    
      dtmSubPoints[2].x := 220;
      dtmSubPoints[2].y := 275;
      dtmSubPoints[2].AreaSize := 0;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := 65536;
      dtmSubPoints[2].Tolerance := 0;
    
      dtmSubPoints[3].x := 237;
      dtmSubPoints[3].y := 280;
      dtmSubPoints[3].AreaSize := 0;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := 65536;
      dtmSubPoints[3].Tolerance := 0;
    
      dtmSubPoints[4].x := 209;
      dtmSubPoints[4].y := 274;
      dtmSubPoints[4].AreaSize := 0;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := 65536;
      dtmSubPoints[4].Tolerance := 0;
    
      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
    
      Result := AddDTM(TempTDTM);
    end;
    
    function AddyPick:integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 225;
      dtmMainPoint.y := 272;
      dtmMainPoint.AreaSize := 4;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 4149311;
      dtmMainPoint.Tolerance := 15;
    
      dtmSubPoints[0].x := 213;
      dtmSubPoints[0].y := 297;
      dtmSubPoints[0].AreaSize := 0;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 65536;
      dtmSubPoints[0].Tolerance := 0;
    
      dtmSubPoints[1].x := 214;
      dtmSubPoints[1].y := 297;
      dtmSubPoints[1].AreaSize := 0;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 65536;
      dtmSubPoints[1].Tolerance := 0;
    
      dtmSubPoints[2].x := 220;
      dtmSubPoints[2].y := 275;
      dtmSubPoints[2].AreaSize := 0;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := 65536;
      dtmSubPoints[2].Tolerance := 0;
    
      dtmSubPoints[3].x := 237;
      dtmSubPoints[3].y := 280;
      dtmSubPoints[3].AreaSize := 0;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := 65536;
      dtmSubPoints[3].Tolerance := 0;
    
      dtmSubPoints[4].x := 209;
      dtmSubPoints[4].y := 274;
      dtmSubPoints[4].AreaSize := 0;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := 65536;
      dtmSubPoints[4].Tolerance := 0;
    
      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
    
      Result := AddDTM(TempTDTM);
    end;
    
    function MithPick:integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 225;
      dtmMainPoint.y := 272;
      dtmMainPoint.AreaSize := 4;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 5782587;
      dtmMainPoint.Tolerance := 15;
    
      dtmSubPoints[0].x := 213;
      dtmSubPoints[0].y := 297;
      dtmSubPoints[0].AreaSize := 0;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 65536;
      dtmSubPoints[0].Tolerance := 0;
    
      dtmSubPoints[1].x := 214;
      dtmSubPoints[1].y := 297;
      dtmSubPoints[1].AreaSize := 0;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 65536;
      dtmSubPoints[1].Tolerance := 0;
    
      dtmSubPoints[2].x := 220;
      dtmSubPoints[2].y := 275;
      dtmSubPoints[2].AreaSize := 0;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := 65536;
      dtmSubPoints[2].Tolerance := 0;
    
      dtmSubPoints[3].x := 237;
      dtmSubPoints[3].y := 280;
      dtmSubPoints[3].AreaSize := 0;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := 65536;
      dtmSubPoints[3].Tolerance := 0;
    
      dtmSubPoints[4].x := 209;
      dtmSubPoints[4].y := 274;
      dtmSubPoints[4].AreaSize := 0;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := 65536;
      dtmSubPoints[4].Tolerance := 0;
    
      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
    
      Result := AddDTM(TempTDTM);
    end;
    
    function SteelPick:integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 225;
      dtmMainPoint.y := 272;
      dtmMainPoint.AreaSize := 4;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 7040116;
      dtmMainPoint.Tolerance := 15;
    
      dtmSubPoints[0].x := 213;
      dtmSubPoints[0].y := 297;
      dtmSubPoints[0].AreaSize := 0;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 65536;
      dtmSubPoints[0].Tolerance := 0;
    
      dtmSubPoints[1].x := 214;
      dtmSubPoints[1].y := 297;
      dtmSubPoints[1].AreaSize := 0;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 65536;
      dtmSubPoints[1].Tolerance := 0;
    
      dtmSubPoints[2].x := 220;
      dtmSubPoints[2].y := 275;
      dtmSubPoints[2].AreaSize := 0;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := 65536;
      dtmSubPoints[2].Tolerance := 0;
    
      dtmSubPoints[3].x := 237;
      dtmSubPoints[3].y := 280;
      dtmSubPoints[3].AreaSize := 0;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := 65536;
      dtmSubPoints[3].Tolerance := 0;
    
      dtmSubPoints[4].x := 209;
      dtmSubPoints[4].y := 274;
      dtmSubPoints[4].AreaSize := 0;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := 65536;
      dtmSubPoints[4].Tolerance := 0;
    
      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
    
      Result := AddDTM(TempTDTM);
    end;
    
    function IronPick:integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 224;
      dtmMainPoint.y := 272;
      dtmMainPoint.AreaSize := 4;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 4671565;
      dtmMainPoint.Tolerance := 15;
    
      dtmSubPoints[0].x := 213;
      dtmSubPoints[0].y := 297;
      dtmSubPoints[0].AreaSize := 0;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 65536;
      dtmSubPoints[0].Tolerance := 0;
    
      dtmSubPoints[1].x := 214;
      dtmSubPoints[1].y := 297;
      dtmSubPoints[1].AreaSize := 0;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 65536;
      dtmSubPoints[1].Tolerance := 0;
    
      dtmSubPoints[2].x := 220;
      dtmSubPoints[2].y := 275;
      dtmSubPoints[2].AreaSize := 0;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := 65536;
      dtmSubPoints[2].Tolerance := 0;
    
      dtmSubPoints[3].x := 237;
      dtmSubPoints[3].y := 280;
      dtmSubPoints[3].AreaSize := 0;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := 65536;
      dtmSubPoints[3].Tolerance := 0;
    
      dtmSubPoints[4].x := 209;
      dtmSubPoints[4].y := 274;
      dtmSubPoints[4].AreaSize := 0;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := 65536;
      dtmSubPoints[4].Tolerance := 0;
    
      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
    
      Result := AddDTM(TempTDTM);
    end;
    
    function BronzePick:integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 225;
      dtmMainPoint.y := 272;
      dtmMainPoint.AreaSize := 4;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 2243147;
      dtmMainPoint.Tolerance := 15;
    
      dtmSubPoints[0].x := 213;
      dtmSubPoints[0].y := 297;
      dtmSubPoints[0].AreaSize := 0;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 65536;
      dtmSubPoints[0].Tolerance := 0;
    
      dtmSubPoints[1].x := 214;
      dtmSubPoints[1].y := 297;
      dtmSubPoints[1].AreaSize := 0;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 65536;
      dtmSubPoints[1].Tolerance := 0;
    
      dtmSubPoints[2].x := 220;
      dtmSubPoints[2].y := 275;
      dtmSubPoints[2].AreaSize := 0;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := 65536;
      dtmSubPoints[2].Tolerance := 0;
    
      dtmSubPoints[3].x := 237;
      dtmSubPoints[3].y := 280;
      dtmSubPoints[3].AreaSize := 0;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := 65536;
      dtmSubPoints[3].Tolerance := 0;
    
      dtmSubPoints[4].x := 209;
      dtmSubPoints[4].y := 274;
      dtmSubPoints[4].AreaSize := 0;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := 65536;
      dtmSubPoints[4].Tolerance := 0;
    
      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
    
      Result := AddDTM(TempTDTM);
    end;
    
    function PickHandle:integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 829;
      dtmMainPoint.y := 650;
      dtmMainPoint.AreaSize := 4;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 335662;
      dtmMainPoint.Tolerance := 15;
    
      dtmSubPoints[0].x := 834;
      dtmSubPoints[0].y := 639;
      dtmSubPoints[0].AreaSize := 0;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 65536;
      dtmSubPoints[0].Tolerance := 0;
    
      dtmSubPoints[1].x := 824;
      dtmSubPoints[1].y := 664;
      dtmSubPoints[1].AreaSize := 0;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 65536;
      dtmSubPoints[1].Tolerance := 0;
    
      dtmSubPoints[2].x := 823;
      dtmSubPoints[2].y := 664;
      dtmSubPoints[2].AreaSize := 0;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := 65536;
      dtmSubPoints[2].Tolerance := 0;
    
      dtmSubPoints[3].x := 835;
      dtmSubPoints[3].y := 644;
      dtmSubPoints[3].AreaSize := 0;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := 65536;
      dtmSubPoints[3].Tolerance := 0;
    
      dtmSubPoints[4].x := 831;
      dtmSubPoints[4].y := 641;
      dtmSubPoints[4].AreaSize := 0;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := 65536;
      dtmSubPoints[4].Tolerance := 0;
    
      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
    
      Result := AddDTM(TempTDTM);
    end;
    
    function FindLostPick:boolean; forward;
    
    function FindPickaxe(Equip:boolean):boolean;
    var
      i: Integer;
      PickDTM,PickColor: Array[0..5] of Integer;
      Pick: Array[0..5] of String;
    begin
      if not LoggedIn then exit;
      PickDTM[0]:= RunePick;
      Pick[0]:= 'Rune';
      PickColor[0]:= 5984829;
      PickDTM[1]:= AddyPick;
      Pick[1]:= 'Addy';
      PickColor[1]:= 4149311;
      PickDTM[2]:= MithPick;
      Pick[2]:= 'Mith';
      PickColor[2]:= 6176831;
      PickDTM[3]:= SteelPick;
      Pick[3]:= 'Steel';
      PickColor[3]:= 7697790;
      PickDTM[4]:= IronPick;
      Pick[4]:= 'Iron';
      PickColor[4]:= 4342343;
      PickDTM[5]:= BronzePick;
      Pick[5]:= 'Bronze';
      PickColor[5]:= 1979202;
      if Players[CurrentPlayer].Booleans[2]then
      begin
        GameTab(5)
      end else
      begin
        GameTab(4);
      end;
      for i:= 0 to 5 do
      begin
        if FindDTM(PickDTM[i],x,y,MIX1,MIY1,MIX2,MIY2)then
        begin
          if Equip then
          begin
            Mouse(x,y,4,4,true);
            wait(500+random(500));
          end;
          Players[CurrentPlayer].Strings[0]:= Pick[i];
          Players[CurrentPlayer].Integers[0]:= PickColor[i];
          writeln('You have a '+Pick[i]+' pickaxe');
          result:= true;
        end;
      end;
      if not Result then
      begin
        if(FindLostPick)then
        begin
          Result:= True;
        end else
        begin
          NoPick:= True;
        end;
      end;
    end;
    
    Procedure AttachPick;
    Var
      AxeHead: Integer;
    Begin
      if not(LoggedIn)then exit;
      AxeHead := DTMFromString('78DA637466626078C280024C9D4D19FE03694' +
           '620FE0F048CD640352F18D000231209A42D816A9E1150E3886917' +
           '861A27A09AC704D4B800D53C24A0C60DA8E63901359E44A871256' +
           'C1700B0451030');
      GameTab(4);
      If(FindDTM(PickaxeHandle, X, Y, MIX1, MIY1, MIX2, MIY2))Then
        Begin
          Mouse(X, Y, 4, 4, False);
          ChooseOption('Use');
          Wait(300+Random(400));
          If(FindDTM(AxeHead, X, Y, MIX1, MIY1, MIX2, MIY2))Then
            Begin
              Mouse(X, Y, 3, 3, True);
              Writeln('Pick Attached!');
            End;
          Wait(300+Random(400));
        End;
      FreeDTM(AxeHead);
    End;
    
    function FindLostPick:boolean;
    var
      i: Integer;
      RedPoints: TPointArray;
    begin
      if not LoggedIn then exit;
      FindColorsTolerance(RedPoints,241,MMX1,MMY1,MMX2,MMY2,5);
      for i:= 0 to length(RedPoints)-1 do
      begin
        Mouse(RedPoints[i].X,RedPoints[i].Y,4,4,true);
        FFlag(0);
        if FindObjCustom(x,y,['ake'],[Players[CurrentPlayer].Integers[0]],15)then
        begin
          Mouse(x,y,0,0,true);
          FFlag(0);
          wait(500+random(500));
          AttachPick;
          if FindPickaxe(True) then
          begin
            result:= true;
            ReportVars[3]:= ReportVars[3] + 1;
            SendSRLReport;
            SRLRandomsReport;
            break;
          end;
        end;
      end;
    end;
    
    function FindFastRandoms: boolean;
    var
      I, mk, lx, ly: integer;
    begin
      result:= false;
      GetMousePos(lx, ly);
      MarkTime(MK);
      for i:= 0 to 8 do
      begin
        case I of
          0: FindTalk;
          1: if FindBox then SolveBox;
          3, 4: if FindFight then
                begin
                  RunAway(RunDir, True, 1, 15000);
                end;
          5: if FindInventoryRandoms then result:= true;
          7: FindTalk;
          8: wait(1);
        end;
      end;
      //Writeln('FindFastRandoms took '+IntToStr(TimeFromMark(MK))+' msec.');
    end;
    
    var
      RespondTimer:integer;
    
    procedure ResetRespond;
    begin
      MarkTime(RespondTimer);
    end;
    
    function FollowColor(var cx,cy: integer; color: integer): Boolean;
    begin
      if not LoggedIn then Exit;
      if FindColorSpiralTolerance(cx,cy,Color,x-30,y-30,x+30,y+30,Tol) then
      begin
        Result := True;
        //GoneColor:= GetColor(x,y);
        Status('Rock followed');
      end else
      begin
        Result := False;
        cx:= MSCX;
        cy:= MSCY;
        Status('Failed to Follow Rock');
      end;
    end;
    
    function FollowOre:boolean;
    var
      CTS: integer;
      FlagTime,FlagGone: LongInt;
    begin
      CTS:= GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      MarkTime(FlagTime);
      result:= true;
      while TimeFromMark(FlagTime) < RandomRange(7000,8000) do
      begin
        if not FollowColor(cx,cy,TempColor)then
        begin
          result:= false;
        end;
        Wait(50);
        if not FlagPresent then
        begin
          MarkTime(FlagGone);
          while TimeFromMark(FlagGone) < 1000 do
          begin
            if not FollowColor(cx,cy,TempColor)then
            begin
              result:= false;
            end;
            Wait(50);
          end;
          ColorToleranceSpeed(CTS);
          Break;
        end;
      end;
      ColorToleranceSpeed(CTS);
    end;
    
    procedure HandleFight;
    begin
      RunAway(RunDir,true,1,randomrange(10000,15000));
    end;
    
    procedure waitrock;
    var
      oretime:LongInt;
    begin
      MarkTime(oretime);
      if swing then
      begin
        repeat
          if NoPick then break;
          FindFastRandoms;
          wait(1);
          if (TimeFromMark(RespondTimer) > 3000)then
          begin
            if RespondAll then ResetRespond;
          end;
          if not(LoggedIn)then break;
          FindNormalRandoms;
          if level then break;
          if higherlvlrock then
          begin
            if (TimeFromMark(oretime) > randomrange(12500,15000))then break;
          end else
          begin
            //if (TimeFromMark(oretime) > 7500)then exit;
            if (TimeFromMark(oretime) > randomrange(10000,12500))then break;
          end;
          if manage then break;
          if level then break;
          FindFastRandoms;
          if FindFight then
          begin
            HandleFight;
          end;
          if manage then break;
          if level then break;
          FindFastRandoms;
          if manage then break;
          if level then break;
          case random(10) of
            0: FindTalk;
            1: SleepAndMoveMouse(random(3000));
          end;
          FindFastRandoms;
          FindNormalRandoms;
          if manage then break;
          if w_wizzupgas(cx,cy-5)then
          begin
            MFF(MSCX,MSCY,5,5);
            Gasses:= Gasses + 1;
            ReportVars[2] := ReportVars[2] + 1;
            SendSRLReport;
            SRLRandomsReport;
            FTWait(36+random(4));
            Status('Found Gas! Using wizzups');
            exit;
          end else
          begin
            if MKFindGas then
            begin
              MFF(MSCX,MSCY,5,5);
              Gasses:= Gasses + 1;
              ReportVars[2] := ReportVars[2] + 1;
              SendSRLReport;
              SRLRandomsReport;
              FTWait(36+random(4));
              Status('Found Gas! Using Masterkills');
              exit;
            end;
          end;
          if manage then exit;
          FindFastRandoms;
          FindNormalRandoms;
          if level then break;
          if noore then break;
          if not LoggedIn then break;
          wait(1);
        until(manage);
      end;
      if noore then exit;
    end;
    
    procedure powermine;
    begin
      if not(LoggedIn)then exit;
      if NoPick then exit;
      FindNormalRandoms;
      SetChats;
      wait(1);
      if not FindPickaxe(false) then
      begin
        logout;
        Players[CurrentPlayer].Active:= false;
      end;
      if not LoggedIn then exit;
      RespondAll;
      if FindObjOre(cx,cy,'ocks',orecolor,tol,mincount)then
      begin
        GetMousePos(cx,cy);
        TempColor:=GetColor(cx,cy);
      end else
      begin
        FTWait(1+random(2));
        exit;
      end;
      if w_wizzupgas(cx,cy-5)then
      begin
        MFF(MMCX+2,MMCY,4,4);
        Gasses:= Gasses + 1;
        ReportVars[2] := ReportVars[2] + 1;
        SendSRLReport;
        SRLRandomsReport;
        MMouse(random(MSX2),random(MSY2),5,5);
        Status('Found Gas! Using wizzups gas checker');
        FTWait(8+random(2));
        exit;
      end else
      begin
        if (isuptext('ine'))then
        begin
          case(random(6))of
          0,1,2,3,4:Mouse(cx,cy,0,0,true);
          5:begin
              Mouse(cx,cy,0,0,false);
              ChooseOption('Mine');
            end;
          end;
          attempts:= attempts + 1;
          FollowOre;
          FindNormalRandoms;
          FTWait(4);
        end;
        WaitRock;
        wait(100+random(250));
      end;
    end;
    
    procedure SetupPick;
    begin
      if not(LoggedIn)then exit;
      {if(GetCombatLevel < 10)Then
      begin
          Writeln('Please Level Up Your Charachters in Combat');
          Logout;
          Players[CurrentPlayer].Loc := 'Too Low Level';
          Players[CurrentPlayer].Active:= False;
          Exit;
      end;}
      if(not FindPickaxe(false))then
      begin
        Writeln('Couldnt get pick colors, Equip or have in inventory.');
        Logout;
      end else
      begin
        GetAllLevels;
        done:= true;
      end;
      SetAngle(true);
    end;
    
    procedure ProgressReport;
    var Sec:integer;
    begin
      Sec := GetTimeRunning div 1000+1;
      writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
      writeln(' [SRL4] QuickPowerminer 3.0 by Timothegreat ')
      writeln('----------------------------------------')
      writeln(' Time Running: '+TimeRunning)
      writeln(' Ores Mined: '+inttostr(ores))
      writeln(' Loads: '+inttostr(loads))
      writeln(' Ores/hr: '+IntToStr(Round(3600*Ores/Sec)))
      writeln(' Responded: '+inttostr(RespondedTimes)+' Times')
      writeln(' Broken Picks: '+inttostr(BrokenPicks));
      writeln(' Gasses found: '+inttostr(Gasses));
      writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
    end;
    
    procedure setup;
    begin
      SetupSRL;
      ScriptID := '513';
      if ((SRLStatsID = '') or (SRLStatsPW = ''))then
      begin
        SRLID:='3936';
        SRLPassword:='leechme';
        writeln('Stupid leecher...');
        writeln('Get a stats account soon at');
        writeln('http://stats.srl-forums.com');
      end else
      begin
        SRLID := SRLStatsID;
        SRLPassword := SRLStatsPW;
      end;
    end;
    
    function AllPlayersInactive: boolean;
    var
      p: integer;
    begin
      for p:= 0 to HowManyPlayers - 1 do
        if Players[p].Active then exit;
      result:= true;
    end;
    
    procedure SwitchPlayers(Active:boolean);
    var
      thenextplayer,thelastplayer: integer;
      SleepyTime: LongInt;
    begin
      Logout;
      Players[CurrentPlayer].Active:= Active;
      TheNextPlayer:= CurrentPlayer + 1;
      TheLastPlayer:= HowManyPlayers - 1;
      if (TheNextPlayer <= TheLastPlayer)then
      begin
        CurrentPlayer:= CurrentPlayer + 1;
      end else
      begin
        CurrentPlayer:= 0;
      end;
      if not(Players[CurrentPlayer].Active)then
      begin
        repeat
          CurrentPlayer:= random(HowManyPlayers);
        until(Players[CurrentPlayer].Active)or(AllPlayersInactive);
      end;
      ProgressReport;
      if AllPlayersInactive then
      begin
        writeln('All Players False');
        TerminateScript;
      end;
      done:= false;
      if SleepMode then
      begin
        SleepyTime:= SleepFor+random(5);
        SleepyTime:= SleepyTime * 60000;
        wait(SleepyTime);
      end;
      LoginPlayer;
    end;
    
    procedure MainLoop;
    begin
      Repeat
        if not LoggedIn then LoginPlayer;
        Done:=false;
        wait(1000);
        Repeat
          if Not LoggedIn then break;
          if not(done) then
          begin
            SetupPick;
          end;
          SetupScript;
          if NoPick then
          begin
            TLoads:=0;
            Done:= False;
            NextPlayer(false);
          end;
          Powermine;
          if not LoggedIn then break;
          if (invfull) then
          begin
            Done:= False;
            TLoads:= TLoads + 1;
            loads:= loads + 1;
            ReportVars[1] := ReportVars[1] + 1;
            SendSRLReport;
            SRLRandomsReport;
            if (Players[CurrentPlayer].Booleans[2])then
            begin
              DropIt(1,28);
              ores:= ores + 28;
              ReportVars[0] := ReportVars[0] + 28;
              SendSRLReport;
              SRLRandomsReport;
            end else
            begin
              DropIt(2,28);
              ores:= ores + 27;
              ReportVars[0] := ReportVars[0] + 27;
              SendSRLReport;
              SRLRandomsReport;
            end;
            ProgressReport;
          end;
          if not LoggedIn then break;
        until(TLoads >= Players[CurrentPlayer].Integers[1]);
        TLoads:=0;
        if LoggedIn then
        begin
          Done:= False;
          SwitchPlayers(True);
        end else
        begin
          SwitchPlayers(False);
        end;
      until(AllPlayersInactive);
      SRLRandomsReport;
    end;
    
    {*******************************************************************************
    function FindRS: Boolean;
    By: RsN
    Description: Finds RS Window
    *******************************************************************************}
    
    function FindRS: Boolean;
    begin
      Result := FindWindowBySize(766, 504);
    end;
    
    begin
      Setup;
      DeclarePlayers;
      Done:= False;
      LoginPlayer;
      SetupScript;
      MainLoop;
      ProgressReport;
    end.
    here is the error i am getting when i run this (with my real username and pass and nick)

    Successfully compiled (2824 ms)
    SRL Compiled in 1547 msec
    Stupid leecher...
    Get a stats account soon at
    http://stats.srl-forums.com
    [Runtime Error] : Out Of Range in line 46 in script

  6. #6
    Join Date
    Jan 2008
    Location
    Alberta
    Posts
    727
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ryanhoffman5 View Post
    well i have been trying by myself for the past half hour with no success, the real reason i wanted this tut runner is because "QuickPowerMiner by Timothegreat" is not working...

    I have my guy in SE Varrock mine by the iron, with pick unequipped, everything seems to be set up ok but i just can't figure it out, gonna edit and post the code i have in there.

    Code:
    program Powerminer;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\Skill\Mining.scar}
    
    ////////////////////////////////////////////////////////////
    //      [SRL4] QuickPowerMiner by Timothegreat            //
    //                                                        //
    //                   Version 3.0 Pro                      //
    //                                                        //
    //                     ------------                       //
    //                     Instructions                       //
    //                     ------------                       //
    //                                                        //
    // 1. Setup your players by the ore you want to mine      //
    // 2. Fill out lines 23-60                                //
    // 3. Hit the play button                                 //
    // 4. Enjoy!                                              //
    //                 Autoresponder by Me                    //
    //                Gas Detection by Wizzup                 //
    ////////////////////////////////////////////////////////////
    
    const
      SRLStatsID = '';  // SRL Stats ID Number
      SRLStatsPW = '';  // SRL Stats Password
      UseResponder = True; // Use autoresponder? (recommended)
      SleepMode = True; // sleep mode? (single player)
      SleepFor = 2; // minutes to sleep (add random 5 minutes to it)
      RunDir = 'N'; // direction to run if in fight
                    // N for north, S for south, etc.
                    
    Procedure DeclarePlayers;
    Begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      Players[0].Name :='*******'; //obviously my name would go here
      Players[0].Pass :='*******'; //obviously my pass would go here
      Players[0].Nick :='***'; //3-4 letters from name
      Players[0].Active:= True;
      Players[0].Booleans[1]:= True; // True if new rocks. False if old. (new rocks have veins)
      Players[0].Booleans[2]:= False; // Pick equipped?
      Players[0].Strings[1]:= 'Iron'; // type of ore
      Players[0].Integers[1]:= 3; // # of loads
    
      Players[1].Name :='';
      Players[1].Pass :='';
      Players[1].Nick :=''; //3-4 letters from name
      Players[1].Active:= True;
      Players[1].Booleans[1]:= True; // True if new rocks. False if old.
      Players[1].Booleans[2]:= False; // Pick equipped?
      Players[1].Strings[1]:= 'Iron'; // type of ore
      Players[1].Integers[1]:= 3; // # of loads
    
      Players[2].Name :='';
      Players[2].Pass :='';
      Players[2].Nick :=''; //3-4 letters from name
      Players[2].Active:= True;
      Players[2].Booleans[1]:= True; // True if new rocks. False if old.
      Players[2].Booleans[2]:= False; // Pick equipped?
      Players[2].Strings[1]:= 'Iron'; // type of ore
      Players[2].Integers[1]:= 3; // # of loads
    
      Players[3].Name :='';
      Players[3].Pass :='';
      Players[3].Nick :=''; //3-4 letters from name
      Players[3].Active:= True;
      Players[3].Booleans[1]:= True; // True if new rocks. False if old.
      Players[3].Booleans[2]:= False; // Pick equipped?
      Players[3].Strings[1]:= 'Iron'; // type of ore
      Players[3].Integers[1]:= 3; // # of loads
    
    End;
    
    {---------------------DO NOT TOUCH BELOW THIS---------------------------}
    
    const
      oldclay = 5212840;
      oldcopper = 4483472;
      oldtin = 8553100;
      oldiron = 2437455;
      oldgold = 2081517;
      oldcoal = 2636603;
      oldmith = 6636869;
      oldaddy = 5202510;
    
      newclay = 5212840;
      newcopper = 5010848; //
      newtin = 7829376; //
      newiron = 3030370; //
      newgold = 2081517; // from rimmington
      newcoal = 2636603;
      newmith = 6636869;
      newaddy = 5202510;
    
    var
      x,y,cx,cy,orecolor,TLoads,Gasses,attempts,tol,levels,BrokenPicks,tempcolor,
      loads,ores,RespondedTimes:integer;
      done:boolean;
      Mincount:byte;
    
    procedure SetupScript;
    begin
      if (Players[CurrentPlayer].Booleans[1])then
      begin
        Mincount:= 1;
        tol:= 5;
        case lowercase(Players[CurrentPlayer].Strings[1]) of
          'clay'    : orecolor:= newclay;
          'copper'  : orecolor:= newcopper;
          'tin'     : orecolor:= newtin;
          'iron'    : orecolor:= newiron;
          'coal'    : orecolor:= newcoal;
          'mithril' : orecolor:= newmith;
          'mith'    : orecolor:= newmith;
          'adamant' : orecolor:= newaddy;
          'addy'    : orecolor:= newaddy;
        end;
      end else
      begin
        Mincount:= 4;
        tol:= 5;
        case lowercase(Players[CurrentPlayer].Strings[1]) of
          'clay'    : orecolor:= oldclay;
          'copper'  : orecolor:= oldcopper;
          'tin'     : orecolor:= oldtin;
          'iron'    : orecolor:= oldiron;
          'coal'    : orecolor:= oldcoal;
          'mithril' : orecolor:= oldmith;
          'mith'    : orecolor:= oldmith;
          'adamant' : orecolor:= oldaddy;
          'addy'    : orecolor:= oldaddy;
        end;
      end;
    end;
    
    var
      thechat,talkername,ZeText:string;
      GoodBye,YourName,General,Greetings,Crafting,Mining,Macroes:Array [0..10] of string;
      Funnies,Questions,Totals,Highest: Array [0..10] of String;
      ResponseTime: LongInt;
    
    {*******************************************************************************
    function DetermineHighest: String;
    By: Timothegreat
    Description: Determines your character's highest skill
    
    *******************************************************************************}
    
    function DetermineHighest: string;
    var
      h,i,skill: integer;
    begin
      for h:= 1 to 99 do
      begin
        for i:= 1 to 21 do
        begin
          if (Players[CurrentPlayer].level[i] >= h) then
          begin
            skill:= i;
          end;
        end;
      end;
      case skill of
        1 : result:= 'attack';
        2 : result:= 'strength';
        3 : result:= 'defence';
        4 : result:= 'range';
        5 : result:= 'prayer';
        6 : result:= 'magic';
        7 : result:= 'runecrafting';
        8 : result:= 'hitpoints';
        9 : result:= 'agility';
        10 : result:= 'herblore';
        11 : result:= 'thieving';
        12 : result:= 'crafting';
        13 : result:= 'fletching';
        14 : result:= 'slayer';
        15 : result:= 'mining';
        16 : result:= 'smithing';
        17 : result:= 'fishing';
        18 : result:= 'cooking';
        19 : result:= 'firemaking';
        20 : result:= 'woodcutting';
        21 : result:= 'farming';
      end;
    end;
    
    {*******************************************************************************
    function DetermineTotal: String;
    By: Timothegreat
    Description: Determines your character's total lvl
    
    *******************************************************************************}
    
    function DetermineTotal: string;
    var
      i,total: integer;
    begin
      for i:= 1 to 21 do
      begin
        Total:= Total + Players[CurrentPlayer].Level[i];
      end;
      result:= inttostr(Total+3);
    end;
    
    procedure SetupArrays;
    begin
      Greetings[0]:= 'Hi';
      Greetings[1]:= 'Hello';
      Greetings[2]:= 'Sup';
      Greetings[3]:= 'yo';
      Greetings[4]:= 'good day';
      Greetings[5]:= 'homey';
      Greetings[6]:= 'homeslice';//
      Greetings[7]:= 'ello';
      Greetings[8]:= 'Sup';
      Greetings[9]:= 'Hi';
      Greetings[10]:= 'Hey';
    
      Questions[0]:= 'ok i guess...you?';
      Questions[1]:= 'great';
      Questions[2]:= 'good';
      Questions[3]:= 'ok, u';
      Questions[4]:= 'fine';
      Questions[5]:= 'umm..ok';
      Questions[6]:= 'awesome';
      Questions[7]:= 'How are you';
      Questions[8]:= 'ow are u';
      Questions[9]:= 'ow r u';
      Questions[10]:= 'ow are you doing';
    
      General[0]:= 'idk';
      General[1]:= 'i dont know';
      General[2]:= 'wow..';
      General[3]:= 'hmmmmmmmmmmmmm';
      General[4]:= 'im black';
      General[5]:= 'poo';
      General[6]:= 'im captain underpants';
      General[7]:= 'Who';
      General[8]:= 'What';
      General[9]:= 'How';
      General[10]:= 'Why';
    
      Macroes[0]:= 'what the hell?';
      Macroes[1]:= 'omfg im not an autoer';
      Macroes[2]:= 'whatcha talkin bout willis';
      Macroes[3]:= 'bots are gone';
      Macroes[4]:= 'there arent bots anymore';
      Macroes[5]:= 'stupid potty bots';
      Macroes[6]:= 'il creampie some of these bots';
      Macroes[7]:= 'utoer';
      Macroes[8]:= 'bot';
      Macroes[9]:= 'acroer';
      Macroes[10]:= 'utoing';
    
      Funnies[0]:= 'lol';
      Funnies[1]:= 'rofl';
      Funnies[2]:= 'roflcopter';
      Funnies[3]:= 'lmao';
      Funnies[4]:= 'lmfao';
      Funnies[5]:= 'pwnt?';
      Funnies[6]:= 'wtf';
      Funnies[7]:= 'lol';
      Funnies[8]:= 'rofl';
      Funnies[9]:= 'lmao';
      Funnies[10]:= 'haha';
    
      YourName[0]:= 'ya?';
      YourName[1]:= 'what?';
      YourName[2]:= 'what you want?';
      YourName[3]:= 'yep?';
      YourName[4]:= '......?';
      YourName[5]:= 'im chuck norris';
      YourName[6]:= 'byah! rick james';
      YourName[7]:= Players[CurrentPlayer].Name;
      YourName[8]:= Players[CurrentPlayer].Nick;
      YourName[9]:= Players[CurrentPlayer].Name;
      YourName[10]:= Players[CurrentPlayer].Nick;
    
      GoodBye[0]:= 'later man';
      GoodBye[1]:= 'bye dude';
      GoodBye[2]:= 'cya later man';
      GoodBye[3]:= 'cya dude';
      GoodBye[4]:= 'k later';
      GoodBye[5]:= 'bye man';
      GoodBye[6]:= 'i love you';
      GoodBye[7]:= 'gtg';
      GoodBye[8]:= 'bye';
      GoodBye[9]:= 'brb';
      GoodBye[10]:= 'cya';
    
      Crafting[0]:= 'mine is '+inttostr(Players[CurrentPlayer].level[12]);
      Crafting[1]:= inttostr(Players[CurrentPlayer].level[12])+' you';
      Crafting[2]:= inttostr(Players[CurrentPlayer].level[12]);
      Crafting[3]:= 'almost '+inttostr(Players[CurrentPlayer].level[12]+1);
      Crafting[4]:= 'im almost'+inttostr(Players[CurrentPlayer].level[12]+1);
      Crafting[5]:= 'poopy only '+inttostr(Players[CurrentPlayer].level[12]);
      Crafting[6]:= 'okey im '+inttostr(Players[CurrentPlayer].level[12]);
      Crafting[7]:= 'crafting lvl';
      Crafting[8]:= 'crafting level';
      Crafting[9]:= 'craft lvl';
      Crafting[10]:= 'craft level';
    
      Mining[0]:= 'mine is '+inttostr(Players[CurrentPlayer].level[15]);
      Mining[1]:= inttostr(Players[CurrentPlayer].level[15])+' you';
      Mining[2]:= inttostr(Players[CurrentPlayer].level[15]);
      Mining[3]:= 'almost '+inttostr(Players[CurrentPlayer].level[15]+1);
      Mining[4]:= 'im almost'+inttostr(Players[CurrentPlayer].level[15]+1);
      Mining[5]:= 'poopy only '+inttostr(Players[CurrentPlayer].level[15]);
      Mining[6]:= 'okey im '+inttostr(Players[CurrentPlayer].level[15]);
      Mining[7]:= 'mining lvl';
      Mining[8]:= 'mine lvl'
      Mining[9]:= 'minin lev';
      Mining[10]:= 'mining level';
      
      Highest[0]:= 'mine is '+DetermineHighest;
      Highest[1]:= DetermineHighest+' you';
      Highest[2]:= DetermineHighest;
      Highest[3]:= DetermineHighest+' i guess';
      Highest[4]:= 'mines '+DetermineHighest;
      Highest[5]:= DetermineHighest;
      Highest[6]:= 'mines '+DetermineHighest+' u?';
      Highest[7]:= 'high lvl';
      Highest[8]:= 'biggest lvl'
      Highest[9]:= 'highest lvl';
      Highest[10]:= 'highest lev';
    
      Totals[0]:= 'mine is '+DetermineTotal;
      Totals[1]:= DetermineTotal+' you';
      Totals[2]:= DetermineTotal;
      Totals[3]:= DetermineTotal+' i guess';
      Totals[4]:= 'mines '+DetermineTotal;
      Totals[5]:= DetermineTotal;
      Totals[6]:= 'mines '+DetermineTotal+' u?';
      Totals[7]:= 'total lvl';
      Totals[8]:= 'totals lvl'
      Totals[9]:= 'total lev';
      Totals[10]:= 'totals lev';
    
    end;
    
    function TheLastChat: Boolean;
    var
      i: Integer;
      textP: TPoint;
    begin
      textP := TextCoords(8);
      talkername := LowerCase(Trim(GetTextAtEx(textP.x - 2, textP.y - 2, 0, SmallChars, False, False, 0, 1,
        0, 60, False, tr_allChars)))
      i := Pos(':', talkername)
      talkername:= ':'+talkername;
      talkername:=Between(':',':',talkername);
      if not(talkername = '') then
      begin
        Result := True;
      end;
    end;
    
    function CheckLastChatText(thetext:string): Boolean;
    var
      x, y: Integer;
      textP: TPoint;
    begin
      textP := TextCoords(8);
      if findcolor(x, y, 16711680, textp.x, textp.y, textp.x + 200, textp.y + 14) then
      begin
        thechat := LowerCase(Trim(GetTextAtEx(x - 3, textp.y - 2, 0, SmallChars, False,
          False, -1, 1, 16711680, 60, False, tr_allChars)));
        if (pos(thetext,thechat) <> 0) then
          Result := True;
        try
        if (pos(thetext,Capitalize(thechat)) <> 0) then
          Result := True;
        except
          writeln('stupid chat');
        end;
        try
        if (pos(Capitalize(thetext),Capitalize(thechat)) <> 0)then
          Result := True;
        except
          writeln('stupid chat');
        end;
      end;
    end;
    
    function Respondit(TheType:Array of String):boolean;
    var
      i,Response:integer;
    begin
      if not TheLastchat then exit;
      if (Capitalize(talkername) = Capitalize(Players[CurrentPlayer].Name))then exit;
      for i:= 7 to 10 do
      begin
        ZeText:= TheType[i];
        if CheckLastChatText(ZeText)then
        begin
          Response:= random(7);
          wait(random(500));
          TypeSend(TheType[Response]);
          RespondedTimes:= RespondedTimes + 1;
          ReportVars[3]:= ReportVars[3] + 1;
          SendSRLReport;
          SRLRandomsReport;
          Result:=true;
        end;
      end;
    end;
    
    function RespondAll:boolean;
    begin
      SetupArrays;
      result:= false;
      if (TimeFromMark(ResponseTime) < RandomRange(5000,7500))then exit;
      result:= RespondIt(Highest);
      if result then
      begin
        MarkTime(ResponseTime);
        exit;
      end;
      result:= RespondIt(Totals);
      if result then
      begin
        MarkTime(ResponseTime);
        exit;
      end;
      result:= RespondIt(Greetings);
      if result then
      begin
        MarkTime(ResponseTime);
        exit;
      end;
      if result then exit;
      case random(4)of
        0: result:= RespondIt(Funnies);
        1: wait(1);
        2: wait(1);
      end;
      if result then
      begin
        MarkTime(ResponseTime);
      end;
      if result then exit;
      result:= RespondIt(Crafting);
      if result then
      begin
        MarkTime(ResponseTime);
      end;
      if result then exit;
      result:= RespondIt(Mining);
      if result then
      begin
        MarkTime(ResponseTime);
      end;
      if result then exit;
      result:= RespondIt(Questions);
      if result then
      begin
        MarkTime(ResponseTime);
      end;
      if result then exit;
      result:= RespondIt(YourName);
      if result then
      begin
        MarkTime(ResponseTime);
      end;
      if result then exit;
      result:= RespondIt(Goodbye);
      if result then
      begin
        MarkTime(ResponseTime);
      end;
      if result then exit;
      result:= RespondIt(Macroes);
      if result then
      begin
        MarkTime(ResponseTime);
      end;
    end;
    
    var Mx, My, Ux, Uy : integer;
    MyTPoint1, MyTPoint2: TPoint;
    
    function PointOnCubicBezier(cp: TPointArray; t: Extended): TPoint;
    var
      ax, ay, bx, by, cx, cy,
      tSquared, tCubed, Curve: Extended;
    begin
      Curve:= 3.0; //average curve.
      cx := Curve * (cp[1].x - cp[0].x);
      bx := Curve * (cp[2].x - cp[1].x) - cx;
      ax := cp[3].x - cp[0].x - cx - bx;
    
      cy := Curve * (cp[1].y - cp[0].y);
      by := Curve * (cp[2].y - cp[1].y) - cy;
      ay := cp[3].y - cp[0].y - cy - by;
    
      tSquared := t * t;
      tCubed := tSquared * t;
    
      result.x := Round((ax * tCubed) + (bx * tSquared) + (cx * t) + cp[0].x);
      result.y := Round((ay * tCubed) + (by * tSquared) + (cy * t) + cp[0].y);
    end;
    
    
    function Spline(ex, ey: integer; CTRLP1, CTRLP2: TPoint): TPointArray;
    var
        theta, theta_Inc: extended;     sx, sy: integer;
        Dist: integer;
        CtrlPoints: Array [1..4] of TPoint; //Added, Control Points array.
    begin
      GetMousePos(sx, sy);
      Dist:= Distance(sx, sy, ex, ey);
      CtrlPoints[1]:= Point(sx, sy);
      CtrlPoints[2]:= CtrlP1;
      CtrlPoints[3]:= CtrlP2;
      CtrlPoints[4]:= Point(ex, ey);
      theta_inc:= 1.0 div Dist;
      theta:= 0.0;
      repeat
        theta_Inc:= MinE(1.0 - theta, theta_Inc); //This is the line to stop theta over 1.0
        theta:= theta + theta_Inc;
        SetLength(Result,Length(Result)+1);
        Result[High(result)]:= PointOnCubicBezier(ctrlpoints, theta);
      until(Theta >= 1.0);
      result[High(result)]:= Point(ex, ey); //This is a failsafe. High = Length - 1.
    end;
    
    procedure TimoMouse(x, y, rx, ry: integer; left, justmove:boolean);
    var
      P: TPointArray;
      I, tempx, tempy, b, c: integer;
    begin
      GetMousePos(mx,my);
      x:= x+random(rx);
      y:= y+random(ry);
      ux:=x;
      uy:=y;
      tempy:= my + y;
      tempx:= mx + x;
      if (mx > x) then
      begin
        if (my > y) then
        begin
          MyTPoint1.y:= tempy/2;
          MyTPoint1.x:= tempx/2;
          MyTPoint2.y:= tempy/3;
          MyTPoint2.x:= tempx/3;
        end else
        begin
          MyTPoint1.y:= tempy/3;
          MyTPoint1.x:= tempx/2;
          MyTPoint2.y:= tempy/2;
          MyTPoint2.x:= tempx/3;
        end;
      end else
      begin
        if (my > y) then
        begin
          MyTPoint1.y:= tempy/2;
          MyTPoint1.x:= tempx/3;
          MyTPoint2.y:= tempy/3;
          MyTPoint2.x:= tempx/2;
        end else
        begin
          MyTPoint1.y:= tempy/3;
          MyTPoint1.x:= tempx/3;
          MyTPoint2.y:= tempy/2;
          MyTPoint2.x:= tempx/2;
        end;
      end;
      P:= Spline(x, y, MyTPoint1, MyTPoint2);
      for i:= 0 to High(P) do
      begin
        MoveMouse(P[i].x, P[i].y);
        wait(randomrange(0, 2));
      end;
      if justmove then exit;
      Wait(60 + Random(30));
      GetMousePos(b, c);
      HoldMouse(b + 1, c, left);
      repeat
        Wait(20 + Random(30));
        I := I + 1;
      until (I > 4);
      GetMousePos(b, c);
      ReleaseMouse(b, c, left);
      Wait(100 + Random(100));
    end;
    
    procedure setchats;
    begin
      if not(LoggedIn)then exit;
      if not findcolortolerance(x,y,65280,138,490,155,499,2)then
      begin
        TimoMouse(x,y,2,2,false,false);
        ChooseOption('On');
      end;
    end;
    
    function GetMessage:string;
    
    begin
      Result := Trim(GetTextAtEx(30, 443 , 0, SmallChars, False,
      False, 0, 1, 0, 80, False, tr_AllChars));
    end;
    
    function GetMessage2:string;
    
    begin
      Result := Trim(GetTextAtEx(30, 429 , 0, SmallChars, False,
      False, 0, 1, 0, 80, False, tr_AllChars));
    end;
    
    function WhichLevel:string;
    Var TheLevel:string;
    begin
      if FindColor(x, y, 8388608, 14, 372, 495, 389) then
      begin
        TheLevel := GetTextAtEx(x + 4, y - 1, 0, NPCChars, false, false, 0, 2, 8388608, 60, false, tr_AllChars)
        Result := Trim(Between('ced a','evel',TheLevel))
      end;
    end;
    
    
    Function Level:boolean;
    begin
      Result:=FindColor(x, y, 8388608, 14, 372, 495, 389)
      if (result) then
      begin
        WriteLn('******** Advanced A '+WhichLevel+' Level ********');
        WriteFileString(TheFile, '******** Advanced A '+WhichLevel+' Level ********'
        + Chr(13))
        clicktocontinue;
        wait(2000)
        clicktocontinue;
        levels:=levels+1;
      end;
    end;
    
    procedure Dropit(slot1,slot2: integer);
    var
      i,beginslot,endslot: integer;
      DropPoint: Array [0..27] of TPoint;
    begin
      DropPoint[0]:= inttopoint(579,230);
      DropPoint[1]:= inttopoint(621,230);
      DropPoint[2]:= inttopoint(663,230);
      DropPoint[3]:= inttopoint(703,230);
      DropPoint[4]:= inttopoint(579,266);
      DropPoint[5]:= inttopoint(621,266);
      DropPoint[6]:= inttopoint(663,266);
      DropPoint[7]:= inttopoint(703,266);
      DropPoint[8]:= inttopoint(579,303);
      DropPoint[9]:= inttopoint(621,303);
      DropPoint[10]:= inttopoint(663,303);
      DropPoint[11]:= inttopoint(703,303);
      DropPoint[12]:= inttopoint(579,339);
      DropPoint[13]:= inttopoint(621,339);
      DropPoint[14]:= inttopoint(663, 336);
      DropPoint[15]:= inttopoint(705, 337);
      DropPoint[16]:= inttopoint(578, 371);
      DropPoint[17]:= inttopoint(620, 372);
      DropPoint[18]:= inttopoint(663, 372);
      DropPoint[19]:= inttopoint(704, 372);
      DropPoint[20]:= inttopoint(579, 407);
      DropPoint[21]:= inttopoint(621, 406);
      DropPoint[22]:= inttopoint(663, 407);
      DropPoint[23]:= inttopoint(706, 407);
      DropPoint[24]:= inttopoint(579, 444);
      DropPoint[25]:= inttopoint(620, 444);
      DropPoint[26]:= inttopoint(662, 443);
      DropPoint[27]:= inttopoint(705, 442);
      beginslot:= slot1 - 1;
      endslot:= slot2 - 1;
      for i:= beginslot to endslot do
      begin
        Mouse(DropPoint[i].X,DropPoint[i].Y,6,6,false);
        wait(random(10));
        ChooseOption('Drop');
        wait(random(100));
      end;
    end;
    
    Function w_WizzupGas(cx,cy: integer): Boolean;
    
    Var
       CTS, I, Le, T, Time: Integer;
       P, P2: TPointArray;
       C, C2: TIntegerArray;
       R, G, B: Integer;
       H, S, L: Extended;
       X, Y, Z: Extended;
       GP: TPoint;
    
    Begin
      Result := False;
    
      Time := GetSystemTime;
    
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.16, 0.46);
      GP.X := cx;
      GP.Y := cy;
      GP.Y := GP.Y - 20;
      FindColorsTolerance(P, 9083807, GP.x - 25, GP.y - 25, GP.X + 25, GP.Y + 25, 15);
      ColorToleranceSpeed(CTS);
      SetColorSpeed2Modifiers(0.2, 0.2);
    
      If Length(P) < 60 Then
        Exit;
    
      C := GetColors(P);
      C2 := C;
      ClearSameIntegers(C);
    
    
      If Length(C) < 40 Then // Maybe lower the value.
      //If Length(C) < 60 Then
      Begin
        Exit;
      End;
    
      WriteLn('Passed Color Diversity: ' + IntToStr(Length(C)));
      Writeln('Total colors found: ' + IntToStr(Length(P)));
    
      SetLength(C, 0);
      SetLength(C, Length(C2));
      SetLength(P2, Length(P));
    
      Le := High(C2);
    
      For I := 0 To Le Do
      Begin
        ColorToRGB(C2[i], R, G, B);
        //If ((R - G) <= 6) And (G - B > 7) Then
        If ((R - G) <= 10) And (G - B > 7) Then
        Begin
          ColorToHSL(C2[i], H, S, L);
          If (H > 11.5) And (H < 16.0) And (S < 16.0) And (S > 2.0) And (L > 42.0) And (L < 71.0) Then
          Begin
            ColorToXYZ(C2[i], X, Y, Z);
            If (X >= 18.0) And (X <= 45.0) And (Y >= 20.0)
                           And (Y <= 48.0) And (Z >= 15.0)
                           And (Z <= 47.0) And (Abs(X - Y) < 3.0)
                           And (Abs(X - Z) < 5.0) And (Abs(Y - Z) < 6.5)
                            Then
            Begin
              C[T] := C2[i];
              P2[T] := P[i];
              T := T + 1;
            End;
          End;
        End;
      End;
      SetLength(C, T);
    
      ClearSameIntegers(C);
    
      If Length(C) < 25 Then
      Begin
        Exit;
      End;
      WriteLn('Passed Color Diversity after filtering the colors: ' + IntToStr(Length(C)));
      Writeln('Total colors found, after filtering: ' + IntToStr(Length(P2)));
    
    
      Result := True;
      WriteLn('Gas Gave TRUE');
      writeln('Time taken: ' + IntToStr(GetSystemTime - Time));
    End;
    
    Function MKFindGas:boolean; // By MasterKill
    begin
      if not LoggedIn then Exit;
      if (FindColorTolerance (x, y, 10596274, 0, 0, 500, 500, 1))
      or (FindColorTolerance (x, y, 8950933, 0, 0, 500, 500, 1))
      or (FindColorTolerance (x, y, 9017755, 0, 0, 500, 500, 1))
      or (FindColorTolerance (x, y, 7900302, 0, 0, 500, 500, 1)) then result:= true;
    end;
    
    function noore:boolean;
    begin
      result:= (pos('no ore',GetMessage)<>0)
    end;
    
    function manage:boolean;
    begin
      result:= (pos('manage',GetMessage)<>0)
    end;
    
    function swing:boolean;
    begin
      if(pos('swing',GetMessage)<>0)then
      begin
        result:=true;
      end else
      begin
        if(pos('swing',GetMessage2)<>0)then
        begin
          if not(Manage)then
          begin
            if not(NoOre)then
            begin
              result:=true;
            end;
          end;
        end else
        begin
          result:=false;
        end;
      end
    end;
    
    function higherlvlrock:boolean;
    begin
      case lowercase(Players[CurrentPlayer].Strings[1]) of
        'clay'    : result:= false;
        'copper'  : result:= false;
        'tin'     : result:= false;
        'iron'    : result:= false;
        'coal'    : result:= true;
        'mithril' : result:= true;
        'mith'    : result:= true;
        'adamant' : result:= true;
        'addy'    : result:= true;
      end;
    end;
    
    function RunePick:integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 224;
      dtmMainPoint.y := 272;
      dtmMainPoint.AreaSize := 4;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 5984829;
      dtmMainPoint.Tolerance := 15;
    
      dtmSubPoints[0].x := 213;
      dtmSubPoints[0].y := 297;
      dtmSubPoints[0].AreaSize := 0;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 65536;
      dtmSubPoints[0].Tolerance := 0;
    
      dtmSubPoints[1].x := 214;
      dtmSubPoints[1].y := 297;
      dtmSubPoints[1].AreaSize := 0;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 65536;
      dtmSubPoints[1].Tolerance := 0;
    
      dtmSubPoints[2].x := 220;
      dtmSubPoints[2].y := 275;
      dtmSubPoints[2].AreaSize := 0;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := 65536;
      dtmSubPoints[2].Tolerance := 0;
    
      dtmSubPoints[3].x := 237;
      dtmSubPoints[3].y := 280;
      dtmSubPoints[3].AreaSize := 0;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := 65536;
      dtmSubPoints[3].Tolerance := 0;
    
      dtmSubPoints[4].x := 209;
      dtmSubPoints[4].y := 274;
      dtmSubPoints[4].AreaSize := 0;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := 65536;
      dtmSubPoints[4].Tolerance := 0;
    
      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
    
      Result := AddDTM(TempTDTM);
    end;
    
    function AddyPick:integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 225;
      dtmMainPoint.y := 272;
      dtmMainPoint.AreaSize := 4;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 4149311;
      dtmMainPoint.Tolerance := 15;
    
      dtmSubPoints[0].x := 213;
      dtmSubPoints[0].y := 297;
      dtmSubPoints[0].AreaSize := 0;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 65536;
      dtmSubPoints[0].Tolerance := 0;
    
      dtmSubPoints[1].x := 214;
      dtmSubPoints[1].y := 297;
      dtmSubPoints[1].AreaSize := 0;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 65536;
      dtmSubPoints[1].Tolerance := 0;
    
      dtmSubPoints[2].x := 220;
      dtmSubPoints[2].y := 275;
      dtmSubPoints[2].AreaSize := 0;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := 65536;
      dtmSubPoints[2].Tolerance := 0;
    
      dtmSubPoints[3].x := 237;
      dtmSubPoints[3].y := 280;
      dtmSubPoints[3].AreaSize := 0;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := 65536;
      dtmSubPoints[3].Tolerance := 0;
    
      dtmSubPoints[4].x := 209;
      dtmSubPoints[4].y := 274;
      dtmSubPoints[4].AreaSize := 0;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := 65536;
      dtmSubPoints[4].Tolerance := 0;
    
      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
    
      Result := AddDTM(TempTDTM);
    end;
    
    function MithPick:integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 225;
      dtmMainPoint.y := 272;
      dtmMainPoint.AreaSize := 4;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 5782587;
      dtmMainPoint.Tolerance := 15;
    
      dtmSubPoints[0].x := 213;
      dtmSubPoints[0].y := 297;
      dtmSubPoints[0].AreaSize := 0;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 65536;
      dtmSubPoints[0].Tolerance := 0;
    
      dtmSubPoints[1].x := 214;
      dtmSubPoints[1].y := 297;
      dtmSubPoints[1].AreaSize := 0;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 65536;
      dtmSubPoints[1].Tolerance := 0;
    
      dtmSubPoints[2].x := 220;
      dtmSubPoints[2].y := 275;
      dtmSubPoints[2].AreaSize := 0;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := 65536;
      dtmSubPoints[2].Tolerance := 0;
    
      dtmSubPoints[3].x := 237;
      dtmSubPoints[3].y := 280;
      dtmSubPoints[3].AreaSize := 0;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := 65536;
      dtmSubPoints[3].Tolerance := 0;
    
      dtmSubPoints[4].x := 209;
      dtmSubPoints[4].y := 274;
      dtmSubPoints[4].AreaSize := 0;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := 65536;
      dtmSubPoints[4].Tolerance := 0;
    
      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
    
      Result := AddDTM(TempTDTM);
    end;
    
    function SteelPick:integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 225;
      dtmMainPoint.y := 272;
      dtmMainPoint.AreaSize := 4;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 7040116;
      dtmMainPoint.Tolerance := 15;
    
      dtmSubPoints[0].x := 213;
      dtmSubPoints[0].y := 297;
      dtmSubPoints[0].AreaSize := 0;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 65536;
      dtmSubPoints[0].Tolerance := 0;
    
      dtmSubPoints[1].x := 214;
      dtmSubPoints[1].y := 297;
      dtmSubPoints[1].AreaSize := 0;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 65536;
      dtmSubPoints[1].Tolerance := 0;
    
      dtmSubPoints[2].x := 220;
      dtmSubPoints[2].y := 275;
      dtmSubPoints[2].AreaSize := 0;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := 65536;
      dtmSubPoints[2].Tolerance := 0;
    
      dtmSubPoints[3].x := 237;
      dtmSubPoints[3].y := 280;
      dtmSubPoints[3].AreaSize := 0;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := 65536;
      dtmSubPoints[3].Tolerance := 0;
    
      dtmSubPoints[4].x := 209;
      dtmSubPoints[4].y := 274;
      dtmSubPoints[4].AreaSize := 0;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := 65536;
      dtmSubPoints[4].Tolerance := 0;
    
      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
    
      Result := AddDTM(TempTDTM);
    end;
    
    function IronPick:integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 224;
      dtmMainPoint.y := 272;
      dtmMainPoint.AreaSize := 4;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 4671565;
      dtmMainPoint.Tolerance := 15;
    
      dtmSubPoints[0].x := 213;
      dtmSubPoints[0].y := 297;
      dtmSubPoints[0].AreaSize := 0;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 65536;
      dtmSubPoints[0].Tolerance := 0;
    
      dtmSubPoints[1].x := 214;
      dtmSubPoints[1].y := 297;
      dtmSubPoints[1].AreaSize := 0;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 65536;
      dtmSubPoints[1].Tolerance := 0;
    
      dtmSubPoints[2].x := 220;
      dtmSubPoints[2].y := 275;
      dtmSubPoints[2].AreaSize := 0;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := 65536;
      dtmSubPoints[2].Tolerance := 0;
    
      dtmSubPoints[3].x := 237;
      dtmSubPoints[3].y := 280;
      dtmSubPoints[3].AreaSize := 0;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := 65536;
      dtmSubPoints[3].Tolerance := 0;
    
      dtmSubPoints[4].x := 209;
      dtmSubPoints[4].y := 274;
      dtmSubPoints[4].AreaSize := 0;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := 65536;
      dtmSubPoints[4].Tolerance := 0;
    
      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
    
      Result := AddDTM(TempTDTM);
    end;
    
    function BronzePick:integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 225;
      dtmMainPoint.y := 272;
      dtmMainPoint.AreaSize := 4;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 2243147;
      dtmMainPoint.Tolerance := 15;
    
      dtmSubPoints[0].x := 213;
      dtmSubPoints[0].y := 297;
      dtmSubPoints[0].AreaSize := 0;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 65536;
      dtmSubPoints[0].Tolerance := 0;
    
      dtmSubPoints[1].x := 214;
      dtmSubPoints[1].y := 297;
      dtmSubPoints[1].AreaSize := 0;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 65536;
      dtmSubPoints[1].Tolerance := 0;
    
      dtmSubPoints[2].x := 220;
      dtmSubPoints[2].y := 275;
      dtmSubPoints[2].AreaSize := 0;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := 65536;
      dtmSubPoints[2].Tolerance := 0;
    
      dtmSubPoints[3].x := 237;
      dtmSubPoints[3].y := 280;
      dtmSubPoints[3].AreaSize := 0;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := 65536;
      dtmSubPoints[3].Tolerance := 0;
    
      dtmSubPoints[4].x := 209;
      dtmSubPoints[4].y := 274;
      dtmSubPoints[4].AreaSize := 0;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := 65536;
      dtmSubPoints[4].Tolerance := 0;
    
      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
    
      Result := AddDTM(TempTDTM);
    end;
    
    function PickHandle:integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..4] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 829;
      dtmMainPoint.y := 650;
      dtmMainPoint.AreaSize := 4;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 335662;
      dtmMainPoint.Tolerance := 15;
    
      dtmSubPoints[0].x := 834;
      dtmSubPoints[0].y := 639;
      dtmSubPoints[0].AreaSize := 0;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 65536;
      dtmSubPoints[0].Tolerance := 0;
    
      dtmSubPoints[1].x := 824;
      dtmSubPoints[1].y := 664;
      dtmSubPoints[1].AreaSize := 0;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 65536;
      dtmSubPoints[1].Tolerance := 0;
    
      dtmSubPoints[2].x := 823;
      dtmSubPoints[2].y := 664;
      dtmSubPoints[2].AreaSize := 0;
      dtmSubPoints[2].AreaShape := 0;
      dtmSubPoints[2].Color := 65536;
      dtmSubPoints[2].Tolerance := 0;
    
      dtmSubPoints[3].x := 835;
      dtmSubPoints[3].y := 644;
      dtmSubPoints[3].AreaSize := 0;
      dtmSubPoints[3].AreaShape := 0;
      dtmSubPoints[3].Color := 65536;
      dtmSubPoints[3].Tolerance := 0;
    
      dtmSubPoints[4].x := 831;
      dtmSubPoints[4].y := 641;
      dtmSubPoints[4].AreaSize := 0;
      dtmSubPoints[4].AreaShape := 0;
      dtmSubPoints[4].Color := 65536;
      dtmSubPoints[4].Tolerance := 0;
    
      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
    
      Result := AddDTM(TempTDTM);
    end;
    
    function FindLostPick:boolean; forward;
    
    function FindPickaxe(Equip:boolean):boolean;
    var
      i: Integer;
      PickDTM,PickColor: Array[0..5] of Integer;
      Pick: Array[0..5] of String;
    begin
      if not LoggedIn then exit;
      PickDTM[0]:= RunePick;
      Pick[0]:= 'Rune';
      PickColor[0]:= 5984829;
      PickDTM[1]:= AddyPick;
      Pick[1]:= 'Addy';
      PickColor[1]:= 4149311;
      PickDTM[2]:= MithPick;
      Pick[2]:= 'Mith';
      PickColor[2]:= 6176831;
      PickDTM[3]:= SteelPick;
      Pick[3]:= 'Steel';
      PickColor[3]:= 7697790;
      PickDTM[4]:= IronPick;
      Pick[4]:= 'Iron';
      PickColor[4]:= 4342343;
      PickDTM[5]:= BronzePick;
      Pick[5]:= 'Bronze';
      PickColor[5]:= 1979202;
      if Players[CurrentPlayer].Booleans[2]then
      begin
        GameTab(5)
      end else
      begin
        GameTab(4);
      end;
      for i:= 0 to 5 do
      begin
        if FindDTM(PickDTM[i],x,y,MIX1,MIY1,MIX2,MIY2)then
        begin
          if Equip then
          begin
            Mouse(x,y,4,4,true);
            wait(500+random(500));
          end;
          Players[CurrentPlayer].Strings[0]:= Pick[i];
          Players[CurrentPlayer].Integers[0]:= PickColor[i];
          writeln('You have a '+Pick[i]+' pickaxe');
          result:= true;
        end;
      end;
      if not Result then
      begin
        if(FindLostPick)then
        begin
          Result:= True;
        end else
        begin
          NoPick:= True;
        end;
      end;
    end;
    
    Procedure AttachPick;
    Var
      AxeHead: Integer;
    Begin
      if not(LoggedIn)then exit;
      AxeHead := DTMFromString('78DA637466626078C280024C9D4D19FE03694' +
           '620FE0F048CD640352F18D000231209A42D816A9E1150E3886917' +
           '861A27A09AC704D4B800D53C24A0C60DA8E63901359E44A871256' +
           'C1700B0451030');
      GameTab(4);
      If(FindDTM(PickaxeHandle, X, Y, MIX1, MIY1, MIX2, MIY2))Then
        Begin
          Mouse(X, Y, 4, 4, False);
          ChooseOption('Use');
          Wait(300+Random(400));
          If(FindDTM(AxeHead, X, Y, MIX1, MIY1, MIX2, MIY2))Then
            Begin
              Mouse(X, Y, 3, 3, True);
              Writeln('Pick Attached!');
            End;
          Wait(300+Random(400));
        End;
      FreeDTM(AxeHead);
    End;
    
    function FindLostPick:boolean;
    var
      i: Integer;
      RedPoints: TPointArray;
    begin
      if not LoggedIn then exit;
      FindColorsTolerance(RedPoints,241,MMX1,MMY1,MMX2,MMY2,5);
      for i:= 0 to length(RedPoints)-1 do
      begin
        Mouse(RedPoints[i].X,RedPoints[i].Y,4,4,true);
        FFlag(0);
        if FindObjCustom(x,y,['ake'],[Players[CurrentPlayer].Integers[0]],15)then
        begin
          Mouse(x,y,0,0,true);
          FFlag(0);
          wait(500+random(500));
          AttachPick;
          if FindPickaxe(True) then
          begin
            result:= true;
            ReportVars[3]:= ReportVars[3] + 1;
            SendSRLReport;
            SRLRandomsReport;
            break;
          end;
        end;
      end;
    end;
    
    function FindFastRandoms: boolean;
    var
      I, mk, lx, ly: integer;
    begin
      result:= false;
      GetMousePos(lx, ly);
      MarkTime(MK);
      for i:= 0 to 8 do
      begin
        case I of
          0: FindTalk;
          1: if FindBox then SolveBox;
          3, 4: if FindFight then
                begin
                  RunAway(RunDir, True, 1, 15000);
                end;
          5: if FindInventoryRandoms then result:= true;
          7: FindTalk;
          8: wait(1);
        end;
      end;
      //Writeln('FindFastRandoms took '+IntToStr(TimeFromMark(MK))+' msec.');
    end;
    
    var
      RespondTimer:integer;
    
    procedure ResetRespond;
    begin
      MarkTime(RespondTimer);
    end;
    
    function FollowColor(var cx,cy: integer; color: integer): Boolean;
    begin
      if not LoggedIn then Exit;
      if FindColorSpiralTolerance(cx,cy,Color,x-30,y-30,x+30,y+30,Tol) then
      begin
        Result := True;
        //GoneColor:= GetColor(x,y);
        Status('Rock followed');
      end else
      begin
        Result := False;
        cx:= MSCX;
        cy:= MSCY;
        Status('Failed to Follow Rock');
      end;
    end;
    
    function FollowOre:boolean;
    var
      CTS: integer;
      FlagTime,FlagGone: LongInt;
    begin
      CTS:= GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      MarkTime(FlagTime);
      result:= true;
      while TimeFromMark(FlagTime) < RandomRange(7000,8000) do
      begin
        if not FollowColor(cx,cy,TempColor)then
        begin
          result:= false;
        end;
        Wait(50);
        if not FlagPresent then
        begin
          MarkTime(FlagGone);
          while TimeFromMark(FlagGone) < 1000 do
          begin
            if not FollowColor(cx,cy,TempColor)then
            begin
              result:= false;
            end;
            Wait(50);
          end;
          ColorToleranceSpeed(CTS);
          Break;
        end;
      end;
      ColorToleranceSpeed(CTS);
    end;
    
    procedure HandleFight;
    begin
      RunAway(RunDir,true,1,randomrange(10000,15000));
    end;
    
    procedure waitrock;
    var
      oretime:LongInt;
    begin
      MarkTime(oretime);
      if swing then
      begin
        repeat
          if NoPick then break;
          FindFastRandoms;
          wait(1);
          if (TimeFromMark(RespondTimer) > 3000)then
          begin
            if RespondAll then ResetRespond;
          end;
          if not(LoggedIn)then break;
          FindNormalRandoms;
          if level then break;
          if higherlvlrock then
          begin
            if (TimeFromMark(oretime) > randomrange(12500,15000))then break;
          end else
          begin
            //if (TimeFromMark(oretime) > 7500)then exit;
            if (TimeFromMark(oretime) > randomrange(10000,12500))then break;
          end;
          if manage then break;
          if level then break;
          FindFastRandoms;
          if FindFight then
          begin
            HandleFight;
          end;
          if manage then break;
          if level then break;
          FindFastRandoms;
          if manage then break;
          if level then break;
          case random(10) of
            0: FindTalk;
            1: SleepAndMoveMouse(random(3000));
          end;
          FindFastRandoms;
          FindNormalRandoms;
          if manage then break;
          if w_wizzupgas(cx,cy-5)then
          begin
            MFF(MSCX,MSCY,5,5);
            Gasses:= Gasses + 1;
            ReportVars[2] := ReportVars[2] + 1;
            SendSRLReport;
            SRLRandomsReport;
            FTWait(36+random(4));
            Status('Found Gas! Using wizzups');
            exit;
          end else
          begin
            if MKFindGas then
            begin
              MFF(MSCX,MSCY,5,5);
              Gasses:= Gasses + 1;
              ReportVars[2] := ReportVars[2] + 1;
              SendSRLReport;
              SRLRandomsReport;
              FTWait(36+random(4));
              Status('Found Gas! Using Masterkills');
              exit;
            end;
          end;
          if manage then exit;
          FindFastRandoms;
          FindNormalRandoms;
          if level then break;
          if noore then break;
          if not LoggedIn then break;
          wait(1);
        until(manage);
      end;
      if noore then exit;
    end;
    
    procedure powermine;
    begin
      if not(LoggedIn)then exit;
      if NoPick then exit;
      FindNormalRandoms;
      SetChats;
      wait(1);
      if not FindPickaxe(false) then
      begin
        logout;
        Players[CurrentPlayer].Active:= false;
      end;
      if not LoggedIn then exit;
      RespondAll;
      if FindObjOre(cx,cy,'ocks',orecolor,tol,mincount)then
      begin
        GetMousePos(cx,cy);
        TempColor:=GetColor(cx,cy);
      end else
      begin
        FTWait(1+random(2));
        exit;
      end;
      if w_wizzupgas(cx,cy-5)then
      begin
        MFF(MMCX+2,MMCY,4,4);
        Gasses:= Gasses + 1;
        ReportVars[2] := ReportVars[2] + 1;
        SendSRLReport;
        SRLRandomsReport;
        MMouse(random(MSX2),random(MSY2),5,5);
        Status('Found Gas! Using wizzups gas checker');
        FTWait(8+random(2));
        exit;
      end else
      begin
        if (isuptext('ine'))then
        begin
          case(random(6))of
          0,1,2,3,4:Mouse(cx,cy,0,0,true);
          5:begin
              Mouse(cx,cy,0,0,false);
              ChooseOption('Mine');
            end;
          end;
          attempts:= attempts + 1;
          FollowOre;
          FindNormalRandoms;
          FTWait(4);
        end;
        WaitRock;
        wait(100+random(250));
      end;
    end;
    
    procedure SetupPick;
    begin
      if not(LoggedIn)then exit;
      {if(GetCombatLevel < 10)Then
      begin
          Writeln('Please Level Up Your Charachters in Combat');
          Logout;
          Players[CurrentPlayer].Loc := 'Too Low Level';
          Players[CurrentPlayer].Active:= False;
          Exit;
      end;}
      if(not FindPickaxe(false))then
      begin
        Writeln('Couldnt get pick colors, Equip or have in inventory.');
        Logout;
      end else
      begin
        GetAllLevels;
        done:= true;
      end;
      SetAngle(true);
    end;
    
    procedure ProgressReport;
    var Sec:integer;
    begin
      Sec := GetTimeRunning div 1000+1;
      writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
      writeln(' [SRL4] QuickPowerminer 3.0 by Timothegreat ')
      writeln('----------------------------------------')
      writeln(' Time Running: '+TimeRunning)
      writeln(' Ores Mined: '+inttostr(ores))
      writeln(' Loads: '+inttostr(loads))
      writeln(' Ores/hr: '+IntToStr(Round(3600*Ores/Sec)))
      writeln(' Responded: '+inttostr(RespondedTimes)+' Times')
      writeln(' Broken Picks: '+inttostr(BrokenPicks));
      writeln(' Gasses found: '+inttostr(Gasses));
      writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
    end;
    
    procedure setup;
    begin
      SetupSRL;
      ScriptID := '513';
      if ((SRLStatsID = '') or (SRLStatsPW = ''))then
      begin
        SRLID:='3936';
        SRLPassword:='leechme';
        writeln('Stupid leecher...');
        writeln('Get a stats account soon at');
        writeln('http://stats.srl-forums.com');
      end else
      begin
        SRLID := SRLStatsID;
        SRLPassword := SRLStatsPW;
      end;
    end;
    
    function AllPlayersInactive: boolean;
    var
      p: integer;
    begin
      for p:= 0 to HowManyPlayers - 1 do
        if Players[p].Active then exit;
      result:= true;
    end;
    
    procedure SwitchPlayers(Active:boolean);
    var
      thenextplayer,thelastplayer: integer;
      SleepyTime: LongInt;
    begin
      Logout;
      Players[CurrentPlayer].Active:= Active;
      TheNextPlayer:= CurrentPlayer + 1;
      TheLastPlayer:= HowManyPlayers - 1;
      if (TheNextPlayer <= TheLastPlayer)then
      begin
        CurrentPlayer:= CurrentPlayer + 1;
      end else
      begin
        CurrentPlayer:= 0;
      end;
      if not(Players[CurrentPlayer].Active)then
      begin
        repeat
          CurrentPlayer:= random(HowManyPlayers);
        until(Players[CurrentPlayer].Active)or(AllPlayersInactive);
      end;
      ProgressReport;
      if AllPlayersInactive then
      begin
        writeln('All Players False');
        TerminateScript;
      end;
      done:= false;
      if SleepMode then
      begin
        SleepyTime:= SleepFor+random(5);
        SleepyTime:= SleepyTime * 60000;
        wait(SleepyTime);
      end;
      LoginPlayer;
    end;
    
    procedure MainLoop;
    begin
      Repeat
        if not LoggedIn then LoginPlayer;
        Done:=false;
        wait(1000);
        Repeat
          if Not LoggedIn then break;
          if not(done) then
          begin
            SetupPick;
          end;
          SetupScript;
          if NoPick then
          begin
            TLoads:=0;
            Done:= False;
            NextPlayer(false);
          end;
          Powermine;
          if not LoggedIn then break;
          if (invfull) then
          begin
            Done:= False;
            TLoads:= TLoads + 1;
            loads:= loads + 1;
            ReportVars[1] := ReportVars[1] + 1;
            SendSRLReport;
            SRLRandomsReport;
            if (Players[CurrentPlayer].Booleans[2])then
            begin
              DropIt(1,28);
              ores:= ores + 28;
              ReportVars[0] := ReportVars[0] + 28;
              SendSRLReport;
              SRLRandomsReport;
            end else
            begin
              DropIt(2,28);
              ores:= ores + 27;
              ReportVars[0] := ReportVars[0] + 27;
              SendSRLReport;
              SRLRandomsReport;
            end;
            ProgressReport;
          end;
          if not LoggedIn then break;
        until(TLoads >= Players[CurrentPlayer].Integers[1]);
        TLoads:=0;
        if LoggedIn then
        begin
          Done:= False;
          SwitchPlayers(True);
        end else
        begin
          SwitchPlayers(False);
        end;
      until(AllPlayersInactive);
      SRLRandomsReport;
    end;
    
    {*******************************************************************************
    function FindRS: Boolean;
    By: RsN
    Description: Finds RS Window
    *******************************************************************************}
    
    function FindRS: Boolean;
    begin
      Result := FindWindowBySize(766, 504);
    end;
    
    begin
      Setup;
      DeclarePlayers;
      Done:= False;
      LoginPlayer;
      SetupScript;
      MainLoop;
      ProgressReport;
    end.
    here is the error i am getting when i run this (with my real username and pass and nick)

    Successfully compiled (2824 ms)
    SRL Compiled in 1547 msec
    Stupid leecher...
    Get a stats account soon at
    http://stats.srl-forums.com
    [Runtime Error] : Out Of Range in line 46 in script
    To fix it go to http://stats.srl-forums.com and sign up an account then put the ID and password from stats there.

  7. #7
    Join Date
    Apr 2008
    Location
    Montana
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ARE YOU SERIOUS! thats all i have to do? i never got one so i didn't think it mattered, but i have tried going to that website over and over and typing in my user and pass i have and it just refreshs the website, and it does the same thing when i hit sign up....


    *EDIT never mind i got the Stat stuff to work, now i run the program and it simply closes scar entirely and leaves me looking at my runescape char standing by the SE Varrock mine iron rocks doing nothing lol anyone know why this happens? should i make a different thread about this?

    *EDIT never mind i am just gonna make a new thread about this, please lock or close this thread thanks

  8. #8
    Join Date
    Jun 2007
    Location
    Liverpool ,Nsw,Australia
    Posts
    740
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you should remove the scripts because the J.R mems and new users can see this
    Quote Originally Posted by Darkmage View Post
    I got 2 questions'
    #1. When i run the script will it automatically pick up the mouse and move?

  9. #9
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Replace IsUpTextMulti with IsUpText and also use one of the parameters
    On another note, I think that HellBoyz was updating the versions.

    Hope I Helped

  10. #10
    Join Date
    Jun 2008
    Posts
    0
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nice man

  11. #11
    Join Date
    Jan 2010
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Are any scripts working for Scar on Runescape???

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

    Default

    closed.
    I made a new script, check it out!.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Nielsie95's Tutorial Runner Fixed*
    By mormonman in forum RS3 Outdated / Broken Scripts
    Replies: 269
    Last Post: 07-17-2009, 01:14 PM
  2. Nielsie95's Tutorial Island Runner
    By nielsie95 in forum RS3 Outdated / Broken Scripts
    Replies: 1228
    Last Post: 04-22-2009, 09:53 PM
  3. Nielsie95's Tutorial runner [FIXED]
    By gl3nni in forum RS3 Outdated / Broken Scripts
    Replies: 2
    Last Post: 12-08-2007, 01:13 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
  •