grimble // User Search

grimble // User Search

1  2  3  4  5  6  ...  28  |  

Detecting a Object Click, and Verafying it.

May 17, 2001, 10:21pm
As BillyBob says, you have no choice but to locate and store the objects
first ... locate the object with an AwQuery in the first place, store all
the named objects it finds (or just the ones you are looking for) in an
array or a collection and then reference the collection in the
EventObjectClick to identify which one was clicked.

There's no "quick and dirty" solution to this, sorry.

Just a hint here ... when you are doing a survey to locate named objects,
rather than parsing the whole action line, its much easier to make the first
command in the action text on each of the objects the name of the object ...
so, in your example, code the object as "create name click1, sign" rather
than the other way around. Then in the EventCellObject event use something
like the following:

awObjectAction = awSDK.AwObjectAction
If (UCase(Left(awObjectAction, 12)) = "CREATE NAME " Then
<record the object>
EndIf

That way, you can see at the first opportunity (i.e. the first line of code
in the event handler) whether you even care about the object without having
to do some nasty string parsing before you can decide. To get the name of
the object, you just take the text up to the next delimiter ("," ";" or the
end of the string) and go from there.

If you are placing the object, it is much easier to make the object's action
text comply your bot's code than to code the bot to handle any action text
possible. For example, you could make sure that there is ALWAYS only one
space between "name" and the objects name and ALWAYS put a space after the
object name (whether it is the only command in the action text or not) so
that you know that the bot can take the text between "create name " and the
next space to be the object name. That saves a load of excessive coding and
processing.

Grims.


[View Quote]

What chance is there ....

May 17, 2001, 7:19am
Is there any chance we could have a new newsgroup on news.activeworlds.com
for C++, VB, Delphi and Java questions related to the SDK?

I appreciate that there is a need for people who have started using these
languages purely for bot development with no other experience to speak of in
programming them to have a place to ask questions about the language and the
best way to do things, so I am not saying these people aren't welcome (in my
view anyway) to ask for the information they need.

The thing is, this SDK newsgroup is now getting littered with questions
about how to do things in VB ... and less and less to do with the SDK
itself. I know there are people with relevant skills that would monitor the
new NG, and it would help to keep on-topic stuff at the forefront in this
one.

Any comments (or ideas whether AW would set one up)?

Grims

What chance is there ....

May 17, 2001, 7:21am
Oops ... sorry.

"related to the SDK" meant to say "not directly related to the SDK".

Grims


[View Quote]

What chance is there ....

May 17, 2001, 9:05pm
LOL .... nicely put.

[View Quote] It would keep some fights over correct basic programming and
i'll-help-but-i-have-no-clue helpers out of sight.

What chance is there ....

May 17, 2001, 9:12pm
Apart from the basic concept of keeping the basic VB questions out of the
SDK newsgroup (although they are perfectly valid questions ... and will be
welcome there), one of the key ideas behind this is so that people like you
who think that way don't have to read the posts and not even subscribe to
the newsgroup.

In that way we can keep the threads in the SDK focussed on SDK issues and
still help the people trying to learn the languages in question in a
separate forum. I take it from your comments that you won't subscribe to the
newsgroup if it ever materialised, which is your choice. Whatever happens,
we'll have to make sure there's a firm charter behind it ... that is stuck
to.

Grims

[View Quote]

What chance is there ....

May 18, 2001, 7:49am
Wow ... Some response.

