Results 1 to 9 of 9

Thread: PlayerForm help

  1. #1
    Join Date
    Jul 2014
    Posts
    86
    Mentioned
    3 Post(s)
    Quoted
    37 Post(s)

    Default PlayerForm help

    Can anyone explain what's wrong , I tried following https://villavu.com/forum/showthread...ayerform+guide this guide but everything i try seem to cause an error
    Simba Code:
    procedure declarePlayers();
    var
      i: integer;
    begin
      players.setup(playerForm.players); // load the SPF players from the SRL Player Manager
      currentPlayer := 0;                                           // player to use first

      // set player attributes based on the settings from the form
      for i := 0 to high(players) do
        with players[i] do
        begin
          // convert the integers
          integers[0] := strToInt(playerForm.players[i].settings[0]);
          integers[1] := strToInt(playerForm.players[i].settings[1]);
          integers[2] := strToInt(playerForm.players[i].settings[2]);

          // booleans
          booleans[0] := strToBool(playerForm.players[i].settings[4]);

        end;
    end;

    procedure initPlayerForm();
    begin
      with playerForm do
      begin
        name := 'SRL Player Form ~ Test'; // the title of the SPF, usually the name of your script
        scriptHelpThread := '';           // a link to a help thread, if set to '' will link to my setup guide

        editBoxLabels := ['Minutes to run', 'Minutes before breaking', 'Logs to burn'];     // edit boxes are created for each array element
        editBoxDefaults := ['80', '5', '1000'];                                                 // optional default values for each edit box; array length must equal editBoxLabel length

        checkBoxLabels := ['Find Spirit?']; // same as editBoxLabels but for check boxes
        checkBoxDefaults := ['False'];


      end;
    end;

  2. #2
    Join Date
    Jul 2014
    Posts
    86
    Mentioned
    3 Post(s)
    Quoted
    37 Post(s)

    Default

    bump

  3. #3
    Join Date
    Mar 2013
    Posts
    1,010
    Mentioned
    35 Post(s)
    Quoted
    620 Post(s)

    Default

    Quote Originally Posted by GTFO_Jagex View Post
    bump
    You only posted this 2 hours ago...
    #slack4admin2016
    <slacky> I will build a wall
    <slacky> I will ban reflection and OGL hooking until we know what the hell is going on

  4. #4
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default



    works fine for me.

    err. rev 1040 of srl, lemme update just to make sure.

  5. #5
    Join Date
    Jul 2014
    Posts
    86
    Mentioned
    3 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post


    works fine for me.

    err. rev 1040 of srl, lemme update just to make sure.

    Its like this for me

  6. #6
    Join Date
    Nov 2013
    Location
    North of Hell
    Posts
    271
    Mentioned
    7 Post(s)
    Quoted
    171 Post(s)

    Default

    Quote Originally Posted by GTFO_Jagex View Post
    Simba Code:
    integers[0] := strToInt(playerForm.players[i].settings[0]);
          integers[1] := strToInt(playerForm.players[i].settings[1]);
          integers[2] := strToInt(playerForm.players[i].settings[2]);

          // booleans
          booleans[0] := strToBool(playerForm.players[i].settings[4]);
    Pretty sure that last line has to be
    Simba Code:
    booleans[0] := strToBool(playerForm.players[i].settings[3]);
    If you don't have that, the player form will still be able to load, but it won't be able to declare players.

    Otherwise, just make sure you have

    at the top of your script, and make sure the player form one goes after the SRL One, and then your main loop should look somethin like:
    So... I hear you like infinite loops.............

  7. #7
    Join Date
    Jul 2014
    Posts
    86
    Mentioned
    3 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by The Spark View Post
    Pretty sure that last line has to be
    Simba Code:
    booleans[0] := strToBool(playerForm.players[i].settings[3]);
    If you don't have that, the player form will still be able to load, but it won't be able to declare players.

    Otherwise, just make sure you have

    at the top of your script, and make sure the player form one goes after the SRL One, and then your main loop should look somethin like:
    Still getting this
    Simba Code:
    Error: "False" is an invalid integer at line 39

    Simba Code:
    program SRLPlayerFormTest;
    {$DEFINE SMART}
    {$i srl-6/srl.simba}
    {$i srl-6/lib/misc/srlplayerform.simba}

    // initiates the SRL player form (you aren't restricted to the procedure name; it can be whatever you want)
    procedure initPlayerForm();
    begin
      with playerForm do
      begin
        name := 'SRL Player Form ~ Test'; // the title of the SPF, usually the name of your script
        scriptHelpThread := '';           // a link to a help thread, if set to '' will link to my setup guide

        editBoxLabels := ['Minutes to run', 'Minutes before breaking', 'Logs to burn'];     // edit boxes are created for each array element
        editBoxDefaults := ['80', '5', '1000'];                                                 // optional default values for each edit box; array length must equal editBoxLabel length

        checkBoxLabels := ['Find Spirit?']; // same as editBoxLabels but for check boxes
        checkBoxDefaults := ['False'];


      end;
    end;

    // again, not restricted to the procedure name, although it's recommended
    procedure declarePlayers();
    var
      i: integer;
    begin
      players.setup(playerForm.players); // load the SPF players from the SRL Player Manager
      currentPlayer := 0;                                           // player to use first

      // set player attributes based on the settings from the form
      for i := 0 to high(players) do
        with players[i] do
        begin
          // convert the integers
          integers[0] := strToInt(playerForm.players[i].settings[0]);
          integers[1] := strToInt(playerForm.players[i].settings[1]);
          integers[2] := strToInt(playerForm.players[i].settings[2]);

          // booleans
          booleans[0] := strToBool(playerForm.players[i].settings[3]);

        end;
    end;

    procedure debugSPFSettings();
    var
      i: integer;
    begin
      writeln('');

      for i := 0 to high(players) do
      begin
        writeln('Minutes to run:          ', players[i].integers[0]);
        writeln('Logs to chop:            ', players[i].integers[1]);
        writeln('Minutes before breaking: ', players[i].integers[2]);
        writeln('Hatchet Equipped:        ', players[i].booleans[0]);

        writeln('');
      end;
    end;

    begin
      clearDebug();

      initPlayerForm(); // initiate your settings
      runPlayerForm();  // run the form

      // use this so the script doesn't continue if the user exits out of the form
      if (not playerForm.isScriptReady) then
        exit;

      declarePlayers();
      debugSPFSettings(); // this can be removed if you're satisfied with the result
      //setupSRL();
    end.

  8. #8
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Quote Originally Posted by GTFO_Jagex View Post

    Its like this for me
    Why did you not post this from the start?



    Force update on your SRL?
    You may have a recalled version of the player form... (which was changed and accepted without the implications being considered)

  9. #9
    Join Date
    Jul 2014
    Posts
    86
    Mentioned
    3 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post
    Why did you not post this from the start?



    Force update on your SRL?
    You may have a recalled version of the player form... (which was changed and accepted without the implications being considered)
    Still the same :/
    Can you post your playerform code here ?

    Edit : Re-installed Simba , its fine now

    Thanks for the help

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
  •