Results 1 to 2 of 2

Thread: standards

  1. #1
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default standards

    ok as some of you amy no im not new to scripting but im new to standards

    which probably isnt good cause now it looks like crap most of the time

    but anyways heres my first attempt at standards from memory is this right or is it not

    Code:
    {.include srl/srl/misc/smart.scar}
    {.include srl/srl.scar}
    
    
    var
      x, y, loads :integer;
    
    
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1; // If you add more players , make sure you set this correct, ;)
      NumberOfPlayers(HowManyPlayers);
    
      Players[0].Name := ''; //Your username
      Players[0].Pass := ''; //Your password
      Players[0].Nick := ''; //Nickname from you username
      Players[0].Active := True; //Active->True or False.
      Players[0].Integers[0] := 99; //Loads to do.
      Players[0].Strings[1] := 'mining'; //what skill do u want to do mining, wcing , or prayer
      Players[0].strings[2] := 'iron' //what tree or ore or bone do u want to power skill
      Players[0].strings[3] := '0000' // pin number
      Players[0].BoxRewards := ['Xp', 'ostume', 'gem', 'mote', 'ithril', 'oal'];//What do u want out of randomns
      players[0].loc :='start'//no touchy
      { woodcutting
         tree =  normal   oak =oak  willow= willow yew = yew
    
      mining
        all the normal ore name must be spelled perfectly
          }
    end;
    
    
    procedure antibanz;
    begin
      If(not LoggedIn)then Exit;
      Case Random(9) of
        0:  MMouse(Random(MSX2),Random(MSY2),0,0);
        1:  PickupMouse;
        2:  SleepAndMoveMouse(400+Random(1500));
        3:  if Random(2) = 1 then MMouse(1, 338, 515, 165);
        4:  if Random(2) = 1 then MMouse(515, 1, 250, 503);
        5:  RandomMovement;
     6..9:
    begin
      case Random(3) of
       0: begin
            KeyDown(VK_RIGHT);
            Wait(500+Random(2000));
            KeyUp(VK_RIGHT);
        end;
       1: begin
            KeyDown(VK_Left);
            Wait(500+Random(2000));
            KeyUp(VK_Left);
          end;
       2: begin
            case Random(2) of
              0: begin
                   KeyDown(VK_RIGHT);
                   Wait(500+Random(1400));
                   KeyUp(VK_RIGHT);
                 end;
              1: begin
                   KeyDown(VK_Left);
                   Wait(500+Random(1400));
                   KeyUp(VK_Left);
                end;
              end;
            end;
          end;
        end;
      end;
    end;
    
    
    procedure findrandoms;
    begin
      LampSkill := 'mining';
      FindNormalRandoms;
      if not LoggedIn then
        players[currentplayer].loc := 'failed at random srry'
    end;
    
    
    
    procedure woodcutting;
    var
      x, y, H, m, cts, i, maincolor: integer;
      TreeUptext: string;
      WillowPoints, TreePoints, TPA: TPointArray;
      ATPA: T2DPointArray;
      
      
    begin
      if not LoggedIn then exit;
      case lowercase(players[currentplayer].strings[3]) of
        'willow': TreeUptext := 'illo';
        'oak': TreeUptext := 'Oak';
        'tree': TreeUptext := 'ree';
      end;
      if (players[currentplayer].strings[2] = 'oak') then
        maincolor := 3173729;
         if (players[currentplayer].strings[2] = 'willow') then
          maincolor := 2570803;
           if (players[currentplayer].strings[2] = 'tree') then
            maincolor := 863784;
            repeat
              if not LoggedIn then exit;
              CTS := GetColorToleranceSpeed;
              ColorToleranceSpeed(2);
              SetColorSpeed2Modifiers(0.2, 0.2);
              FindColorsTolerance(WillowPoints, maincolor, MSX1, MSY1, MSX2, MSY2, 5);
              FindColorsTolerance(TreePoints, 1988172, MSX1, MSY1, MSX2, MSY2, 5);
              TPA := CombineTPA(WillowPoints, TreePoints);
              if (Length(TPA) = 0) then Exit;
              ATPA := SplitTPAEx(TPA, 9, 9);
              SortATPAFrom(ATPA, Point(MSCX, MSCY));
              H := High(ATPA) - 1;
              for I := 0 to H do
              begin
                MiddleTPAEx(ATPA[i], x, y);
                MMouse(x, y, 3, 3);
                Wait(100 + Random(200));
                if IsUpText('Oak') then
                begin
                  marktime(m)
                  Mouse(x, y, 3, 3, True);
                  ismoving(10);
                  wait(15000 + random(400));
                  findrandoms;
                  antibanz;
                end;
                AntiBanz;
                FindRandoms;
                if not (LoggedIn) then
                begin
                  NextPlayer(False);
                  LoginPlayer;
                end;
              end;
      until invfull or FindChatBoxText('full to', 8, 0)
    end;
    
    
    procedure logdropping;
    var
      logdtm:integer;
    begin
      repeat
        if not LoggedIn then exit;
        logDTM := DTMFromString('78DA63CC66626078C28002EA12AD181E02694' +
                '620FE0F048C1940357718D000231209A48B806A6E1250530654F3' +
                '88809A6AA09A6704D45400D5BC21A0A618A8E62D0135E940351F0' +
                '9A84924C29C58A09AA7B8D570C0CCB94F404D32FE7006A90100DC' +
                'FE160C');
        If FindDTM(logDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
        Begin
          Mouse(x,y,2,2,False);
          wait(random(200));
          ChooseOption('Drop');
          wait(500 + random(100))
          findrandoms;
       end;
      Until not FindDTM(logDTM,x,y,MIX1,MIY1,MIX2,MIY2);
    end;
    
    
    procedure mineores;
    var
      x, y, H, m, cts, i, maincolor, basecolor, inv, invset: integer;
      TreeUptext: string;
      MainPoints, BasePoints, TPA: TPointArray;
      ATPA: T2DPointArray;
    
    
    begin
      disguise('mining')
      if not LoggedIn then exit;
      if (players[currentplayer].strings[2] = 'Tin') then
        maincolor := 10197927;
        basecolor := 3421240;
         if (players[currentplayer].strings[2] = 'copper') then
           maincolor := 3430801;
           basecolor := 602956;
           if (players[currentplayer].strings[2] = 'iron') then
            maincolor := 2503507;
            Basecolor := 1004667;
            if (players[currentplayer].strings[2] = 'gold') then
              maincolor := 1748437;
              Basecolor := 1345703;
              repeat
                if not LoggedIn then exit;
                CTS := GetColorToleranceSpeed;
                ColorToleranceSpeed(2);
                SetColorSpeed2Modifiers(0.2, 0.2);
                FindColorsTolerance(MainPoints, maincolor, MSX1, MSY1, MSX2, MSY2, 5);
                FindColorsTolerance(BasePoints, Basecolor, MSX1, MSY1, MSX2, MSY2, 5);
                TPA := CombineTPA(MainPoints, BasePoints);
                if (Length(TPA) = 0) then Exit;
                ATPA := SplitTPAEx(TPA, 9, 9);
                SortATPAFrom(ATPA, Point(MSCX, MSCY));
                H := High(ATPA) - 1;
                for I := 0 to H do
                begin
                  MiddleTPAEx(ATPA[i], x, y);
                  MMouse(x, y, 3, 3);
                  Wait(100 + Random(200));
                  if IsUpText('Rock') then
                  begin
                    Mouse(x, y, 4, 4, True);
                    Marktime(m);
                    invset:=invcount;
                    repeat
                      inv:=invcount;
                      wait (100);
                      findrandoms;
                    until ((invset < Inv) or (TimeFromMark(m) > 15000) or FindChatBoxText('availa', 8, 0));
                  AntiBanz;
                  FindRandoms;
                  if not (LoggedIn) then
                  begin
                    NextPlayer(False);
                    LoginPlayer;
                  end;
                end;
              end;
      until invfull or FindChatBoxText('full to', 8, 0)
    end;
    
    
    procedure OreDropping;
    
    var OreDTM:integer;
    begin
      if not LoggedIn then exit;
      OreDTM := DTMFromString('78DA637463626078C28002FC0C54181E02694' +
         '620FE0F048CEE40353718D000231209A403816AEE1350E30D54F3' +
         '86801A7BA09A4F04D49800D53C26C29CEBF8D5000045B70DB0');
      repeat
       if not LoggedIn then exit;
       Disguise('dropping ores');
       If FindDTM(OreDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
       Begin
        Mouse(x,y,2,2,False);
        wait(random(200));
        ChooseOption('Drop');
        wait(500 + random(100))
        findrandoms;
       end;
      Until not FindDTM(OreDTM,x,y,MIX1,MIY1,MIX2,MIY2);
      inc(loads);
    end;
    
    
    
    
    procedure proggy;
    begin
      cleardebug;
      SrlRandomsReport;
      WriteLn('             _____  ______')
      WriteLn('            |     ||      \    ')
      WriteLn('            |     ||       |  ')
      WriteLn('            |     ||   ___/   ')
      WriteLn('           /_____/ |__|    Power Skiller')
      WriteLn('_________________________________________________')
      WriteLn('        Ran for ' + timerunning               )
      WriteLn('        Skill trained ' + Players[CurrentPlayer].Strings[1] )
      WriteLn('        Loads done ' + inttostr(loads));
      WriteLn('        Thank You For Using JP Power skiller')
      WriteLn('        Your player is currently at ' + players[currentplayer].loc)
      WriteLn('_________________________________________________')
    end;
    
    begin
      SmartSetupEx(49, false, true, false);
      while not SmartActive do wait(100);
      SetTargetDC(SmartGetDC);
      setupsrl;
      activateclient;
      GraphicsSet := true;
      declareplayers;
      Login_SetAudio(1, 1, 1, NoChange);
      loginplayer;
      loads:=0;
      repeat
        GetTimeRunning;
        proggy
        if Players[CurrentPlayer].strings[1] = 'woodcutting' then
          players[currentplayer].loc := 'trees';
          woodcutting;
          if Players[CurrentPlayer].strings[1] = 'woodcutting' then
          logdropping;
          if Players[CurrentPlayer].strings[1] = 'mining' then
            players[currentplayer].loc := 'mines';
            mineores;
            if Players[CurrentPlayer].strings[1] = 'mining' then
            oredropping;
            inc(loads);
      until(loads = Players[CurrentPlayer].Integers[0])
    end.

  2. #2
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    skimming through it, overall it looks nice. very rarely would i see like and end; or begin like 1 space off.

    in the beginning, all those spaces are not needed, but that's personal preference

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
  •