Results 1 to 8 of 8

Thread: Line 44! (wonders yew chopnbank)

  1. #1
    Join Date
    Aug 2010
    Posts
    351
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Line 44! (wonders yew chopnbank)

    I keep on getting an error at line 44 (this line):
    if FindObjCustom(x, y, ['Yew'], [1259052, 3168591, 1586478], 7) then

    and how do I incorporate breaking correctly?

    Please let me know of any errors I missed .

    complete script:
    Simba Code:
    program wonderyewbanknchop;
    {$DEFINE SMART}
    {.include srl/srl/misc/smart.scar}
    {.include srl/srl.scar}
    {.include reflection/reflection.simba}
    {.include srl/srl/misc/debug.scar}
    {.include SRL/SRL/Skill/WoodCutting.scar}


    {Setup:
    1: Have Simba Set up with the latest reflection and SRL.
    2: Make sure you have the required plugins.
    3: Download this script.
    4: Fill Out This Script.
    5: Put your player next to/on the same tile as the yew tree.
    6: Press the play button.}


    const
     World = 78;
     Signed = True;
     Members = True;

     SRLStats_UserID = '';
     SRLStats_Password = '';

     BreakMins = 12; // How long the break should last

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

      Players[0].Name := 'Username';
      Players[0].Pass := 'Password';
      Players[0].Nick := 'ame';
      Players[0].Active := True;

    end;    {END SETUP. DO NOT CHANGE ANYTHING BELOW THIS!}



    Procedure ChopTree;
    begin
      MakeCompass('S');
      repeat
       if FindObjCustom (x, y, ['Yew'], [1259052, 3168591, 1586478], 7) then
          begin
          Mouse(x,y,0,0,false);
          repeat
             Wait(100 + (random(150)));
             ChooseOption('hop')
           until(InvFull)
           end;
      until(InvFull)
    end;



    function Banking: Boolean;
    begin
      if (InvFull) then
      begin
        MakeCompass('N')
        Wait (300 + random(160));
        OpenBankQuiet('db');
        if (PinScreen) then
        InPin(YourPin);
          if(FindColorSpiral(x, y, 669516, 547, 206, 734, 464))then
        begin
         Mouse(x, y, 4, 3, false);
         ChooseOption('All');
         end;
         CloseBank;
         Wait(150 + random (278));
         MakeCompass('S');
      end;
    end;

    Function AntiBan: Boolean;
    begin
      case Random(20) of  // how often to perform, higher number less often
        0: begin
            BoredHuman;
            end;

        1: begin
            RandomMovement;
            end;

        2: begin
            HoverSkill('Woodcutting', false);
            end;

        3: begin
            HoverSkill('Summoning', false);

        4: begin
            AlmostLogout;

        5: begin
            BoredHuman;

        6: begin
            HoverSkill('Smithing', false);
      End;
    End;

    function CheckHatchet: Boolean;
    var
      Item: TInvItem;
      Equiped: TEquipment;
    begin

      for j:= 0 to 27 do
      begin
        Item:= GetInvItemAt(j);
        for i:= 8 downto 0 do
          if (Item.ID = Hatchets[i]) then
          begin
            Writeln('Found a'+HatchetNames[i]+' in backpack');
            Result:= True;
            Exit;
          end else
            if (j = 27) then
              Writeln('Could not find a '+HatchetNames[i]+' in backpack');
      end;
      Equiped:= GetEquippedItemAt(3);
      for i:= 8 downto 0 do
        if (Equiped.id = Hatchets[i]) then
        begin
          Writeln('Found '+HatchetNames[i]+' in hand');
          Result:= True;
          Exit;
        end else
            Writeln('Could not find a'+HatchetNames[i]+' in hand');
      Writeln('You do not have a hatchet either in your backpack or weilded');
      Logout;
      ChangePlayer(False);
    end;


    procedure DoBreak;
    var
      BreakTime, T: Integer;
    begin
      if Debug then
        Writeln('Starting the Break');
      if (TimeFromMark(TimeSinceLastBreak) > (Players[CurrentPlayer].Integers[3]*60*1000)) then
        if (PlayersActive > 1) then
          ChangePlayer(True)
        else
        begin
          Proggy(False);
          BreakTime:= ((BreakMins*60*1000)+Random(5*60*1000));
          ExitToLobby;
          MarkTime(T);
          repeat
            Wait(1000);
          until(TimeFromMark(T)>BreakTime);
          LoginPlayer;
          MarkTime(TimeSinceLastBreak);
        end;
      if Debug then
        Writeln('Finished the Break');
    end;

    procedure ProgressReport(MainLoop: Boolean);
    var
      TempExp, TempLvl, Player: Integer;
    begin
      if (x=100)or(not(MainLoop)) then
      begin
        Me:= GetMe;
        TempExp:= Me.Experience[Skill_WoodCutting];
        TempLvl:= Me.Levels[Skill_WoodCutting];
        ClearDebug;
      if Debug then
        Writeln(TempExp);
      if Debug then
        Writeln(TempLvl);
        Writeln('Wonders Yew Chop N Bank Progress Report');
        Writeln('+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_');
        Writeln('Ran for: '+ TimeRunning);
        Writeln('+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_');
        for Player:=0 to High(Players) do
        begin
          Writeln('Player: '+Players[Player].Nick);
          Writeln('Woodcutting Level: '+IntToStr(Players[Player].Integers[1]));
          Writeln('Experience Gained: '+IntToStr(TempExp-Players[Player].Integers[0]));
          Writeln('Levels Gained: '+IntToStr(TempLvl-Players[Player].Integers[1]));
          Writeln('Logs chopped: '+IntToStr((TempExp-Players[Player].Integers[0])/332));
          Writeln('+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_');
          Writeln('Location: '+ Players[Player].Strings[0]);
          Writeln('+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_');
        end;
        x:=0;
      end else
        x:= x + 1;
    end;

    Function AntiRandom: Boolean;
    Begin
      If Not LoggedIn Then Exit;
      Case Lowercase(AntiRandomz) Of
        'c':
          Begin
            Result := FindNormalRandoms;
            If Not Result Then Result := R_FindRandoms;
            FindNormalRandoms;
          End;
        'r':
          Begin
            Result := R_FindRandoms;
            If Not Result Then Result := FindNormalRandoms;
            R_FindRandoms;
          End;
      End;
    End;

    Procedure MainLoop;
     SetupSRL;
         repeat
            ChopTree;
            Banking;
         until(false)
    end.
    Last edited by wondersueak; 09-19-2010 at 07:16 AM.

  2. #2
    Join Date
    Feb 2009
    Location
    Irvine, CA
    Posts
    2,873
    Mentioned
    8 Post(s)
    Quoted
    138 Post(s)

    Default

    declary x and y as integer variables by adding the following lines before the begin/end; loop:

    Simba Code:
    var
      x, y: integer;

  3. #3
    Join Date
    Aug 2010
    Posts
    351
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay. Thanks!

    now i get error at line 71:
    Simba Code:
    InPin(YourPin);

    how do I add breaks correctly? whenever i try it spits out an error.

  4. #4
    Join Date
    Mar 2006
    Location
    Behind you
    Posts
    3,193
    Mentioned
    61 Post(s)
    Quoted
    63 Post(s)

    Default

    Change that line to:
    Simba Code:
    InPIN(players[currentplayer].Pin);
    and add a line to DeclarePlayers
    Simba Code:
    Players[0].Pin := '';
    to the list

    "Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."

  5. #5
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    I'm sure that there will be a guide on taking breaks in Tutorial Island somewhere. Have a look there. If nothing turns up, perhaps look for guides on incorporating multiplayer, as the two topics are quite closely linked.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  6. #6
    Join Date
    Aug 2010
    Posts
    351
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks!

    Er... Now I get an error at line 43:
    Simba Code:
    var x ,y:interger;

    I'm about ready to call it quits and let someone with skillz do the scripting =P

  7. #7
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    interger is integer, no r

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  8. #8
    Join Date
    Aug 2010
    Posts
    351
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ah, sorry, typo.

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
  •