ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
AW_Create (Sdk)
AW_Create // Sdkstrike rapierAug 23, 2002, 11:29pm
Howdy peoples,
Could someone please tell me what port and host to use in aw_create for AW? 0,0 dosent work anymore for me. - Mark statusAug 23, 2002, 11:45pm
....
Host: auth.activeworlds.com (64.94.241.250) Port: 5670 -Status strike rapier said, "Could someone please tell me what port and host to use in aw_create for AW?" strike rapierAug 24, 2002, 12:11am
Thanks, ive got it sorted.. but now its saying my PPW is invalid, ive even hardcoded it to the right 1 with no luck. All my other bots login fine, anyone know if there is a problem seen before like this?
- Mar [View Quote] kahAug 24, 2002, 11:11am
"strike rapier" <strike at rapiercom.freeserve.co.uk> wrote in
news:3d66eb3f at server1.Activeworlds.com: > Thanks, ive got it sorted.. but now its saying my PPW is invalid, ive > even hardcoded it to the right 1 with no luck. All my other bots login > fine, anyone know if there is a problem seen before like this? Change it to a new one to be 100% sure. And what's your code for setting it (replace the PPW with something like "secret")? KAH strike rapierAug 24, 2002, 12:34pm
I fixed it, I use functions to set some globals, however AW_LOGIN_PASSWORD was being set instead of AW_LOGIN_PRIVILEGE_PASSWORD :) Thanks for baron for pointing out my stupidity and helping me getting it working. :)
Now my only prob is its not recieving events even with all the events set and the features installed. - Mark [View Quote] milestegAug 24, 2002, 12:48pm
"strike rapier" <strike at rapiercom.freeserve.co.uk> a écrit dans le message
de news: 3d679990 at server1.Activeworlds.com... > I fixed it, I use functions to set some globals, however AW_LOGIN_PASSWORD was being set instead of AW_LOGIN_PRIVILEGE_PASSWORD :) Thanks for baron for pointing out my stupidity and helping me getting it working. :) > > Now my only prob is its not recieving events even with all the events set and the features installed. > > - Mark Did you call aw_state_change? because, if you re not in global mode, you need to call aw_state_change to receive all the events related to avatars :) Regards, MilesTeg strike rapierAug 24, 2002, 12:59pm
Public Sub Login_Bot(Citnum As Long, PPW As String, BotName As String, Avatar As Integer, World As String, X As Long, Y As Long, Z As Long, YAW As Long, GlobalMode As Boolean, Invisible As Boolean, Universal As Boolean)
Dim RC As Long, LoginTime As Long, vbDoubleTab As String vbDoubleTab = vbTab & vbTab LoginTime = Timer With FrmMain.sdk 'Create instance RC = .aw_create("auth.activeworlds.com", 5670) If RC Then Display Time & vbTab & "Could not create instance in Active Worlds - Reason: " & ARC_Lookup(RC), vbRed Status "Could not create instance in Active Worlds - Reason: " & ARC_Lookup(RC), vbRed Exit Sub Else Display Time & vbTab & "Successfully created instance in Active Worlds", vbBlue Status "Successfully created instance in Active Worlds - Time Taken: " & (Timer - logintimer), vbBlue End If .aw_int_set AW_LOGIN_OWNER, Citnum .aw_string_set AW_LOGIN_PRIVILEGE_PASSWORD, PPW .aw_string_set AW_LOGIN_NAME, "saykuamon" .aw_string_set AW_LOGIN_APPLICATION, "Saykuamon" RC = .aw_login If RC Then Display "Could not login - Reason: " & ARC_Lookup(RC), vbRed Status "Could not login - Reason: " & ARC_Lookup(RC), vbRed Exit Sub Else Display Time & vbTab & BotName & " sucessfully logged into Universe Active Worlds - Level 3", vbBlue Status BotName & " sucessfully logged into Universe Active Worlds - Time Taken: " & (Timer - logintimer), vbBlue End If If Universal = True Then Status "Holding at universal level (3) - Total login time: " & (Timer - logintimer), vbBlue FrmLogin.Visible = False Exit Sub End If If GlobalMode = True Then .aw_bool_set AW_ENTER_GLOBAL, True Else .aw_bool_set AW_ENTER_GLOBAL, False End If RC = .aw_enter(World) If RC Then Display Time & vbTab & BotName & " could not enter '" & World & "' - Reason: " & ARC_Lookup(RC), vbRed Status BotName & " could not enter '" & World & "' - Reason: " & ARC_Lookup(RC), vbRed Exit Sub Else Display Time & vbTab & BotName & " enters the world '" & World & "'", vbBlue Status BotName & " enters the world '" & World & "'", vbBlue FrmMain.Caption = "Seykuamon - " & World End If If Invisible = True Then Status "Holding at world level (2) - Total login time: " & (Timer - logintimer), vbBlue FrmLogin.Visible = False Exit Sub End If .aw_int_set AW_MY_X, X .aw_int_set AW_MY_Y, Y .aw_int_set AW_MY_Z, -2750000 .aw_int_set AW_MY_YAW, YAW .aw_int_set AW_MY_TYPE, 1 Status "Setting SDK coordinate values - X: " & X & " Y: " & Y & " Z: " & Z & " YAW: " & YAW, vbBlue Status "Evaluating SDK coordinates - Target Set: " & StringCoords(X, Y, Z, YAW), vbBlue .aw_event_set EventAvatarAdd .aw_event_set EventAvatarChange .aw_event_set EventAvatarDelete .aw_event_set EventChat RC = .aw_state_change If RC Then Display Time & vbTab & BotName & " could not state change - Reason: " & ARC_Lookup(RC), vbRed Status BotName & " could not state change - Reason: " & ARC_Lookup(RC), vbRed Exit Sub Else Display Time & vbTab & BotName & " enters the world '" & World & "' at the physical level", vbBlue Status BotName & " enters the world '" & World & "' at the physical level", vbBlue End If .aw_event_set EventAvatarAdd .aw_event_set EventAvatarChange .aw_event_set EventAvatarDelete .aw_event_set EventChat .aw_event_set EventWorldInfo Status "Holding at Physical level (1) - Total login time: " & (Timer - logintimer), vbBlue FrmLogin.Visible = False End With End Sub Is what im using.. But it still does not recieve any events appart from avatar add baronAug 24, 2002, 1:14pm
Try setting the events like this:
.aw_event_set (AW_EVENT_CHAT) .aw_event_set (AW_EVENT_AVATAR_ADD) .aw_event_set (AW_EVENT_AVATAR_DELETE) .aw_event_set (AW_EVENT_AVATAR_CHANGE) Always use Option Explicit, compiler would have caught these if you did. Btw are you sure it receives AW_EVENT_AVATAR_ADD? If it does you have set the events elsewhere in your code too. You already tried to set them twice in this procedure, setting events just once for an instance is sufficient :) -Baron [View Quote] > .aw_event_set EventAvatarAdd > .aw_event_set EventAvatarChange > .aw_event_set EventAvatarDelete > .aw_event_set EventChat > .aw_event_set EventAvatarAdd > .aw_event_set EventAvatarChange > .aw_event_set EventAvatarDelete > .aw_event_set EventChat > .aw_event_set EventWorldInfo > > Is what im using.. But it still does not recieve any events appart from avatar add > > strike rapierAug 24, 2002, 1:55pm
Yep, it always recieved Avatar_Add nomatter what, even without a handler installed at all.
*adds Option explicit* - Mark [View Quote] baronAug 24, 2002, 9:32pm
Option Explicit being optional is one of the reasons for a lot of sloppy VB code in general and the bad reputation the language has, not referring to this example or you personally. VB is very tolerant, a lot more than it should be so it's up to the developer to make it more strict in order to maintain his sanity. Fortunately this has changed a lot with VB.NET, those who think their compiler (and computer) actually speaks English are in for a big surprise. Anyway to make sure you don't forget it in the future you can make Option Explicit the default behavior in your projects by checking Tools/Options/Editor/Require Variable Declaration. That is the first thing I do in every new VS6 installation :)
-Baron [View Quote] strike rapierAug 25, 2002, 12:10am
|