Results 1 to 3 of 3

Thread: Lots of problems xD

  1. #1
    Join Date
    Jan 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Lots of problems xD

    This is my first script.
    It chops logs and drops them.
    It logsout after your have done the wanted amount of loads.
    It should login with the next user and chop again.

    The Problems
    1. It doesnt switch players after logging out.
    2. Can someone check the randoms im using, they dont seem to work =S

    Thanks alot

    SCAR Code:
    {.Script Info:
    # ScriptName  = R3velati0ns Power Cutter
    # Author      = R3velati0n
    # Description = Chops logs then drops them
    # Version     = 1.0
    # Date        = 21/1/07
    # Comments    = BETA Version
    # Credits     = Dub@Fagex
    /Script Info}


    {.Instructions:
    # Select the two colors of the tree
    # Set the tree name
    # Set the name to disguise scar with
    # Set the wait time
    # Run :)
    /Instructions}


    program PowerChopper;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/skill/WoodCutting.scar}
    {.include SRL/SRL/misc/PlayerForm.scar}

    Var
    Dropped:integer;
    WCLevel:integer;

    //<============= Setup =============>\\
    Const
    TreeC=4290672;
    TreeT='Willow'; //Tree name
    Disg='Notepad'; //Name to disguise the window
    WaitTime=6000; //Time in milliseconds to wait between tree click
    LogoutTime=600000; //Time to stay logged out when using antiban
    StartPlayer=0;//Starting player
    Loads=1;//Amount of loads to cut before switching

    Procedure DeclarePlayers;
    begin
         HowManyPlayers  :=2;               // Set Number of Players here.
         NumberOfPlayers(HowManyPlayers);   // Sets the Players Array Length;
         CurrentPlayer:=StartPlayer;        // CurrentPlayer = Array Index

      Players[0].Name      := '';
      Players[0].Pass      := '';
      Players[0].Nick      := ''; // 2-4 letters of username
      Players[0].Active    := True;

      Players[1].Name      := '';
      Players[1].Pass      := '';
      Players[1].Nick      := ''; // 2-4 letters of username
      Players[1].Active    := True;
    end;

    Procedure WaitLogout;
    begin
    WriteLn('Resting with logout');
    Logout;
    Wait(LogoutTime);
    NextPlayer(false);
    LoginPlayer;
    end;

    Procedure Startup;
    begin
    Dropped:=0;
    SetupSRL;
    DeclarePlayers;
    DisguiseScar(Disg);
    ChatsOff;
    HighestAngle;
    FindAxeHeadColor;
    end;

    Procedure GetLevel;
    begin
    GameTab(2);
    WCLevel:=GetSkillLevel('Woodcutting');
    end;

    function FindObjX2(var cx, cy: Integer; Text: string; color, tolerance: Integer):
      Boolean;
    var
      x, y, a, c, i, x1, y1, x2, y2: Integer;
    begin
      if (FindMSColorTol(x, y, color, tolerance)) 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;
          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;
            if (a = 2) then
            begin
              y1 := y1 - 20;
              y2 := y2 - 20;
            end;
            if (a = 3) then
            begin
              x1 := x1 - 30;
              x2 := x2 - 30;
            end;
            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;
            if (FindColorTolerance(x, y, color, x1, y1, x2, y2, tolerance)) then
            begin
              MMouse(x, y, 0, 0)
                cx := x;
              cy := y;
              if (IsUpText(Text)) then
              begin
                Result := True;
                Break;
              end;
            end;
          end;
          if (a = 4) then
            a := 0;
        until (x2 > 515) or (Result = True);
      end;
    end;

    Procedure TheAntiBan;
    var
    DONTBAN:integer;
    begin
      if ( not ( LoggedIn )) then Exit;
      DONTBAN:= 1 + Random(100);
        case DONTBAN of
         1: RandomRClickEvery(2 + Random(10));
         2: HoverSkill('woodcutting', false);
         3: HoverSkill('random', false);
         4: DoEmote(1 + Random(20));
         5: BoredEvery(9 + Random (21));
         6: PickUpMouse;
         7: LeaveScreenEvery(10 + Random(5));
         8: RotateEvery(20 + Random(5));
         9: MMouse(MSX1,MSX2,10,10)
        12: GameTab(1+random(7))
        13: HighestAngle;
        14: TypeSend('Lol my wc lvl is ' +IntToStr (WClevel)  + '.')
        15: TypeSend('Wc lvl ' +IntToStr (WClevel) + '! Sweet!')
        16: TypeSend('Grr, my wc lvl is only ' +IntToStr (WClevel) + '')
        17: GetSkillLevel('WoodCutting')
        18: GameTab(1+Random(7))
        19: MakeCompass('W')
        20: MakeCompass('E')
        21: TypeSend('I''m lvl ' +IntToStr (WClevel) + ', but I want ' +IntToStr (WClevel + 3 + Random(8)) + '')
        22: TypeSend('' +IntToStr (WClevel) + ' woodcuting.../')
        23: TypeSend('I can''t wait till im lvl ' +IntToStr (WClevel + 4 + Random(7)) + '')
        24: TypeSend('Hmm... im only lvl ' +IntToStr (WClevel) + ' woodcutting... i should go for ' +IntToStr (WClevel + 6 + Random(8))+'')
        25: TypeSend('yay... lvl ' +IntToStr (WClevel) + 'wc... still...')
        26: TypeSend('cool! only ' + IntToStr (500000+random(400000)) + 'k xp till lvl ' +IntToStr (WClevel + 1 + random(3)) + ' wc')
        27: TypeSend('WC lvl ' +IntToStr (WClevel) + '')
        28: TypeSend('hmph... only ' +IntToStr (WClevel) + '')
        29: GetLevel
        30: GetLevel
        31: WaitLogout
        32: WaitLogout
        end;
    end;

    Var
      EX, EY : integer;
      FX, FY : integer;
    Procedure EntChecker;
    Begin
      Status('Checking For Ent')
      Flag;
      If (FindObjMultiText(EX, EY, TreeT, TreeT, TreeT, TreeC, 4)) then
      Begin
      MMouse(Ex, EY, 0, 0)
        If FindColorTolerance( FX, FY, 55769, 85, 15, 115, 15, 20) then
        Begin
        Status('Ent Found');
        MouseFindFlag(648,83,5,5);
        Wait(15000+Random(5000));
        end;
      end;
    end;

    function NormRandoms: Boolean;
    var
      i: Integer;
    begin
      for i := 1 to 16 do
      begin
        case I of
          1: CloseWindow;
          2: if FindTalk then
              Result := True;
          3: if FindDead then
              Result := True;
          4: if FindMod then
              Result := True;
          5: if FindMime then
              Result := True;
          6: if FindMaze then
              Result := True;
          7: if FindQuiz then
              Result := True;
          8: if FindDemon then
              Result := True;
          9: if FindScapeRune then
              Result := True;
          10: if FindTalk then // Call it twice
              Result := True;
          11: if FindLamp(LampSkill) then // Maybe we missed it?
              Result := True;
          12: if (FindNewBox) then
            begin
              Result := True;
              if (UseBoxSolver) then
                SolveBox
              else
                GambleNewBox;
            end;
          13: if FindTrade then
              Result := True;
          14:
            begin
              if NoGameTab then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'No GameTab';
                Logout;
                Exit;
              end;
            end;
          15: SaveToChatLog;
          16: if RC then
              Result := True;
        end;
        Wait(1);
      end;
    end;

    Procedure Randoms;
    begin
    NormRandoms;
    FindHead;
    FindBirdsNest;
    FindEnt(TreeC);
    EntChecker;
    if (FindFight) then
      begin
        RunAwayDirection('E');
        Wait(8500 + random(3500));
        RunBack;
      end;
    end;

    Procedure CheckLogs;
    begin
    if InvFull then begin
       DropAllLogs;
       Dropped:=Dropped+1;
       end;
    end;

    Procedure Report;
    begin
    writeln('');
    writeln('<============= R3velati0ns Power Chopper ==============>');
    writeln('<============ Version 1.0 Progress Report =============>');
    writeln('Dropped ' + inttostr(Dropped) + ' Full Loads');
    WriteLn('Woodcutting Level Is Now: ' + inttostr(WCLevel));
    writeln('<======================================================>');
    writeln('');
    end;

    Procedure CutLogs;
    var
    cx,cy:integer;
    begin
         if FindObjX2(cx, cy, TreeT,TreeC, 1) then begin
         wait(192+random(213))
         Mouse(cx,cy,3,3,true)
         wait(WaitTime+random(400));
         end;
    end;

    begin
    Startup;
    repeat
          repeat
                CutLogs;
                TheAntiBan;
                CheckLogs;
                Randoms;
          until(Dropped=Loads);
    GetLevel;
    Report;
    SRLRandomsReport;
    logout;
    NextPlayer(false);
    LoginPlayer;
    until(CurrentPlayer>HowManyPlayers);
    end.

  2. #2
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    if you are including playerform, take out the delcareplayers proc and just call setupplayers instead

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

    Default

    Thanks but everything is fine now
    Dub helped me on msn ^^

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Lots off votes!
    By Macros in forum NOTA
    Replies: 8
    Last Post: 02-18-2009, 09:29 PM
  2. Need lots of help with this script
    By Gold in forum OSR Help
    Replies: 0
    Last Post: 03-28-2008, 02:47 AM

Posting Permissions

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