ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
Help with VB Code (Bots)
Help with VB Code // BotsgamerApr 19, 2001, 12:00pm
This is a multi-part message in MIME format.
------=_NextPart_000_0008_01C0C8E0.1068B160 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi I'm writting my first every bot (yay!) and I'm adding a login part. I want to make it so that the bot logs into the name, ppw and world = specified in 3 Text Feilds. I need to know how to make a declaration so that instead of just being a = plain value, its based on the contents of another text feild... Private Const CitizenNumber =3D 12345 Private Const Password =3D "ppw" Private Const BotName =3D "GBot" Private Const Application =3D "GBotApp" Private Const world =3D "world" in the code above..there are the declarations for the bot use when = creating an instance. I want those to refer to 3 text feilds called = citnum, ppw and wts and I don't know the code....can someone please = help? I have tried: Private Const CitizenNumber =3D "" & citnum and I've tried: Private Const CitizenNumber =3D citnum.text what am I doing wrong? I get errors on both of those attempts... -Gamer ------=_NextPart_000_0008_01C0C8E0.1068B160 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 content=3D"text/html; charset=3Diso-8859-1" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY> <DIV><FONT face=3DArial size=3D2>Hi I'm writting my first every bot = (yay!) and I'm=20 adding a login part.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>I want to make it so that the bot logs = into the=20 name, ppw and world specified in 3 Text Feilds.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>I need to know how to make a = declaration so that=20 instead of just being a plain value, its based on the contents of = another text=20 feild...</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>Private Const CitizenNumber =3D <FONT=20 color=3D#ff0000>12345</FONT><BR>Private Const Password =3D "<FONT=20 color=3D#ff0000>ppw</FONT>"<BR>Private Const BotName =3D = "GBot"<BR>Private Const=20 Application =3D "GBotApp"<BR>Private Const world =3D "<FONT=20 color=3D#ff0000>world</FONT>"</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>in the code above..there are the = declarations for=20 the bot use when creating an instance. I want those to refer to 3 text = feilds=20 called <FONT color=3D#ff0000>citnum<FONT color=3D#000000>,</FONT> ppw = <FONT=20 color=3D#000000>and</FONT> wts </FONT><FONT color=3D#000000>and I don't = know the=20 code....can someone please help?</FONT></FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>I have tried:</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2><FONT face=3DArial size=3D2>Private = Const CitizenNumber=20 =3D <FONT color=3D#ff0000>"" & citnum</FONT></FONT></FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>and I've tried:</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2> <DIV><FONT face=3DArial size=3D2><FONT face=3DArial size=3D2>Private = Const CitizenNumber=20 =3D <FONT color=3D#ff0000>citnum.text</FONT></FONT></FONT></DIV> <DIV> </DIV> <DIV> </DIV> <DIV>what am I doing wrong? I get errors on both of those = attempts...</DIV> <DIV> </DIV> <DIV> </DIV> <DIV>-Gamer</DIV></FONT></DIV></BODY></HTML> ------=_NextPart_000_0008_01C0C8E0.1068B160-- azazaelApr 19, 2001, 12:35pm
Constants, Gamer.
A constant, once set in code cannot be changed. What we need is a variable, something like Dim iCitizenNumber iCitizenNumber = citnum.text should do the trick Regards Az [View Quote] I want to make it so that the bot logs into the name, ppw and world specified in 3 Text Feilds. I need to know how to make a declaration so that instead of just being a plain value, its based on the contents of another text feild... Private Const CitizenNumber = 12345 Private Const Password = "ppw" Private Const BotName = "GBot" Private Const Application = "GBotApp" Private Const world = "world" in the code above..there are the declarations for the bot use when creating an instance. I want those to refer to 3 text feilds called citnum, ppw and wts and I don't know the code....can someone please help? I have tried: Private Const CitizenNumber = "" & citnum and I've tried: Private Const CitizenNumber = citnum.text what am I doing wrong? I get errors on both of those attempts... -Gamer azazaelApr 19, 2001, 1:12pm
Before I get hammered for not declaring variable type:0)
Dim iCitizenNumber as Long iCitizenNumber = citnum.text Regards Az [View Quote] grimbleApr 19, 2001, 4:57pm
Sounds like you've got a global and a local variable/constant of the same
name. Maybe you declared it as a constant as well in the declarations section of the form/module?? Grims. [View Quote] azazaelApr 19, 2001, 5:16pm
Have you still got iCitizenNumber set as a constant?
either delete or comment out: Private Const iCitizenNumber = citnum.text [View Quote] |