Close

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    New User
    Join Date
    Jun 2016
    Posts
    7
    Post Thanks / Like
    Rep Power
    0

    Question Morning style nametag

    So if you don't know already, Morning's name ingame has a check mark on the left of it, presumably his tag. Whenever he types a new message in chat tho this check changes color and I've been interested in it for quit some time now. I know he is fairly secretive about it so I won't be releasing any code publicly without his permission but if someone could help me out with a few questions I have that would be awesome! I have devised a couple of ways to achieve this effect ingame:

    1. Completely random colors
    This would involve randomly generating either a letter (A-F) or a number (0-9) and formatting it into a hex to create a truly random color (ex: #FA5C00)
    Then you would have to execute sm_customtag "{}HEXCOLORpreferredtag" either every time you type a message or every ____ period of time

    2. Random KSF colors
    Since KSF has default colors; {1}, {2}, etc. You could randomly generate a number between 1 and the number of presets on ksf
    Then sm_customtag "{RNGNUMBER}preferredtag" again either every time you type a message or every ____ period of time

    3. Set 2 colors
    For example if you only wanted to switch between blue and green, you could have an integer counter or boolean that switches between 1 and 0, or true and false respectively. You could then use an if statement to determine whether to sm_customtag "{}COLOR1preferredtag" or to sm_customtag "{}COLOR2preferredtag" executed after each message.

    4. Set colors >2
    If you wanted more than two specific colors this can be achieved in the same way as method 3 but an integer counter must be used. For each message you send the counter would have to be increased by one and a different if statement would signify a different colors in the sm_customtag command, executed after each message

    5. Random color from list
    If you had a list of colors that you liked but didn't care in which order they appeared in, you could have a random number generated from 0 - #of colors and have a separate if statement for each color, executed either after each message or randomly every ___ period of time

    As I do have the programming capabilities to achieve this, I have little to no experience with coding in CSS or valve language in general, for all I know there may not be a language that is executable beyond in-game commands. I have looked at a list of over 2000 commands and nowhere in there is a simple random number generator (RNG) or something that can act as a boolean, counter, if statement, or detector for when a message is sent ingame. If anyone knows of a way to program this into the source code of CSS it would be much appreciated! Thanks for taking the time to read :)

    EDIT: This could also be done by a third party macro, which I myself do not know how to execute within CSS though

    TL;DR: If you know of a way to program the source code of CSS it would be greatly appreciated if you would mind sharing :)
    Last edited by Goldace31415; 01-03-2017 at 03:05 PM.

  2. #2
    Elite
    Join Date
    Mar 2015
    Posts
    312
    Post Thanks / Like
    Rep Power
    0
    It's just an autohotkey script whenever he press T (default key to open chat) he has a cmd which his colour to change and i think it would be sm_customtag "{XXXXXXX}checkmarkthing" like this with random hex colours
    is not that hard..

  3. #3
    Casual
    Join Date
    Jan 2014
    Posts
    55
    Post Thanks / Like
    Rep Power
    0
    Here's an idea. Write a program that modifies a .cfg file every few seconds with a randomized, formatted sm_customtag value. Rebind y to "exec yourconfig.cfg;default_y_bind", now whenever you press Y to chat it'll apply the randomized color
    Last edited by Crayz; 01-03-2017 at 05:15 PM.

  4. #4
    Recruit
    Join Date
    Jan 2016
    Location
    US, CA
    Posts
    29
    Post Thanks / Like
    Rep Power
    4
    Oh, I see, thanks. welp.png I'll try that to, thanks for the idea Crayz

  5. #5
    Regular Poster Spari's Avatar
    Join Date
    Mar 2014
    Posts
    102
    Post Thanks / Like
    Rep Power
    0
    edit: sunday posted it before me

  6. #6
    Elite
    Join Date
    Mar 2015
    Posts
    312
    Post Thanks / Like
    Rep Power
    0

  7. #7
    New User
    Join Date
    Jul 2016
    Posts
    6
    Post Thanks / Like
    Rep Power
    0
    you dont need any program just a config

    format goes like:

    alias colour1 "bind y colour2; sm_chatcolor xyz; messagemode"
    alias colour2 "bind y colour1; sm_chatcolor abc; messagemode"

  8. #8
    Elite
    Join Date
    Mar 2015
    Posts
    312
    Post Thanks / Like
    Rep Power
    0
    morning's script has 9999999999999999999999 colours , making a config with those cmds and with lots of colours will take you ages to write and it will not be random

  9. Thanks synki thanked for this post
  10. #9
    Casual
    Join Date
    Jan 2014
    Posts
    55
    Post Thanks / Like
    Rep Power
    0
    I slapped together some shit for this, it only took a few minutes. I've never used AHK so I don't know if it would have been easier there, but this is probably more extensible. Source is included
    https://dl.dropboxusercontent.com/u/...ndomConfig.zip

    Instructions:
    There's a config.txt in the zip. It comes with default values.

    First line - Number of milliseconds between each update
    Second line - Path to your .cfg file in Source Engine directory (this file wont be created for you, it must already exist)
    Any additional lines will be added to a List in the program. The List is iterated each update and replaces occurrences of {rand} with:
    {}XXXXXX - x's being a random hex color - then writes those lines to the .cfg file. This lets you do multiple lines like
    sm_customtag {rand}SHIT
    sm_customname {rand}Jake
    Run the .exe
    Bind Y to "messagemode; exec yourcfg"

    I just realized if {rand} is used multiple times in a single line they will all result in the same color. I can fix it if anybody actually uses this. There's no exception/error catching while parsing the config.txt so modify it carefully. If you mess something up just delete it and restart the program, a new one will be generated.

    I haven't even tested this, don't have VIP, so if you try it let me know how it goes

  11. #10
    Regular Poster Spari's Avatar
    Join Date
    Mar 2014
    Posts
    102
    Post Thanks / Like
    Rep Power
    0
    oh

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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