Results 1 to 2 of 2

Thread: [Runtime Error] : Could not call proc in line 66 in script

  1. #1
    Join Date
    Aug 2006
    Posts
    151
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    [Runtime Error] : Could not call proc in line 66 in script

    Well im hopefully at last bug in script but heres the error

    SCAR Code:
    [Runtime Error] : Could not call proc in line 66 in script


    heres the scipt i dont get why its doing this????
    SCAR Code:
    {
    --------------------------------------------------------------------------------
    Made by=Wtf I Sp4nk                                                            -
    Script Name=Vial Wanker                                                        -
    Script Info=Fills Empty Vials with water at varock West Bank                   -
    Intructions=Have Vials in first bank slot; start in bank with empty invintory  -
    MSN=crazyirishman84@hotmail.com                                                -
    Thnx to all that Helped!                                                       -
    Enjoy                                                                          -
    --------------------------------------------------------------------------------
                           (:  Proggys :)








    --------------------------------------------------------------------------------
    }








    program Vial_Wanker;

    {.include SRL/SRL.scar}


    var
    LoadsToFinish : integer;
    Vialsfilled : integer;
    unvial,ex, ey : Integer;
    {********************************FROM VARIABLES*********************************}
     var
      frmDesign : TForm;
      Label1 : TLabel;
      Label2 : TLabel;
      Label3 : TLabel;
      Label4 : TLabel;
      Label5 : TLabel;
      Label6 : TLabel;
      Edit1 : TEdit;
      Edit2 : TEdit;
      Edit3 : TEdit;
      Edit4 : TEdit;
      Button1 : TButton;

    {*******************************************************************************}
    const
    FountainColor=1;//Color of the fountain
    FountainColor1=1;//another color of the fountain
    FountainColor2=1;//yet another color of the fountain

    Procedure DeclarePlayers;

     Begin
        HowManyPlayers := 1;                // Set Number of Players here.
        NumberOfPlayers(HowManyPlayers);    // Sets the Players Array Length;
        CurrentPlayer := 0;                // CurrentPlayer = Array Index

        Players[0].Name := Edit2.Text;   //Username
        Players[0].Pass := Edit3.Text; //Password
        Players[0].Nick := Edit4.Text;         //3 or 4 letters username
        Players[0].Loc := '';               //Leave as blank
        Players[0].Skill := '';  //The skill for when you get a lamp
        Players[0].Active := True;

      Writeln(inttostr(HowManyPlayers) + ' Players');
    End;

    { $$$$$$$$$$$$$$$$$$$ END OF SETUP $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$}

    procedure ButtonClick(sender: TObject);
    begin
     frmDesign.Caption:= frmDesign.Caption + '.';
     frmDesign.ModalResult:= mrOk;
    end;

    Procedure InitForm;
    begin
    frmDesign := CreateForm;
    frmDesign.Left := 250;
    frmDesign.Top := 114;
    frmDesign.Width := 386;
    frmDesign.Height := 314;
    frmDesign.Caption := 'Sp4nk'#39's Vial Wanker';
    frmDesign.Color := clRed;
    frmDesign.Font.Color := clWindowText;
    frmDesign.Font.Height := -11;
    frmDesign.Font.Name := 'MS Sans Serif';
    frmDesign.Font.Style := [];
    frmDesign.Visible := True;
    frmDesign.PixelsPerInch := 96;
    Label1 := TLabel.Create(frmDesign);
    Label1.Parent := frmDesign;
    Label1.Left := 108;
    Label1.Top := 14;
    Label1.Width := 124;
    Label1.Height := 24;
    Label1.Caption := 'Vial Wanker';
    Label1.Font.Color := clWindowText;
    Label1.Font.Height := -19;
    Label1.Font.Name := 'MS Sans Serif';
    Label1.Font.Style := [fsBold, fsItalic];
    Label1.ParentFont := False;
    Label2 := TLabel.Create(frmDesign);
    Label2.Parent := frmDesign;
    Label2.Left := 48;
    Label2.Top := 40;
    Label2.Width := 245;
    Label2.Height := 29;
    Label2.Caption := 'Made by: Wtf I Sp4nk';
    Label2.Font.Color := clWindowText;
    Label2.Font.Height := -24;
    Label2.Font.Name := 'MS Sans Serif';
    Label2.Font.Style := [fsBold];
    Label2.ParentFont := False;
    Label3 := TLabel.Create(frmDesign);
    Label3.Parent := frmDesign;
    Label3.Left := 21;
    Label3.Top := 100;
    Label3.Width := 91;
    Label3.Height := 16;
    Label3.Caption := 'Loads To Do';
    Label3.Font.Color := clWindowText;
    Label3.Font.Height := -13;
    Label3.Font.Name := 'MS Sans Serif';
    Label3.Font.Style := [fsBold];
    Label3.ParentFont := False;
    Label4 := TLabel.Create(frmDesign);
    Label4.Parent := frmDesign;
    Label4.Left := 20;
    Label4.Top := 149;
    Label4.Width := 75;
    Label4.Height := 16;
    Label4.Caption := 'UserName';
    Label4.Font.Color := clWindowText;
    Label4.Font.Height := -13;
    Label4.Font.Name := 'MS Sans Serif';
    Label4.Font.Style := [fsBold];
    Label4.ParentFont := False;
    Label5 := TLabel.Create(frmDesign);
    Label5.Parent := frmDesign;
    Label5.Left := 20;
    Label5.Top := 188;
    Label5.Width := 73;
    Label5.Height := 16;
    Label5.Caption := 'PassWord';
    Label5.Font.Color := clWindowText;
    Label5.Font.Height := -13;
    Label5.Font.Name := 'MS Sans Serif';
    Label5.Font.Style := [fsBold];
    Label5.ParentFont := False;
    Label6 := TLabel.Create(frmDesign);
    Label6.Parent := frmDesign;
    Label6.Left := 20;
    Label6.Top := 230;
    Label6.Width := 73;
    Label6.Height := 16;
    Label6.Caption := 'NickName';
    Label6.Font.Color := clWindowText;
    Label6.Font.Height := -13;
    Label6.Font.Name := 'MS Sans Serif';
    Label6.Font.Style := [fsBold];
    Label6.ParentFont := False;
    Edit1 := TEdit.Create(frmDesign);
    Edit1.Parent := frmDesign;
    Edit1.Left := 120;
    Edit1.Top := 98;
    Edit1.Width := 121;
    Edit1.Height := 21;
    Edit1.TabOrder := 8;
    Edit1.Text := 'Edit1';
    Edit2 := TEdit.Create(frmDesign);
    Edit2.Parent := frmDesign;
    Edit2.Left := 96;
    Edit2.Top := 148;
    Edit2.Width := 121;
    Edit2.Height := 21;
    Edit2.TabOrder := 9;
    Edit2.Text := 'Edit2';
    Edit3 := TEdit.Create(frmDesign);
    Edit3.Parent := frmDesign;
    Edit3.Left := 97;
    Edit3.Top := 185;
    Edit3.Width := 121;
    Edit3.Height := 21;
    Edit3.TabOrder := 10;
    Edit3.Text := 'Edit3';
    Edit4 := TEdit.Create(frmDesign);
    Edit4.Parent := frmDesign;
    Edit4.Left := 97;
    Edit4.Top := 226;
    Edit4.Width := 121;
    Edit4.Height := 21;
    Edit4.TabOrder := 11;
    Edit4.Text := 'Edit4';
    Button1 := TButton.Create(frmDesign);
    Button1.Parent := frmDesign;
    Button1.Left := 249;
    Button1.Top := 146;
    Button1.Width := 114;
    Button1.Height := 103;
    Button1.Caption := 'START';
    Button1.Font.Color := clWindowText;
    Button1.Font.Height := -13;
    Button1.Font.Name := 'MS Sans Serif';
    Button1.Font.Style := [fsBold];
    Button1.ParentFont := False;
    Button1.TabOrder := 12;
    end;

    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;

    procedure ShowFormModal;
    begin
      frmDesign.ShowModal;
    end;

    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;



    procedure LoadDTM;
    begin
      unvial := DTMFromString('78DA63EC676260D8C900065C108AE1CE42250' +
           '61120CD08C4FF8180D113A8E639030A48484801D38C503E23C89C' +
           'FDA86A3485D851D57801D5BC4755B36AF546143500D4290E35');
    end;





    procedure ProgressReport;
    begin
     Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
     Writeln('~~~~~~~WTF I SP4NK~~~~~~~~~~~');
     Writeln('~~~~~~~Vial Wanker~~~~~~~~~~');
     Writeln('Worked For: '+ScriptTime2(2));
     Writeln('Banked: '+IntToStr(LoadsToFinish)+'Loads of wfvials');
     Writeln('Filled: '+IntToStr(Vialsfilled)+'vials')
     Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
     Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
     SRLRandomsReport;
    end;




    function IsWelcomeScreen: Boolean;
    begin
      if(GetColor(271, 292) = 8356779)and
        (GetColor(499, 292) = 8356779)and
        (GetColor(271, 381) = 8356779)then
        Result := True;
    end;

    procedure WelcomeScreen;
    begin
      if(not(IsWelcomeScreen))then Exit;
      MouseBox(275, 296, 495, 377, 1);
    end;






    Procedure beginscript;
     Begin
      cleardebug
      DisguiseScar('Limewire:Enabling Walk It Out');
        Writeln(' /==\ /==\   /| |   | |  / ')
        Writeln('/     |  |  / | |\  | | /  ')
        Writeln('\===\ |__/ |__| | \ | |<   ')
        Writeln('    / |       | |  \| | \  ')
        Writeln('\==/  |       | |   | |  \ ')
       Writeln('--->Version 1.0')
      Writeln('--->Vial Wanker')
      Writeln('--->Contact Me At [email]crazyirishman84@hotmail.com[/email]')
    End;


    Procedure Setup;
    begin
      SetupSRL;
      ActivateClient;
      ChatsOff;
      If (LoggedIn) then
      begin
      HighestAngle;
      MakeCompass('n');
      end;
      If (not(LoggedIn)) then
      LoginPlayer;
      WelcomeScreen;
      HighestAngle;
      MakeCompass('n');
    end;


    Procedure Ban;
     var
     NoBan : Integer;
      begin
       if ( not ( LoggedIn )) then Exit;
       NoBan:=Random(120)
        case NoBan of
         1: RandomRClickEvery(2 + Random(30));
         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));
        end;
       end;



    procedure GetVials;
    begin
      OpenBank;
      wait(200+Random(100));
      Withdraw(1,1,28);
      wait(200+Random(100));
      CloseBank;
    end;

    Procedure WalktoDummy;
    begin
      If (FindSymbol(x,y, 'training dummy')) then
      begin
       SetRun(true)
       Mouse(x,y,1,1,true)
       wait(10000)
      end
    end;





    Procedure WalktoWater;
    begin
      If (FindSymbol(x,y, 'water source')) then
      begin
       SetRun(true)
       Mouse(x,y,1,1,true)
       wait(10000)
      end
    end;


    procedure clickfountain;
    begin
      FindNormalRandoms;
      SRLRandomsReport;
       Ban;
       If (FindFight) Then
         begin
          Runawaydirection('N')
          Wait(25000+Random(5000))
          RunBack;
         end;
     If(FindColorSpiralTolerance(x,y,FountainColor,msx1,msy1,msx2,msy2,15))Or
             (FindColorSpiralTolerance(x,y,FountainColor1,msx1,msy1,msx2,msy2,15))Or
               (FindColorSpiralTolerance(x,y,FountainColor2,msx1,msy1,msx2,msy2,15))Then
                 mmouse(x,y,3,3)
                begin
                 GetMousePos(x,y)
                    mouse(x,y,1,1,true)
        end;
    end;
       




    function CoordsToInvSpot(gx,gy:integer):integer;
    var col,row:integer;
    begin
    if ((gx>569) and(gx<600)) then col:=1;
    if ((gx>611) and(gx<642)) then col:=2;
    if ((gx>653) and(gx<684)) then col:=3;
    if ((gx>695) and(gx<723)) then col:=4;

    if ((gy>213) and(gy<244)) then row:=1;
    if ((gy>249) and(gy<280)) then row:=2;
    if ((gy>285) and(gy<316)) then row:=3;
    if ((gy>322) and(gy<352)) then row:=4;
    if ((gy>357) and(gy<387)) then row:=5;
    if ((gy>393) and(gy<424)) then row:=6;
    if ((gy>429) and(gy<459)) then row:=7;

    result:=((row-1)*4)+col;
    end;



    procedure FillWater;
    begin
     FindNormalRandoms;
      SRLRandomsReport;
       Ban;
        If (FindFight) Then
         begin
          Runawaydirection('N')
          Wait(25000+Random(5000))
          RunBack;
         end;
       begin
     repeat
    finddtm(unvial,ex,ey,554, 205, 743, 465);
      useitem(coordstoinvspot(ex,ey+10));
    wait(500+random(100));
    clickfountain;
    until countitemdtm(unvial)=0;
    Vialsfilled:= Vialsfilled+ 28;
    end;
    end;

    procedure walktobank;
    begin
      If (FindSymbol(x,y,'bank'))then
       begin
        MMouse(x,y,1,1)
        Mouse(x,y,1,1,true)
        end
    end;




    procedure bankvials;
    begin
     OpenBank;
     DepositAll;
     LoadsToFinish:= LoadsToFinish + 1;
       Withdraw(1,1,28);
      wait(200+Random(100));
      CloseBank;
    end;






    begin
     beginscript;
     DeclarePlayers;
     Setup;
     repeat
     ProgressReport;
     GetVials;
     WalktoDummy;
     WalktoWater;
     FillWater;
     WalktoDummy;
     walktobank;
     bankvials;
     until (LoadsToFinish >=strtoint(Edit1.text))
    end.

  2. #2
    Join Date
    Mar 2006
    Location
    United States, -7:00 GMT
    Posts
    1,790
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    You don't even have the form pop up...Nice try, but this is how your main loop should look.

    Added this so your button will close

    SCAR Code:
    procedure ButtonClick(sender: TObject);
    begin
      frmDesign.Caption:= frmDesign.Caption + '.';
      frmDesign.ModalResult:= mrOk;
    end;

    And this

    SCAR Code:
    Button1 := TButton.Create(frmDesign);
    Button1.OnClick := @ButtonClick; //This line, it calls that proc to close the button ;)
    Button1.Parent := frmDesign;
    Button1.Left := 249;
    Button1.Top := 146;
    Button1.Width := 114;

    So you didn't even run your form, heres what you add to the main loop to do that.

    SCAR Code:
    begin
     beginscript;
     SafeInitForm; //Added this, safe form it
     SafeShowFormModal; //This to show it
     DeclarePlayers;
     Setup;
     repeat

    And finally, have to change the visibility to false.

    SCAR Code:
    frmDesign.Font.Style := [];
    frmDesign.Visible := False; //Well, you just have to make this false, on all forms ;)
    frmDesign.PixelsPerInch := 96;

    I look foward to using this script, filling vials is boring!

    hakuna matata ;)

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
  •