Mudbot and .dll Files

DaegonDaegon CanadaMember Posts: 89 ✭✭✭
Mudbot has been around a while now. Rather useful for mapping, I find, and it doesn't seem to have any connection issues for me. Like I've heard other people say.

I want to convert my system to Mudbot format. So .dll file. Thing is... How?

Before all the questions start flying here's what I know, and have done thus far.

1) I researched what Mudbot is exactly and what it was meant to do originally.

2) I know Mudbot can accept LUA based .dll files. So that's perfect for my coding style.

3)You need a specific program in order to make the .dll files. Visual Studios 2017 for Windows, as an example. I've heard SciTE can be used for it too.

Now those are the main points to my question. How do you convert the files to .dll? I've coded enough in SciTE, and even have the exact same codes in my version on Visual Studios 2017. But how do I convert it when I save it? I've tried everything. It doesn't seem to give me an option for .dll. Even when I make a new project and I'm selecting all my options in Visual Studios. No .dll option that I can see. Even tried googling it, but as I assumed most people that use such things, and make such things, know how to do that very of basic commands.

So can someone help me not feel like an idiot? I just want to convert my code to .dll already!
'Those that do not attempt are those with the least stories to tell.'

Comments

  • EowynEowyn SomewhereMember Posts: 106 ✭✭✭
    If you really want to try to make this a thing, start over with it. Use the Imperian IMTS version, which will be much easier for you to edit because you can edit the files in a word/notepad usually:

    https://sourceforge.net/projects/imts/

    When I played Imperian, I had updated it quite often. But, it takes some practice and getting used to. Plus, the fun part of converting it over. Our version of mudbot is not intended to be used as a system, so even if you get files converted to DLL? It probably won't work that well. They stripped out a lot of stuff from it with the conversion to the mapper alone.
  • DaegonDaegon CanadaMember Posts: 89 ✭✭✭
    Really? I'll take a look into it. I've always wanted to switch to mud out for the speed. Hopefully this gets me in the right direction
    'Those that do not attempt are those with the least stories to tell.'
  • AishiaAishia Queen Bee Member Posts: 2,123 ✭✭✭✭✭
    I had an aet mudbot system when I first started can't even remember where I got it from.




  • DaegonDaegon CanadaMember Posts: 89 ✭✭✭
    I downloaded that sourceforge project but it looks about the same as the one I have. Nothing new, or fancy other than this one is blue. I can't see anything about writing down new code?
    'Those that do not attempt are those with the least stories to tell.'
  • EowynEowyn SomewhereMember Posts: 106 ✭✭✭
    I'm not sure which one you downloaded? I downloaded win and see the i_offense.dll (which is where the offense was housed) and related .is files which house other parts of the script for said offense. And if you download sources, you get all the .h and .c files that go along with the rest.
  • DaegonDaegon CanadaMember Posts: 89 ✭✭✭
    K, I will try downloading again. I did end up downloading a thousand different things yesterday. Working on coding the system now, just need that test system to get my foot in the door XD. Few c++ questions I need answered with it.
    'Those that do not attempt are those with the least stories to tell.'
  • DaegonDaegon CanadaMember Posts: 89 ✭✭✭
    Well I had it then I lost it lol. I managed to get the Imperian stuff and it loaded up almost fine. For some reason it was connecting to my firmware and not Aetolia. But I decided to make my own mudbot like thing anyways. I got it pretty much done just can't seem to get it to connect to telnet for some reason.
    'Those that do not attempt are those with the least stories to tell.'
  • LaniraLanira Member Posts: 71 ✭✭✭
    edited July 2018
    A few months late, but...

    Mudbot is written in C, as are it's modules which are compiled as DLLs. DLLs are compiled code which can be loaded by other programs to execute functions contained within. Compiling a DLL versus an EXE is mainly just a compile option. In Visual Studio this is under Project Properties->Configuration Properties->General->Configuration Type | Select Dynamic Library (DLL)

    In Mudbot's config.txt you can specify DLLs/Modules to load on start. On initialization these modules register with Mudbot their various functions to process server lines, prompts, gmcp data, and user input. Mudbot itself is responsible for calling those functions and passing through the related data.

    The section of code in my Citadel Mudbot module which registers its functions with Mudbot looks like this:
    ENTRANCE( i_citadel_module_register )
    {
    self->name = _strdup( "Citadel" );
    self->version_major = citadel_version_major;
    self->version_minor = citadel_version_minor;
    self->id = i_citadel_id;

    self->init_data = i_citadel_module_init_data;
    self->unload = i_citadel_module_unload;
    self->process_server_line = i_citadel_process_server_line;
    self->process_server_prompt = i_citadel_process_server_prompt;
    self->process_server_gmcp = i_citadel_process_server_gmcp;
    self->process_client_aliases = i_citadel_process_client_aliases;
    // self->process_server_paragraph = i_citadel_process_server_paragraph;

    GET_FUNCTIONS( self );
    }
    But the problem is Mudbot doesn't have triggers or real pattern matching. Everything in the Mudbot Mapper is done using string comparisons and pointers/arrays. Here's the function for parsing sense:
    void parse_msense( char *line )
    {
    char *end;
    char buf[256];

    DEBUG( "parse_msense" );

    if ( strncmp( line, "An image of ", 12 ) )
    return;

    line += 12;

    if ( !( end = strstr( line, " appears in your mind." ) ) )
    return;

    if ( end < line )
    return;

    strncpy( buf, line, end - line );
    buf[end-line] = '.';
    buf[end-line+1] = 0;

    /* We now have the room name in 'buf'. */
    locate_room( buf, 1, NULL );
    }<.pre>

    That's a lot of work for parsing one line. A mistake here would crash Mudbot at the moment you tried to use the sense ability.

    So I wouldn't recommend writing your system as a Mudbot module as it would require writing it in C. But as you alluded to there is a Lua Mudbot module which you can use to write your system in Lua and run through Mudbot.

    http://forums.zuggsoft.com/forums/viewtopic.php?p=110733

    If you're still interested, see if that works. If it doesn't, I can likely get it to compile under the latest version of Mudbot. Alternatively, I could release a new LUA module as Citadel has support for Lua triggers. Here's some example code which would run on load and sets up some limb targeting oninput triggers/aliases, and an auto-impaler trigger which is disabled after creation but has oninput triggers/aliases to turn on and off.

    limb_targets = { "none", "none" }

    -- Offense

    create_group("offense", "", 1, 0)
    set_group("offense")

    -- :: Targetting

    add_lua_oninput_trigger(
    "targetting",
    "^t (.+)$",
    function(args, matches)
    target = matches[2]
    no_input()
    end,
    "",
    "")

    add_lua_oninput_trigger(
    "targetting",
    "^p(?:ush)?l(?:imb)?t(?:arget)? (.+)",
    function(args, matches)
    limb_targets[2] = limb_targets[1]
    limb_targets[1] = matches[2]
    no_input()
    end,
    "",
    "")

    -- :: Lycanthropy

    create_group("lycanthropy", "", 1, 0)
    set_group(".|lycanthropy")

    add_lua_oninput_trigger(
    "",
    "^br$",
    function(args, matches)
    send("claw " .. limb_targets[1] .. " of " .. target)
    send("claw " .. limb_targets[2] .. " of " .. target)
    end,
    "",
    "")

    set_group("")

    -- :: Templar

    create_group("templar", "", 1, 0)
    set_group(".|templar")

    add_lua_oninput_trigger(
    "",
    "^gon$",
    function(args, matches)
    enable_group("gauche_impale")
    no_input()
    end,
    "",
    "")

    add_lua_oninput_trigger(
    "",
    "^goff$",
    function(args, matches)
    disable_group("gauche_impale")
    no_input()
    end,
    "",
    "")

    add_lua_pattern_trigger(
    "gauche_impale",
    "^With a swift movement you dart in toward ([A-Z][a-z]+) and stab (?:her|him) with ",
    function(args, matches)
    send("impale " .. matches[2])
    end,
    "",
    "")

    disable_group("gauche_impale")

    That's still a lot of code as you're not working with any sort of GUI to assist with creating triggers. Mudlet may be a better option. One cool feature is you can to Mudbot running on your PC from any phone/tablet/other-pc from plain Telnet and have access to your system. Pretty cool.
    Post edited by Lanira on
Sign In or Register to comment.