Testing our trigger is as easy as typing ‘random’ in game to call our game-driven function! As a part of the test I’ve added in an action to echo the text ” <- hit” in-game. With a verified and tested regex pattern it’s time to apply this in-game in our Mudlet trigger. regex101 provides pattern validation, performance metrics, and details on the pattern expressions used Here is a shared reference that is specific to our use case. A great resource to help understand and explain each component of the expression above is. While regex is its own independent deep topic we could delve on, we’ll save that topic for another day. When applied to the example above we should expect the following results: rand() | random() | arc4random() <- No Match - <- No Match int32 | int32 | int32 <- Match int32 | int32 | int32 <- Match The end result will be to transform the data above into the JSON schema below: [$ Certainly overkill where we’ll be working with numbers ranging from 1-20 but is a standard. Note my use of the term int32 is referencing a 32-bit integer value that can range from -2,147,483,648 to +2,147,483,647. MUDLET STRING FUNCTIONS SERIESTaking a look at the data in-game, it is presented as a series of text in a set format. In our case the destination environment is the Elasticsearch database that expects data in the JSON format. Where this blog is specific to analyzing these random numbers, the component of collecting data from the game client can be leveraged for future endeavors. So now the question becomes… How can we get the data from inside a MUD’s game client and make it presentable in a way that supports our goals? Before solving extracting the data out of Mudlet it’s a good step to determine where it needs to go. With this in place it’s time to piece together how we’re going to transition the data from above into the visualization below. When ran in-game the output is presented to the game administrator like so: Here’s a sample representing this function’s code: void do_random(CHAR_D *ch, char *argument, int cmd) To accomplish this we’ve set a command in-game that produces 100 rolls for each of the three functions. Do we need to evaluate other sources or methods for rolls?. MUDLET STRING FUNCTIONS GENERATOR
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |