Results 1 to 9 of 9

Thread: Firemaking Script Help.

  1. #1
    Join Date
    May 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Question Firemaking Script Help.

    I will make this simple.

    Script:

    SCAR Code:
    Program AutoFiremaker;
    {.include SRL/SRL.Scar}

    Var
      x, y, Tinderbox, Willow : Integer;
     
    Const
      LogType = 'Willow'; //Choose the type of log you wish to burn.
      //Valid Options: Normal, Oak, Willow, Maple, Yew
      LogBurn = 100; //Choose the amount of logs you wish to burn.
      //Valid Options: Any number other than zero.
      PinNumber = ''; //Enter your pin number for banking.
      //Valid Options: Four digit number or leave blank if no pin.
     
    Procedure DeclareDTMs;
    Begin
      Tinderbox := DTMFromString('78DA6314616060006124E06EC701166204E2F' +
             'F40C0280764B033A001462412487300095E026A7880843C013520' +
             '7929FC6A00FCE40572');
      Willow := DTMFromString('78DA6314656060106140016EF69260214620F' +
             'E0F048CB2400607031A60442281341790E021A0861748C81350A3' +
             '0424A4F0AB0100093E0589');
    End;

    Procedure Banking;
    Var
      FailedBank : Integer;
    Begin
      Repeat
        Wait(250 + Random(250));
        OpenBankFast('Vbw');
        Inc(FailedBank);
        Wait(250 + Random(250));
      Until PinScreen or BankScreen or (FailedBank = 3);
      If FailedBank = 3 Then
      Begin
        WriteLn('Failed to find bank.');
        LogOut;
        Exit;
      End;
      If PinScreen Then
      Begin
        Wait(250 + Random(250));
        FailedBank := 0;
        InPin(PinNumber);
        Wait(250 + Random(250));
      End;
      If BankScreen Then
      Begin
        Wait(250 + Random(250));
        FailedBank := 0;
        If FindDTM(Willow, x, y, MIX1, MIY1, MIX2, MIY2) Then
        Begin
          Wait(250 + Random(250));
          Mouse(x, y, 5, 5, False);
          Wait(250 + Random(250));
          ChooseOption('All');
          Wait(250 + Random(250));
          CloseBank;
          Wait(250 + Random(250));
        End Else
        Begin
          CloseBank;
          WriteLn('Failed to find bank.');
          LogOut;
          Exit;
        End;
      End;
    End;

    Procedure WalkToBank;
    Begin
      If FindSymbol(x, y, 'Bank') Then
      Begin
        Wait(250 + Random(250));
        Mouse(x, y, 5, 5, True);
        Wait(250 + Random(250));
        Banking;
      End Else
      Begin
        WriteLn('Failed to find bank.');
        LogOut;
        Exit;
      End;
    End;

    Procedure Burning;
    Begin
      DeclareDTMs;
      If FindDTM(Tinderbox, x, y, MIX1, MIY1, MIX2, MIY2) Then
      Begin
        Wait(250 + Random(250));
        Mouse(x, y, 5, 5, True);
        Wait(250 + Random(250));
        If FindDTM(LogType, x, y, MIX1, MIY1, MIX2, MIY2) Then
        Begin
          Wait(250 + Random(250));
          Mouse(x, y, 5, 5, True);
          Wait(250 + Random(250));
          Dec(LogBurn);
      End Else
      Begin
        WriteLn('Faild to find tinderbox.');
        LogOut;
        Exit;
      End;
    End;

    Procedure WalkToRoad;
    Begin
      If FindSymbol(x, y, 'Bank') Then
      Begin
        Wait(250 + Random(250));
        Mouse(x+60, y+35, 5, 5, True);
        Wait(250 + Random(250));
      End Else
      Begin
        WriteLn('Failed to walk to the road.');
        LogOut;
        Exit;
      End;
    End;

    Procedure FiremakingLoop;
    Begin
      MakeCompass('N');
      SetAngle(True);
      Banking;
      WalkToRoad;
      Burning;
      WalkToBank;
    End;

    Begin
      SetupSRL;
      ActivateClient;
      repeat
        FiremakingLoop;
      Until (False);
    End.

    Problem:

    Code:
    Line 95: [Error] (16852:51): Type mismatch in script
    Lines 90 - 100:

    SCAR Code:
    If FindDTM(Tinderbox, x, y, MIX1, MIY1, MIX2, MIY2) Then
      Begin
        Wait(250 + Random(250));
        Mouse(x, y, 5, 5, True);
        Wait(250 + Random(250));
        If FindDTM(LogType, x, y, MIX1, MIY1, MIX2, MIY2) Then
        Begin
          Wait(250 + Random(250));
          Mouse(x, y, 5, 5, True);
          Wait(250 + Random(250));
          Dec(LogBurn);

  2. #2
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    LogType is not an integer, or the DTM. Just change LogType on line 95 with Willow (I assume that is the DTM you want to use) and the script should work fine.

    Edit: on line 100, you also try to decrement a constant. Constants cannot be changed. You will need to create a variable to hold the value of what the user sets that constant to, and then you can decrement/increment that variable.

    You are also missing an end to close the begin after the Willow DTM check.
    Last edited by JAD; 06-03-2009 at 11:38 AM.

  3. #3
    Join Date
    May 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  4. #4
    Join Date
    May 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    New Problem:

    SCAR Code:
    Program AutoFiremaker;
    {.include SRL/SRL.Scar}

    Var
      x, y, Tinderbox, Willow, FailedBank, LogsBurned : Integer;

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

      Players[0].Name := 'lord devoker'; //Username.
      Players[0].Pass := 'aaron11'; //Password.
      Players[0].Nick := 'dev'; //3-4 Letters From Your Username.
      Players[0].Pin := ''; //Bank Pin.
      Players[0].Integers[0] := 100; //Logs to cut for each player.
      Players[0].Active := True;
    end;
     
    Procedure DeclareDTMs;
    Begin
      Tinderbox := DTMFromString('78DA6314616060006124E06EC701166204E2F' +
             'F40C0280764B033A001462412487300095E026A7880843C013520' +
             '7929FC6A00FCE40572');
      Willow := DTMFromString('78DA6314656060106140016EF69260214620F' +
             'E0F048CB2400607031A60442281341790E021A0861748C81350A3' +
             '0424A4F0AB0100093E0589');
    End;

    Procedure Walk2Road; Forward;

    Procedure Banking;
    Begin
        Wait(250 + Random(250));
        OpenBankFast('Vwb');
        Inc(FailedBank);
        Wait(2000 + Random(1000));
    End;

    Procedure Walk2Bank;
    Begin
      If FindSymbol(x, y, 'Bank') Then
      Begin
        Wait(250 + Random(250));
        Mouse(x, y, 5, 5, True);
        Wait(250 + Random(250));
        Banking;
      End Else
      Begin
        WriteLn('** Failed to find bank. **');
        LogOut;
        Exit;
      End;
    End;

    Procedure Burning;
    Begin
      DeclareDTMs;
      If FindDTM(Tinderbox, x, y, MIX1, MIY1, MIX2, MIY2) Then
      Begin
        Wait(250 + Random(250));
        Mouse(x, y, 5, 5, True);
        Wait(250 + Random(250));
        If FindDTM(Willow, x, y, MIX1, MIY1, MIX2, MIY2) Then
        Begin
          Wait(250 + Random(250));
          Mouse(x, y, 5, 5, True);
          Wait(2000 + Random(1000));
          inc(LogsBurned);
        End Else
        Begin
          Walk2Bank;
        End;
      End Else
      Begin
        WriteLn('** Failed to find tinderbox. **');
        LogOut;
        Exit;
      End;
    End;

    Procedure Walk2Road;
    Begin
      If FindSymbol(x, y, 'Bank') Then
      Begin
        Wait(250 + Random(250));
        Mouse(x+60, y+35, 5, 5, True);
        Wait(5000 + Random(1000));
        Burning;
      End Else
      Begin
        WriteLn('** Failed to walk to the road. **');
        LogOut;
        Exit;
      End;
    End;

    Procedure FiremakingLoop;
    Begin
      MakeCompass('N');
      SetAngle(True);
      Banking;
    End;

    Begin
      SetupSRL;
      ActivateClient;
      repeat
        FiremakingLoop;
      Until (Players[CurrentPlayer].Integers[0] >= LogsBurned);
    End.

    Code:
    [Runtime Error] : Out Of Range in line 812 in script C:\Documents and Settings\User\My Documents\My Scripts\SCAR 3.20\includes\SRL/SRL/Core/Bank.scar
    Lines 805 to 812 in the Bank Script:

    SCAR Code:
    MarkTime(c);
            repeat
              Wait(100);
            until (BankScreen) or (PinScreen) or (TimeFromMark(c) > 3000);
            Wait(Random(300));
            if (Players[CurrentPlayer].Pin <> '') then
              InPin(Players[CurrentPlayer].Pin);
          end;
        end;
      end;
      Result := (BankScreen) or (PinScreen);

  5. #5
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You did not call DeclarePlayers in the main loop. That should most likely solve the problem.

  6. #6
    Join Date
    May 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Now it says:

    Code:
    [Runtime Error] : Exception: Access violation at address 00721336 in module 'scar.exe'. Read of address 00000000 in line 37 in script
    Script:

    SCAR Code:
    Program AutoFiremaker;
    {.include SRL/SRL.Scar}

    Var
      x, y, Tinderbox, Willow, LogsBurned : Integer;

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

      Players[0].Name := ''; //Username.
      Players[0].Pass := ''; //Password.
      Players[0].Nick := 'dev'; //3-4 Letters From Your Username.
      Players[0].Pin := ''; //Bank Pin.
      Players[0].Integers[0] := 100; //Logs to cut for each player.
      Players[0].Active := True;
    end;
     
    Procedure DeclareDTMs;
    Begin
      Tinderbox := DTMFromString('78DA6314616060006124E06EC701166204E2F' +
             'F40C0280764B033A001462412487300095E026A7880843C013520' +
             '7929FC6A00FCE40572');
      Willow := DTMFromString('78DA6314656060106140016EF69260214620F' +
             'E0F048CB2400607031A60442281341790E021A0861748C81350A3' +
             '0424A4F0AB0100093E0589');
    End;

    Procedure Walk2Road; Forward;

    Procedure Banking;
    Begin
      Wait(250 + Random(250));
      OpenBankFast('Vwb');
      If FindDTM(Willow, x, y, MIX1, MIY1, MIX2, MIX2) Then
      Begin
        Wait(250 + Random(250));
        Mouse(x, y, 5, 5, False);
        Wait(250 + Random(250));
        ChooseOption('All');
        Wait(250 + Random(250));
        CloseBank;
      End Else
      Begin
        WriteLn('** Failed to find logs. **');
        CloseBank;
        LogOut;
        Exit;
      End;
    End;

    Procedure Walk2Bank;
    Begin
      If FindSymbol(x, y, 'Bank') Then
      Begin
        Wait(250 + Random(250));
        Mouse(x, y, 5, 5, True);
        Wait(250 + Random(250));
        Banking;
      End Else
      Begin
        WriteLn('** Failed to find bank. **');
        LogOut;
        Exit;
      End;
    End;

    Procedure Burning;
    Begin
      DeclareDTMs;
      If FindDTM(Tinderbox, x, y, MIX1, MIY1, MIX2, MIY2) Then
      Begin
        Wait(250 + Random(250));
        Mouse(x, y, 5, 5, True);
        Wait(250 + Random(250));
        If FindDTM(Willow, x, y, MIX1, MIY1, MIX2, MIY2) Then
        Begin
          Wait(250 + Random(250));
          Mouse(x, y, 5, 5, True);
          Wait(2000 + Random(1000));
          inc(LogsBurned);
        End Else
        Begin
          Walk2Bank;
        End;
      End Else
      Begin
        WriteLn('** Failed to find tinderbox. **');
        LogOut;
        Exit;
      End;
    End;

    Procedure Walk2Road;
    Begin
      If FindSymbol(x, y, 'Bank') Then
      Begin
        Wait(250 + Random(250));
        Mouse(x+60, y+35, 5, 5, True);
        Wait(5000 + Random(1000));
        Burning;
      End Else
      Begin
        WriteLn('** Failed to walk to the road. **');
        LogOut;
        Exit;
      End;
    End;

    Procedure FiremakingLoop;
    Begin
      MakeCompass('N');
      SetAngle(True);
      DeclarePlayers;
      Banking;
    End;

    Begin
      SetupSRL;
      ActivateClient;
      repeat
        FiremakingLoop;
      Until (LogsBurned >= Players[CurrentPlayer].Integers[0]);
    End.

    Lines 33 - 53:

    SCAR Code:
    Procedure Banking;
    Begin
      Wait(250 + Random(250));
      OpenBankFast('Vwb');
      If FindDTM(Willow, x, y, MIX1, MIY1, MIX2, MIX2) Then
      Begin
        Wait(250 + Random(250));
        Mouse(x, y, 5, 5, False);
        Wait(250 + Random(250));
        ChooseOption('All');
        Wait(250 + Random(250));
    Last edited by Devoker; 06-03-2009 at 01:47 PM.

  7. #7
    Join Date
    Feb 2009
    Location
    Philipines
    Posts
    600
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hey you left your account on the script I changed your password, I will PM you the new one.

    Edit:
    SCAR Code:
    procedure Banking;
    begin
      Wait(250 + Random(250));
      DeclareDTMs;  //You forgot to put this to declare the DTMs
      OpenBankFast('Vwb');
      if FindDTM(Willow, x, y, MIX1, MIY1, MIX2, MIX2) then
      begin
        Wait(250 + Random(250));
        Mouse(x, y, 5, 5, False);
        Wait(250 + Random(250));
        ChooseOption('All');
        Wait(250 + Random(250));
        CloseBank;
      end else
      begin
        WriteLn('** Failed to find logs. **');
        CloseBank;
        LogOut;
        Exit;
      end;
    end;
    Last edited by Dark Arcana; 06-03-2009 at 01:44 PM.

  8. #8
    Join Date
    May 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  9. #9
    Join Date
    May 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay, it starts off well. It opens the bank like I want it too. But then it clicks at a spot in the top right where nothing is or could possibly be.

    SCAR Code:
    Program AutoFiremaker;
    {.include SRL/SRL.Scar}

    Var
      x, y, Tinderbox, Willow, LogsBurned : Integer;
     
    Procedure DeclarePlayers;
    Begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name := ''; //Username.
      Players[0].Pass := ''; //Password.
      Players[0].Nick := ''; //3-4 Letters From Your Username.
      Players[0].Pin := ''; //Bank Pin.
      Players[0].Integers[0] := 100; //Logs to cut for each player.
      Players[0].Active := True;
    End;
     
    Procedure DeclareDTMs;
    Begin
      Tinderbox := DTMFromString('78DA6314616060006124E06EC701166204E2F' +
             'F40C0280764B033A001462412487300095E026A7880843C013520' +
             '7929FC6A00FCE40572');
      Willow := DTMFromString('78DA6314656060106140016EF69260214620F' +
             'E0F048CB2400607031A60442281341790E021A0861748C81350A3' +
             '0424A4F0AB0100093E0589');
    End;

    Procedure Banking;
    Begin
      DeclareDTMs;
      Wait(1000 + Random(500));
      OpenBankFast('vwb');
      Withdraw(1, 1, 0);
      Wait(1000 + Random(500));
    End;

    Procedure WalkToBank;
    Begin
      If FindSymbol(x, y, 'Bank') Then
      Begin
        Wait(1000 + Random(500));
        Mouse(x, y, 5, 5, True);
        Wait(5000 + Random(2500));
        Banking;

      End Else
      Begin
        WriteLn('** Failed to find bank. **');
        LogOut;
        Exit;
      End;
    End;

    Procedure Burning;
    Begin
      DeclareDTMs;
      If FindDTM(Tinderbox, x, y, MIX1, MIY1, MIX2, MIY2) Then
      Begin
        Wait(1000 + Random(500));
        Mouse(x, y, 5, 5, True);
        Wait(1000 + Random(500));
        If FindDTM(Willow, x, y, MIX1, MIY1, MIX2, MIY2) Then
        Begin
          Wait(1000 + Random(500));
          Mouse(x, y, 5, 5, True);
          Wait(1000 + Random(500));
          inc(LogsBurned);
        End;
      End Else
      Begin
        WriteLn('** Failed to find tinderbox. **');
        LogOut;
        Exit;
      End;
    End;

    Procedure WalkToRoad;
    Begin
      If FindSymbol(x, y, 'Bank') Then
      Begin
        Wait(1000 + Random(500));
        Mouse(x+60, y+35, 5, 5, True);
        Wait(1000 + Random(500));
        Burning;
        Wait(1000 + Random(500));
      End Else
      Begin
        WriteLn('** Failed to walk to the road. **');
        LogOut;
        Exit;
      End;
    End;

    Procedure FiremakingLoop;
    Begin
      MakeCompass('N');
      SetAngle(True);
      DeclarePlayers;
      If InvFull Then WalkToRoad;
      If not InvFull Then WalkToBank;
    End;

    Begin
      SetupSRL;
      ActivateClient;
      DeclareDTMs;
      repeat
        FiremakingLoop;
      Until (LogsBurned >= Players[CurrentPlayer].Integers[0]) or (not LoggedIn);
    End.

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
  •