Results 1 to 11 of 11

Thread: SRL Player Remote

  1. #1
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default SRL Player Remote

    Hello SRL

    i have come to announce my SRL Player Remote which is based off of this

    This will allow you to add, remove or edit players during runtime

    The remote is in two separate parts

    First there is the Form, for this you will need to move the sex file into your extensions folder, from here there will be a menu called "SRL Remote"

    This will allow you to edit the scripts player properties

    If you are running more than one script then a form will popup first asking you which script instance you would like to edit

    for developers there are three things they need to know about
    Simba Code:
    SetupSRLRemote
    SRLRemote
    RemoteInstance

    in order to use the remote you must call SetupSRLRemote
    you can do so by using
    Simba Code:
    procedure SetupSRLRemote(ScriptName: string; Integers, Booleans, Strings: TVariantArray; StringValues: array of array of string);
    now dont worry if you dont understand these, i will explain
    ScriptName is simply the name of the script so "Vine Vanquisher"
    Integers, Booleans and Strings are each arrays from the player array (Players[0].Integers[0], Players[0].Strings[0] etc.) and must be fileld in a particular way (string, int, string, int)
    first you put a one or two word description of what the variable is for, then you put the variable index

    so for example, lets say i have this in my setup
    Simba Code:
    Players[0].Integers[0]:= 5; //Loads
    Players[0].Integers[2]:= 45; //Time till break
    you would put this as
    Simba Code:
    ['loads', 0, 'time till break', 2]
    as you can see the name matches up with the index

    this is the same for the strings and booleans

    and lastly we have StringValues
    now this is because strings are different in scripts because you want the user to choose certain ones, otherwise the script might not work, so that is what this is for
    so lets say for Strings i put
    Simba Code:
    ['Location', 0, 'Tan Type', 1]
    using StringValues you define what options the user can choose for the strings
    so you can put
    Simba Code:
    [['Al Kharid', 'Lumby', 'Draynor'], ['Soft', 'Hard', 'Snake', 'Dragon']]

    So in total the setup could look like
    Simba Code:
    SetupSRLRemote('Ultimate Tanner', ['Loads', 2], [], ['Location', 1, 'Hide Type', 0], [['Al Kharid', 'Lumby', 'Fally'], ['Soft', 'Hard', 'Dragon', 'Snake']]);

    this is all you need to do to set up the SRL Player Remote

    Now to make your script use the remote add this line somewhere it will get called frequently
    Simba Code:
    SRLRemote;

    and one last thing , there is a Integer which you can use to let the user know which instance the script is
    RemoteInstance;
    You can put this in your progress reports or put it somewhere so your user knows which instance it is

    Well i think i have rambled on long enough so i shall give you the files (please not there may be bugs as i havent been able to fully test it but it should work)

    Place remote.simba into Includes/SRL/SRL/Misc
    and to use the remote in your script simply include the file

    and SRLRemote.sex into your extensions folder

    ~shut

    EDIT: Just remembered you probably want to see some images



    Last edited by Shuttleu; 08-16-2011 at 01:43 PM.

  2. #2
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    This looks awesome, Shut! Definitely has the potential to be added to SRL (after we know it's stable and all that good stuff). I'm wondering if it's possible to export some methods used in extensions to PS or vise versa. That would allow people to use your remote's code also as a player form. Kills two birds with one stone.

    E: Does this work? I didn't think you could declare string arrays line that.
    Simba Code:
    SetupSRLRemote('Ultimate Tanner', ['Loads', 2], [], ['Location', 1, 'Hide Type', 0], [['Al Kharid', 'Lumby', 'Fally']['Soft', 'Hard', 'Dragon', 'Snake']]);
    Guess you learn something new every day. When you say "StringValues" is that what's added to combo boxes for "Location" and "Hide Type"? How exactly does that work? Maybe including a picture of what the end result looks like with those settings will help with the understanding.
    Last edited by Coh3n; 08-13-2011 at 09:57 PM.

  3. #3
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  4. #4
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  5. #5
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  6. #6
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    So Shut, was just thinking this can still easily be used for MSI to reset players. The user just wouldn't be able to reset specific player attributes because of the way MSI is written. It would actually work really well for script settings and player activity + breakLoads, breakTime, totalTime and totalLoads.

    If you're interested in add this to MSI, fantastic, if not I'll add it to my to-do list as I can't see the new form being completely finished anytime soon.

  7. #7
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    So Shut, was just thinking this can still easily be used for MSI to reset players. The user just wouldn't be able to reset specific player attributes because of the way MSI is written. It would actually work really well for script settings and player activity + breakLoads, breakTime, totalTime and totalLoads.

    If you're interested in add this to MSI, fantastic, if not I'll add it to my to-do list as I can't see the new form being completely finished anytime soon.
    sure i would love to help add this

    ~shut

    EDIT: however i do feel like the saving and loading of the vars functions will have to be changed for MSI as it doesnt use the Players array, it uses its own type (MSIPlayers?)
    Last edited by Shuttleu; 08-16-2011 at 07:46 AM.

  8. #8
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    This has now been added to MSI, and will be added to SRL as soon as I get my authentication back. I'll also send a pull request for SRLRemote.sex to be added to Simba.

    E: https://github.com/MerlijnWajer/Simba/pull/38
    Last edited by Coh3n; 08-24-2011 at 10:48 PM.

  9. #9
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    I'm using this with MSI right now and it asks me to choose an instance (with 3 options), yet I only have one running? Isn't it supposed to delete the remote file after the script is executed?

  10. #10
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    I'm using this with MSI right now and it asks me to choose an instance (with 3 options), yet I only have one running? Isn't it supposed to delete the remote file after the script is executed?
    it cant delete the file because there is no DeleteFile in simba

    so i have to set a bool in the ini to false when the script stops, it should work (at least it did when i done it)

    the only reason i can think of is if you press the stop button two times which will terminate the script before it gets to set the var in the ini

    ~shut

  11. #11
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Shuttleu View Post
    it cant delete the file because there is no DeleteFile in simba

    so i have to set a bool in the ini to false when the script stops, it should work (at least it did when i done it)

    the only reason i can think of is if you press the stop button two times which will terminate the script before it gets to set the var in the ini

    ~shut
    Oh okay. That's probably it.

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
  •