Bak wrote: |
To the best of my knowledge TWCore, and therefore each of its plugins, is written in Java.
If you want to use C++ consider MervCore. |
Bak wrote: |
http://wiki.minegoboom.com/index.php/MERVBot_Tutorial
That guide has describes how to set up the compile environment with MS Visual Studio. If you don't have that the process is the same as creating any .dll file, although if you can't figure out how to do that let me know and I might make some sort of tutorial. |
Samapico wrote: |
I don't know if someone found a solution for this, but compiling Merv plugins with MS Visual Studio 2005 often gives you plugins that cannot work on computers without VS2005 installed. I personally use VS 6.0 to compile merv plugins. |
Doc Flabby wrote: |
Hey i might be able to take a look at mervbot and update it for vs2005.
Or indeed convert it too a cross-platform system which will compile on dev++ if you give me a week or so. |
Zamin wrote: |
OK, thanks for a quick tutorial.
Editing this post 3 times now, lol. I installed 'wxdev'. When I try to compile 'default.dll', it give me the following error: "No Host application was provided. You can set it in Execute | Parameters" When I go to Execute > Parameters from top menu, it opens a box from which I can set a host application. I dunno what is a host application. |
Zamin wrote: |
Despite this error listed above, it does creade a 'Default.dll' file in the debug folder. It also creates the following files: "command.o", "libDefault.a", and "spawn.o". What should I do with these files? Also copy them with the default.dll file or these don't really matter. |
Zamin wrote: |
So many questions, so little time. Also wonder, is there a way to edit an existing .dll file? For example, can I edit the 'Default.dll' which I just created; using wxDev?? If you can help than many thanks. |
Code: Show/Hide # Spawns.txt Format:
# Bot name : Bot password : Arena name : Plugin names : Staff password |
Code: Show/Hide void sendPrivate( Player * p, char * msg); |
Code: Show/Hide void botInfo::sendPrivate( Player *p, char * msg)
{ //code... } |
Code: Show/Hide else if (c->check("rand"))
{ sendPrivate(p, "asd as"); } |
Code: Show/Hide else if (c->check("rand"))
{ string Message; Message = "asd as"; sendPrivate(p,Message); } |
Code: Show/Hide else if (c->check("rand"))
{ int z = 0; z = 2 + 2; sendPrivate(p,z); } |
Code: Show/Hide void sendPrivate( Player * p, char * msg); |
Code: Show/Hide string Message;
Message = "asd as"; sendPrivate(p,Message.c_str()); |
Code: Show/Hide else if (c->check("rand"))
{ int z = 0; z = 2 + 2; String message = z; sendPrivate(p,message); } |
Code: Show/Hide else if (c->check("rand"))
{ int z = 0; char buf[128]; z = 2 + 2; snprintf(buf, sizeof(buf), "%i", z); // may need to #include the proper header for snprintf, use google sendPrivate(p,buf); } |
Code: Show/Hide else if (c->check("rand"))
{ int z = 0; z = addition(2,2); String Message; Message = "The number is: "; Message += z; sendPrivate(p, Message); } |
Code: Show/Hide void addition(int a, int b)
{ int z; z = a + b; return z } |
Bak wrote: |
the compiler (thing that makes the .dlls) needs to know about the function before you use it. It reads the files from top to bottom. Thus, place the function above where it's called (at the top level, not inside another function), and it should work. Also, your function is missing a semicolon after "return z". |
Quote: |
int addition(int a, int b)
{ int z; z = a + b; return z; } |
Zamin wrote: |
Thanks for replying sama, i'm assuming your the same sama in HS. lol
Anyways, your techneque about loading plugin, seeing effect and unloading again to change code is very useful. But the only problem is that when I load plugin, use it. And when I unload the plugin to change the code, I need to delete the current default.dll file in order to bring int he new default.dll file right. But when I try to delete the current .dll file it says it is being used. |
Bak wrote: | ||
your function is defined as returning a void (not returning any value) but it should actually return an integer. Change the return value in the signature to int:
Also, I'm fairly certain the semicolon after the return is mandatory, perhaps you're thinking of another language. |
Code: Show/Hide int age;
cout << "enter age: "; cin >> age; |