ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
3.4 vb sdk (Sdk)
3.4 vb sdk // Sdkagent1Jan 31, 2003, 10:39pm
scuzFeb 1, 2003, 5:05am
yes i know, but i really need a 3.4 sdk for vb. its mrgrimm who made the
current one, sos i need a 3.4 one. [View Quote] strike rapierFeb 1, 2003, 7:34am
If you want the beta SDK before everyone else, do what the rest of us do
when we need it... Use C++ :P - Mark [View Quote] baron sweetmanFeb 1, 2003, 7:25pm
"bowen" <thisguyrules at 7k2.4mg.com.ANTISPAM> wrote in news:3e3c1973
at server1.Activeworlds.com: > [View Quote] print? i know printf, sprintf, fprintf never heard of print :) bowenFeb 1, 2003, 10:37pm
> print? i know printf, sprintf, fprintf never heard of print :)
I know, I was just saying that it'd be a function. --Bowen-- bowenFeb 1, 2003, 10:38pm
grimbleFeb 2, 2003, 12:41am
Sort your lives out will ya and take this sad crap somewhere else.
Is this seriously the best you can do in a technical newsgroup? [View Quote] strike rapierFeb 2, 2003, 9:37am
bowenFeb 3, 2003, 6:21pm
[View Quote]
C++ uses C functions. Why do you think it's called C++? (hint... what can you do
with ints to add one to them) --Bowen-- .duo.Feb 7, 2003, 7:56pm
Its based on the same architecture, but C is not as powerful. Hence C++.
BTW, this seems dumb, but I haven't programmed in a while, so I forgot how to add text to a string, LOL. Do you use an & sign or a function or what? [View Quote] bowenFeb 7, 2003, 8:01pm
[View Quote]
That's arguable. x++ to add one to an int right? Now, using that, why do you think
it's called C++? > BTW, this seems dumb, but I haven't programmed in a while, so I forgot how > to add text to a string, LOL. > > Do you use an & sign or a function or what? Well... #include <string.h> char into_string[256]; then use strcpy(into_string, "text you want entered"); or if you want to append to a string... strcat(into_string,", text you appended"); --Bowen-- .duo.Feb 7, 2003, 11:24pm
I know those functions but they always crash my bots. >_< Its kind of
annoying how unstable they are. [View Quote] bowenFeb 7, 2003, 11:34pm
.duo.Feb 7, 2003, 11:45pm
This is a multi-part message in MIME format.
------=_NextPart_000_001F_01C2CEE9.DAFEAAE0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Honestly, I just suck at VB. I can't even get a VB bot to work. I can = do much more in C++. I just can't add text to these strings. I'm just = making a rights bot which has taken five minutes so far, its just that I = can't make it add the text. [View Quote] Its completely unpolished, rushed, and badly programmed, but oh well. My bots code: #define AW_STATIC #include <iostream.h> #include <conio.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <aw.h> void handle_avatar_add (void); void handle_chat (void); void handle_avatar_delete (void); void ProcessRights (); char* copya (char* t); bool CheckString (char* o,char* t); char* addtext (char* o,char* t); int StringLength (char* t); bool TheMask =3D false; bool Builderz =3D false; bool NelXaga =3D false; bool Cameron999 =3D false; bool SuperGuy3 =3D false; bool Cadet =3D false; void main (int argc, char *argv[]) { ProcessRights(); int rc; //API if (rc =3D aw_init (AW_BUILD)) { cout<<"Unable to initialize the API (reason %d)\n"<<rc; } //Set events aw_event_set (AW_EVENT_AVATAR_ADD, handle_avatar_add); aw_event_set (AW_EVENT_CHAT, handle_chat); aw_event_set (AW_EVENT_AVATAR_DELETE, handle_avatar_delete); aw_state_change (); for (;;) { if (aw_wait (1000)) { break; } } //Bot Instance if (rc =3D aw_create (0, 0, 0)) { cout<<"Unable to create bot instance (reason %d)\n"<<rc; exit (1); } //Login Bot aw_string_set (AW_LOGIN_NAME, "RightsBot"); aw_int_set (AW_LOGIN_OWNER, 342836); aw_string_set (AW_LOGIN_PRIVILEGE_PASSWORD, "zero"); aw_string_set (AW_LOGIN_APPLICATION, "DuoBot: RightsBot"); if (rc =3D aw_login ()) { cout<<"Unable to login (reason "<<rc<<")\n"; } //Enter Bot Into World if (rc =3D aw_enter ("Jediwrld")) { printf("Unable to enter world (reason %d)\n", rc); exit (1); } puts (aw_string (AW_WORLD_WELCOME_MESSAGE)); //Go to place aw_int_set (AW_MY_X, 0000);=20 aw_int_set (AW_MY_Z, 0000);=20 aw_int_set (AW_MY_YAW, 0000); aw_int_set (AW_MY_TYPE, 0); aw_int_set (AW_MY_GESTURE, 0); if (rc =3D aw_state_change ()) { cout<<"Unable to change state (reason %d)\n"<<rc; exit (1); } //Main event loop while (!aw_wait (-1)) ; //Close Bot aw_destroy (); aw_term (); } void handle_avatar_add (void) { char* name =3D new char; int session; name =3D copya(aw_string(AW_AVATAR_NAME)); session =3D aw_int(AW_AVATAR_SESSION); if(!stricmp(name,"TheMask")) { aw_whisper(session,"Whisper password to gain rights"); } else if(!stricmp(name,"Builderz")) { aw_whisper(session,"Whisper password to gain rights"); } else if(!stricmp(name,"NelXaga")) { aw_whisper(session,"Whisper password to gain rights"); } else if(!stricmp(name,"Cameron999")) { aw_whisper(session,"Whisper password to gain rights"); } else if(!stricmp(name,"SuperGuy3")) { aw_whisper(session,"Whisper password to gain rights"); } else if(!stricmp(name,"Cadet")) { aw_whisper(session,"Whisper password to gain rights"); } } void handle_chat () { char* message =3D new char; char* name =3D new char; int session; message =3D copya(aw_string(AW_CHAT_MESSAGE)); name =3D copya(aw_string(AW_AVATAR_NAME)); session =3D aw_int(AW_CHAT_SESSION); if(!stricmp(message,"=B6Noob Hater Alpha Boss=B6")) { if(!stricmp(name, "TheMask")) { TheMask =3D true; } } else if(!stricmp(message,"=B6I Will Build Even Though I Say I = Won't=B6")) { if(!stricmp(name,"Builderz")) { Builderz =3D true; } } else if(!stricmp(message,"=B6Noob Hater Beta Supreme=B6")) { if(!stricmp(name,"NelXaga")) { NelXaga =3D true; } } else if(!stricmp(message,"=B6Large Stinky Gorillas Basking In The = Sun=B6")) { if(!stricmp(name,"Cameron999")) { Cameron999 =3D true; } } else if(!stricmp(message,"=B6Theworld is a dumbass noob using = AWHack=B6")) { if(!stricmp(name,"SuperGuy3")) { SuperGuy3 =3D true; } } else if(!stricmp(message,"=B6I Had Better Do Well :-P=B6")) { if(!stricmp(name,"Cadet")) { Cadet =3D true; } } else { //Do nothing } ProcessRights(); } void handle_avatar_delete () { char* name =3D new char; int session; name =3D copya(aw_string(AW_AVATAR_NAME)); session =3D aw_int(AW_AVATAR_SESSION); if(!stricmp(name,"TheMask")) { TheMask =3D false; } else if(!stricmp(name,"Builderz")) { Builderz =3D false; } else if(!stricmp(name,"NelXaga")) { NelXaga=3D false; } else if(!stricmp(name,"Cameron999")) { Cameron999 =3D false; } else if(!stricmp(name,"SuperGuy3")) { SuperGuy3 =3D false; } else if(!stricmp(name,"Cadet")) { Cadet =3D false; } else { //Do nothing } ProcessRights(); } void ProcessRights() { char* b =3D new char; char* ed =3D new char; char* ps =3D new char; char* e =3D new char; char* bt =3D new char; b =3D "342836"; ed =3D "342836"; ps =3D "342836"; e =3D "342836"; bt =3D "342836"; if(TheMask =3D=3D true) { strcat(b,",312237"); <b><----------- None of these work.</b> strcat(ed,",312237"); strcat(ps,",312237"); strcat(e,",312237"); strcat(bt,",312237"); } if(Builderz =3D=3D true) { strcat(b,",92986"); strcat(ed,",92986"); strcat(ps,",92986"); strcat(e,",92986"); strcat(bt,",92986"); } if(NelXaga =3D=3D true) { strcat(b,",337709"); strcat(ed,",337709"); strcat(ps,",337709"); strcat(e,",337709"); strcat(bt,",337709"); } if(Cameron999 =3D=3D true) { strcat(b,",350803"); strcat(ed,",350803"); strcat(ps,",350803"); strcat(e,",350803"); strcat(bt,",350803"); } if(SuperGuy3 =3D=3D true) { strcat(b,",347525"); strcat(ed,",347525"); strcat(ps,",347525"); strcat(e,",347525"); strcat(bt,",347525"); } if(Cadet =3D=3D true) { strcat(ps,",350957"); strcat(e,",350957"); } aw_string_set (AW_WORLD_BUILD_RIGHT, b); aw_string_set (AW_WORLD_EMINENT_DOMAIN_RIGHT, ed); aw_string_set (AW_WORLD_PUBLIC_SPEAKER_RIGHT, ps); aw_string_set (AW_WORLD_EJECT_RIGHT, e); aw_string_set (AW_WORLD_BOTS_RIGHT, bt); } char* copya (char* t) { char* out =3D new char; for(int C=3D0;t[C] !=3D NULL;C++) { out[C] =3D t[C]; } return out; } char* addtext (char* o,char* t) { char* out =3D new char; for(int C =3D StringLength (o) + 1;t[C] !=3D NULL;C++) { out[C] =3D t[C]; } return out; } int StringLength (char* t) { int Plength; for(Plength=3D0;t[Plength] !=3D NULL;Plength++); return Plength; } bool CheckString (char* o,char* t) { int olength =3D StringLength (o); int tlength =3D StringLength (t); int mlength =3D 0; if(olength =3D=3D tlength) { for(int C =3D 0;t[C] !=3D NULL;C++) { if(o[C] =3D=3D t[C]) { mlength++; } } } if(mlength =3D=3D tlength) { return true; } else { return false; } } ------=_NextPart_000_001F_01C2CEE9.DAFEAAE0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2722.900" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY> <DIV><FONT face=3DArial size=3D2>Honestly, I just suck at VB. I = can't even get=20 a VB bot to work. I can do much more in C++. I just can't = add text=20 to these strings. I'm just making a rights bot which has taken = five=20 minutes so far, its just that I can't make it add the text.</FONT></DIV> <DIV><FONT face=3DArial size=3D2>"bowen" <</FONT><A=20 href=3D"mailto:thisguyrules at 7k2.4mg.com.ANTISPAM"><FONT face=3DArial=20 size=3D2>thisguyrules at 7k2.4mg.com.ANTISPAM</FONT></A><FONT face=3DArial = size=3D2>>=20 [View Quote] 0);<BR> aw_int_set (AW_MY_GESTURE, 0);<BR> if (rc =3D = aw_state_change=20 ())<BR> {<BR> cout<<"Unable to change state = (reason=20 %d)\n"<<rc;<BR> exit (1);<BR> }<BR> //Main = event=20 loop<BR> while (!aw_wait (-1))<BR> =20 ;<BR> //Close Bot<BR> aw_destroy ();<BR> aw_term=20 ();<BR>}</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>void handle_avatar_add = (void)<BR>{<BR> char*=20 name =3D new char;<BR> int session;<BR> name =3D=20 copya(aw_string(AW_AVATAR_NAME));<BR> session =3D=20 aw_int(AW_AVATAR_SESSION);<BR> if(!stricmp(name,"TheMask"))<BR> = ;{<BR> aw_whisper(session,"Whisper=20 password to gain rights");<BR> }<BR> else=20 if(!stricmp(name,"Builderz"))<BR> {<BR> aw_whisper(sessio= n,"Whisper=20 password to gain rights");<BR> }<BR> else=20 if(!stricmp(name,"NelXaga"))<BR> {<BR> aw_whisper(session= ,"Whisper=20 password to gain rights");<BR> }<BR> else=20 if(!stricmp(name,"Cameron999"))<BR> {<BR> aw_whisper(sess= ion,"Whisper=20 password to gain rights");<BR> }<BR> else=20 if(!stricmp(name,"SuperGuy3"))<BR> {<BR> aw_whisper(sessi= on,"Whisper=20 password to gain rights");<BR> }<BR> else=20 if(!stricmp(name,"Cadet"))<BR> {<BR> aw_whisper(session,"= Whisper=20 password to gain rights");<BR> }<BR>}</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>void handle_chat ()<BR>{<BR> char* = message =3D=20 new char;<BR> char* name =3D new char;<BR> int = session;<BR> message=20 =3D copya(aw_string(AW_CHAT_MESSAGE));<BR> name =3D=20 copya(aw_string(AW_AVATAR_NAME));<BR> session =3D=20 aw_int(AW_CHAT_SESSION);<BR> if(!stricmp(message,"=B6Noob Hater = Alpha=20 Boss=B6"))<BR> {<BR> if(!stricmp(name,=20 "TheMask"))<BR> {<BR> TheMask =3D=20 true;<BR> }<BR> }<BR> else = if(!stricmp(message,"=B6I Will=20 Build Even Though I Say I=20 Won't=B6"))<BR> {<BR> if(!stricmp(name,"Builderz"))<BR>&n= bsp; {<BR> Builderz=20 =3D true;<BR> }<BR> }<BR> else = if(!stricmp(message,"=B6Noob=20 Hater Beta=20 Supreme=B6"))<BR> {<BR> if(!stricmp(name,"NelXaga"))<BR>&= nbsp; {<BR> NelXaga=20 =3D true;<BR> }<BR> }<BR> else = if(!stricmp(message,"=B6Large=20 Stinky Gorillas Basking In The=20 Sun=B6"))<BR> {<BR> if(!stricmp(name,"Cameron999"))<BR>&n= bsp; {<BR> Cameron999=20 =3D true;<BR> }<BR> }<BR> else = if(!stricmp(message,"=B6Theworld=20 is a dumbass noob using=20 AWHack=B6"))<BR> {<BR> if(!stricmp(name,"SuperGuy3"))<BR>= {<BR> SuperGuy3=20 =3D true;<BR> }<BR> }<BR> else = if(!stricmp(message,"=B6I Had=20 Better Do Well=20 :-P=B6"))<BR> {<BR> if(!stricmp(name,"Cadet"))<BR> &= nbsp;{<BR> Cadet=20 =3D = true;<BR> }<BR> }<BR> else<BR> {<BR>  = ;//Do=20 nothing<BR> }<BR> ProcessRights();<BR>}</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>void handle_avatar_delete = ()<BR>{<BR> char*=20 name =3D new char;<BR> int session;<BR> name =3D=20 copya(aw_string(AW_AVATAR_NAME));<BR> session =3D=20 aw_int(AW_AVATAR_SESSION);<BR> if(!stricmp(name,"TheMask"))<BR> = ;{<BR> TheMask=20 =3D false;<BR> }<BR> else=20 if(!stricmp(name,"Builderz"))<BR> {<BR> Builderz =3D=20 false;<BR> }<BR> else=20 if(!stricmp(name,"NelXaga"))<BR> {<BR> NelXaga=3D=20 false;<BR> }<BR> else=20 if(!stricmp(name,"Cameron999"))<BR> {<BR> Cameron999 =3D = false;<BR> }<BR> else=20 if(!stricmp(name,"SuperGuy3"))<BR> {<BR> SuperGuy3 =3D=20 false;<BR> }<BR> else=20 if(!stricmp(name,"Cadet"))<BR> {<BR> Cadet =3D=20 false;<BR> }<BR> else<BR> {<BR> //Do=20 nothing<BR> }<BR> ProcessRights();<BR>}</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>void = ProcessRights()<BR>{<BR> char* b =3D new=20 char;<BR> char* ed =3D new char;<BR> char* ps =3D new = char;<BR> char*=20 e =3D new char;<BR> char* bt =3D new char;<BR> b =3D = "342836";<BR> ed =3D=20 "342836";<BR> ps =3D "342836";<BR> e =3D "342836";<BR> bt = =3D=20 "342836";<BR> if(TheMask =3D=3D=20 true)<BR> {<BR> strcat(b,",312237"); = <b><-----------=20 None of these=20 work.</b><BR> strcat(ed,",312237");<BR> strca= t(ps,",312237");<BR> strcat(e,",312237");<BR> strca= t(bt,",312237");<BR> }<BR> if(Builderz=20 =3D=3D=20 true)<BR> {<BR> strcat(b,",92986");<BR> strcat= (ed,",92986");<BR> strcat(ps,",92986");<BR> strcat(= e,",92986");<BR> strcat(bt,",92986");<BR> }<BR> if(N= elXaga=20 =3D=3D=20 true)<BR> {<BR> strcat(b,",337709");<BR> strca= t(ed,",337709");<BR> strcat(ps,",337709");<BR> strc= at(e,",337709");<BR> strcat(bt,",337709");<BR> }<BR> = ;if(Cameron999=20 =3D=3D=20 true)<BR> {<BR> strcat(b,",350803");<BR> strca= t(ed,",350803");<BR> strcat(ps,",350803");<BR> strc= at(e,",350803");<BR> strcat(bt,",350803");<BR> }<BR> = ;if(SuperGuy3=20 =3D=3D=20 true)<BR> {<BR> strcat(b,",347525");<BR> strca= t(ed,",347525");<BR> strcat(ps,",347525");<BR> strc= at(e,",347525");<BR> strcat(bt,",347525");<BR> }<BR> = ;if(Cadet=20 =3D=3D=20 true)<BR> {<BR> strcat(ps,",350957");<BR> strc= at(e,",350957");<BR> }<BR> aw_string_set=20 (AW_WORLD_BUILD_RIGHT, b);<BR> aw_string_set=20 (AW_WORLD_EMINENT_DOMAIN_RIGHT, ed);<BR> aw_string_set=20 (AW_WORLD_PUBLIC_SPEAKER_RIGHT, ps);<BR> aw_string_set=20 (AW_WORLD_EJECT_RIGHT, e);<BR> aw_string_set (AW_WORLD_BOTS_RIGHT,=20 bt);<BR>}</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>char* copya (char* = t)<BR>{<BR> char* out =3D new=20 char;<BR> for(int C=3D0;t[C] !=3D = NULL;C++)<BR> {<BR> out[C] =3D=20 t[C];<BR> }<BR> return out;<BR>}</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>char* addtext (char* o,char* = t)<BR>{<BR> char*=20 out =3D new char;<BR> for(int C =3D StringLength (o) + 1;t[C] !=3D=20 NULL;C++)<BR> {<BR> out[C] =3D = t[C];<BR> }<BR> return=20 out;<BR>}</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>int StringLength (char* = t)<BR>{<BR> int=20 Plength;<BR> for(Plength=3D0;t[Plength] !=3D = NULL;Plength++);<BR> return=20 Plength;<BR>}</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>bool CheckString (char* o,char*=20 t)<BR>{<BR> int olength =3D StringLength (o);<BR> int tlength = =3D=20 StringLength (t);<BR> int mlength =3D 0;<BR> if(olength =3D=3D = tlength)<BR> {<BR> for(int C =3D 0;t[C] !=3D=20 NULL;C++)<BR> {<BR> if(o[C] =3D=3D=20 t[C])<BR> {<BR> mlength++;<BR>&nb= sp; }<BR> }<BR> }<BR> if(mlength=20 =3D=3D tlength)<BR> {<BR> return=20 true;<BR> }<BR> else<BR> {<BR> return=20 false;<BR> }<BR>}</FONT></DIV></BODY></HTML> ------=_NextPart_000_001F_01C2CEE9.DAFEAAE0-- bowenFeb 8, 2003, 12:16am
Why not try to actually predefine string length? I'm sure you can make do with 256
or 1024 characters. But then it looks like you're trying to do something weird with the rights list... I know what Andras means when he says I should comment better now. ;) --Bowen-- hal9000Feb 8, 2003, 1:26am
sprintf(yourstring,"%s%s",yourstring,stringtoadd);
i believe that is right, thuogh it has been awhie since i have done anything in C++ -- Hal9000 Worlds: Discover, Planets, Revolt76 [View Quote] bowenFeb 8, 2003, 1:35am
[View Quote]
That's a little silly to do, but ok. It won't change the results of his crash
though. He's trying to do something with the rights list and it's messing up (as far as I can tell). --Bowen-- hal9000Feb 8, 2003, 2:08am
maybe i misunderstand... where is the error happening?
and yes, i believe that AW requires fixed length strings (now that i look at the code)... You can use whatever you want to begin with, but make sure that you give it to aw as a fixed length... -- Hal9000 Worlds: Discover, Planets, Revolt76 [View Quote] bowenFeb 8, 2003, 3:02am
[View Quote]
It seems to be crashing when it attempts to modify the rights list. (as far as I can
ascertain) --Bowen-- andrasFeb 8, 2003, 6:47am
[View Quote]
All text variable definition/creation in your example is WRONG. char *c; c=new char; will create a single character pointer but not a string! char *c; c=new char[1024]; Will create a 1024 character long string pointed by c. In your case you probably wanted to use the later one :) HTH -- Andras "It's MY computer" (tm Steve Gibson) .duo.Feb 8, 2003, 12:10pm
I've ran the debugger many times, and it crashes as soon as I use the string
functions. I hope what you said will fix my problem. [View Quote] bowenFeb 8, 2003, 2:29pm
[View Quote]
I said it in a less direct way. ;) I didn't see that single char stuff though. But
then again you were doing some crazy stuff with your own functions. --Bowen-- |