Search found 334 matches
- Thu Jul 13, 2017 8:49 pm
- Forum: Help Forum
- Topic: command, ";"
- Replies: 4
- Views: 5368
Re: command, ";"
There's a problem with the mud I play that a lot of special exits don't actually provide a message to indicate usage, other then showing the room description for the room you've been moved to. The only unique indicator for a room change (which isn't always a room change, it could be for another reas...
- Thu Jul 13, 2017 4:48 pm
- Forum: Help Forum
- Topic: command, ";"
- Replies: 4
- Views: 5368
command, ";"
Question: The command separator for multiple commands sent on the same line is "command1;command2" Right after someone types that, I receive a response from the mud. In that trigger, when it looks at the 'command' variable the contents of it will be 'command2'. How would I find 'command1',...
- Thu Jul 13, 2017 4:41 pm
- Forum: Help Forum
- Topic: Migrating from CMud and looking for design patterns
- Replies: 3
- Views: 3159
Re: Migrating from CMud and looking for design patterns
Just to followup - I don't personally find placing a wait for execution of a command to be the best idea. Especially when it starts getting complex, any time of internet slow downs / mud lag/ etc usually break this. I find it usually better to look for whether there's a unique response from the mud ...
- Thu Jul 13, 2017 2:37 am
- Forum: Help Forum
- Topic: Migrating from CMud and looking for design patterns
- Replies: 3
- Views: 3159
Re: Migrating from CMud and looking for design patterns
Code: Select all
send("get all sack")
tempTimer(2, [[send("drop all.sword")]])
tempTimer(4, [[echo("done")]])
- Mon Jun 26, 2017 10:16 am
- Forum: Help Forum
- Topic: Question
- Replies: 4
- Views: 3855
Re: Question
I dealt with this on the mud I play by writing a trigger to replace tabs with the appropriate amount of spaces.
regex pattern:
\t
trigger body:
while selectString("\t",1) > -1 do
replace(" ")
end
regex pattern:
\t
trigger body:
while selectString("\t",1) > -1 do
replace(" ")
end
- Wed Jun 14, 2017 6:55 pm
- Forum: Scripts & Packages
- Topic: Timer Script
- Replies: 0
- Views: 5351
Timer Script
This is an easy to use timer script that works by creating a single permanent master timer, and provides functions to create countdown timers based off that. If a function exists matching the name of a timer, it will also be called every second with (functionname, remainingtime) passed as arguments....
- Wed Jun 14, 2017 2:56 pm
- Forum: Help Forum
- Topic: Timer Script
- Replies: 3
- Views: 2825
Re: Timer Script
Thanks - You can delete this post. I hadn't exactly looked at the code since I wrote it, and looking back at it something stood out right away that should be changed to simplify it. I'll rewrite and repost in the scripts forum.
- Wed Jun 14, 2017 10:59 am
- Forum: Help Forum
- Topic: raiseEvent works with everything but tables?
- Replies: 3
- Views: 3296
Re: raiseEvent works with everything but tables?
I don't know if it was intentional or not, but it can be worked with using the function pair yajl.to_string / yajl.to_value
These function encode a table into a usable string, and decode the string back into a table.
These function encode a table into a usable string, and decode the string back into a table.
- Tue Jun 13, 2017 5:20 pm
- Forum: Help Forum
- Topic: Timer Script
- Replies: 3
- Views: 2825
Re: Timer Script
Here's a quick example using the above: timer:init() timer:set("bomb", 10) function bomb(reason) if reason == "timer" then echo("I am a " .. timer:get("bomb") .. " second bomb.\n") else echo("BOOM!\n") end end -- output -- I am a 9 second b...
- Tue Jun 13, 2017 5:01 pm
- Forum: Help Forum
- Topic: Timer Script
- Replies: 3
- Views: 2825
Timer Script
I'd posted this in another thread. With numerous timer related questions, better to just give it it's own thread. The below script includes a couple easy to use timer related commands (and some documentation/commenting!) timer = timer or {} timer.values = timer.values or {} -- Usage: -- -- timer:ini...