Results 1 to 9 of 9

Thread: script error 2....

  1. #1
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default script error 2....

    SCAR Code:
    program Hermpie;
    {.Include SRl/SRl.Scar}
    {.include SRL/SRL/Misc/Users.scar}

    Var
      X, Y, Loads : Integer;// Normal Variables
      Bone, BigBone, OpenFWBank : Integer;// DTM Variables
    {==========================]
      Loads The DTMs In Memory
    [==========================}

    Procedure LoadDTMs;
    Begin
      Bone := DTMFromString('78DA637462626078C200068C108AE1CCD1230' +
            'C9250FE7F2060B400AA79C080061851F4303A00D5DC26A0C606A8' +
            'E6150135BE40354F09A87104AA794D408D3B50CD3DFC6A0003390' +
            'E90');
      BigBone := DTMFromString('78DA63B467626078C400068C108AE1D9E3C70' +
               'C9250FE7F20603407AA79CA80061851F430FA00D5BC2642CD0302' +
               '6A1C806A9E1350E30254F392801A3BA09ADB4498739F801A5B22D' +
               'CE30E54F30CBF1A009C351275');
      OpenFWBank := DTMFromString('78DA635465646038CF00068C108AA13AC58D4' +
                  '112CAFF0F048C2035BB51D504DAABC1D580C5AD802C25461435ED' +
                  'CEF6A86ADA802C055435C78FEF4355130464ED40B52BD4490355C' +
                  'D2F20B10FBF7B00443410E9');
    End;

    Function WaitUntil(Secs : integer; UntilProc : boolean):Boolean;
    Var
      Time : Integer;
    Begin
      MarkTime(Time)
      Repeat
        Wait(50 + Random(25));
      Until (TimeFromMark(time) > Secs) or (UntilProc);
        if UntilProc then Result:=True;
    End;
    {==========================]
      Performs Anti-Ban
    [==========================}

    Procedure AntiBan;
    Begin
      If Not (LoggedIn) Then Exit;


    End;

    {==========================]
      Take's Bones From Bank
    [==========================}

    Procedure Bank;
    Begin
      If Not (LoggedIn) Then Exit;
      LoadDTMs;
      If DTMRotated(OpenFWBank, X, Y, MSX1, MSY1, MSX2, MSY2) Then
      Begin
        Mouse(X,Y,3,3,False);
        Wait(50 + Random (25));
        If ChooseOption('quickly') Then if WaitUntil(2000,PinScreen) then if Inpin('4044') then if WaitUntil(2000,BankScreen=True) then
        begin
          If Players[CurrentPlayer].Booleans[2] Then
          Begin
            If FindDTM(BigBone, X, Y, MSX1, MSY1, MSX2, MSY2) then
            Begin
              WaitUntil(5000,ChooseOption('ll'));
              CloseBank;
              GameTab(4);
            End Else
              If FindDTM(Bone, X, Y, MSX1, MSY1, MSX2, MSY2) Then
              WaitUntil(5000,ChooseOption('ll'));
              CloseBank;
              GameTab(4);
          End Else
            If FindDTM(Bone, X, Y, MSX1, MSY1, MSX2, MSY2) then
            WaitUntil(5000,ChooseOption('ll'));
            CloseBank;
            GameTab(4);
        End Else
          Begin
            CloseBank;
            logout;
          End;
      End Else
      OpenBankQuiet('FWB');
    End;

    {==========================]
      Bury's The Bones
    [==========================}

    Procedure Bury;
    Begin
      If Not (LoggedIn) Then Exit;


    End;

    {==========================]
      Writes an ProgressReport
    [==========================}

    Procedure ProgressReport;
    Begin


    End;

    {==========================]
      Multi-Player Procedure
    [==========================}

    Procedure LoginNewPlayer;
    Begin
      If LoggedIn Then Exit;
      If Not(LoggedIn) Then If Players[CurrentPlayer].Integers[0] > Loads then Nextplayer(True) else Nextplayer(False);
      Wait(1000 + Random(500));
      SetAngle(True);
      MakeCompass('N');
    End;

    {==========================]
      Main Loop
    [==========================}

    Begin
      SetupSrl;
      SRLPlayerForm(True, ['Bank(True), Pick-Up(False)','Use BigBones'], ['How Many Loads','Pin, If you have one'], [''], ['']);
      LoginPlayer;
      Repeat
        Bank;


      Until (False);

    End.

    somehow bank; doesn't work bc of waituntil; can some1 fix waituntil for me? im really stuck at it
    ~Hermen

  2. #2
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    As far as WaitUntil is concerned, ChooseOption('11') or PinScreen is either tru eor false for the duration of the functions life (meaning that it won't change when it's running), so you would have to just use repeat until loops in them all (but this is as far as I know) and will also return the same value (as you have result:= procuntil) as at the beginning, meaning that if 'pinscreen' is false when it starts, then it will return false regardless. Otherwise, as they seem to all use the same past the initial checks, you can just use ChooseOption('11') as your check inside the function (which would shorten it a bit instead of adding the repeats etc.).
    I hope this explains it, as I tend to ramble on a bit and circle the point rather than just get to it.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  3. #3
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i get like 75% thanks but that procedure waituntil it really can't get fixed bc it would be very easy and good
    ~Hermen

  4. #4
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    I'm not 100% sure (just glanced over the tutorial), but this should work (I think): Tutorial
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  5. #5
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    It can be fixed by using a pointer to a function. Let's see what I can come up with...
    SCAR Code:
    program New;
     
    function A: Boolean;
    begin
      Result:= True;
    end;

    procedure WaitUntil(MS: Integer; Func: Function: Boolean);
    var
      T: Integer;
    begin
      T:= GetSystemTime;
      while (GetSystemTime - T < MS) and (not(Func())) do
        wait(100);
    end;

    begin
      WaitUntil(5000, @A);
    end.

  6. #6
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    I pointed to a tutorial for that, but you also have to remember to setup a type as a function.
    Anyway, got bored and fixed WaitUntil to work now:
    SCAR Code:
    Function WaitUntil(Secs : integer; UntilProc: UntilProcType):Boolean;
    Var
      Time : Integer;
    Begin
      MarkTime(Time)
      Repeat
        Wait(50 + Random(25));
      Until (TimeFromMark(time) > Secs) or (UntilProc());
        if UntilProc() then Result:=True;
    End;
    Just have to add the following before your const/variable's
    SCAR Code:
    type
      UntilProcType = Function: Boolean;
    and in all your WaitUntil()'s in the script just have to add an @ sign before the procedure (pinscreen -> @pinscreen).
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  7. #7
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Oh, sorry, I assumed it was a link to something other than that.

    SCAR Code:
    function WaitUntil(MS: Integer; Func: Function: Boolean): Boolean;
    var
      T: Integer;
    begin
      T:= GetSystemTime;
      while (GetSystemTime - T < MS) and (not(Func())) do
        wait(100);
      Result:= Func();
    end;
    Mine's shorter

  8. #8
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    kk, and then i can do if waituntil(5000,Bankscreen) then dosomthing; ?
    ~Hermen

  9. #9
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    But did you test yours for compile? I'm sure you have to declare a type for a boolean function and can't just have 'Func: Function: Boolean'. Also, mine is his adjusted to use senders and pointers including the random wait between 50 and 75 ms. Not only that, but you only have 1 line on me
    Edit: Zomg, got a cool pen avatar and Hermpie - Just add an @ sign in front and it *should* work (so 'WaitUntil(5000,@Bankscreen)')
    Edit2: Just tried with RBool and for some reason it doesn't like that - you have to make a new function that just does that, so not sure how useful that will be now, but just use as so:
    SCAR Code:
    function BankScreen2: Boolean;
    begin
      Result := BankScreen;
    end;
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Line 135: [Error] (14845:1): Syntax error in script
    By AbsTrACt'^.| in forum OSR Help
    Replies: 16
    Last Post: 05-23-2008, 01:14 PM
  2. Replies: 5
    Last Post: 02-26-2008, 04:14 PM
  3. Error: Cannot Fix Script - Error Overgrowth - Begin Headdesking
    By PhantasmalScripter in forum OSR Help
    Replies: 6
    Last Post: 12-23-2006, 12:50 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
  •