ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
Moving the bots (Sdk)
Moving the bots // Sdkedward sumerfieldDec 1, 1998, 12:05pm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML> Are Veleno and Fast the same person or just two interested parties? <P>So were do you want me to start? <P>Do you have a C compiler? Which one? <P>Have you written bots before? <P>What is your level of C experience? [View Quote] velenoDec 1, 1998, 7:37pm
[View Quote]
> Are Veleno and Fast the same person or just two interested parties?
Sorry about the confusion. Me and Fastwalker (Fast) are two different people. I know him in AW. > > So were do you want me to start? > > Do you have a C compiler? Which one? > Right now, since I don't feeling like shelling out $90, I'm running the GNU from Cygnus. > > Have you written bots before? > Yes, actually I have about seven bots resident on my system, though I only run one or two on a regular basis. > > What is your level of C experience? Umm... I have a programming book on C/C++, but I've only been at it since early August. So I know what I'm doing, but don't have much of the experience needed yet. Still learning. Got into the SDK around Build 5, if that means anything to you... > > [View Quote] edward sumerfieldDec 2, 1998, 3:02am
This is a multi-part message in MIME format.
--------------5F48D06410C8F2FE04DFE96A Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here is a working solution. Most is cut and paste from my C++ AWCPP into this C program. It waits for someone to walk within 5 meters of it and then follows them for 60 seconds after which it runs back to its starting position. To run you will require: 1. Cygnus GNU G++ compiler. 2. The awsdk.lib wrapper that was built to interface with COF's aw.dll. 3. Just type make to create the exe file. If you do not change anything then to test: 1. Goto Beta and teleport to 99n 99w 0a 45. This will place you 10 meters away from the bot and facing it. 2. Run the bot using "follower <citizen number> <priv password>" 3. The bot will report your distance as you approach. When you are with 5 meters which is reported as 500 cm it will switch into follow mode and move to 1 meter behind you facing in the same direction as you are. Good luck. Edward Sumerfield. [View Quote] [View Quote] --------------5F48D06410C8F2FE04DFE96A Content-Type: text/plain; charset=us-ascii; name="Makefile" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Makefile" CFLAGS=-g -I. -I${AWSDK} all: follower.exe follower.exe: follower.o g++ $< ${AWSDK}/awsdk.lib -o $ at --------------5F48D06410C8F2FE04DFE96A Content-Type: application/x-unknown-content-type-c_auto_file; name="follower.c" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="follower.c" I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3RkbGliLmg+DQojaW5jbHVkZSA8bWF0 aC5oPg0KI2luY2x1ZGUgPGF3Lmg+DQoNCiNkZWZpbmUgVFJVRSAxDQojZGVmaW5lIEZBTFNF IDANCg0KI2RlZmluZSBQSSAzLjE0MTU5MjY1NA0KI2RlZmluZSBDSVJDTEVfUkFESUFOUyAg KDIqUEkpDQojZGVmaW5lIENJUkNMRV9ERUdSRUVTICAoMzYwKQ0KI2RlZmluZSBDSVJDTEVf QVcgICAgICAgKDM2MDApDQoNCiNkZWZpbmUgTUlOX1hfQ09PUkQgICAtMzI3NjcwMA0KI2Rl ZmluZSBNQVhfWF9DT09SRCAgIDMyNzY3MDANCiNkZWZpbmUgTUlOX1pfQ09PUkQgICAtMzI3 NjcwMA0KI2RlZmluZSBNQVhfWl9DT09SRCAgIDMyNzY3MDANCiNkZWZpbmUgTUlOX0FMVElU VURFICAtMzI3NjcwMA0KI2RlZmluZSBNQVhfQUxUSVRVREUgIDMyNzY3MDANCiNkZWZpbmUg TUlOX1lBVyAgICAgICAwDQojZGVmaW5lIE1BWF9ZQVcgICAgICAgMzYwDQojZGVmaW5lIE1J Tl9QSVRDSCAgICAgMA0KI2RlZmluZSBNQVhfUElUQ0ggICAgIDM2MA0KDQp0eXBlZGVmIGVu dW0gew0KICBJTlZBTElEID0gMCwNCiAgV0FJVElORywNCiAgRk9MTE9XSU5HDQp9IFNUQVRF Ow0KDQovKiBTdGF0aWMgdmFyaWFibGVzIHNoYXJlZCBiZXR3ZWVuIHRoZSBtYWluIGxvb3Ag YW5kIHRoZSBjYWxsYmFjayBmdW5jdGlvbnMuICovDQoNClNUQVRFIHJvYm90X3N0YXRlID0g SU5WQUxJ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dfeCwgZm9s bG93X3osIGZvbGxvd19hbHRpdHVkZSk7DQoNCiAgICAgIHRpbWVyLS07IA0KICAgICAgaWYg KHRpbWVyIDw9IDApIHsgDQoNCglyb2JvdF9zdGF0ZSA9IFdBSVRJTkc7IA0KCWF2YXRhcl9z ZXNzaW9uID0gLTE7IA0KDQoJLy8gcmVzZXQgcG9zaXRpb24NCgltb3ZlKHJlc2V0X3gsIHJl c2V0X3osIDAsIDE4MDApOw0KCWZvbGxvd194ID0gKGZsb2F0KXJlc2V0X3g7DQoJZm9sbG93 X3ogPSAoZmxvYXQpcmVzZXRfejsNCglmb2xsb3dfYWx0aXR1ZGUgPSAwOw0KCWZvbGxvd195 YXcgPSAxODAwOw0KICAgICAgfSANCiAgICB9IA0KICB9IA0KDQogIC8qIGNsb3NlIGV2ZXJ5 dGhpbmcgZG93biAqLw0KICBhd19kZXN0cm95ICgpOw0KICBhd190ZXJtICgpOw0KICByZXR1 cm4gMDsNCn0NCg== --------------5F48D06410C8F2FE04DFE96A-- velenoDec 3, 1998, 12:33am
why is the makefile in a renderware extension? How can it work?
[View Quote] > Here is a working solution. Most is cut and paste from my C++ AWCPP into this > C program. > > It waits for someone to walk within 5 meters of it and then follows them for > 60 seconds after which it runs back to its starting position. > > To run you will require: > > 1. Cygnus GNU G++ compiler. > 2. The awsdk.lib wrapper that was built to interface with COF's aw.dll. > 3. Just type make to create the exe file. > > If you do not change anything then to test: > > 1. Goto Beta and teleport to 99n 99w 0a 45. > This will place you 10 meters away from the bot and facing it. > 2. Run the bot using "follower <citizen number> <priv password>" > 3. The bot will report your distance as you approach. When you are with 5 > meters which > is reported as 500 cm it will switch into follow mode and move to 1 meter > behind you facing > in the same direction as you are. > > Good luck. > > Edward Sumerfield. > [View Quote] edward sumerfieldDec 3, 1998, 2:07am
I don't understand. A renderware extension? Like .rwx?
The c file has the extension of ".c" and the Makefile has no extension. Makefile is the standard name that the command make looks for when you run it. You can of coarse call your makefile anything you like but you would have to add the "-f <file name>" parameter to tell the make command which file to use. o Copy both files into one diretory o cd to that directory o export AWSDK=<path were you installed aw.h> o make sure that the aw.dll is in a directory in your PATH o make o follower <number> <priv> Edward Sumerfield. [View Quote] > why is the makefile in a renderware extension? How can it work? > [View Quote] velenoDec 3, 1998, 11:19am
Strange... the makefile gave itself the .rwx extension when i saved it to my computer. I
don't need it right now. I converted the follower.c source over to standard GNU format. A bit longer (2k more). But it's compiled just with the normal gcc.exe (I am running C, not C++ right now). And I did get that to run. Thanks Edward! [View Quote] > I don't understand. A renderware extension? Like .rwx? > > The c file has the extension of ".c" and the Makefile has no extension. Makefile is the > standard name that the command make looks for when you run it. You can of coarse call > your makefile anything you like but you would have to add the "-f <file name>" > parameter to tell the make command which file to use. > > o Copy both files into one diretory > o cd to that directory > o export AWSDK=<path were you installed aw.h> > o make sure that the aw.dll is in a directory in your PATH > o make > o follower <number> <priv> > > Edward Sumerfield. > [View Quote] edward sumerfieldDec 3, 1998, 12:03pm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML> I'm glad it worked for you. <P>What did you mean by "converted to standard GNU format"? [View Quote] velenoDec 3, 1998, 7:53pm
The way you have your AWCPP written, you need the lib file to make it
work, and the makefile. The normal way of running the sdk through the GNU is bypassing the aw.lib through the aw.dll defining the methods manually. I've been using this system for a while, so I feel comfortable with the layout. I assume you've seen the source of GNU sdk bots that have done that. (ie, "aw_int" is "(AWInt)"). There's an example source in a higher thread... [View Quote] > I'm glad it worked for you. > > What did you mean by "converted to standard GNU format"? > [View Quote] edward sumerfieldDec 4, 1998, 1:54am
--------------F23D54E14A43430991BB801A
Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I see what you mean now. I agree, that was how we started the GNU development process. However, since then we have worked out some simpler ways of interacting with the dll. What you are doing in your code is loading the DLL, and retrieving the addresses of all the functions from within it so that they can be called. It seems there are some standard tools for dynamically generating this "wrapper" code so that you don't have to bother with all that extra coding. With VC++ there is implib, Borland's C++ there is impdef and we discovered the following slightly clugy solution for the GNU gcc compiler. All it is doing is creating a .lib file that contains all the code for loading the dll and working out the function addresses. So all you have to do is link with this new lib and you are set. This method drastically reduces your code maintenance problem and removes the need to add all the GetProcAddress stuff. The following is copied from a thread above titled "Cygwin" started by Josh. ============================================== There is a utility called "impdef" (apparently the same name as a similar Borland tool) that lists the methods in a dll file. You can find it at http://www.geocities.com/Tokyo/Towers/6162/gcc-extra.html Once you have this you must run it from a DOS prompt. Doesn't work from a bash shell. impdef aw.dll > awsdk.def This generates an awsdk.def file which is just a text file that lists the functions in the dll file. Now you can use the Cygwin utility dlltool to read this def file and the dll file and create a new Cygwin compatible lib file. dlltool --def awsdk.def --dllname aw.dll --output-lib awsdk.lib ============================================== Edward Sumerfield. [View Quote] > The way you have your AWCPP written, you need the lib file to make it > work, and the makefile. The normal way of running the sdk through the > GNU is bypassing the aw.lib through the aw.dll defining the methods > manually. I've been using this system for a while, so I feel comfortable > with the layout. > I assume you've seen the source of GNU sdk bots that have done that. > (ie, "aw_int" is "(AWInt)"). > There's an example source in a higher thread... > [View Quote] --------------F23D54E14A43430991BB801A Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> I see what you mean now. I agree, that was how we started the GNU development process. However, since then we have worked out some simpler ways of interacting with the dll. <p>What you are doing in your code is loading the DLL, and retrieving the addresses of all the functions from within it so that they can be called. It seems there are some standard tools for dynamically generating this "wrapper" code so that you don't have to bother with all that extra coding. <p>With VC++ there is implib, Borland's C++ there is impdef and we discovered the following slightly clugy solution for the GNU gcc compiler. <p>All it is doing is creating a .lib file that contains all the code for loading the dll and working out the function addresses. So all you have to do is link with this new lib and you are set. This method drastically reduces your code maintenance problem and removes the need to add all the GetProcAddress stuff. <p>The following is copied from a thread above titled "Cygwin" started by Josh. <center> <p>==============================================</center> <p>There is a utility called "impdef" (apparently the same name as a similar Borland <br>tool) that lists the methods in a dll file. You can find it at <p> <A HREF="http://www.geocities.com/Tokyo/Towers/6162/gcc-extra.html">http://www.geocities.com/Tokyo/Towers/6162/gcc-extra.html</A> <p>Once you have this you must run it from a DOS prompt. Doesn't <br>work from a bash shell. <p> impdef aw.dll > awsdk.def <p>This generates an awsdk.def file which is just a text file that lists the functions <br>in the dll file. Now you can use the Cygwin utility dlltool to read this def file <br>and the dll file and create a new Cygwin compatible lib file. <p> dlltool --def awsdk.def --dllname aw.dll --output-lib awsdk.lib <center> <p>==============================================</center> <p>Edward Sumerfield. [View Quote] --------------F23D54E14A43430991BB801A-- |