Results 1 to 24 of 24

Thread: need help with smart script

  1. #1
    Join Date
    Apr 2008
    Posts
    99
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default need help with smart script

    its a little bit old now and it doesnt work in smart anymore.
    it will load smart but after that it does nothing, just sits there at the login screen.

    can someone please check it and change it please.

    Code:
    program new;
    {.include SRL/SRL/misc/SMART.scar}
    {.include srl/srl.scar}
    {.include srl/srl/misc/users.scar}
    var x,y,loads,RandomSleep,TotalSleep,chicks,chickdtm:integer;
    
    procedure loaddtms; forward;
    
    procedure setup;
    begin
      SRLPlayerForm(True,['sleep'],['loads to buy','minutes to sleep', 'Random sleep in minutes'],['SRL I.D','SRL Pass'],[]);
      SmartSetup('world83', True, true, False);
      SetTargetDC(SmartGetDC);
      If Not (LoggedIn) Then
        While Not (SmartGetColor(360, 172) = 13158) Do
          Wait(100);
      If Not (LoggedIn) Then
      While Not (SmartGetColor(386, 249) = 65535) Do
      Wait(100);
      setupsrl;
      ScriptID := '811';
      begin
        if ((players[currentplayer].strings[0] = '') or (players[currentplayer].strings[1] = ''))then
        begin
          writeln('leeching noob');
          writeln('get an I.D. and pass now');
          OpenWebPage('http://www.stats.srl-forums.com/');
          terminatescript;
        end else
        SRLID:=players[currentplayer].strings[0];
        SRLPassword:=players[currentplayer].strings[1];
        loaddtms;
      end;
    end;
    
    Procedure MainLoop; Forward;
    
    procedure antiban; forward;
    
    
    procedure goshop;
    begin
      if radialwalk(65536,280,360,72,4,4) then wait(1000);
      if findsymbol(x, y,'food shop')then
      begin
        mouse(x,y,2,2,true);
      end else
      if findsymbol(x, y,'bank')then
      begin
        mouse(x,y,2,2,true);
        mainloop;
      end;
      antiban;
    end;
    
    Procedure FindFightEx;
    Begin
      If(FindFight) then
      Begin
        Status('Fight found!');
        Writeln('Our player is being attacked!')
        Writeln('Lets run away!')
        Begin
          Status('Running away!');
          WriteLn('Running....')
          RunAway('W',False,1,8000+Random(3000))
          WriteLn('Successfully ran away from fight!')
        end;
      end;
    end;
    
    // BY Starblaster
    function FindObjCustom2(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tolerance: Integer): Boolean;
    var
      a, b, c, i, x1, y1, x2, y2: Integer;
      Start: Boolean;
    begin
      for b := 0 to (GetArrayLength(Color)-1) do
      begin
        if (FindColorSpiralTolerance(cx, cy, color[b], MSX1, MSY1, MSX2, MSY2, Tolerance)) then
        begin
          Start := True;
          Break;
        end;
      end;
      if(Start)then
      begin
        x1 := 245;
        y1 := 165;
        x2 := 277;
        y2 := 185;
        repeat
          if not(LoggedIn)then break;
          a := a + 1;
          if (a = 1) then
            c := c + 1
          else if (a = 3) then
            c := c + 1;
          for i := 1 to c do
          begin
            if (a = 1) then
            begin
              x1 := x1 + 30;
              x2 := x2 + 30;
            end else
            if (a = 2) then
            begin
              y1 := y1 - 20;
              y2 := y2 - 20;
            end else
            if (a = 3) then
            begin
              x1 := x1 - 30;
              x2 := x2 - 30;
            end else
            if (a = 4) then
            begin
              y1 := y1 + 20;
              y2 := y2 + 20;
            end;
            if (x1 = 485) and (x2 = 517) then
              x2 := x2 - 2;
            if (y1 = 325) and (y2 = 345) then
              y2 := y2 - 7;
            if (x2 > 515) then
              Break;
            for b := 0 to (GetArrayLength(Color)-1) do
            begin
              if (FindColorTolerance(cx, cy, Color[b], x1, y1, x2, y2, tolerance)) then
              begin
                MMouse(cx, cy, 3, 3);
                Wait(5+Random(10));
                if (IsUpTextMultiCustom(Text)) then
                begin
                  Result := True;
                  Exit;
                end;
              end;
            end;
          end;
          if (a = 4) then
            a := 0;
        until (x2 > 515) or (Result = True);
      end;
    end;
    
    procedure loaddtms;
    begin
    chickDTM := DTMFromString('78DA632C626460F8C880020E2F59CCF01F480' +
           '36518FE03012348CD4F0634C0884402E90620EB3301355940D61B' +
           '026A3280AC1F04D4D402598FF0AB0100308F0F73');
    end;
    
    procedure useshop;
    var tries:integer;
    begin
      repeat
        if FindObjCustom2(x, y, ['ufus'], [8431572,7444678,9935011], 10)then
        begin
          if(IsUpText('alk'))then
          begin
            Mouse(x, y, 5, 5, false);
            if(ChooseOption('Trade'))then
            fflag(0);
          end;
        end else
        wait(1000+random(100));
        tries:=tries+1;
      until (((getcolor(485, 42))=65536)or(tries>=10));
      tries:=0;
    end;
    
    procedure srlstuff;
    begin
      reportVars[0] := ReportVars[0] + CountItems(chickdtm,'dtm',[0,0]);
      reportVars[1] := ReportVars[1] + 1;
      srlrandomsreport;
    end;
    
    procedure buy;
    begin
     if FindObjCustom2(x, y, ['hick'], [10593218, 9408948, 10856388],10) then
      begin
        mouse(x,y,3,3,false);
        ChooseOption('X');
        wait(800+random(500));
        Typesend('99');
        wait(600+random(300));
        Mouse(486,40,2,2,True);
        wait(1000+random(200));
        exit;
      end;
    end;
    
    procedure antiban;
    var
    noban: Integer;
    Begin
      If Not (LoggedIn) Then Exit;
      noban := Random(21);
      Case noban Of
        0,9,17: PickUpMouse;
        1,13,16: RandomRclick;
        2,10,18: randomMovement;
        5,11,8:  ChooseOption('cancel');
        6,15,21: MMouse(Random(MSX2), Random(MSY2), 0, 0);
        7,14,3: HoverSkill('woodcutting', false);
      end;
    end;
    
    procedure gobank;
    begin
    if radialwalk(65536,160,200,72,4,4) then wait(1000);
    if (findsymbol(x, y,'bank'))then mouse(x,y,2,2,true);
    antiban;
    end;
    
    procedure usebank;
    var tries:integer;
    begin
    repeat
    if FindObjCustom2(x, y, ['ooth'], [8161164,2898753,3032913], 10)then
        begin
          if(IsUpText('Use'))then
          begin
            Mouse(x, y, 5, 5, false);
            if(ChooseOption('ckly'))then
            fflag(0);
          end;
        end else
        wait(1000+random(100));
        tries:=tries+1;
        writeln(inttostr(tries));
    until ((BankScreen)or(tries>=5));
      tries:=0;
      if bankscreen then deposit(1,28,true);
      loads:=loads+1;
    end;
    
    procedure getcoinage;
    var
    Cash: TIntegerArray;
    t: Integer;
    begin
      if(not(LoggedIn))then Exit;
      Cash := [2014952,2148340,1745606,2014437,1947358,2148854];
      for t := 0 to 2 do
      begin
        if(FindColorSpiralTolerance(x,y,Cash[t],76,70,111,85,3))then
        begin
          mouse(x,y,3,3,false);
          ChooseOption('X');
          wait(800+random(500));
          Typesend('252');
          wait(600+random(300));
          CloseBank;
          wait(1000+random(300));
          exit;
        end else
          writeln('out of cash');
          CloseBank;
          nextplayer(false);
          mainloop;
        end;
    end;
    
    procedure proggy;
    begin
    cleardebug;
    writeln('progress report');
    writeln('ran for '+timerunning);
    writeln('banked '+inttostr(chicks)+' chickens');
    writeln('banked '+inttostr(loads)+' loads');
    end;
    
    Procedure AntiRandoms;
    var
    i : Integer;
    Begin
      Status('Doing AntiRandoms');
      for i := 0 to 3 do
      begin
        FindNormalRandoms;
        FindFightEx;
        FindNonInventoryRandoms;
        wait(1)
      end;
    end;
    
    procedure mainloop;
    begin
    repeat
    if not loggedin then loginplayer;
          If (Not (LoggedIn)) then
          Begin
            writeln('Not logged in, next player!');
            NextPlayer(True);
            Loads:=0;
            mainloop;
          end;
          if Loads >= players[currentplayer].integers[0] then
          begin
            RandomSleep:=players[currentplayer].integers[2]*60000;
            TotalSleep:=players[currentplayer].integers[1]*60000;
              if (players[currentplayer].Booleans[0]=false) then
              begin
                NextPlayer(True);
                Loads:=0;
                mainloop;
              end;
              if (players[currentplayer].Booleans[0]=true) then
              begin
                logout;
                sleep(TotalSleep+random(RandomSleep));
                Loads:=0;
                mainloop;
              end;
          end;
    
    goshop;
    useshop;
    buy;
    chicks:=chicks+CountItems(chickdtm,'dtm',[0,0]);
    gobank;
    srlstuff;
    usebank;
    getcoinage;
    antirandoms;
    proggy;
    Until(Not LoggedIn);
    end;
    
    begin
      setup;
      activateclient;
      loginplayer;
      makecompass('N');
      mainloop;
    end.
    Resist and Multiply

  2. #2
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    tell me how this works out for you.
    just changed a few lines.

    SCAR Code:
    program new;
    {.include SRL/SRL/misc/SMART.scar}
    {.include srl/srl.scar}
    {.include srl/srl/misc/users.scar}
    var x,y,loads,RandomSleep,TotalSleep,chicks,chickdtm:integer;

    procedure loaddtms; forward;

    procedure setup;
    begin
      setupsrl;
      SRLPlayerForm(True,['sleep'],['loads to buy','minutes to sleep', 'Random sleep in minutes'],['SRL I.D','SRL Pass'],[]);
      SmartSetup('world83', True, true, False);
      SetTargetDC(SmartGetDC);
      Wait(100);
      ScriptID := '811';
      SRLID:=players[currentplayer].strings[0];
      SRLPassword:=players[currentplayer].strings[1];
      loaddtms;
    end;

    Procedure MainLoop; Forward;

    procedure antiban; forward;


    procedure goshop;
    begin
      if radialwalk(65536,280,360,72,4,4) then wait(1000);
      if findsymbol(x, y,'food shop')then
      begin
        mouse(x,y,2,2,true);
      end else
      if findsymbol(x, y,'bank')then
      begin
        mouse(x,y,2,2,true);
        mainloop;
      end;
      antiban;
    end;

    Procedure FindFightEx;
    Begin
      If(FindFight) then
      Begin
        Status('Fight found!');
        Writeln('Our player is being attacked!')
        Writeln('Lets run away!')
        Begin
          Status('Running away!');
          WriteLn('Running....')
          RunAway('W',False,1,8000+Random(3000))
          WriteLn('Successfully ran away from fight!')
        end;
      end;
    end;

    // BY Starblaster
    function FindObjCustom2(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tolerance: Integer): Boolean;
    var
      a, b, c, i, x1, y1, x2, y2: Integer;
      Start: Boolean;
    begin
      for b := 0 to (GetArrayLength(Color)-1) do
      begin
        if (FindColorSpiralTolerance(cx, cy, color[b], MSX1, MSY1, MSX2, MSY2, Tolerance)) then
        begin
          Start := True;
          Break;
        end;
      end;
      if(Start)then
      begin
        x1 := 245;
        y1 := 165;
        x2 := 277;
        y2 := 185;
        repeat
          if not(LoggedIn)then break;
          a := a + 1;
          if (a = 1) then
            c := c + 1
          else if (a = 3) then
            c := c + 1;
          for i := 1 to c do
          begin
            if (a = 1) then
            begin
              x1 := x1 + 30;
              x2 := x2 + 30;
            end else
            if (a = 2) then
            begin
              y1 := y1 - 20;
              y2 := y2 - 20;
            end else
            if (a = 3) then
            begin
              x1 := x1 - 30;
              x2 := x2 - 30;
            end else
            if (a = 4) then
            begin
              y1 := y1 + 20;
              y2 := y2 + 20;
            end;
            if (x1 = 485) and (x2 = 517) then
              x2 := x2 - 2;
            if (y1 = 325) and (y2 = 345) then
              y2 := y2 - 7;
            if (x2 > 515) then
              Break;
            for b := 0 to (GetArrayLength(Color)-1) do
            begin
              if (FindColorTolerance(cx, cy, Color[b], x1, y1, x2, y2, tolerance)) then
              begin
                MMouse(cx, cy, 3, 3);
                Wait(5+Random(10));
                if (IsUpTextMultiCustom(Text)) then
                begin
                  Result := True;
                  Exit;
                end;
              end;
            end;
          end;
          if (a = 4) then
            a := 0;
        until (x2 > 515) or (Result = True);
      end;
    end;

    procedure loaddtms;
    begin
    chickDTM := DTMFromString('78DA632C626460F8C880020E2F59CCF01F480' +
           '36518FE03012348CD4F0634C0884402E90620EB3301355940D61B' +
           '026A3280AC1F04D4D402598FF0AB0100308F0F73');
    end;

    procedure useshop;
    var tries:integer;
    begin
      repeat
        if FindObjCustom2(x, y, ['ufus'], [8431572,7444678,9935011], 10)then
        begin
          if(IsUpText('alk'))then
          begin
            Mouse(x, y, 5, 5, false);
            if(ChooseOption('Trade'))then
            fflag(0);
          end;
        end else
        wait(1000+random(100));
        tries:=tries+1;
      until (((getcolor(485, 42))=65536)or(tries>=10));
      tries:=0;
    end;

    procedure srlstuff;
    begin
      reportVars[0] := ReportVars[0] + CountItems(chickdtm,'dtm',[0,0]);
      reportVars[1] := ReportVars[1] + 1;
      srlrandomsreport;
    end;

    procedure buy;
    begin
     if FindObjCustom2(x, y, ['hick'], [10593218, 9408948, 10856388],10) then
      begin
        mouse(x,y,3,3,false);
        ChooseOption('X');
        wait(800+random(500));
        Typesend('99');
        wait(600+random(300));
        Mouse(486,40,2,2,True);
        wait(1000+random(200));
        exit;
      end;
    end;

    procedure antiban;
    var
    noban: Integer;
    Begin
      If Not (LoggedIn) Then Exit;
      noban := Random(21);
      Case noban Of
        0,9,17: PickUpMouse;
        1,13,16: RandomRclick;
        2,10,18: randomMovement;
        5,11,8:  ChooseOption('cancel');
        6,15,21: MMouse(Random(MSX2), Random(MSY2), 0, 0);
        7,14,3: HoverSkill('woodcutting', false);
      end;
    end;

    procedure gobank;
    begin
    if radialwalk(65536,160,200,72,4,4) then wait(1000);
    if (findsymbol(x, y,'bank'))then mouse(x,y,2,2,true);
    antiban;
    end;

    procedure usebank;
    var tries:integer;
    begin
    repeat
    if FindObjCustom2(x, y, ['ooth'], [8161164,2898753,3032913], 10)then
        begin
          if(IsUpText('Use'))then
          begin
            Mouse(x, y, 5, 5, false);
            if(ChooseOption('ckly'))then
            fflag(0);
          end;
        end else
        wait(1000+random(100));
        tries:=tries+1;
        writeln(inttostr(tries));
    until ((BankScreen)or(tries>=5));
      tries:=0;
      if bankscreen then deposit(1,28,true);
      loads:=loads+1;
    end;

    procedure getcoinage;
    var
    Cash: TIntegerArray;
    t: Integer;
    begin
      if(not(LoggedIn))then Exit;
      Cash := [2014952,2148340,1745606,2014437,1947358,2148854];
      for t := 0 to 2 do
      begin
        if(FindColorSpiralTolerance(x,y,Cash[t],76,70,111,85,3))then
        begin
          mouse(x,y,3,3,false);
          ChooseOption('X');
          wait(800+random(500));
          Typesend('252');
          wait(600+random(300));
          CloseBank;
          wait(1000+random(300));
          exit;
        end else
          writeln('out of cash');
          CloseBank;
          nextplayer(false);
          mainloop;
        end;
    end;

    procedure proggy;
    begin
    cleardebug;
    writeln('progress report');
    writeln('ran for '+timerunning);
    writeln('banked '+inttostr(chicks)+' chickens');
    writeln('banked '+inttostr(loads)+' loads');
    end;

    Procedure AntiRandoms;
    var
    i : Integer;
    Begin
      Status('Doing AntiRandoms');
      for i := 0 to 3 do
      begin
        FindNormalRandoms;
        FindFightEx;
        FindNonInventoryRandoms;
        wait(1)
      end;
    end;

    procedure mainloop;
    begin
    repeat
    if not loggedin then loginplayer;
          If (Not (LoggedIn)) then
          Begin
            writeln('Not logged in, next player!');
            NextPlayer(True);
            Loads:=0;
            mainloop;
          end;
          if Loads >= players[currentplayer].integers[0] then
          begin
            RandomSleep:=players[currentplayer].integers[2]*60000;
            TotalSleep:=players[currentplayer].integers[1]*60000;
              if (players[currentplayer].Booleans[0]=false) then
              begin
                NextPlayer(True);
                Loads:=0;
                mainloop;
              end;
              if (players[currentplayer].Booleans[0]=true) then
              begin
                logout;
                sleep(TotalSleep+random(RandomSleep));
                Loads:=0;
                mainloop;
              end;
          end;

    goshop;
    useshop;
    buy;
    chicks:=chicks+CountItems(chickdtm,'dtm',[0,0]);
    gobank;
    srlstuff;
    usebank;
    getcoinage;
    antirandoms;
    proggy;
    Until(Not LoggedIn);
    end;

    begin
      setup;
      activateclient;
      loginplayer;
      makecompass('N');
      mainloop;
    end.

  3. #3
    Join Date
    Apr 2008
    Posts
    99
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    awesome that worked great.
    now i just need to figure out why it logs out strait away.

    thanks
    Resist and Multiply

  4. #4
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Not to be rude, but the mainloop, nay, the entire script weren't written very well.
    It has several NextPlayer(True);'s where there shouldn't be any.

    Most likely all it will do is log you out.

  5. #5
    Join Date
    Apr 2008
    Posts
    99
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    lol,
    its woddo's work, it did work once but that was months ago.
    iv tried to get others to remake it but no ones interested.
    i don't suppose you'd want to......
    lol
    Resist and Multiply

  6. #6
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It's too jumbled together, you can't really understand what it's doing.

  7. #7
    Join Date
    Apr 2008
    Posts
    99
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    its a chicken buyer.
    start it in canafis bank and it will buy and bank chickens.

    could you make a new one for me please. i would make it myself but with my job i don't really get much time to learn how to script
    Resist and Multiply

  8. #8
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I would, but I don't have a members account.

  9. #9
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  10. #10
    Join Date
    Apr 2008
    Posts
    99
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Creating the NickTPA.
    NextPlayer(Active: True);

    thats the last thing it says before loging out

    EDIT: thanks for having a look.
    Resist and Multiply

  11. #11
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    try this and tell me what it says in the debug
    SCAR Code:
    program new;
    {.include SRL/SRL/misc/SMART.scar}
    {.include srl/srl.scar}
    {.include srl/srl/misc/users.scar}
    var x,y,loads,RandomSleep,TotalSleep,chicks,chickdtm:integer;

    procedure loaddtms; forward;

    procedure setup;
    begin
      setupsrl;
      SRLPlayerForm(True,['sleep'],['loads to buy','minutes to sleep', 'Random sleep in minutes'],['SRL I.D','SRL Pass'],[]);
      SmartSetup('world83', True, true, False);
      SetTargetDC(SmartGetDC);
      Wait(100);
      ScriptID := '811';
      SRLID:=players[currentplayer].strings[0];
      SRLPassword:=players[currentplayer].strings[1];
      loaddtms;
    end;

    Procedure MainLoop; Forward;

    procedure antiban; forward;


    procedure goshop;
    begin
      if radialwalk(65536,280,360,72,4,4) then wait(1000);
      if findsymbol(x, y,'food shop')then
      begin
        mouse(x,y,2,2,true);
      end else
      if findsymbol(x, y,'bank')then
      begin
        mouse(x,y,2,2,true);
        mainloop;
      end;
      antiban;
    end;

    Procedure FindFightEx;
    Begin
      If(FindFight) then
      Begin
        Status('Fight found!');
        Writeln('Our player is being attacked!')
        Writeln('Lets run away!')
        Begin
          Status('Running away!');
          WriteLn('Running....')
          RunAway('W',False,1,8000+Random(3000))
          WriteLn('Successfully ran away from fight!')
        end;
      end;
    end;

    // BY Starblaster
    function FindObjCustom2(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tolerance: Integer): Boolean;
    var
      a, b, c, i, x1, y1, x2, y2: Integer;
      Start: Boolean;
    begin
      for b := 0 to (GetArrayLength(Color)-1) do
      begin
        if (FindColorSpiralTolerance(cx, cy, color[b], MSX1, MSY1, MSX2, MSY2, Tolerance)) then
        begin
          Start := True;
          Break;
        end;
      end;
      if(Start)then
      begin
        x1 := 245;
        y1 := 165;
        x2 := 277;
        y2 := 185;
        repeat
          if not(LoggedIn)then break;
          a := a + 1;
          if (a = 1) then
            c := c + 1
          else if (a = 3) then
            c := c + 1;
          for i := 1 to c do
          begin
            if (a = 1) then
            begin
              x1 := x1 + 30;
              x2 := x2 + 30;
            end else
            if (a = 2) then
            begin
              y1 := y1 - 20;
              y2 := y2 - 20;
            end else
            if (a = 3) then
            begin
              x1 := x1 - 30;
              x2 := x2 - 30;
            end else
            if (a = 4) then
            begin
              y1 := y1 + 20;
              y2 := y2 + 20;
            end;
            if (x1 = 485) and (x2 = 517) then
              x2 := x2 - 2;
            if (y1 = 325) and (y2 = 345) then
              y2 := y2 - 7;
            if (x2 > 515) then
              Break;
            for b := 0 to (GetArrayLength(Color)-1) do
            begin
              if (FindColorTolerance(cx, cy, Color[b], x1, y1, x2, y2, tolerance)) then
              begin
                MMouse(cx, cy, 3, 3);
                Wait(5+Random(10));
                if (IsUpTextMultiCustom(Text)) then
                begin
                  Result := True;
                  Exit;
                end;
              end;
            end;
          end;
          if (a = 4) then
            a := 0;
        until (x2 > 515) or (Result = True);
      end;
    end;

    procedure loaddtms;
    begin
    chickDTM := DTMFromString('78DA632C626460F8C880020E2F59CCF01F480' +
           '36518FE03012348CD4F0634C0884402E90620EB3301355940D61B' +
           '026A3280AC1F04D4D402598FF0AB0100308F0F73');
    end;

    procedure useshop;
    var tries:integer;
    begin
      repeat
        if FindObjCustom2(x, y, ['ufus'], [8431572,7444678,9935011], 10)then
        begin
          if(IsUpText('alk'))then
          begin
            Mouse(x, y, 5, 5, false);
            if(ChooseOption('Trade'))then
            fflag(0);
          end;
        end else
        wait(1000+random(100));
        tries:=tries+1;
      until (((getcolor(485, 42))=65536)or(tries>=10));
      tries:=0;
    end;

    procedure srlstuff;
    begin
      reportVars[0] := ReportVars[0] + CountItems(chickdtm,'dtm',[0,0]);
      reportVars[1] := ReportVars[1] + 1;
      srlrandomsreport;
    end;

    procedure buy;
    begin
     if FindObjCustom2(x, y, ['hick'], [10593218, 9408948, 10856388],10) then
      begin
        mouse(x,y,3,3,false);
        ChooseOption('X');
        wait(800+random(500));
        Typesend('99');
        wait(600+random(300));
        Mouse(486,40,2,2,True);
        wait(1000+random(200));
        exit;
      end;
    end;

    procedure antiban;
    var
    noban: Integer;
    Begin
      If Not (LoggedIn) Then Exit;
      noban := Random(21);
      Case noban Of
        0,9,17: PickUpMouse;
        1,13,16: RandomRclick;
        2,10,18: randomMovement;
        5,11,8:  ChooseOption('cancel');
        6,15,21: MMouse(Random(MSX2), Random(MSY2), 0, 0);
        7,14,3: HoverSkill('woodcutting', false);
      end;
    end;

    procedure gobank;
    begin
    if radialwalk(65536,160,200,72,4,4) then wait(1000);
    if (findsymbol(x, y,'bank'))then mouse(x,y,2,2,true);
    antiban;
    end;

    procedure usebank;
    var tries:integer;
    begin
      repeat
        if FindObjCustom2(x, y, ['ooth'], [8161164,2898753,3032913], 10)then
        begin
          if(IsUpText('Use'))then
          begin
            Mouse(x, y, 5, 5, false);
            if(ChooseOption('ckly'))then
            fflag(0);
          end;
        end else
        wait(1000+random(100));
        tries:=tries+1;
        writeln(inttostr(tries));
      until ((BankScreen)or(tries>=5));
      tries:=0;
      if bankscreen then deposit(1,28,true);
      loads:=loads+1;
    end;

    procedure getcoinage;
    var
    Cash: TIntegerArray;
    t: Integer;
    begin
      if(not(LoggedIn))then Exit;
      Cash := [2014952,2148340,1745606,2014437,1947358,2148854];
      for t := 0 to 2 do
      begin
        if(FindColorSpiralTolerance(x,y,Cash[t],76,70,111,85,3))then
        begin
          mouse(x,y,3,3,false);
          ChooseOption('X');
          wait(800+random(500));
          Typesend('252');
          wait(600+random(300));
          CloseBank;
          wait(1000+random(300));
          exit;
        end else
          writeln('out of cash');
          CloseBank;
          nextplayer(false);
          mainloop;
        end;
    end;

    procedure proggy;
    begin
    cleardebug;
    writeln('progress report');
    writeln('ran for '+timerunning);
    writeln('banked '+inttostr(chicks)+' chickens');
    writeln('banked '+inttostr(loads)+' loads');
    end;

    Procedure AntiRandoms;
    var
    i : Integer;
    Begin
      Status('Doing AntiRandoms');
      for i := 0 to 3 do
      begin
        FindNormalRandoms;
        FindFightEx;
        FindNonInventoryRandoms;
        wait(1)
      end;
    end;

    procedure mainloop;
    begin
      repeat
        if not loggedin then loginplayer;
        If (Not (LoggedIn)) then
        Begin
          writeln('Not logged in, next player!');
          NextPlayer(True);
          Loads:=0;
          mainloop;
        end;
        if Loads >= players[currentplayer].integers[0] then
        begin
          RandomSleep:=players[currentplayer].integers[2]*60000;
          TotalSleep:=players[currentplayer].integers[1]*60000;
          if (players[currentplayer].Booleans[0]=false) then
          begin
            NextPlayer(True);
            Writeln('1');
            Loads:=0;
            mainloop;
          end;
          if (players[currentplayer].Booleans[0]=true) then
          begin
            logout;
            sleep(TotalSleep+random(RandomSleep));
            Loads:=0;
            mainloop;
          end;
        end;
        goshop;
        useshop;
        buy;
        chicks:=chicks+CountItems(chickdtm,'dtm',[0,0]);
        gobank;
        srlstuff;
        usebank;
        getcoinage;
        antirandoms;
        proggy;
      Until(Not LoggedIn);
    end;

    begin
      setup;
      activateclient;
      loginplayer;
      makecompass('N');
      mainloop;
    end.


    ~shut

  12. #12
    Join Date
    Apr 2008
    Posts
    99
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    same again

    Creating the NickTPA.
    NextPlayer(Active: True);

    does that help?
    am i doing something wrong?
    Resist and Multiply

  13. #13
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  14. #14
    Join Date
    Apr 2008
    Posts
    99
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    no, should it?
    Resist and Multiply

  15. #15
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    try this and copy everything in the debugbox
    SCAR Code:
    program new;
    {.include SRL/SRL/misc/SMART.scar}
    {.include srl/srl.scar}
    {.include srl/srl/misc/users.scar}
    var x,y,loads,RandomSleep,TotalSleep,chicks,chickdtm:integer;

    procedure loaddtms; forward;

    procedure setup;
    begin
      setupsrl;
      SRLPlayerForm(True,['sleep'],['loads to buy','minutes to sleep', 'Random sleep in minutes'],['SRL I.D','SRL Pass'],[]);
      SmartSetup('world83', True, true, False);
      SetTargetDC(SmartGetDC);
      Wait(100);
      ScriptID := '811';
      SRLID:=players[currentplayer].strings[0];
      SRLPassword:=players[currentplayer].strings[1];
      loaddtms;
    end;

    Procedure MainLoop; Forward;

    procedure antiban; forward;


    procedure goshop;
    begin
      if radialwalk(65536,280,360,72,4,4) then wait(1000);
      if findsymbol(x, y,'food shop')then
      begin
        mouse(x,y,2,2,true);
      end else
      if findsymbol(x, y,'bank')then
      begin
        mouse(x,y,2,2,true);
        mainloop;
      end;
      antiban;
    end;

    Procedure FindFightEx;
    Begin
      If(FindFight) then
      Begin
        Status('Fight found!');
        Writeln('Our player is being attacked!')
        Writeln('Lets run away!')
        Begin
          Status('Running away!');
          WriteLn('Running....')
          RunAway('W',False,1,8000+Random(3000))
          WriteLn('Successfully ran away from fight!')
        end;
      end;
    end;

    // BY Starblaster
    function FindObjCustom2(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tolerance: Integer): Boolean;
    var
      a, b, c, i, x1, y1, x2, y2: Integer;
      Start: Boolean;
    begin
      for b := 0 to (GetArrayLength(Color)-1) do
      begin
        if (FindColorSpiralTolerance(cx, cy, color[b], MSX1, MSY1, MSX2, MSY2, Tolerance)) then
        begin
          Start := True;
          Break;
        end;
      end;
      if(Start)then
      begin
        x1 := 245;
        y1 := 165;
        x2 := 277;
        y2 := 185;
        repeat
          if not(LoggedIn)then break;
          a := a + 1;
          if (a = 1) then
            c := c + 1
          else if (a = 3) then
            c := c + 1;
          for i := 1 to c do
          begin
            if (a = 1) then
            begin
              x1 := x1 + 30;
              x2 := x2 + 30;
            end else
            if (a = 2) then
            begin
              y1 := y1 - 20;
              y2 := y2 - 20;
            end else
            if (a = 3) then
            begin
              x1 := x1 - 30;
              x2 := x2 - 30;
            end else
            if (a = 4) then
            begin
              y1 := y1 + 20;
              y2 := y2 + 20;
            end;
            if (x1 = 485) and (x2 = 517) then
              x2 := x2 - 2;
            if (y1 = 325) and (y2 = 345) then
              y2 := y2 - 7;
            if (x2 > 515) then
              Break;
            for b := 0 to (GetArrayLength(Color)-1) do
            begin
              if (FindColorTolerance(cx, cy, Color[b], x1, y1, x2, y2, tolerance)) then
              begin
                MMouse(cx, cy, 3, 3);
                Wait(5+Random(10));
                if (IsUpTextMultiCustom(Text)) then
                begin
                  Result := True;
                  Exit;
                end;
              end;
            end;
          end;
          if (a = 4) then
            a := 0;
        until (x2 > 515) or (Result = True);
      end;
    end;

    procedure loaddtms;
    begin
    chickDTM := DTMFromString('78DA632C626460F8C880020E2F59CCF01F480' +
           '36518FE03012348CD4F0634C0884402E90620EB3301355940D61B' +
           '026A3280AC1F04D4D402598FF0AB0100308F0F73');
    end;

    procedure useshop;
    var tries:integer;
    begin
      repeat
        if FindObjCustom2(x, y, ['ufus'], [8431572,7444678,9935011], 10)then
        begin
          if(IsUpText('alk'))then
          begin
            Mouse(x, y, 5, 5, false);
            if(ChooseOption('Trade'))then
            fflag(0);
          end;
        end else
        wait(1000+random(100));
        tries:=tries+1;
      until (((getcolor(485, 42))=65536)or(tries>=10));
      tries:=0;
    end;

    procedure srlstuff;
    begin
      reportVars[0] := ReportVars[0] + CountItems(chickdtm,'dtm',[0,0]);
      reportVars[1] := ReportVars[1] + 1;
      srlrandomsreport;
    end;

    procedure buy;
    begin
     if FindObjCustom2(x, y, ['hick'], [10593218, 9408948, 10856388],10) then
      begin
        mouse(x,y,3,3,false);
        ChooseOption('X');
        wait(800+random(500));
        Typesend('99');
        wait(600+random(300));
        Mouse(486,40,2,2,True);
        wait(1000+random(200));
        exit;
      end;
    end;

    procedure antiban;
    var
    noban: Integer;
    Begin
      If Not (LoggedIn) Then Exit;
      noban := Random(21);
      Case noban Of
        0,9,17: PickUpMouse;
        1,13,16: RandomRclick;
        2,10,18: randomMovement;
        5,11,8:  ChooseOption('cancel');
        6,15,21: MMouse(Random(MSX2), Random(MSY2), 0, 0);
        7,14,3: HoverSkill('woodcutting', false);
      end;
    end;

    procedure gobank;
    begin
    if radialwalk(65536,160,200,72,4,4) then wait(1000);
    if (findsymbol(x, y,'bank'))then mouse(x,y,2,2,true);
    antiban;
    end;

    procedure usebank;
    var tries:integer;
    begin
      repeat
        if FindObjCustom2(x, y, ['ooth'], [8161164,2898753,3032913], 10)then
        begin
          if(IsUpText('Use'))then
          begin
            Mouse(x, y, 5, 5, false);
            if(ChooseOption('ckly'))then
            fflag(0);
          end;
        end else
        wait(1000+random(100));
        tries:=tries+1;
        writeln(inttostr(tries));
      until ((BankScreen)or(tries>=5));
      tries:=0;
      if bankscreen then deposit(1,28,true);
      loads:=loads+1;
    end;

    procedure getcoinage;
    var
    Cash: TIntegerArray;
    t: Integer;
    begin
      if(not(LoggedIn))then Exit;
      Cash := [2014952,2148340,1745606,2014437,1947358,2148854];
      for t := 0 to 2 do
      begin
        if(FindColorSpiralTolerance(x,y,Cash[t],76,70,111,85,3))then
        begin
          mouse(x,y,3,3,false);
          ChooseOption('X');
          wait(800+random(500));
          Typesend('252');
          wait(600+random(300));
          CloseBank;
          wait(1000+random(300));
          exit;
        end else
          writeln('out of cash');
          CloseBank;
          nextplayer(false);
          mainloop;
        end;
    end;

    procedure proggy;
    begin
    cleardebug;
    writeln('progress report');
    writeln('ran for '+timerunning);
    writeln('banked '+inttostr(chicks)+' chickens');
    writeln('banked '+inttostr(loads)+' loads');
    end;

    Procedure AntiRandoms;
    var
    i : Integer;
    Begin
      Status('Doing AntiRandoms');
      for i := 0 to 3 do
      begin
        FindNormalRandoms;
        FindFightEx;
        FindNonInventoryRandoms;
        wait(1)
      end;
    end;

    procedure mainloop;
    begin
      repeat
        if not loggedin then loginplayer;
        If (Not (LoggedIn)) then
        Begin
          writeln('Not logged in, next player!');
          NextPlayer(True);
          Loads:=0;
          mainloop;
        end;
        if Loads >= players[currentplayer].integers[0] then
        begin
          RandomSleep:=players[currentplayer].integers[2]*60000;
          TotalSleep:=players[currentplayer].integers[1]*60000;
          if (players[currentplayer].Booleans[0]=false) then
          begin
            Writeln('1');
            NextPlayer(True);
            Loads:=0;
            mainloop;
          end;
          if (players[currentplayer].Booleans[0]=true) then
          begin
            logout;
            sleep(TotalSleep+random(RandomSleep));
            Loads:=0;
            mainloop;
          end;
        end;
        goshop;
        useshop;
        buy;
        chicks:=chicks+CountItems(chickdtm,'dtm',[0,0]);
        gobank;
        srlstuff;
        usebank;
        getcoinage;
        antirandoms;
        proggy;
      Until(Not LoggedIn);
    end;

    begin
      setup;
      activateclient;
      loginplayer;
      makecompass('N');
      mainloop;
    end.

    ~shut

  16. #16
    Join Date
    Apr 2008
    Posts
    99
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Successfully compiled (1743 ms)
    SRL Compiled in 16 msec
    Welcome to Runescape.
    *******
    Creating the NickTPA.
    1
    NextPlayer(Active: True);
    Successfully executed

    i *'d my account name but that's the only change i made.
    Resist and Multiply

  17. #17
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  18. #18
    Join Date
    Apr 2008
    Posts
    99
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    omg i feel like a fool.
    all cos i missed one box on the form.
    sorry about that and thanks soo much for helping.
    Resist and Multiply

  19. #19
    Join Date
    Apr 2008
    Posts
    99
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    damn script still doesn't work right, looks like im gunna have to buy chickens manually.
    Resist and Multiply

  20. #20
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  21. #21
    Join Date
    Apr 2008
    Posts
    99
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    it logs in and buys 1 lot of chicken but struggles to find the chicken in the shop.
    then wen it goes to bank it cant find the money and just logs out.
    Resist and Multiply

  22. #22
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  23. #23
    Join Date
    Apr 2008
    Posts
    99
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    hmmmm,
    ill see if i can use one of my army for it.
    ill pm you
    Resist and Multiply

  24. #24
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

Thread Information

Users Browsing this Thread

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

Posting Permissions

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