Poll: Should this procedure be added to SRL?

Results 1 to 13 of 13

Thread: Procedure SetUserNicks(Active: Boolean);

  1. #1
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Procedure SetUserNicks(Active: Boolean);

    This procedure sets all the user nicks for you. "Active" is what you want the status of the player to be if a nickname can not be created (ex: la la la). If true, the player will remain active.

    I just finished working on this, so let me know if there are any bugs.

    SCAR Code:
    {*******************************************************************************
    Procedure SetUserNicks(Active: Boolean);
    By: Macrosoft
    Description: Will set the nickname for all the players in your script.  If Active is set as false,
    then if a player's username cannot be used to make a nickname, the player will become not active.
    *******************************************************************************}


    Procedure SetUserNicks(Active: Boolean);

    var
      counter: integer;
      n, a, x, NameLength: integer;
      cName: array of char;
      nName: array[0..2] of char;
    begin
      a:=GetArrayLength(Players);
      for n:= 0 to a-1 do
        begin
          Counter:=2;
          x:=0
          NameLength:=Length(Players[n].Name);
          SetArrayLength(cName, NameLength + 1);
          repeat
            begin
              cName[Counter-1]:=StrGet(Players[n].Name, Counter);
              if(cName[Counter-1] = ' ')then
              begin
                x:=0;
                Counter:=Counter+1;
              end else
              begin
                nName[x]:=cName[Counter-1];
                x:=x+1;
              end;
              Counter:=Counter+1;
            end;
          until(Counter=NameLength + 2) or (x=3);
          if(Counter=NameLength + 2)then
          begin
            writeln('Nickname can not be made from the username: ' + Players[n].Name);
            if(Active=False) then
            begin
              writeln(Players[n].Name + ' is no longer active');
              Players[n].Active:=False;
            end;
          end else
          begin
            Players[n].Nick:= nName[0] + nName[1] + nName[2];
            writeln(Players[n].Name + +#39+ 's nickname has been set to: ' + Players[n].Nick);
          end;
        end;
    end;

    Feel free to use this but remember to Credit Me!

  2. #2
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Reserved for current scripts using this procedure

  3. #3
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Nice...ish? I figure I could just use a for loop, as calling a procedure has lots of overhead .
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  4. #4
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by R0b0t1 View Post
    Nice...ish? I figure I could just use a for loop, as calling a procedure has lots of overhead .
    for loop for what?

  5. #5
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    SCAR Code:
    for I:= 0 to GetArrayLength(Players) do
      Players[I].Active:= True;
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  6. #6
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    sry man, you got me lost

    where exactly would i need this?

  7. #7
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Heh? Sorry... It got like buried.


    I though you meant that it set the Active attribute on a player XD?
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  8. #8
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    if active is true, the player will remain active even if the nick can not be set

  9. #9
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Setting up nicks automatically would be nice. However as I found out some peoples names are actually censored in RS. 3 cheers to Jagex for their brilliant censor system.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  10. #10
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    dang, that can be a problem

    maybe we can figure out what is sensored and then add that to the procedure?

    just a thought, i guess its too much work

    Simple solution: Dont have bad usernames

  11. #11
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    dont worry, posting on this thread is not a grave dig

    (sorry about double post)

  12. #12
    Join Date
    Jul 2007
    Location
    St. Louis, Missouri, USA.
    Posts
    575
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So why isn't this in SRL? Afraid it'll increase leechers?
    -You can call me Mick-



  13. #13
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol, i dont know

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Procedure SetUserNicks(Active: Boolean);
    By Macrosoft in forum Research & Development Lounge
    Replies: 13
    Last Post: 11-16-2007, 08:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •