Thread

VB SDK - Logging In... (Sdk)

VB SDK - Logging In... // Sdk

1  |  

dion

Jul 16, 2004, 5:02pm
Okay... it just won't create an instance. GRR! It gives me error code 429
RC_UNABLE_TO_CONNECT

It's probably something really simple.

Private Sub Form_Load()
Dim rc As Long
rc = sdk.aw_init(AW_BUILD)
If rc Then
MsgBox "Unable to initialize the API (reason " & rc & ")"
GoTo bottom
End If
rc = sdk.aw_create(0, 0)
If rc Then
MsgBox "Unable to login (reason " & rc & ")"
GoTo bottom
End If
sdk.AW_LOGIN_NAME = DoomBot
sdk.AW_LOGIN_OWNER = 287096
sdk.AW_LOGIN_PRIVILEGE_PASSWORD = *****
sdk.AW_LOGIN_APPLICATION = "Doom Bot"
rc = sdk.AwLogin
If rc Then
MsgBox "Unable to login (reason " & rc & ")"
GoTo bottom
End If
bot_login.Visible = False
bottom:
End Sub

ksg

Jul 16, 2004, 6:19pm
rc = sdk.aw_create(0, 0)

should be

rc = sdk.aw_create(auth.activeworlds.com, 5670)

[View Quote]

ksg

Jul 16, 2004, 6:21pm
also before bot_login.Visible = False you should have
rc = sdk.aw_enter(WorldName)

i hope this has been some help
[View Quote]

r i c h a r d

Jul 16, 2004, 9:19pm
errr what???

sdk.AW_LOGIN_OWNER

Its either Sdk.AwLoginOwner for the Ocx SDK
or sdk.aw_int_set AW_LOGIN_OWNER,Citnum

dion

Jul 17, 2004, 1:24am
UGH! The documentation is totally old or some crap. I have the newest VB
sdk. Just what on earth am I supposed to do to login? I just need an
example. This is 100x more difficult than it should be.

-D

[View Quote]

r i c h a r d

Jul 17, 2004, 5:07am
Here is some code examples for AwSdk2.dll

Ok here is the quick method, using this method you dont have worry about
setting most events and should suite ur needs most the time.

Const CitizenNumber = 123
Const PrivPass = "Bobppw"
Const BotName = "Botty"
Const Application = "Botty bot"
Const World = "AW"
Private Sub Form_Load()
Dim rc As Integer
rc Sdk.aw_init(AW_BUILD)
If rc <> 0 Then
MsgBox "Unable to init the sdk reason: " & rc
End
End If
Sdk.QuickStartHost = "auth.activeworlds.com" 'Isn't requried for AW
Sdk.QuickStartPort = 5670 'Isn't requried for AW
Sdk.QuickStartGlobal = True 'Isn't required unless you want to enter
global
rc = Sdk.QuickStart(CitizenNumber, PrivPass, BotName, Application,
World, 0, 0, 0, 0, 0)
If rc <> 0 Then
MsgBox "Unable to login reason: " & rc
End
End If
Sdk.aw_state_change
timAWwait.Interval = 1000
timAWwait.Enabled = True
End Sub

Private Sub timAWwait_Timer()
timAWwait.Enabled = True
End Sub

Here is an example for the standard login method like the C++ SDK would be.
You must remember to set events as needed though.

Const CitizenNumber = 123
Const PrivPass = "Bobppw"
Const BotName = "Botty"
Const Application = "Botty bot"
Const World = "AW"
Private Sub Form_Load()
Dim rc As Integer
rc Sdk.aw_init(AW_BUILD)
If rc <> 0 Then
MsgBox "Unable to init the sdk reason: " & rc
End
End If
rc = Sdk.aw_create("auth.activeworlds.com", 5670)
If rc <> 0 Then
MsgBox "Unable to connect reason: " & rc
End
End If
Sdk.aw_int_set AW_LOGIN_OWNER, CitizenNumber
Sdk.aw_string_set AW_LOGIN_PRIVILEGE_PASSWORD, PrivPass
Sdk.aw_string_set AW_LOGIN_NAME, BotName
Sdk.aw_string_set AW_LOGIN_APPLICATION, Application
rc = Sdk.aw_login
If rc <> 0 Then
MsgBox "Unable to login reason: " & rc
End
End If
rc = Sdk.aw_enter(World)
If rc <> 0 Then
MsgBox "Unable to enter world reason: " & rc
End
End If
Sdk.aw_int_set AW_MY_TYPE, 0
Sdk.aw_int_set AW_MY_X, 0
Sdk.aw_int_set AW_MY_Y, 0
Sdk.aw_int_set AW_MY_Z, 0
Sdk.aw_int_set AW_MY_YAW, 0
Sdk.aw_int_set AW_MY_PITCH, 0
Sdk.aw_state_change

'Remember to set the events you will need as well as call backs
Sdk.aw_event_set AW_AVATAR_ADD
Sdk.aw_event_set AW_AVATAR_DELETE

timAWwait.Interval = 1000
timAWwait.Enabled = True
End Sub

Private Sub timAWwait_Timer()
timAWwait.Enabled = True
End Sub

johnf

Jul 17, 2004, 8:18am
The AwSdkDll2 is to be used in a similar way to the proper AW SDK.

You may no longer use ABC = "blah" like you used to but now,

sdk.aw_string_set abc, "blah".... etc.

Quite simple and in truth faster than AwSdkOcx#

[View Quote]

strike rapier

Jul 17, 2004, 10:11am
Use the C sdk documentation: www.activeworlds.com/sdk/, its cleaner.

I even go as far as to have aw_int, aw_int_set, aw_string etc defined as
global functions, just like in C.

That way no silly property malarva.

- Mark R

[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