Thread

AW sample greeter/dj ... (Sdk)

AW sample greeter/dj ... // Sdk

1  |  

lady nighthawk

Apr 29, 2006, 6:12pm
Neither of these work for me from copying off the webpage ... they look
right but my bot gets stopped before login and I get an error that says:
eon2 (bot progy name) number password

Nowhere on the page does it tell me where to input the citnum or password!?
Is this *old code* perhaps? Or am I suppose to know to replace a certain
part of the code with actual login data? Help???

The greeterbot code in question is ...

#include "aw.h"
#include <stdio.h>
#include <stdlib.h>

void handle_avatar_add (void);

main (int argc, char *argv[])
{

int rc;

/* check command line */
if (argc < 3) {
printf ("Usage: %s number password\n", argv[0]);
exit (1);
}

/* initialize Active Worlds API */
if (rc = aw_init (AW_BUILD)) {
printf ("Unable to initialize API (reason %d)\n", rc);
exit (1);
}

/* install handler for avatar_add event */
aw_event_set (AW_EVENT_AVATAR_ADD, handle_avatar_add);

/* create bot instance */
if (rc = aw_create (0, 0, 0)) {
printf ("Unable to create bot instance (reason %d)\n", rc);
exit (1);
}

/* log bot into the universe */
aw_int_set (AW_LOGIN_OWNER, atoi (argv[1]));
aw_string_set (AW_LOGIN_PRIVILEGE_PASSWORD, argv[2]);
aw_string_set (AW_LOGIN_APPLICATION, "SDK Sample Application #1");
aw_string_set (AW_LOGIN_NAME, "GreeterBot");
if (rc = aw_login ()) {
printf ("Unable to login (reason %d)\n", rc);
exit (1);
}

/* log bot into the world called "beta" */
if (rc = aw_enter ("Beta")) {
printf ("Unable to enter world (reason %d)\n", rc);
exit (1);
}

/* announce our position in the world */
aw_int_set (AW_MY_X, 1000); /* 1W */
aw_int_set (AW_MY_Z, 1000); /* 1N */
aw_int_set (AW_MY_YAW, 2250); /* face towards GZ */
if (rc = aw_state_change ()) {
printf ("Unable to change state (reason %d)\n", rc);
exit (1);
}

/* main event loop */
while (!aw_wait (-1))
;

/* close everything down */
aw_destroy ();
aw_term ();
return 0;

}

void handle_avatar_add (void)
{

char message[100];

sprintf (message, "Hello %s", aw_string (AW_AVATAR_NAME));
aw_say (message);
/* log the event to the console */
printf ("avatar_add: %s\n", aw_string (AW_AVATAR_NAME));

}

andras

Apr 29, 2006, 6:21pm
[View Quote] > Neither of these work for me from copying off the webpage ... they look
> right but my bot gets stopped before login and I get an error that says:
> eon2 (bot progy name) number password
>
> Nowhere on the page does it tell me where to input the citnum or password!?
> Is this *old code* perhaps? Or am I suppose to know to replace a certain
> part of the code with actual login data? Help???
>
<snip code>

This is a DOS application and you have to invoke it from a Command Line prompt (Start/Run/cmd.exe)

xxx> cd yourbotpath
yourbotpath> eon2 yourcitnumber yourprivpass <enter>

HTH
--
Andras
"It's MY computer" (tm Steve Gibson)

lady nighthawk

Apr 29, 2006, 6:53pm
Thank you for your help Andras :o} Got this one working ... now on to the DJ
bot LOL hugzzz

LNH



[View Quote]

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn