in reply to Re: Possible or am I dreaming for Perl made dlls
in thread Possible or am I dreaming for Perl made dlls

This header file is interface between botcore.exe which source is not published cause the author wants keep some things in secret. Anyway the author has published this header file for other programmers so they could change the behavior of the corebot.exe.
I try clarify this more..
There are 4 files:
botcore.exe <-- source not available.
behaviors.ini <-- contains the name of compiled behavior dll file
bot.h <-- the published header file
botbehavior.cpp <-- C++ file which is compiled to dll. This file also includes the bot.h file
Bot.h presents how programmer may do their own behaviors for the botcore.exe. Bot.h does not need to exsist as long ht behavior code is compiled to dll and it contains following:
// this is the only function a behavior has to implement: // extern "C" __declspec (dllexport) void CALLBACK BOT_Cmd(BOTCMD *bc) +;
botcore.exe is calling this callback function every 10 ms
+----------------+ |botcore.exe | +-----+ |CORE | <-->| ini | name of dll +-------------|--+ +-----+ |Bot.h | | -- | BotCMD | | | +-------------|--+ | <-- Any Bot programmer may change |behavior.dll | | if only code is compiled into DLL | CODE | -- and it exports BOT_Cmd function +----------------+
Like I said I am not any good with C pluss I know I could do lot of nice new bots if all these things could be done just using Perl. ...Sorry my clumsy english, I hope you figured out the proplem...

Replies are listed 'Best First'.
You Need ActiveState PerlDev Kit - Re: Re: Re: Possible or am I dreaming for Perl made dlls
by metadoktor (Hermit) on Feb 14, 2002 at 12:04 UTC
    Looks like you'll probably have to spend some $$$ to get the tool necessary to do this (i.e. PerlCtrl to create a Perl DLL), otherwise you're probably out of luck. See ActiveState's reference on creating Perl DLLs

    metadoktor

    "The doktor is in."

      Ok sounds reasonable, but could it be done so that the dll made by C++, calls the perl script by passing all the data it gets in *bc pointer variable and viceversa ?
      This way I don't need to figure out how to compile dlls from the perl scripts.
      --------------+ corebot.exe | ------|-------+ ------|-------+ C made API for the Perl script Small.dll | <-Maps BOTCMD *bc pointer to perl Table ? ------+-------+ and then calls Perl script | DATA v +--------------+ |Perl programm | +--------------+
        I don't follow your remark about a C++ DLL calling a Perl script?

        From your explanations, it sounds like you have an executable called "botcore.exe" and a DLL called "botbehavior.dll". They give you the .ini and .h files to include in your own compiled version of botbehavior.cpp which is botbehavior.dll.

        So your problem is how do you create your own "botbehavior.dll" that implements your desired functionality. It seems that you want to do this strictly in Perl. Well...it seems like it is possible to do but possibly only by using ActiveState's dev kit. I've never bought or used their kit myself so I cannot tell you from first hand experience how difficult it is to do this with their software. You should probably contact them to find out if their software totally meets your requirements.

        If you had Microsoft Visual C++ then you would have no problem since you can create DLL's and code in C++ with their software; however, you do not seem to know C++ and do not seem to have a desire to learn C++ and that package would also cost lots of $$$ so your options are somewhat limited.

        Perhaps you should find a different bot program that is open source?

        Good luck.

        metadoktor

        "The doktor is in."