Results 1 to 24 of 24

Thread: Player Array Queston...

  1. #1
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Player Array Queston...

    In the Player Array I'm noticing that there is this...

    SCAR Code:
    type
      TUser = record
        Name: string; // * User Name
        Pass: string; // * User Pass
        Nick: string; // * Screen Name for random detection
        Active: Boolean; // * Set to True if Ok, False if Lost.
        Loc: string; // * User Location
        Rand: string;
        Skill: string; // * User Action to Perform
        Level: array[0..21] of word;
          // * Levels of all skills. SetIn GetPlayerLevels.
        Ore: string; // * test
        WaitTime: Integer; // * Wait Time for Each User, Good for Autofighters
        Fight: Boolean; // * If we want the Char to randomly fight
        Worked: Integer; // * Time User has worked
        Banked: Integer; // * Number of Banks User has done
        Killed: Integer; // * Number of Kills User has made
        Pin: Integer;    // * Current Users Pin Number
        Boolean1: Boolean; // * For reports, etc.
        Boolean2: Boolean; // * For reports, etc.
        Boolean3: Boolean; // * For reports, etc.
        Integer1: Integer; // * For reports, etc.
        Integer2: Integer; // * For reports, etc.
        Integer3: Integer; // * For reports, etc.
        Integer4: Integer; // * For reports, etc.
        String1: string; // * For reports, etc.
        String2: string; // * For reports, etc.
        String3: string; // * For reports, etc.
        Extended1: Extended; // * For reports, etc.
        Extended2: Extended; // * For reports, etc.
        Extended3: Extended; // * For reports, etc.
      end;

    It seems to me that you can just do like
    SCAR Code:
    OresMined: Integer;
    in your own script and then you could use it just like integer1...

    Writeln('Ores Mined : '' + IntToStr(Players[CurrentPlayer].OresMined));

    Would this work?

    Edit: BTW what are TUser, Ore, and Rand for????

  2. #2
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    First question: You would have to add ores mined to that record.

    Im not sure what all of those mean but ore probably means what ore you are mining, instead of using one of your strings.


  3. #3
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok thank you.

  4. #4
    Join Date
    May 2006
    Posts
    1,230
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    TUser is a Type of variable that all that stuff is store in so

    Players : Array Of TUser;

    Rand is Random, and im pretty sure SRL assigns rand to the random they are stuck in if any

    Ore idk lol

  5. #5
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Ore is for powerminers, so you can set players[0].ore := 'iron'; or something like that.
    I made a new script, check it out!.

  6. #6
    Join Date
    Oct 2006
    Posts
    207
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    TBH, i think it would be best if they just had Other: array[1..30] of variant...

  7. #7
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    If your talking about the array in SRL, yes its possible, but you would have to edit everyones SRL that wants to use this ..
    Administrator's Warning:


  8. #8
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    or you could make your own play array inside your script.

    i.e.

    IcePlayers[CurrentPlayer].AirsCrafted

    ect...

  9. #9
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    Well, actually the Player Record has never fully matured really. We kinda always add-to-it, but never given it much attention. We could make it bigger and better, but that will eat up memory or will be incompatible with older scripts.

    Ore, well, you can use that as preferred Ore for a miner.
    Rand, yes RS_Monkey, it holds information regarding the encountered unsolvable random

    The best ones are the custom vars Boolean1-4, Integer1-4, String1-4, Extended1-4. Use them to store any property worth storing. For instance in my autofighters I only want to set AutoRetalliate true once. So I store that to Boolean1....(For miners AutoRetalliate needs to be set to False)

    It could go with a makeover, but I guess nobody really cares that much, but if you have any good suggestions we might consider.
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  10. #10
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by WT-Fakawi View Post
    Well, actually the Player Record has never fully matured really. We kinda always add-to-it, but never given it much attention. We could make it bigger and better, but that will eat up memory or will be incompatible with older scripts.

    Ore, well, you can use that as preferred Ore for a miner.
    Rand, yes RS_Monkey, it holds information regarding the encountered unsolvable random

    The best ones are the custom vars Boolean1-4, Integer1-4, String1-4, Extended1-4. Use them to store any property worth storing. For instance in my autofighters I only want to set AutoRetalliate true once. So I store that to Boolean1....(For miners AutoRetalliate needs to be set to False)

    It could go with a makeover, but I guess nobody really cares that much, but if you have any good suggestions we might consider.
    THANK YOU!!! THIS CLEARS UP A LOT OF PROBLEMS

    Actually there's nothing wrong at all with it,

    but it wouldn't hurt to have a few more of everything like Integer1-10, Boolean1-10 ect...

    Edit: Also... I think we could remove some of the stuff like

    Killed: Integer; // * Number of Kills User has made
    Fight: Boolean; // * If we want the Char to randomly fight
    Ore: string; // * test
    WaitTime: Integer; // * Wait Time for Each User, Good for Autofighters

    permitted that we add Integer1-10 ect...

    I would find it much more convenient if I didn't have to do weird conversions like StrToBool because there aren't enough booleans or use extendeds when I could use integers (if I had enough) just to make things a bit easier to understand/ read.

    basically I would have mine look something like this

    SCAR Code:
    type
      TUser = record
        Name: string; // * User Name
        Pass: string; // * User Pass
        Nick: string; // * Screen Name for random detection
        Active: Boolean; // * Set to True if Ok, False if Lost.
        Loc: string; // * User Location
        Rand: string;
        Skill: string; // * User Action to Perform
        Level: array[0..21] of word; // * Levels of all skills. SetIn GetPlayerLevels.
        Worked: Integer; // * Time User has worked
        Banked: Integer; // * Number of Banks User has done
        Pin: Integer;    // * Current Users Pin Number
        Boolean1: Boolean; // * For reports, etc.
        Boolean2: Boolean; // * For reports, etc.
        Boolean3: Boolean; // * For reports, etc.
        Boolean4: Boolean; // * For reports, etc.
        Boolean5: Boolean; // * For reports, etc.
        Boolean6: Boolean; // * For reports, etc.
        Boolean7: Boolean; // * For reports, etc.
        Boolean8: Boolean; // * For reports, etc.
        Boolean9: Boolean; // * For reports, etc.
        Boolean10: Boolean; // * For reports, etc.
        Integer1: Integer; // * For reports, etc.
        Integer2: Integer; // * For reports, etc.
        Integer3: Integer; // * For reports, etc.
        Integer4: Integer; // * For reports, etc.
        Integer5: Integer; // * For reports, etc.
        Integer6: Integer; // * For reports, etc.
        Integer7: Integer; // * For reports, etc.
        Integer8: Integer; // * For reports, etc.
        Integer9: Integer; // * For reports, etc.
        Integer10: Integer; // * For reports, etc.
        String1: string; // * For reports, etc.
        String2: string; // * For reports, etc.
        String3: string; // * For reports, etc.
        String4: string; // * For reports, etc.
        String5: string; // * For reports, etc.
        String6: string; // * For reports, etc.
        String7: string; // * For reports, etc.
        String8: string; // * For reports, etc.
        String9: string; // * For reports, etc.
        String10: string; // * For reports, etc.
        Extended1: Extended; // * For reports, etc.
        Extended2: Extended; // * For reports, etc.
        Extended3: Extended; // * For reports, etc.
        Extended4: Extended; // * For reports, etc.
        Extended5: Extended; // * For reports, etc.
        Extended6: Extended; // * For reports, etc.
        Extended7: Extended; // * For reports, etc.
        Extended8: Extended; // * For reports, etc.
        Extended9: Extended; // * For reports, etc.
        Extended10: Extended; // * For reports, etc.
      end;

    Edit: Also I believe there is an Error in there, Pin is an Integer O_o, Should be a string

  11. #11
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    I was thinking of Arrays really
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  12. #12
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    2-D Array?

    Defiantly!

    Players[Array1].Integer[Array2]

    Genius...

    Edit:

    Lmao, Integer array[0..99999] of Integer;

    or even Integer array of Integer;

    Edit: Damn, still limited to <= 2147483647

  13. #13
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Why not use open arrays?
    Users would have to set there own lengths..
    Hup Holland Hup!

  14. #14
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Use Integer1/Integer2/Integer3....
    Thats why I put them in in the first place.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  15. #15
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    Use Integer1/Integer2/Integer3....
    Thats why I put them in in the first place.
    Well I was saying there wasn't enough (with out doing weird conversions).

    Also The .Pin is incorrect... It should be a string since.

    Writeln(IntToStr(0044));

    It doesn't give you 0044 so you're bank pin will mess up if there are 0's in the front i.e. '0044'.

  16. #16
    Join Date
    Feb 2006
    Location
    Under a rock.
    Posts
    1,351
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Icefire908 View Post
    Well I was saying there wasn't enough (with out doing weird conversions).

    Also The .Pin is incorrect... It should be a string since.

    Writeln(IntToStr(0044));

    It doesn't give you 0044 so you're bank pin will mess up if there are 0's in the front i.e. '0044'.
    Nah, bank pins aren't typed in, they are clicked by number..
    SRL Developer
    ◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘

  17. #17
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Icefire908 View Post
    Well I was saying there wasn't enough (with out doing weird conversions).

    Also The .Pin is incorrect... It should be a string since.

    Writeln(IntToStr(0044));

    It doesn't give you 0044 so you're bank pin will mess up if there are 0's in the front i.e. '0044'.
    Isn't enough? Deng, I was thinking we have way to many. Do you really have that many different attributes for your script's characters that you need to store?

  18. #18
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Cheesehunk View Post
    Nah, bank pins aren't typed in, they are clicked by number..
    The WriteLn was just an example of how the IntToStr does not convert unnecessary 0's to strings. The InPin procedure uses ClickText, and if you have a pin like 0044 then the 00's in front will not convert in IntToStr for the Pin:String; screwing up your bank pin (only typing in 44 instead of two 0's then two 4's), hence why every script I've read uses String1 for bank pins including my own scripts.

    i.e. this will never work.

    SCAR Code:
    Players[0].Pin := 0044;
    SCAR Code:
    InPin(IntToStr(Players[CurrentPlayer].Pin));

    as you can see

    SCAR Code:
    IntToStr(0044) = '44';
    IntToStr(0044) <> '0044';
    So we have to use

    SCAR Code:
    Players[0].String1 := '0044'
    SCAR Code:
    InPin(Players[CurrentPlayer].String1);

    Rendering the "Pin" of TUser type as a bug in SRL that needs to be fixed.



    __________________________________________________ ________________



    Quote Originally Posted by WhiteShadow View Post
    Isn't enough? Deng, I was thinking we have way to many. Do you really have that many different attributes for your script's characters that you need to store?
    No it is not enough, the entire purpose of the player array was to have unlimited players (correct me if I'm wrong) shouldn't we also have unlimited or plenty of options as well?

  19. #19
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Icefire908 View Post
    The WriteLn was just an example of how the IntToStr does not convert unnecessary 0's to strings. The InPin procedure uses ClickText, and if you have a pin like 0044 then the 00's in front will not convert in IntToStr for the Pin:String; screwing up your bank pin (only typing in 44 instead of two 0's then two 4's), hence why every script I've read uses String1 for bank pins including my own scripts.

    i.e. this will never work.

    SCAR Code:
    Players[0].Pin := 0044;
    SCAR Code:
    InPin(IntToStr(Players[CurrentPlayer].Pin));

    as you can see

    SCAR Code:
    IntToStr(0044) = '44';
    IntToStr(0044) <> '0044';
    So we have to use

    SCAR Code:
    Players[0].String1 := '0044'
    SCAR Code:
    InPin(Players[CurrentPlayer].String1);

    Rendering the "Pin" of TUser type as a bug in SRL that needs to be fixed.



    __________________________________________________ ________________





    No it is not enough, the entire purpose of the player array was to have unlimited players (correct me if I'm wrong) shouldn't we also have unlimited or plenty of options as well?
    Wth, examples in cases where you actually need that many pl0x? (._.)

    EDIT:

    We have 4 integers, 3 Strings, 3 Extended, and 3 Booleans.

    If you wanted to store all the levels of a player for some reason there is :

    Level: array[0..21] of Word;

    Plus even if it says Ore: string; that doesn't stop you from just using it as a String. The name doesn't really matter just the variable type.

  20. #20
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by WhiteShadow View Post
    Wth, examples in cases where you actually need that many pl0x? (._.)

    EDIT:

    We have 4 integers, 3 Strings, 3 Extended, and 3 Booleans.

    If you wanted to store all the levels of a player for some reason there is :

    Level: array[0..21] of Word;

    Plus even if it says Ore: string; that doesn't stop you from just using it as a String. The name doesn't really matter just the variable type.
    I've used the entire player array and still wasn't able to have all the variables I wanted... yes I used conversions.... and the Pin is still messed up. I'm offering that we add more, there is no reason to oppose that as for it's simple as adding a couple of lines....

  21. #21
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    If you have used the entire player array then I must say i would not like to fill out the requirements for your script


  22. #22
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by bobarkinator View Post
    If you have used the entire player array then I must say i would not like to fill out the requirements for your script
    There aren't that many, most are used for proggies or are automatically set...

  23. #23
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Icefire908 View Post
    I've used the entire player array and still wasn't able to have all the variables I wanted... yes I used conversions.... and the Pin is still messed up. I'm offering that we add more, there is no reason to oppose that as for it's simple as adding a couple of lines....
    You do know that one variable Integer1 can be limitless also right?

    Players[50].Integer1 := 5;

    Players[1].Integer1:= 4;

    Even if you had 1000 characters (lols) you can have an Integral value for every single player with Integer1.

    Just use String1 for the pin then...

    But yeah it would be more effiecient to just use arrays instead of integer1, 2, 3, .... Although I think it would cause confusion to newer people...

    I still can't understand how you would need that oober much though.

  24. #24
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by WhiteShadow View Post
    You do know that one variable Integer1 can be limitless also right?

    Players[50].Integer1 := 5;

    Players[1].Integer1:= 4;

    Even if you had 1000 characters (lols) you can have an Integral value for every single player with Integer1.

    Just use String1 for the pin then...

    But yeah it would be more effiecient to just use arrays instead of integer1, 2, 3, .... Although I think it would cause confusion to newer people...

    I still can't understand how you would need that oober much though.
    It would be much more easier if some one would add a couple of variables to the TUser and fix the Pin crap...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Player not found in player array?quikchat?
    By jerrysyron in forum OSR Help
    Replies: 2
    Last Post: 08-01-2008, 12:44 AM
  2. player array
    By deano2727 in forum OSR Help
    Replies: 2
    Last Post: 04-05-2008, 10:05 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
  •