mud

How to toggle Tcl interact and expect for telnet automation?

纵然是瞬间 提交于 2021-01-29 15:59:48
问题 Similar to but different from autoexpect in that autoexpect will always produce the same output for any given input. Whereas, trying to allow for user input sometimes at least. This works in that it passes control back to the user as below: thufir@dur:~/NetBeansProjects/spawnTelnet/telnet$ thufir@dur:~/NetBeansProjects/spawnTelnet/telnet$ tclsh main.tcl got nyc spawn telnet rainmaker.wunderground.com Trying 35.160.169.47... Connected to rainmaker.wunderground.com. Escape character is '^]'. --

Clojure best way to achieve multiple threads?

时光怂恿深爱的人放手 提交于 2019-12-08 15:29:35
问题 I am working on a MUD client written in Clojure. Right now, I need two different threads. One which receives input from the user and sends it out to the MUD (via a simple Socket), and one that reads and displays output from the MUD, to the user. Should I just use Java Threads, or is there some Clojure-specific feature I should be turning to? 回答1: I would recommend using the pcalls function, like this: (defn- process-server-responses [] (prn "server connected") (. java.lang.Thread sleep 1000)

Class variable within its definition?

前提是你 提交于 2019-12-06 09:05:17
问题 This is probably a dumb question. I am trying to make a text-mud. I need each Room class to contain other Room classes that one can refer to when trying to move to them or get information from them. However, I can not do that because I obviously can not declare a class within its definition. So, how do I do this? Here's what I mean when I state I can not do it: class Room { public: Room NorthRoom; Room EastRoom; Room SouthRoom; Room WestRoom; }; 回答1: It's not possible to have a Room member

Class variable within its definition?

て烟熏妆下的殇ゞ 提交于 2019-12-04 13:00:37
This is probably a dumb question. I am trying to make a text-mud. I need each Room class to contain other Room classes that one can refer to when trying to move to them or get information from them. However, I can not do that because I obviously can not declare a class within its definition. So, how do I do this? Here's what I mean when I state I can not do it: class Room { public: Room NorthRoom; Room EastRoom; Room SouthRoom; Room WestRoom; }; It's not possible to have a Room member variable. You could use a pointer or reference though. class Room { public: Room* NorthRoom; Room* EastRoom;

C++ Text-RPG Inventory system

六眼飞鱼酱① 提交于 2019-12-01 07:50:08
问题 I'm building text-rpg inventory system but I'm not really sure how to properly create equipable items. For example, I can equip item which is in player inventory but I cannot identify what kind of item that is(Sword, Shield, Gloves or something else..) because item should be equiped in proper place(Helmet on head, sword in hands and so on). Is there any way to do so? #include <iostream> #include <vector> #include <Windows.h> #include <string> using namespace std; void Red() {

Grab user input asynchronously and pass to an Event loop in python

青春壹個敷衍的年華 提交于 2019-11-29 10:03:33
I am building a single player MUD, which is basically a text-based combat game. It is not networked. I don't understand how to gather user commands and pass them into my event loop asynchronously. The player needs to be able to enter commands at any time as game events are firing. So pausing the process by using raw_input won't work. I think I need to do something like select.select and use threads. In the example below, I have a mockup function of userInputListener() which is where I like to receive commands, and append them to the command Que if there is input. If have an event loop such as:

【mud】坐在车里玩mud(/obj/toy/car.c)

扶醉桌前 提交于 2019-11-29 06:27:55
坐在车里看mud真的很酷, 代码: // by snowcat 5/3/1997 #include <ansi.h> inherit ITEM; mapping chinese_dirs = ([ "north": "北", "south": "南", "east": "东", "west": "西", "northup": "北边", "southup": "南边", "eastup": "东边", "westup": "西边", "northdown": "北边", "southdown": "南边", "eastdown": "东边", "westdown": "西边", "northeast": "东北", "northwest": "西北", "southeast": "东南", "southwest": "西南", ]); mapping left_dirs = ([ "north": "northwest", "south": "southeast", "east": "northeast", "west": "southwest", "northeast": "north", "northwest": "west", "southeast": "east", "southwest": "south", ]); mapping right_dirs = ([

Grab user input asynchronously and pass to an Event loop in python

我们两清 提交于 2019-11-28 03:25:30
问题 I am building a single player MUD, which is basically a text-based combat game. It is not networked. I don't understand how to gather user commands and pass them into my event loop asynchronously. The player needs to be able to enter commands at any time as game events are firing. So pausing the process by using raw_input won't work. I think I need to do something like select.select and use threads. In the example below, I have a mockup function of userInputListener() which is where I like to

转换大小写

醉酒当歌 提交于 2019-11-27 06:00:48
转换大小写 字符串方法toLowerCase()和toUpperCase()字符串并将所有字符分别转换为小写或大写。 例如,如果要在将数据存储在数据库中之前对所有用户输入的数据进行规范化,这可能非常有用。 让我们尝试输入以下几行来看看会发生什么: let radData = ‘My NaMe Is MuD’; radData.toLowerCase(); radData.toUpperCase(); 来源: https://blog.csdn.net/jean_0920/article/details/99478136