ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
Backdrop change sample #1 (Sdk)
Backdrop change sample #1 // Sdkbyte meOct 14, 1998, 11:58pm
This is a multi-part message in MIME format.
--------------3C9573EF58F Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Ok heres a little program that will chaneg the backdrop and ground every hour :) this bot does not physically show up in the world --------------3C9573EF58F Content-Type: text/plain; charset=us-ascii; name="backdrop.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="backdrop.c" #include "aw.h" #include "stdio.h" #include "stdlib.h" /*login stuff*/ /*this bot does not physically log into the world*/ int b; int c; main (int argc) { int rc; if (rc = aw_init (AW_BUILD)) { printf ("Unable to initialize API (reason %d)\n", rc); exit (1); } if (rc = aw_create (0, 0, 0)) { printf ("Unable to create bot instance (reason %d)\n", rc); exit (1); } #define CIT_NUM 1 #define PASS Secret printf ("Starting...\n"); aw_string_set (AW_LOGIN_PRIVILEGE_PASSWORD, Secret); aw_int_set (AW_LOGIN_OWNER, CIT_NUM); aw_int (AW_WORLD_CARETAKER_CAPABILITY); aw_string_set (AW_LOGIN_APPLICATION, "Backdrop change example #1"); aw_string_set (AW_LOGIN_NAME, "Backdrop"); if (rc = aw_login ()) { printf ("Unable to login (reason %d)\n", rc); exit (1); } if (rc = aw_enter ("Beta", 0)) { printf ("Unable to enter world (reason %d)\n", rc); exit (1); } { /*what ground and backdrops to be used*/ char* backdrop[] = {"fr-day", "fr-nit"}; char* ground[] = {"frgrd-d", "frgrd-n"}; b = 0; c = 0; /*what changes the backdrops*/ do { printf ("Backdrop changed\n"); aw_string_set (AW_WORLD_BACKDROP, backdrop[b]); aw_string_set (AW_WORLD_GROUND, ground[c]); aw_world_attributes_change (); b = (b == sizeof (backdrop) / sizeof (backdrop[0]) - 1) ? 0 : b + 1; c = (c == sizeof (ground) / sizeof (ground[0]) - 1) ? 0 : c + 1; } /*changes backdrop every hour*/ while (!aw_wait (60 * 60 * 1000)) ; aw_destroy (); aw_term (); return 0; } } --------------3C9573EF58F-- byte meOct 15, 1998, 12:18am
This here fixes a little thing in the password :)
#include "aw.h" #include "stdio.h" #include "stdlib.h" /*login stuff*/ /*this bot does not physically log into the world*/ int b; int c; main (int argc) { int rc; if (rc = aw_init (AW_BUILD)) { printf ("Unable to initialize API (reason %d)\n", rc); exit (1); } if (rc = aw_create (0, 0, 0)) { printf ("Unable to create bot instance (reason %d)\n", rc); exit (1); } #define CIT_NUM 1 #define PASS Secret printf ("Starting...\n"); aw_string_set (AW_LOGIN_PRIVILEGE_PASSWORD, PASS); aw_int_set (AW_LOGIN_OWNER, CIT_NUM); aw_int (AW_WORLD_CARETAKER_CAPABILITY); aw_string_set (AW_LOGIN_APPLICATION, "Backdrop change example #1"); aw_string_set (AW_LOGIN_NAME, "Backdrop"); if (rc = aw_login ()) { printf ("Unable to login (reason %d)\n", rc); exit (1); } if (rc = aw_enter ("Beta", 0)) { printf ("Unable to enter world (reason %d)\n", rc); exit (1); } { /*what ground and backdrops to be used*/ char* backdrop[] = {"fr-day", "fr-nit"}; char* ground[] = {"frgrd-d", "frgrd-n"}; b = 0; c = 0; /*what changes the backdrops*/ do { printf ("Backdrop changed\n"); aw_string_set (AW_WORLD_BACKDROP, backdrop[b]); aw_string_set (AW_WORLD_GROUND, ground[c]); aw_world_attributes_change (); b = (b == sizeof (backdrop) / sizeof (backdrop[0]) - 1) ? 0 : b + 1; c = (c == sizeof (ground) / sizeof (ground[0]) - 1) ? 0 : c + 1; } /*changes backdrop every hour*/ while (!aw_wait (60 * 60 * 1000)) ; aw_destroy (); aw_term (); return 0; } } facOct 15, 1998, 2:22am
looks kewl byte =) . .. we need to get this kind of thing into a GUI so
that alot of people can play with it inside windows. . . I know what Ed is saying in his post (the one after this one "daiglogue based. . ."), and to leave windows alone, and i can understand some of the problems assiciated with it, but for pure usability, unless the little sdk apps are imbedded into little GUI's, alot of people are , not through any other reason, not goign to take too much of a look at them. For alto of people, design is everything, sure they want it to work, but they also want it to look good and act in the way a normal OS program works. . . ie, most peoples OS's are windows based. . . Anyone get what i mean ? Im not saying anything against simple apps that jsut run through a dos command box etc etc blah blah, jstu raising the issue of usability, which at this early stage, really shouldnt be thought of much, but it's an issue that will come up =)) balh balh. . . im not a programmer, so im not sure if what im sayin makes sense, but i've been avidly following this NG, as i belive that you guys are all doing amazing jobs. . . kudos to all of ya Fac. [View Quote] > This here fixes a little thing in the password :) > > #include "aw.h" > #include "stdio.h" > #include "stdlib.h" > /*login stuff*/ > /*this bot does not physically log into the world*/ > int b; > int c; > main (int argc) > { > int rc; > > if (rc = aw_init (AW_BUILD)) { > printf ("Unable to initialize API (reason %d)\n", rc); > exit (1); > } > > if (rc = aw_create (0, 0, 0)) { > printf ("Unable to create bot instance (reason %d)\n", rc); > exit (1); > } > > #define CIT_NUM 1 > #define PASS Secret > printf ("Starting...\n"); > aw_string_set (AW_LOGIN_PRIVILEGE_PASSWORD, PASS); > aw_int_set (AW_LOGIN_OWNER, CIT_NUM); > aw_int (AW_WORLD_CARETAKER_CAPABILITY); > aw_string_set (AW_LOGIN_APPLICATION, "Backdrop change example #1"); > aw_string_set (AW_LOGIN_NAME, "Backdrop"); > if (rc = aw_login ()) { > printf ("Unable to login (reason %d)\n", rc); > exit (1); > } > > if (rc = aw_enter ("Beta", 0)) { > printf ("Unable to enter world (reason %d)\n", rc); > exit (1); > } > { > /*what ground and backdrops to be used*/ > char* backdrop[] = {"fr-day", "fr-nit"}; > char* ground[] = {"frgrd-d", "frgrd-n"}; > b = 0; > c = 0; > /*what changes the backdrops*/ > do { > printf ("Backdrop changed\n"); > aw_string_set (AW_WORLD_BACKDROP, backdrop[b]); > aw_string_set (AW_WORLD_GROUND, ground[c]); > aw_world_attributes_change (); > b = (b == sizeof (backdrop) / sizeof (backdrop[0]) - 1) ? 0 : b + 1; > c = (c == sizeof (ground) / sizeof (ground[0]) - 1) ? 0 : c + 1; > } > /*changes backdrop every hour*/ > while (!aw_wait (60 * 60 * 1000)) > ; > aw_destroy (); > aw_term (); > return 0; > } > } pc wizardOct 15, 1998, 2:45am
I'm still planning on make a GUI bot program :) If Roland (or someone else
that knows how to do what I want to do) posts an answer to my NG msg (dialog based one) I'm going to make a GUI bot program with options like able to change the welcome message, have it DJ with midis of the bot runners choice, and a lot of other things. PC Wizard (ICQ-537376) wizardry at home.com http://pcwizard.ml.org [View Quote] facOct 15, 1998, 2:54am
yep, see, thats the kinda thing i meant. . . you could cram all the different
functions into one GUI, instead of having lots of little bits for it . . ie, you could put bytes little bit of code, and ahve a backdrop function in it as well =) mmm, the posibilites ARE endless =) Fac. [View Quote] > I'm still planning on make a GUI bot program :) If Roland (or someone else > that knows how to do what I want to do) posts an answer to my NG msg (dialog > based one) I'm going to make a GUI bot program with options like able to > change the welcome message, have it DJ with midis of the bot runners choice, > and a lot of other things. > > PC Wizard (ICQ-537376) > wizardry at home.com > http://pcwizard.ml.org > [View Quote] edward sumerfieldOct 15, 1998, 10:35am
Its a cool thing you are going after. I wish you the best of luck.
A thought about design simplicity. You could make a generic GUI app that runs bots. It doesn't have to have any AWSDK in it, just a place to configure the start bot command and a button to start it. You could have a list box with a list of bot programs then just select a bot and click start. I think my point is that if you keep the AWSDK out of your windows program you are not going to hit any of the architecture problems that are are looking at now. For example, all bots linked into your GUI are going to have to be asynchronous bots, all callbacks installed. Any bot that blocks on the aw_wait is going to prevent all your GUI from working. Right down to the standard window resize, move, close functions. They will not work if the one thread in the program is blocked in a bot. Another consideration is the portability of your resulting code. I know there are world servers running on windows but there are also a number of unix servers. If you write your program in windows they will not work on unix. There are a number of cross platform GUI libraries available that would solve this problem but you will not be able to use the nice VC++ wizards. Check out the V libraries http://www.objectcentral.com/ Edward Sumerfield [View Quote] walter knupeOct 15, 1998, 7:45pm
Edward,
Edward Sumerfield schrieb in Nachricht <3625eb8a.0 at homer>... >Its a cool thing you are going after. I wish you the best of luck. > >A thought about design simplicity. You could make a generic GUI app that >runs bots. It doesn't have to have any AWSDK in it, just a place to >configure the start bot command and a button to start it. You could have a >list box with a list of bot programs then just select a bot and click start. Interesting, i saw this on Linux with all the cd writer software. It seems like one linux theres one party which writes the good software but with lots of complicated command line arguments, complicated enough so that theres another party which writes pretty KDE guis which collect the args out of editfields and do a system() on it. and the throw a hell of a command output at you if something goes wrong :) > >I think my point is that if you keep the AWSDK out of your windows program >you are not going to hit any of the architecture problems that are are >looking at now. For example, all bots linked into your GUI are going to have >to be asynchronous bots, all callbacks installed. Any bot that blocks on the >aw_wait is going to prevent all your GUI from working. Right down to the >standard window resize, move, close functions. They will not work if the one >thread in the program is blocked in a bot. well, i agree, but aw_wait(10) on a timer worked very well for me. I have my gui, although i command my bot mostly by talking to it in aw :) and for the call backs, all i do is look up the bot using the instance and delegate all actions to the bot obect. all you have to do to supply c++ is you have to route your events. just keep it single threaded. thats a real disadvantage. > >Another consideration is the portability of your resulting code. I know >there are world servers running on windows but there are also a number of >unix servers. If you write your program in windows they will not work on >unix. There are a number of cross platform GUI libraries available that >would solve this problem but you will not be able to use the nice VC++ >wizards. Portability is no issue since the sdk is only available on win32. and believe me, we have been trying and using cross plattform libraries, and i would recommend against it. you run into a lot of limitations using those, and you end up having bad GUIs on all plattforms you support. if you have to support multiple platforms, design for it and seperate GUI from everything else, but do so only if somebody pays you for it :) Walter |