Search found 321 matches
- Tue Jun 17, 2014 4:27 am
- Forum: Help Forum
- Topic: Integrating focus on an IRE MUD
- Replies: 4
- Views: 3201
Re: Integrating focus on an IRE MUD
The reason both would be run is because what you have is a nested if statement. Properly formatted, it would be this: function cure_herbs() if canfocus() then cureherbsfocus() if canfocus() == false and system.mechanics.focusing == false then cureherbsnofocus() end end end Basically, you would never...
- Wed Jun 11, 2014 2:02 am
- Forum: Whatever
- Topic: Good Variable Names
- Replies: 13
- Views: 13419
Re: Good Variable Names
Comments at the end of blocks can be handy, but a better solution is to avoid large blocks as much as possible. Break up large, potentially confusing blocks of code into smaller, easier to handle functions. This helps promote code reuse as well reducing unnecessary code complexity. Often, if I can i...
- Fri Jun 06, 2014 2:05 am
- Forum: Whatever
- Topic: Good Variable Names
- Replies: 13
- Views: 13419
Re: Good Variable Names
I firmly agree with the argument that code should be written for future readers. Numerous studies prove that code is read more than it is written; this can be seen even in the act of sharing scripts here. Therefore, I do believe that variable name need to be descriptive. Descriptive names aren't nec...
- Mon Jun 02, 2014 10:49 pm
- Forum: Help Forum
- Topic: Grabbing info from prompt to store as variables
- Replies: 7
- Views: 5409
Re: Grabbing info from prompt to store as variables
Again, it's about escaping special Regex characters. In this new case, you need to escape the ()'s. So, it will be \(PET\). Also, ?: and ? are special characters. The ?: at the beginning of a capture group makes it a non-capture group. It's used to group things in parentheses without returning the r...
- Mon Jun 02, 2014 12:26 am
- Forum: Help Forum
- Topic: Grabbing info from prompt to store as variables
- Replies: 7
- Views: 5409
Re: Grabbing info from prompt to store as variables
Oh, snap. Thanks. Typing that out on my cell was a pain. Heh. Thanks for catching that.
- Sun Jun 01, 2014 8:14 pm
- Forum: Help Forum
- Topic: Grabbing info from prompt to store as variables
- Replies: 7
- Views: 5409
Re: Grabbing info from prompt to store as variables
This not a Mudlet issue, but a Regex issue. In your pattern, you need to escape the brackets. They have special meaning in Regex patterns. Like so: ^\(?:[(\w+) (\d+)%\])?<(\d+)/(\d+)hp (\d+)/(\d+)m (\d+)/(\d+)mv (\d+)e>\[(\w+)\] I don't know what matches will be. Use display() to work it out. This w...
- Sun Jun 01, 2014 7:57 pm
- Forum: Scripts & Packages
- Topic: Vyzor, UI Manager for Mudlet
- Replies: 329
- Views: 266176
Re: Vyzor, UI Manager for Mudlet
I'm stuck using my phone, so I can't go into a lot of depth. The gray box is usually a result of a missing image or malformed stylesheet. I've personally had problems with image formats like .jpeg on Windows, but I can't give you anything definitive. Check file paths and the like. If there's a bug i...
- Mon May 26, 2014 3:13 am
- Forum: Help Forum
- Topic: Table problems
- Replies: 5
- Views: 3955
Re: Table problems
In order to see the last element of a table, you would index into it like so: local lastValue = tbl[#tbl] Therefore, you can easily see that in order to get the second-to-last value, you should do this: local secondToLastValue = tbl[#tbl - 1] The # symbol gets you the length of a table. Because Lua ...
- Fri May 09, 2014 1:36 am
- Forum: Help Forum
- Topic: from tintin to mudlet
- Replies: 4
- Views: 4223
Re: from tintin to mudlet
This is a pretty standard alias I use:
Obviously, change the .+ to whatever you need. This way, matches[2] does not contain the space.
Code: Select all
^ep(?:\s(.+))?$
- Tue Apr 15, 2014 1:29 am
- Forum: Help Forum
- Topic: Different Style for Different Text in Same Label (CSS)
- Replies: 9
- Views: 5489
Re: Different Style for Different Text in Same Label (CSS)
I dropped this code into an alias exactly as shown here, and it works as expected. Are you getting errors? Are you looking at said errors? echo("Starting HTML test...\n") createLabel("htmlTest", 50, 50, 100, 100, 1) setBgColor("htmlTest", 50, 50, 50) echo("htmlTest...