Thread

SDK COM Wrapper Multiple instances ... (Sdk)

SDK COM Wrapper Multiple instances ... // Sdk

1  |  

grimble

Nov 19, 2002, 7:39pm
I need a "listener" bot for testing to tell me what notifications are
reaching a specific point in a world so I figured "knock one up quickly in
VB", but ...

With the COM wrapper, is it one instance per instantiated AwSdk object like
with the OCX or something else?

Thanks,

Grims.

strike rapier

Nov 19, 2002, 8:29pm
Function HypBetween2D(X1 As Long, Z1 As Long, X2 As Long, Z2 As Long)
'This allows you to find the distance between 4 points allong the hyp
'and is used for mapping and rangefinding. It uses X and Z (NS / EW)
Dim DistanceOnTarget As Long, XDistance As Long, ZDistance As Long
XDistance = X2 - X1
ZDistance = Z2 - Z1
HypBetween2D = Sqr((XDistance ^ 2) + (ZDistance ^ 2))
End Function

For the normal AW_SAY relay system...
For zones as in squares is a lil more interesting, you can still use your global mode however use a world size array to keep the daya they are in, then do a general search around it, such as..

Type AwWorldCell
SendExternal as integer
RecieveExternal as integer
Cell_ID as integer
end type

Public AwCells(20,20) as AwWorldCell

dim i as integer
dim skey as string
skey = cstr(AW_CHAT_SESSION)

For i = 1 to avatars.count
if AwCells(avatars.item(skey).CellX,avatars.item(skey).CellZ).SendExternal then

strike rapier

Nov 19, 2002, 8:39pm
whoops, continued...

Function HypBetween2D(X1 As Long, Z1 As Long, X2 As Long, Z2 As Long)
'This allows you to find the distance between 4 points allong the hyp
'and is used for mapping and rangefinding. It uses X and Z (NS / EW)
Dim DistanceOnTarget As Long, XDistance As Long, ZDistance As Long
XDistance = X2 - X1
ZDistance = Z2 - Z1
HypBetween2D = Sqr((XDistance ^ 2) + (ZDistance ^ 2))
End Function

For the normal AW_SAY relay system...
For zones as in squares is a lil more interesting, you can still use your global mode however use a world size array to keep the daya they are in, then do a general search around it, such as..

Type AwWorldCell
SendExternal as integer
RecieveExternal as integer
Cell_ID as integer
end type

Public AwCells(20,20) as AwWorldCell

dim i as integer, j as integer
dim skey as string
skey = cstr(AW_CHAT_SESSION)

if AwCells(avatars.item(skey).CellX,avatars.item(skey).CellZ).SendExternal then
for j = 1 to avatars.count
if ((AwCells(avatars.item(j).CellX,avatars.item(j).CellZ).RecieveExternal = 1) and (HypBetween2D(avatars.item(j).X, avatars.item(j).Z, avatars.item(skey).x,avatars.item(skey).z) < 200000) or AwCells(avatars.item(j).CellX,avatars.item(j).CellZ).Cell_ID = AwCells(avatars.item(skey).CellX,avatars.item(skey).CellZ).Cell_ID then
'Send whatever needs to be said
end if
next j
else
for j = 1 to avatars.count
if AwCells(avatars.item(j).CellX,avatars.item(j).CellZ).Cell_ID = AwCells(avatars.item(skey).CellX,avatars.item(skey).CellZ).Cell_ID then
'send whatever
end if
next j
end if

If your on about what I think your on about then that should do the trick your after, hence with global only 1 instance?

- Mark

baron

Nov 19, 2002, 8:42pm
At least I don't see a difference, ported all my multiple instance ocx projects to the com with almost no modifications.

-Baron

P.S (OT). If anyone from AWI reads this, Start/run/cmd and type net time/? on the news server, or check out http://www.microsoft.com/WINDOWS2000/techinfo/howitworks/security/wintimeserv.asp ...time flies


[View Quote]

strike rapier

Nov 19, 2002, 8:53pm
Blah, not what was wanted because I missundastood, but screw it :P There is a huge part of a 3.4 RPG chat bot for u there.

- Mark

[View Quote]

kah

Nov 20, 2002, 8:45pm
"baron" <pk39srt at hotmail.com> wrote in
news:3ddabe5b at server1.Activeworlds.com:

> P.S (OT). If anyone from AWI reads this, Start/run/cmd and type net
> time/? on the news server, or check out
> http://www.microsoft.com/WINDOWS2000/techinfo/howitworks/security/winti
> meserv.asp ...time flies

I think that might be difficult, as the server is probably running some
sort of UNIX variant.

KAH

baron

Nov 21, 2002, 4:22am
Not difficult at all, last time I checked that's a Win2KS box. Anyway SNTP would be equally easy to handle if it was *nix; my point was it's always a good administrative practice to automate things like server time sync, especially on machines that need an accurate timestamp.

-Baron


[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