Board ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
sado // User Search
sado // User SearchRe: VB Wrapper - Callback Functions & AWCitizenAttributesBYNumberSep 23, 2000, 1:48am
[View Quote]
> I'm not a VB person, but am I wrong in assuming that, having installed a
> callback function, you should get the result of your citizen query inside > the callback, and not in the calling function? It seems to me that what you > call your callback is the calling function.... And, do you sent the bot > instance before calling sdk2.AwCitizenAttributesByNumber(i) ? > That's a very important step. Don't forget to do an AW.Init, an AW.Create, and an AW.Login... > > AwCitizenAttributesByNumber, in the calling function, should not block or > give you a valid answer if you installed a callback, the answer comes in the > callback itself. > Right-o. So you gotta make your code a state machine instead of a linear script... > > In > sdk2.AwCallbackSet AW_CALLBACK_CITIZEN_ATTRIBUTES > where is the pointer to callback function ? AwCallbackSet has, in C, two > parameters: the type of callback, in this case > AW_CALLBACK_CITIZEN_ATTRIBUTES, and a pointer to an entry point for the > callback function itself. I don't know how to do this in VB, but it seems > to be missing here. > That's because MrGrimm (in his infinite wisdom ;) has created a number of events in the ocx which are triggered when the callbacks are fired (named, oddly enough, AWCallback_XXX) Sure, it's not so elegant as C would make things, but doing pointers (even function pointers) in VB is really, really painful. Sado Multiple instance AwAvatarAddressSep 23, 2000, 10:14pm
Are you using the very, very most recent version of Grimm's ocx? (assuming you are using that)
Also, how are you accessing the different instances of the ocx? You need to create a seperate instance of the OCX for each bot instance. Sado [View Quote] > Hello, > > I'm having a strange prob with a VB multiple instance bot. When I try to get an avatar address, only the instance that logs in first returns the correct IP. The rest return 0.0.0.0. If I kill one of these instances and login again they return the correct address. Code for all instances is identical: sdk.AwAddress(Session) > Address = sdk.AwAvatarAddress > Any ideas? > > Baron Multiple instance AwAvatarAddressSep 24, 2000, 4:41pm
Are you checking your return codes? They are often _very_ enlightening. I know that since I added error checking to the BotTool, it's been much easier to debug/troubleshoot.
You're doing the whole aw.init aw.create aw.login thing, too, of course... Hmm... I can't really say more unless I see code fragments, because a lot of the things that might be going wrong are probably on that level. :-/ Sado [View Quote] > Using AwSdkOcx2 (2.0.2.17) released Sep 14. Different instances are on different MDI child forms. Each instance is created on each child form load and logs in with a login sub routine or manualy. In theory everything seems right but obviously I'm missing something:) > Thanks, > Baron > [View Quote] |