A /roll command

    Joined
    Apr 1, 2014
    Messages
    374
    Reaction score
    442
    • Master Builder Bronze
    • Legacy Citizen 2
    • Purchased!
    Good evening Schemalovelies and random readers.

    I've been meaning to make this and another suggestion for some time, but only ever remembered in the shower or in the car or in some other situation where I wasn't able to act on it.

    As some of you may or may not know, I am head administrator over at Ragnarok Galaxy, an RP server; to this end I admit that in terms of anything other than RP, this is a rather pointless suggestion.

    Basically, I think it would be very neat to have included in the chat system's command a /roll command as is common with many chat applets. This can be used to roll virtual dice, or indeed, work as an in-game RNG. Again, outside RP or maybe trying to select people randomly this doesn't have a great use.

    However, I have come across a number of situations where I wished to determine some random chance, and I thought the ability to do so in-game, where everyone could see the result and be sure people aren't cheating would be nice.

    This could go from just rolling a d100 to determine the severity of some RP event to full on DnD style combat in regards to boarding parties and the like.

    it would not serve a direct purpose so much as be an interesting device for people to use at their leisure.

    For the uninitiated, it works thus:

    the command would be /roll (a)d(b)+(c)
    where (a) is the number of dice, (b) is the number of 'sides' to the dice and optionally (c) represents a modifier that is added to the end result.

    so a /roll 2d20+2 would generate two numbers between 1 and 20 and then add two, giving a result between 4 and 22.

    Hopefully such a thing would not be too challenging to insert.
     
    Joined
    Jul 21, 2013
    Messages
    2,932
    Reaction score
    460
    • Hardware Store
    the command would be /roll (a)d(b)+(c)
    where (a) is the number of dice, (b) is the number of 'sides' to the dice and optionally (c) represents a modifier that is added to the end result.
    what if you want to add a modifier to each individual dice and don't really care about the sum of the rolls?
     
    Joined
    Apr 24, 2013
    Messages
    436
    Reaction score
    73
    • Legacy Citizen 3
    I don't see this as being useful as a chat command but I really want an RNG block for logic.
    I found that a really simple way to get random "numbers" into logic, is to make a sphere filled with area trigger rods, and have wireless push drive balls on the inside.

    I have a tiny station I am planning to release soon that does this, but I want to add more utility to it than it has now.
     
    Joined
    Jul 12, 2013
    Messages
    295
    Reaction score
    112
    • Purchased!
    • Legacy Citizen 10
    With rp being a major part of the game for some people, myself included, I really don't see any problem with having this. Those that want to use it will and those that don't, will never even know it exists.
     

    EMC007

    The guy who's always in way over his head
    Joined
    Aug 8, 2014
    Messages
    132
    Reaction score
    140
    • Purchased!
    • Community Content - Bronze 2
    • Legacy Citizen 5
    You know, if this were to implemented as a block, it cold allow some form of gambling, and potentially, casinos
     
    Joined
    Apr 1, 2014
    Messages
    374
    Reaction score
    442
    • Master Builder Bronze
    • Legacy Citizen 2
    • Purchased!
    Oh yes, having a RNG block is also a splendid idea! especially for logic. Though I cannot argue that this command would be useful for people not interested in roleplay. It depends on how difficult implementation would be.
     
    Joined
    Aug 14, 2013
    Messages
    2,811
    Reaction score
    960
    • Councillor 3 Gold
    • Wired for Logic
    • Top Forum Contributor
    Oh yes, having a RNG block is also a splendid idea! especially for logic. Though I cannot argue that this command would be useful for people not interested in roleplay. It depends on how difficult implementation would be.
    I'm not saying I'm against the idea, adding it doesn't take anything away from the game but like you said, you can't argue for it's usefulness. I know my one friend has an app on his phone that he can specify what type and how many die he wants to "roll". Is there really any benefit to add this to the game that you don't get by having an app on your phone, or actual dice?
     
    Joined
    Jun 27, 2013
    Messages
    896
    Reaction score
    166
    I'm not saying I'm against the idea, adding it doesn't take anything away from the game but like you said, you can't argue for it's usefulness. I know my one friend has an app on his phone that he can specify what type and how many die he wants to "roll". Is there really any benefit to add this to the game that you don't get by having an app on your phone, or actual dice?
    If it's implemented in game, be it as a command or a block, the result is guaranteed to be identical and obvious to all who can watch/are in the same chat channel. With any kind of external application, or physical dice, that is not true.
    I'd like a random generator block; however it is already possible to build at least a PRNG with the current blocks. The cryptographic quality may or may not be sufficient, depending on the intended use.
    EDIT: On the other hand, Java's internal PRNG works on the same principle (LFSR), so it's not guaranteed to be any better...
     
    Last edited:
    Joined
    Jun 10, 2015
    Messages
    333
    Reaction score
    98
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 4
    Takes me back to the days I used to play MUDs on IRC and Telnet. :rolleyes: those were the days.

    Anyway, the casino aspect of it sounds interesting. Setting up a very basic logic slot machine that pays out credits would be an awesome addition to a station casino, or even a craps table if you just want to use th /roll command with 2d6.
     
    Joined
    Apr 1, 2014
    Messages
    374
    Reaction score
    442
    • Master Builder Bronze
    • Legacy Citizen 2
    • Purchased!
    There's absolutely nothing stopping anyone from using the dice or their desk or Random.org to generate random numbers, however, I can tell you with a billion percent certainty that if I were to create, say, some RNG-related grid-based boarding or planetary warfare sub-game for the server with people rolling their own dice or generating their own numbers behind closed doors outside of the chat system itself, people would cheat so hard.
     

    CyberTao

    鬼佬
    Joined
    Nov 10, 2013
    Messages
    2,564
    Reaction score
    641
    • Legacy Citizen 4
    • Railman Gold
    • Thinking Positive
    There's absolutely nothing stopping anyone from using the dice or their desk or Random.org to generate random numbers, however, I can tell you with a billion percent certainty that if I were to create, say, some RNG-related grid-based boarding or planetary warfare sub-game for the server with people rolling their own dice or generating their own numbers behind closed doors outside of the chat system itself, people would cheat so hard.
    Could try a IRC chatroom. I know Mega has a bot that handles rolling and the results are displayed in the chat. Bit of an extra hassle, but it could work in the meantime until better options come up.
     
    Joined
    Jul 21, 2013
    Messages
    2,932
    Reaction score
    460
    • Hardware Store
    I know Mega has a bot that handles rolling and the results are displayed in the chat. Bit of an extra hassle, but it could work in the meantime until better options come up.
    IRC's GameServ usually fulfills that function. My bot also doesn't use the standard format for rolling dice.
    Instead of rolling you give it a formula to calculate, but said formula may contain additional RNG operations. [dX rolls a dice with X sides]. (e.g. d20-d50 would be a valid roll of one d20 and one d50, which's results are subtracted from one-another).
    The bot also stores and manages playerspecific stats, which can be referred to in a roll: $Attacker§AttackStrength would cause the bot to look up the attribute 'AttackStrength' of player 'Attacker' and use it in the calculation.
    You can also store roll-formulas under a name, to quickly call it when the need arises, and to ease the use of those, each roll can be given parameters. (e.g. %1 would cause the bot to use the 1st parameter) In addition, parameters are resolved before attributes are, so $%1§AttackStrength would cause the bot to use the attribute 'AttackStrength' of the player specified in parameter 1.
    As for the commands' syntax:
    • roll <formula/RName> <parameters...>
    • repeatroll <times> <formula/RName> <parameters...>
    • setroll <RName> <formula>
    • clearroll <RName>
    • getroll <RName>
      displays the roll formula. For debugging purposes
    • set <player> <attribute> <value>
    • get <player> <attribute>
    • clear <player> <attribute>
    • addTo <player> <attribute> <value>
      only if the previous value of <attribute> was a number. adds <value> to <attribute>
    • kill <player>
      removes all attributes from a player
    • copy <player> <newPlayer>
      copies all attributes of <player> to <newPlayer>. <newPlayer>'s previous attributes are completely overwritten
    • addAll <player1> <player2>
      adds all numerical attributes from <player1> to <player2>.
     

    Edymnion

    Carebear Extraordinaire!
    Joined
    Mar 18, 2015
    Messages
    2,709
    Reaction score
    1,512
    • Purchased!
    • Thinking Positive Gold
    • Legacy Citizen 5
    Well the game is already set up to allow for chat window based commands, and this is one of the simplest ones you could possibly make.

    I don't particularly need it, but I don't see any reason not to do it. Shouldn't take 'em more than 10-15 minutes to add.
     
    Joined
    Jun 24, 2015
    Messages
    247
    Reaction score
    63
    I don't have a use for it right now, but can certainly see a use for it for others. Adding this kind of functionality should be a no-brainer. As Edymnion said it should be fairly easy and quick to implement.
     
    Joined
    Jun 10, 2015
    Messages
    333
    Reaction score
    98
    • Community Content - Bronze 1
    • Purchased!
    • Legacy Citizen 4
    I haven't done any programming since the days of VB, but I'm sure even I could do this as a mod of some sort.
     
    Joined
    May 15, 2013
    Messages
    16
    Reaction score
    2
    Just thinking aloud here, I've seen servers with special commands (such as ol' nasszone, had the wonderous !core command) that were implemented as mods. I never saw the implementation, but they probably just have a log monitor script that waits to see a command used, and who said it, then does stuff and uses the remote control tool to do it.

    My guess is you can (on a linux server box mind, dunno about windows server) pipe the output of `tail -f` on the current log file(assuming this still works the way I recall when I played around with a short lived pub server ages ago) to a little script to grab the chat info. Then you just have the script sleep till someone inputs your command, which sends commands to the remote control tool to cause an effect on the server. As a note, you would likely not be able to use '/' still for it, as that gets handled differently as far as I know.

    Bear in mind I could be wrong here, operating off of what I recall finding almost a year or two ago lol :P
     
    • Like
    Reactions: Ithirahad
    Joined
    Jun 24, 2015
    Messages
    247
    Reaction score
    63
    Just thinking aloud here, I've seen servers with special commands (such as ol' nasszone, had the wonderous !core command) that were implemented as mods. I never saw the implementation, but they probably just have a log monitor script that waits to see a command used, and who said it, then does stuff and uses the remote control tool to do it.

    My guess is you can (on a linux server box mind, dunno about windows server) pipe the output of `tail -f` on the current log file(assuming this still works the way I recall when I played around with a short lived pub server ages ago) to a little script to grab the chat info. Then you just have the script sleep till someone inputs your command, which sends commands to the remote control tool to cause an effect on the server. As a note, you would likely not be able to use '/' still for it, as that gets handled differently as far as I know.

    Bear in mind I could be wrong here, operating off of what I recall finding almost a year or two ago lol :p
    I did similar things on a minecraft server awhile back. You're right its not hard on a Linux box. I used it to give access to some admin commands on an vanilla server. Works well.
     

    jayman38

    Precentor-Primus, pro-tempore
    Joined
    Jul 13, 2014
    Messages
    2,518
    Reaction score
    787
    • Purchased!
    • Thinking Positive
    • Legacy Citizen 4