ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
HELP My VB bot won't log on (Sdk)
HELP My VB bot won't log on // Sdk.duo.Jul 26, 2002, 11:55pm
Here is the code for my vb bot:
Dim NSC As Long Dim EWC As Long Dim H As Long Dim AVR As Long Dim AVN As Long Dim PPW As String Dim BNa As String Dim WNa As String Dim CNu As Long Private Sub sdk_EventChat() CRTB.Text = CRTB.Text & sdk.AwAvatarName & ": " & sdk.AwChatMessage & Chr(13) & Chr(10) End Sub Private Sub CSTB_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then sdk.AwSay CSTB.Text CRTB.Text = CRTB.Text & BNTB.Text & ": " & CSTB.Text & Chr(13) & Chr(10) CSTB.Text = "" End If End Sub Private Sub ENDPROGRAM_Click() sdk.AwDestroy End End Sub Private Sub LB_Click() EWC = EWCTB.Text EWC = EWC * 1000 NSC = NSCTB.Text NSC = NSC * 1000 H = HTB.Text H = H * 1000 AVR = AVRTB.Text AVR = AVR * 1000 AVN = ANTB.Text CNu = CNTB.Text PPW = PPTB.Text BNa = BNTB.Text WNa = WNTB.Text sdk.AwInit AW_BUILD sdk.QuickStart CNu, PPW, BNa, "DuoBot", WNa, EWC, H, NSC, AVR, AVN CRTB.Text = CRTB.Text & sdk.AwWorldWelcomeMessage & Chr(13) & Chr(10) CML.Visible = True CMTB.Visible = True WTL.Visible = True WPTB.Visible = True WMTB.Visible = True CSTB.Visible = True CRTB.Visible = True EWCTB.Visible = False NSCTB.Visible = False HTB.Visible = False ANTB.Visible = False AVRTB.Visible = False CNTB.Visible = False WNTB.Visible = False PPTB.Visible = False BNTB.Visible = False AVL.Visible = False HL.Visible = False LEWL.Visible = False LNSL.Visible = False WNL.Visible = False BNL.Visible = False PPL.Visible = False CNL.Visible = False MainForm.Height = 4100 End Sub This is really wierd because it works fine until I changed the awsdkocx5 control's name from Aw1 to sdk. It didnt work after I tried chnaging it back either. HELP the derekJul 27, 2002, 2:50am
have you tried using easier to remember variables lol. in a complex bot id
be lost with names like that... [View Quote] ananasJul 27, 2002, 2:52am
strike rapierJul 27, 2002, 6:21am
Hate to critizise, but that looks awfull programming wise, but then again,
its how I started 2. You can place the variables straight into the command like... RC = sdk.QuickStart(val(txtCitnum.text), txtppw.text, txtBotName.text, "Andrasta", txtWorld.text, Xcoord, Ycoord, Zcoord, YAWCoord, val(txtAvatar.text)) If RC Then MsgBox "error: " & RC_Lookup(RC) Else '.... Whatever End if Also, that will give you the error, when your using the SDK for things like login ALLLLLWAYYYYS use a RC function handler else your 100% stuffed when you get a error and in all likelyhood ur users / you will just have their comps crash or the program fail. Also consider putting Aw_Init in ur form_load( ) sub as it takes a while initiating all its API and u dont wanna waste time filling in all ur controls only to have API fail and crash. just 1 last check... you did change the name to SDK didnt you? check the object name, you may have misspelled - Mark .duo.Jul 27, 2002, 10:52am
.duo.Jul 27, 2002, 11:23am
Here is my re-done code:
Dim rc As Long Public Sub PhaseB() 'Makes parts of the window invisible and makes the chat window visible CML.Visible = True CMTB.Visible = True WTL.Visible = True WPTB.Visible = True WMTB.Visible = True CSTB.Visible = True CRTB.Visible = True EWCTB.Visible = False NSCTB.Visible = False HTB.Visible = False ANTB.Visible = False AVRTB.Visible = False CNTB.Visible = False WNTB.Visible = False PPTB.Visible = False BNTB.Visible = False AVL.Visible = False HL.Visible = False LEWL.Visible = False LNSL.Visible = False WNL.Visible = False BNL.Visible = False PPL.Visible = False CNL.Visible = False AVRL.Visible = False AVRTB.Visible = False MainForm.Height = 4100 End Sub Private Sub Form_Load() sdk.AwInit (AW_BUILD) 'Initionalizes API rc = sdk.AwInit(AW_BUILD) If rc Then MsgBox "Error Initializing SDK! (Reason " & rc & ": " & sdk.RCLookUp(rc) & ")" End End If End Sub Private Sub sdk_EventChat() CRTB.Text = CRTB.Text & sdk.AwAvatarName & ": " & sdk.AwChatMessage & Chr(13) & Chr(10) 'Takes in message End Sub Private Sub CSTB_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then 'Checks for the enter key sdk.AwSay CSTB.Text 'Says what's in the text box CRTB.Text = CRTB.Text & BNTB.Text & ": " & CSTB.Text & Chr(13) & Chr(10) 'Displays what the bot says in the textbox used for recieving CSTB.Text = "" 'Empties text box used for entering things to say End If 'Ends the if statement End Sub Private Sub ENDPROGRAM_Click() sdk.AwDestroy 'Ends Aw End 'Closes Program End Sub Private Sub LB_Click() sdk.QuickStart CNTB.Text, PPTB.Text, BNTB.Text, "DuoBot", WNTB.Text, EWCTB.Text * 1000, HTB * 1000, NSCTB.Text * 1000, AVRTB.Text * 1000, AVN 'Logs the bot in If rc Then MsgBox "error: " & sdk.RCLookUp(rc) Else Call PhaseB 'Calls PhaseB CRTB.Text = CRTB.Text & sdk.AwWorldWelcomeMessage & Chr(13) & Chr(10) 'Displays the welcome message End If End Sub When I run this bot, I get a error in the message box saying: "Error Initializing SDK! (Reason 454: RC_Version_Mismatch" I hope this clears up what I need to dofo rall of you, because I have no idea. .duo.Jul 27, 2002, 11:24am
O man, LOL turns out I was including the 3 and 5 OCX, LMAO. Now it works
that I've gotten rid of the 3 [View Quote] |