Results 1 to 11 of 11

Thread: Troublesome Error

  1. #1
    Join Date
    Mar 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Troublesome Error

    Hi, I've been having an error while trying to insert a form into my script. Here is my script:

    program Miner;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\Skill\Mining.scar}

    var

    Loads : Integer;
    Ox, Oy: Integer;
    frmDesign : TForm;
    Label1 : TLabel;
    Label2 : TLabel;
    Button1 : TButton;
    Edit1 : TEdit;
    Edit2 : TEdit;

    const

    Rock=2371663; //Put the color of the Rock here.
    pick=False;//If you have your Pick equipped, true, if not, false.
    LoadsM=44;//How many loads to mine?
    RunDirection='N';//What direction would you like to run in case of a random?

    Procedure DeclarePlayers;
    Begin

    HowManyPlayers := 4;
    NumberOfPlayers(HowManyPlayers);

    Players[0].Name := Edit1.Text;
    Players[0].Pass := Edit2.Text;
    Players[0].Nick := 'game';

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

    procedure mine;
    begin
    repeat
    if (FindMSColor(x,y,Rock)) then
    MMouse(x,y,0,0);
    ClickMouse(x,y,true);
    wait(2500+random(100));
    until(InvFull);
    if(FindChatText('Lol'))or
    (FindChatText('Rofl'))or
    (FindChatText('Lmao'))or
    (FindChatText('Roflmao'))then
    begin
    typesend('lol')
    end;
    end;

    Procedure FindTheGas;
    begin
    if (not(Findgas(Ox,Oy))) then
    begin
    wait(100+random(100));
    if (FindGas(Ox,Oy)) then
    begin
    wait(100+random(100));
    RunAwayDirection(Rundirection);
    Wait(1000+random(1000));
    RunBack;
    end;
    end;
    end;


    procedure converse;
    begin
    if(FindChatText('Ok'))or
    (FindChatText('K'))or
    (FindChatText('No'))or
    (FindChatText('Yes'))then
    typesend('Im So BORED!!!!!!!!!!')
    end;

    procedure drop;
    begin
    if(pick)=True then
    begin
    typesend('brb...')
    RunAwayDirection(RunDirection);
    GameTab(4);
    DropTo(1,28);
    Wait(10000);
    RunBack;
    typesend('back')
    Loads := Loads + 1;
    end;
    begin
    if(pick)=False then
    begin
    typesend('brb...')
    RunAwayDirection(RunDirection);
    GameTab(4);
    DropTo(2,28);
    Wait(10000);
    RunBack;
    typesend('back')
    Loads := Loads + 1;
    If loads=LoadsM then
    begin;
    logout;
    end;
    end;
    end;
    end;

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

    procedure ShowFormModal; // Default Code
    begin
    frmDesign.ShowModal;
    end;

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

    procedure ClickButton(sender: TObject); // Adding Buttons and Interactivity
    begin

    Writeln('Button Clicked!');
    frmDesign.Caption:= frmDesign.Caption + '.';
    frmDesign.ModalResult:= mrOk;
    end;

    Procedure InitForm;
    begin
    ///////////////// Generated from: daForm.dfm
    frmDesign := CreateForm;
    frmDesign.Left := 250;
    frmDesign.Top := 114;
    frmDesign.Width := 271;
    frmDesign.Height := 196;
    frmDesign.Caption := 'frmDesign';
    frmDesign.Color := clBtnFace;
    frmDesign.Font.Color := clWindowText;
    frmDesign.Font.Height := -11;
    frmDesign.Font.Name := 'MS Sans Serif';
    frmDesign.Font.Style := [];
    frmDesign.ShowHint := True;
    frmDesign.Visible := True;
    frmDesign.PixelsPerInch := 96;
    Label1 := TLabel.Create(frmDesign);
    Label1.Parent := frmDesign;
    Label1.Left := 12;
    Label1.Top := 15;
    Label1.Width := 74;
    Label1.Height := 20;
    Label1.Caption := 'Username';
    Label1.Font.Color := clWindowText;
    Label1.Font.Height := -17;
    Label1.Font.Name := 'MS Sans Serif';
    Label1.Font.Style := [];
    Label1.ParentFont := False;
    Label2 := TLabel.Create(frmDesign);
    Label2.Parent := frmDesign;
    Label2.Left := 13;
    Label2.Top := 57;
    Label2.Width := 69;
    Label2.Height := 20;
    Label2.Caption := 'Password';
    Label2.Font.Color := clWindowText;
    Label2.Font.Height := -17;
    Label2.Font.Name := 'MS Sans Serif';
    Label2.Font.Style := [];
    Label2.ParentFont := False;
    Button1 := TButton.Create(frmDesign);
    Button1.Parent := frmDesign;
    Button1.Left := 96;
    Button1.Top := 100;
    Button1.Width := 75;
    Button1.Height := 25;
    Button1.Caption := 'Start';
    Button1.TabOrder := 8;
    Edit1 := TEdit.Create(frmDesign);
    Edit1.Parent := frmDesign;
    Edit1.Left := 98;
    Edit1.Top := 15;
    Edit1.Width := 121;
    Edit1.Height := 21;
    Edit1.TabOrder := 9;
    Edit2 := TEdit.Create(frmDesign);
    Edit2.Parent := frmDesign;
    Edit2.Left := 98;
    Edit2.Top := 58;
    Edit2.Width := 121;
    Edit2.Height := 21;
    Edit2.TabOrder := 10;
    Edit2.Text := 'Edit2';
    Button1.Onclick := @ClickButton;
    end;


    procedure AntiRandoms;
    begin
    FindTalk;
    FindNormalRandoms;
    if (FindFight = true) then
    begin
    RunAwayDirection(RunDirection);
    Wait(10000 + random(2000));
    RunBack;
    end;
    end;

    procedure ProgReport;
    begin
    Writeln('- - - - - - - - - - - - - - - - - - - - -');
    Writeln('You have worked for : ' + ScriptTime2(2))
    Writeln('You have Mined ' +IntToStr(Loads)+' loads,');
    Writeln('You have gained Aprox ' +IntToStr(Loads*945)+(' XP! '));
    Writeln('- - - - - - - - - - - - - - - - - - - - -');
    Writeln('{Thank you for using Games Auto Miner!---}');
    Writeln('Games Autos!---------------------------------------------- ');
    Writeln(' _________ ');
    Writeln(' / ________| __________ ');
    Writeln('/ / | _______| ');
    Writeln('| | ________ | \ / | | ______ ');
    Writeln('| | / / \ \ | \ / | |_______ / /____| ');
    Writeln('| | ____ / / \ \ | \ \_/ / | |_______| / /____ ');
    Writeln('| | | | / /_______ \ | |\ _ /| | | |____ / ');
    Writeln('\ \______| | / / \ \ | | | | |________ / / ');
    Writeln(' \_________| / / \ \ | | | |__________| ___/ / ');
    end;

    begin
    SetupSRL;
    DeclarePlayers;
    SafeInitForm;
    SafeShowFormModal;
    repeat
    if(not (LoggedIn)) then
    LoginPlayer;
    until(false)
    repeat
    ActivateClient;
    antirandoms;
    mine;
    converse;
    drop;
    ProgReport;
    FindTheGas;
    until(false)
    end.


    and here is the Error I get:

    Successfully compiled
    Line 174: [Hint] (182:43): Variable 'NEWLINE' never used in script C:\Program Files\SCAR 2.03\includes\srl\srl\core\Globals.scar
    SRL Compiled in 234msec.
    [Runtime Error] : Could not call proc in line 29 in script C:\Program Files\SCAR 2.03\Scripts\Games Auto Miner 0.3.scar

    Any help is appreciated
    Thanks,
    Games

  2. #2
    Join Date
    Apr 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, heres the problems you had...:

    1. You had DeclarePlayers; before the form...so the DeclarePlayers; doesnt know whats Edit1.Text and Edit2.Text...so heres the fixed version...:

    SCAR Code:
    program Miner;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\Skill\Mining.scar}

    var

    Loads : Integer;
    Ox, Oy: Integer;
    frmDesign : TForm;
    Label1 : TLabel;
    Label2 : TLabel;
    Button1 : TButton;
    Edit1 : TEdit;
    Edit2 : TEdit;

    const

    Rock=2371663; //Put the color of the Rock here.
    pick=False;//If you have your Pick equipped, true, if not, false.
    LoadsM=44;//How many loads to mine?
    RunDirection='N';//What direction would you like to run in case of a random?

    Procedure DeclarePlayers;
    Begin

    HowManyPlayers := 4;
    NumberOfPlayers(HowManyPlayers);

    Players[0].Name := Edit1.Text;
    Players[0].Pass := Edit2.Text;
    Players[0].Nick := 'game';

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

    procedure mine;
    begin
    repeat
    if (FindMSColor(x,y,Rock)) then
    MMouse(x,y,0,0);
    ClickMouse(x,y,true);
    wait(2500+random(100));
    until(InvFull);
    if(FindChatText('Lol'))or
    (FindChatText('Rofl'))or
    (FindChatText('Lmao'))or
    (FindChatText('Roflmao'))then
    begin
    typesend('lol')
    end;
    end;

    Procedure FindTheGas;
    begin
    if (not(Findgas(Ox,Oy))) then
     begin
    wait(100+random(100));
    if (FindGas(Ox,Oy)) then
      begin
    wait(100+random(100));
    RunAwayDirection(Rundirection);
    Wait(1000+random(1000));
    RunBack;
      end;
     end;
    end;


    procedure converse;
    begin
    if(FindChatText('Ok'))or
    (FindChatText('K'))or
    (FindChatText('No'))or
    (FindChatText('Yes'))then
    typesend('Im So BORED!!!!!!!!!!')
    end;

    procedure drop;
    begin
    if(pick)=True then
    begin
    typesend('brb...')
    RunAwayDirection(RunDirection);
    GameTab(4);
    DropTo(1,28);
    Wait(10000);
    RunBack;
    typesend('back')
    Loads := Loads + 1;
    end;
    begin
    if(pick)=False then
    begin
    typesend('brb...')
    RunAwayDirection(RunDirection);
    GameTab(4);
    DropTo(2,28);
    Wait(10000);
    RunBack;
    typesend('back')
    Loads := Loads + 1;
    If loads=LoadsM then
    begin;
    logout;
    end;
    end;
    end;
    end;

    procedure ClickButton(sender: TObject); // Adding Buttons and Interactivity
    begin

    Writeln('Button Clicked!');
    frmDesign.Caption:= frmDesign.Caption + '.';
    frmDesign.ModalResult:= mrOk;
    end;

    Procedure InitForm;
    begin
    ///////////////// Generated from: daForm.dfm
    frmDesign := CreateForm;
    frmDesign.Left := 250;
    frmDesign.Top := 114;
    frmDesign.Width := 271;
    frmDesign.Height := 196;
    frmDesign.Caption := 'frmDesign';
    frmDesign.Color := clBtnFace;
    frmDesign.Font.Color := clWindowText;
    frmDesign.Font.Height := -11;
    frmDesign.Font.Name := 'MS Sans Serif';
    frmDesign.Font.Style := [];
    frmDesign.ShowHint := True;
    frmDesign.Visible := False;
    frmDesign.PixelsPerInch := 96;
    Label1 := TLabel.Create(frmDesign);
    Label1.Parent := frmDesign;
    Label1.Left := 12;
    Label1.Top := 15;
    Label1.Width := 74;
    Label1.Height := 20;
    Label1.Caption := 'Username';
    Label1.Font.Color := clWindowText;
    Label1.Font.Height := -17;
    Label1.Font.Name := 'MS Sans Serif';
    Label1.Font.Style := [];
    Label1.ParentFont := False;
    Label2 := TLabel.Create(frmDesign);
    Label2.Parent := frmDesign;
    Label2.Left := 13;
    Label2.Top := 57;
    Label2.Width := 69;
    Label2.Height := 20;
    Label2.Caption := 'Password';
    Label2.Font.Color := clWindowText;
    Label2.Font.Height := -17;
    Label2.Font.Name := 'MS Sans Serif';
    Label2.Font.Style := [];
    Label2.ParentFont := False;
    Button1 := TButton.Create(frmDesign);
    Button1.Parent := frmDesign;
    Button1.Left := 96;
    Button1.Top := 100;
    Button1.Width := 75;
    Button1.Height := 25;
    Button1.Caption := 'Start';
    Button1.TabOrder := 8;
    Edit1 := TEdit.Create(frmDesign);
    Edit1.Parent := frmDesign;
    Edit1.Left := 98;
    Edit1.Top := 15;
    Edit1.Width := 121;
    Edit1.Height := 21;
    Edit1.TabOrder := 9;
    Edit1.Text := 'Name';
    Edit2 := TEdit.Create(frmDesign);
    Edit2.Parent := frmDesign;
    Edit2.Left := 98;
    Edit2.Top := 58;
    Edit2.Width := 121;
    Edit2.Height := 21;
    Edit2.TabOrder := 10;
    Edit2.Text := 'Password';
    Button1.Onclick := @ClickButton;
    end;

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

    procedure ShowFormModal; // Default Code
    begin
    frmDesign.ShowModal;
    end;

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

    procedure AntiRandoms;
    begin
    FindTalk;
    FindNormalRandoms;
    if (FindFight = true) then
     begin
    RunAwayDirection(RunDirection);
    Wait(10000 + random(2000));
    RunBack;
     end;
    end;

    procedure ShowFormModal; // Default Code
    begin
    frmDesign.ShowModal;
    end;

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

    procedure AntiRandoms;
    begin
    FindTalk;
    FindNormalRandoms;
    if (FindFight = true) then
     begin
    RunAwayDirection(RunDirection);
    Wait(10000 + random(2000));
    RunBack;
     end;
    end;

    procedure ProgReport;
    begin
    Writeln('- - - - - - - - - - - - - - - - - - - - -');
    Writeln('You have worked for : ' + ScriptTime2(2))
    Writeln('You have Mined ' +IntToStr(Loads)+' loads,');
    Writeln('You have gained Aprox ' +IntToStr(Loads*945)+(' XP! '));
    Writeln('- - - - - - - - - - - - - - - - - - - - -');
    Writeln('{Thank you for using Games Auto Miner!---}');
    Writeln('Games Autos!---------------------------------------------- ');
    Writeln(' _________ ');
    Writeln(' / ________| __________ ');
    Writeln('/ / | _______| ');
    Writeln('| | ________ | \ / | | ______ ');
    Writeln('| | / / \ \ | \ / | |_______ / /____| ');
    Writeln('| | ____ / / \ \ | \ \_/ / | |_______| / /____ ');
    Writeln('| | | | / /_______ \ | |\ _ /| | | |____ / ');
    Writeln('\ \______| | / / \ \ | | | | |________ / / ');
    Writeln(' \_________| / / \ \ | | | |__________| ___/ / ');
    end;

    begin
    SetupSRL;
    SafeInitForm;
    SafeShowFormModal;
    DeclarePlayers;
    repeat
    if(not (LoggedIn)) then
    LoginPlayer;
    until(false)
    repeat
    ActivateClient;
    antirandoms;
    mine;
    converse;
    drop;
    ProgReport;
    FindTheGas;
    until(false)
    end.

  3. #3
    Join Date
    Mar 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks Much

  4. #4
    Join Date
    Apr 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by gamesqaure3d View Post
    Thanks Much
    np

  5. #5
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    wtf how do all these 2 posters know so much....now i really feel utterly hopeless and stupid at scripting
    Sleeping...

  6. #6
    Join Date
    Sep 2006
    Location
    West U.S.
    Posts
    2,172
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    well it comes to show they are learning...

    and ive seen SRL members with 10-50 post count so no worries

    They are sisters...
    Runescape Classic

  7. #7
    Join Date
    Mar 2007
    Location
    Under a rock
    Posts
    813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yea, some people learn quickly and others dont. Some can become members fast while others like legendaryhero90 are 100% active with 500+ posts and are still not members . Im about to go for members in a week.

  8. #8
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    I hold the current record for longest time waited till memberified

    1k posts exactly


    Back ontopic (not really)

    KBD, nice...it seems that you know a bit about scripting...might you have been one of the scripters from long ago? Or, maybe, did you script at a different community?

    Anyways, you show promise, keep up the good work

    @Game:

    In your 'Mine' procedure, I see you have something of a primitive autoresponder. You might want to make it a little more advanced by doing this:

    SCAR Code:
    if(FindChatText('Lol'))or
    (FindChatText('Rofl'))or
    (FindChatText('Lmao'))or
    (FindChatText('Roflmao'))then
    begin
     case random(5) of
      0:TypeSend('haha');
      1:TypeSend('lol');
      2:TypeSend('lool');
      3:TypeSend('rofl');
      4:TypeSend('lmao');
     end;
    end;
    Interested in C# and Electrical Engineering? This might interest you.

  9. #9
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    [/Offtopic]Hey smartz are you jason and me still gonna go ahead with that mind crafter cos if ur not i guess jason isn't which means i will on my own lol[offtopic]
    Sleeping...

  10. #10
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    [offtopic] You still wanna? The other day I was gonna do some, but jason didn't feel like it...before that, I didn't feel like it... Now that I got accepted into members, I don't need to spend as much time on my application script, so I've got some extra time (still working on a newt eyer, and some other priv scripts) [/offtopic]

    @Game: I assume this is a powerminer?
    Interested in C# and Electrical Engineering? This might interest you.

  11. #11
    Join Date
    Apr 2006
    Location
    Lincolnshire
    Posts
    106
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by legendaryhero90 View Post
    well it comes to show they are learning...

    and ive seen SRL members with 10-50 post count so no worries
    *Looks Away*
    ---------------------

    I joined this forum a long time ago. I leeched, I didn't really bother to properly learn SCAR and it's uses. I am sorry. I've matured, and I want to commit to a hobby I will enjoy and is worthwhile. Teach me.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 02-26-2008, 04:14 PM
  2. Smart error and Some kind of Math.scar error
    By FagetHax0r in forum OSR Help
    Replies: 6
    Last Post: 02-24-2008, 10:43 AM
  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
  •