I don't remember seeing anyone derided in this newsgroup for using VB (or
any non-C++ language). I have about 4 PC development languages at my
disposal, with experience ranging from months to years. I used to used VB
for bots ... right up to the point it came time to send it to someone(Ack!
4.5MB's worth of cabs!). The post had nothing to do with elitism ... it is a
matter of of focus, not segregation ... to the benefit of all.

I am happy to help people where I can on any subject where I have experience
and feel have value to add to the subject. However I don't believe that
questions about handling visual controls and data stores etc. BELONG in the
sdk newsgroup. It clutters it up making things very difficult to locate
later for both people who want to find something regarding the SDK and those
looking for general programming answers. The result ... they repost the
question.

Recently, the SDK newsgroup (and to a ceetain extent this applies to the
Bots newsgroup too) seems be becoming a "general programming" forum where
the subjects are *very* loosely related to the SDK because people are
writing bots when they have the question. In my view ... these questions
would be best suited to a separate newsgroup.

I agree that it takes time for people to realise which newsgroup should be
posted to when it comes to certain types of question ... and, unfortunately,
true success could only be achieved with someone permanently mediating the
newsgroups, managing the posts (which we don't have here). But I feel that
the benefit of all would be served better by separating the general
programming questions from those related directly to the use of the SDK.

Grims


[View Quote]

VB: Storing Values in INI Files

May 19, 2001, 1:47pm
Get/SetPrivateProfileString and Get/SetPrivateProfileInt aren't exactly
difficult to use.

Personally, I'd tend to go the direct route rather than add another layer
into the application which is only going to call these API functions anyway.
Reduces the number of components out of your control too.

Just a thought.

Grims

[View Quote]

VB: Storing Values in INI Files

May 20, 2001, 12:23pm
Get/SetPrivateProfileString and Get/SetPrivateProfileInt aren't for sharing
data in the registry. They're for private settings.

You should use Get/SetProfileString and Get/SetProfileInt for that. :o)

Grims




[View Quote]

How do you code advanced whispers?

May 18, 2001, 7:15pm
AwWhisper takes the SESSION number of the avatar and not its name. Its there
in black and purple-ish (sorry, I'm color blind when it comes to those
colours) in the Activeworlds SDK documentation! ...
http://www.activeworlds.com/sdk/aw_whisper.htm.

The session number is a Long, and the avatar name is a String, hence the
type mismatch. That error means there's something very simple wrong with
your code ... you're assigning a value to a variable or passing to a
function a value of the WRONG TYPE. What it doesn't mean is for you to wimp
out and post in the newsgroup.

I believe brant's classes allow you to do what you want ... it appears to
say so on his web-site ... passing the name instead of the session number
through the Avatar class.

Grims.

[View Quote]

How do you code advanced whispers?

May 18, 2001, 7:17pm
Only if he stored the session number in the list entry's item data in the
first place.

Grims

[View Quote]

How do you code advanced whispers?

May 18, 2001, 9:18pm
Here.... take this. Here's what you want ... a basic application to
add/remove avatars from a list box when they arrive/leave. Note the use of
the ItemData property (a Long where we put the session number) and not the
List property (a String containing the avatar's name).

Double click the avatar's name to whisper a message to him/her. Read the
code and adapt it to whatever you are trying to do. The code isn't the best
in the world, but it was knocked up in 15 minutes!

Giving people the answer .... geesh! No-one will ever learn for themselves
and fully understand this way!

Grims.



[View Quote]
begin 666 Basic Avatars ListBox Example.zip
M4$L#!!0````(`'T!LRI>MQE4W 8``,P8```I````0F%S:6, at 079A=&%R<R!,
M:7-T0F]X($5X86UP;&4O9G)M36%I;BYF<FV]6&UO(C<0_AXI_\':DQ(B)8C7
MY*(J'Q;8ZZ$0H$!"<E6%##AAFV6]W36!J.I_[]C>%WO97=*[MI:2 at .?%\\R,
M9\9YL$;C[J"/FN5*Y?AH,/^=+!BZ0<:?U_6K]J59JU]\^=QL7E2KG<;%=:55
MNZA4FI66V6 at TKNK67Y^JY<JGBO$3,LSIN',[:#_6R_#+.#YJD1?;10^M\A?J
MK]&SO[[#\/WX""'4QAZSJ8NB=0,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%Z8?LX1\HV// 8'V#C<21N0G?!
M"_\7F at &O11G)3[S]1[I.8!B VAQO17I at _U<Q)HCL&K5[E+[>>Z50[(S3?S/.
MT=M\<#MPG7?(##Z)^H1M?!<\"*\2P6KLP?P;4$L#!!0````(`'T!LRI3`*X!
MOP$``*T"```L````0F%S:6, at 079A=&%R<R!,:7-T0F]X($5X86UP;&4O079A
M=&%R3&ES="YV8G!54DV/FS 0O4?B/T1P:2LE<H#L1RL.!$*+F at 2TI$DKY6) at
MV/46V\B8;+:K_>^U at 6Y;#F;F/0\S[PW[YP:\]06,2<0%]2I!MYBPN7H;DSNH
M0 `KP/MP^OR"$+*1ZZ"9"L8C^!,-CWOU:MES9"$K^' at ZQKLP.6:G[$>V7V]/
MF2R3&NRYK',KV:RG?B<YQ9)P9DR2_!$*Z;W<.M?!E6\[L^AFN9PM%J$[NT4K
M6W58HI7ONNZULWZU%KK#IZE_S,*O2?#=F:O#F,0%9[T"<Y1 at &I-,8B&[YE\H
MX)1B5CJV9ZILAREXIG_&ZN*&M%)!7Z!N`LXD7&0<>B8::AHU:5[#EI<P8%O\
MR,4!A+=0,6%#C+1E9](J46.J5<:L$$"!R1'+0)Q!9%W3<"$C4D.K447JNKX7
M>QX&.W)1EUQ=GFX()1+*<1A2]\;M]>I4:=)(1?_Z#XOPF8M4-24=305_)^E[
M#0=*P(' 4PAY=Q^SBFMPQ_V:X):P>YVM>,?*-GB XF?_<=6^JOG3&Q#5*2=,
M_LW#^/"6?&-"ET,9I;U4O8#>M)[#4H(F!Z.DVL at 0[Q\$X#(%,?X(2/M[V74T
M5U UL*UV^C=02P,$% ```` at ` at at &S*BF,MN<P````-0```"P```!"87-I8R!!
M=F%T87)S($QI<W1";W at at 17AA;7!L92]!=F%T87),:7-T+G9B=TLKRO5-S,Q3
ML%4P-#324;"TT%&P,#;343 Q-=11<-91,#*"8',3H*"QN2E0D)<+`%!+`P0*
M``````!CO[(J````````````````' at ```$)A<VEC($%V871A<G, at 3&ES=$)O
M>"!%>&%M<&QE+U!+`0(4`!0````(`'T!LRI>MQE4W 8``,P8```I````````
M``$`( "V at 0````!"87-I8R!!=F%T87)S($QI<W1";W at at 17AA;7!L92]F<FU-
M86EN+F9R;5!+`0(4`!0````(`'T!LRI3`*X!OP$``*T"```L``````````$`
M( "V at 2,'``!"87-I8R!!=F%T87)S($QI<W1";W at at 17AA;7!L92]!=F%T87),
M:7-T+G9B<%!+`0(4`!0````(`((!LRHIC+;G, ```#4````L``````````$`
M( "V at 2P)``!"87-I8R!!=F%T87)S($QI<W1";W at at 17AA;7!L92]!=F%T87),
M:7-T+G9B=U!+`0(4``H``````&._LBH````````````````>````````````
M$ #_0:8)``!"87-I8R!!=F%T87)S($QI<W1";W at at 17AA;7!L92]02P4&````
/``0`! !7`0``X at D`````
`
end

AW_CALLBACK_ADDRESS/Getting the last visible line in a text/richtext box

May 23, 2001, 2:53pm
That's exactly right, to my knowledge. The top line is used by windows as
the key for painting the edit box itself. I don't think M$ beleive in doing
too much work for you when you're interfacing with windows.

So ... working out the size of the font and calculating the last visible
line is the way to do it. Heh heh ... not try it with a rich text box with
different fonts. :o).

Grims


[View Quote]

Find in Bankbots

May 23, 2001, 9:18pm
Ack! Data controls (I hate them myself, but that's just a personal vendetta
against the horrid things ;o) ).

The data control cannot resolve 'sdk.awAvatarName' into what you expect
because you are providing it as a literal (between the quotes), so it is
looking for the text "sdk.awAvatarName" in the field Both, rather than the
result of the expression. You need to build the string yourself, something
like this:

Data1.Recordset.FindFirst "Both = '" & sdk.awAvatarName & "'"

Then the VALUE AwAvatarName property is added between the two literals "Both
= '" and "'" forming

"Both = 'SnagglePuss'".

Grims.

[View Quote]

Find in Bankbots

May 24, 2001, 9:09pm
The MS Jet database engine that data controls, QueryDefs, Recordsets, etc.
use is the same database engine that drives MS Access. Its just another way
to utilise MDB files.

Grims


[View Quote]

okay this has to be me being stupid I guess:)

May 25, 2001, 12:52pm
WHO exactly would see it? I checked the newsgroup for a few days before I
went away, and no-one ever posted there!

Grims


[View Quote]

okay this has to be me being stupid I guess:)

May 25, 2001, 10:08pm
Well ...

Firstly, considering its an issue when calling AwWait .... I reckon the SDK
newsgroup is the IDEAL place to raise the question.

Secondly, I'm *try*ing to see your point.

Grims.


[View Quote]

okay this has to be me being stupid I guess:)

May 26, 2001, 1:55pm
GRRRR. Yep ... but that's not the issue here. And besides, the last two
times I tried to check the news server its not there!! Hence, I don't even
bother checking anymore. *shrug*



[View Quote]

VB: Getting someones Co-ords...

May 29, 2001, 7:57pm
If you check out Brants's code that he made public a little while ago, you
will hopefully see what TrekerX is talking about. Even if you do not want to
use the actual code, it will show you one way to manage a session table.

As has been said, you add the session information when you get the Avatar
Add event, locate and change the stored attributes of the session when you
get an Avatar Change event and discad the information when you get the
Avatar Delete event.

The original post in this news group was
news:3b003724$1 at server1.Activeworlds.com. If that link doesn't work for you,
the post was on 14th May 2001 (not too far to look down the list really, is
it??), entitled "Free source code and classes".

The rest is just Visual Basic code which hopefully you can deal with on your
own. I haven't used brant's source code, but according to the above post, it
allows you to (and I quote) "Keep a session list with three lines of code".

Grims.


[View Quote]

VB: Getting someones Co-ords...

May 29, 2001, 8:17pm
Awww Geesh, I don't believe it !!!

I've just seen that you even responded to brant's post 4 days later, so you
already know about this.

I rest my case with respect to all my previous comments about people who
can't be bothered to learn off their own backs!



[View Quote]

Using a MDI Child in a bot

May 29, 2001, 11:58pm
The events your're not picking up makes it sound like you're not announcing
the bot's location ... you sure you're doing that (the AwStateChange). The
world attributes is triggered by the AwEnter and the other events (assuming
you have them installed) only happen when you've got a visible avatar.

Any more info??

Grims


[View Quote]

Using a MDI Child in a bot

May 30, 2001, 11:27am
Yep ... each form has a property caled "MDI Child" or something like that
(Boolean value).


[View Quote]

MS Source Code

Jul 5, 2001, 5:13pm
LOL .... you're joking right?

Grims.

[View Quote]

A nice simple INI Module!!!

Jul 9, 2001, 11:21pm
You MUST preallocate space to the string as the API is simply copying over
memory it assumes to exist - as in C. The * 50 or whatever if defining a
pre-allocated fixed length string. Win2000 will blow VB to bits if you try
making the call without preallocating the space in the string.

The number after the "*" is the length of the string (50 characters in this
case). The buffer size is therfore the size of this string. If you DON'T
preallocated the string, then its length will be left over from the last
time you used it.

http://support.microsoft.com/support/kb/articles/Q75/6/39.asp explains it
but they prefill the string with spaces instead.

Grims


[View Quote]

WHo here dosnt liek Lanezeri?

Aug 2, 2001, 9:04pm
Well I have the offensive know-it-all idiot filtered, and until this post
had almost forgotten about him - a policy that WAS working quite nicely.
GRRRR!!

[View Quote]

Zeebot

Aug 28, 2001, 7:38pm
Anyone going to say anything useful on this thread rather than this personal
slanging match? Preferably something to do with bots or the SDK perhaps
considering half of it is getting cross posted between the Bots and SDK
newsgroups.

Children!

[View Quote]

Passing a Variable to a url

Aug 8, 2001, 10:42pm
Is anyone following this thread, because its confusing the hell out of me!!

If you are sending the URL from bot then the bot needs to understand the
variables. Build the staring in the bot code and the use aw_url_send.

If the URL is linked from another page, then where does the bot fit in?

If you are looking for hidden/visible form values are preset in a web-page,
use a combination of a variable (as faber suggested) as the trigger for the
ASP to prefill the values.

Am I missing the point here?

Grims.

[View Quote]

Passing a Variable to a url

Aug 9, 2001, 4:28pm
I still don't see the problem. One aw_url_send preceeded by a bit of string
building.

In MSVC++ its something like this - I only typed it directly into OE cuz I
don't have time right now to try it out, but you should get the drift ...

int SendParmURL(int urlSession, CString urlParm)
{
CStirng targetURL;


targetURL.Format("www.somehost.somedomain/somepage.asp?somevariable=%s",
urlParm);
return aw_url_send(urlSession, targetURL, NULL);
}

Then just pass the target session and the string parm to the function
SendParmURL.

SendParmURL(avatarSession, "Grimble")

For integer values, urlParm is an int and use %d instead of %s in the Format
expression.

etc., etc., etc.

Is this what you need to do?

Grims



[View Quote]

Passing a Variable to a url

Aug 10, 2001, 12:46pm
OK ... PLEASE clear this up for me.

Are there 440 different variables VALUES (citnum=1, citnum=2 or citnum=3,
etc.) or 440 different VARIABLES
(citnum=1&citname="AWUser"&avX=-2436&avY=4657?... etc.)? I can't imagine
that there are 440 different peices of information that you would want to
pass to a CGI or ASP script to generate a single page (ARE there over 400 AW
attributes?). If there you do need to pass this amount of information
(yikes), I can see two other options over and above the file option JerMe
suggested.:

(a) Get the web script to do something a bit more interesting - having a set
of URLs that define a conversation between the bot itself and the web-server
via CGI/ASP scripts before sending the url with some generated key to allow
the script to retrieve the information. Much more fun to do and you can do
some HTTP/HTML decoding stuff too in your bot.

(b) Pack the data into a smaller number of large variable values, delimited
by some innocuous character that won't be in any of the values (i.e. "~").

I'm not too keen on using files for temporary storage in asynchronous
environments because of the timing involved. If the url is triggered by an
avatar event (clicking, entering an area or world, etc.), there is every
possibility that the avatar could do it again and again and again in quick
succession. Also, there could be 10 people all there doing the same thing
and you're going to get a very confused script. Calls to ASP scripts are
session-based so its a one-request-one-response conversation unless you
either build some persistence on the web side (servlets, etc.) or make some
conversation model.

If you only want to pass one of the variables in any one call, the string
building routines can handle that in the same way in the same way as the
values. All this is pointless though if you just have 440 different values
to the same variable.

Grims



[View Quote]

Passing a Variable to a url

Aug 10, 2001, 6:31pm
You only need to do that if its a buffer for returning a value from the
call - such as in GetPrivaterofileString ... CString has a cast for it if
its one-way.

What should be pointed out, however, is that CString is an MFC class and may
not be port to other C++ compilers.

Grims.

[View Quote]

Question

Aug 16, 2001, 2:55pm
Take at leat one thing from TheDerek's code .... the use of FreeFile.

FreeFile allocates the next available (i.e. unused) file number. Worth
remembering if you're ever going to have multiple files open at the same
time, especially if its in event driven code and therefore asynchronous. You
can't have two files open as #1 at the same time.

Just a good habit to get into.

Grims.


[View Quote]

1  2  3  4  5  6  ...  28  |  
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