Thread

Detecting a Object Click, and Verafying it. (Sdk)

Detecting a Object Click, and Verafying it. // Sdk

1  |  

trekkerx

May 15, 2001, 10:54pm
Ive been working on a bot for my rpg. And it dose query the world, and
can sence if you click an object. I cant get it to if you click an
object with a action that says something to get it to work. I have
this...

If sdk.AwObjectAction = "create sign, name click1" Then
sdk.AwSay "You clicked a sign!"
End If

I think that how it works. Im not shure, I would apperciate anyhelp.

m a k a v e l i

May 15, 2001, 11:30pm
If I am not mistaken it goes one of these two ways:

(This may be what you had, I may have miscomprehended it.


Private Sub sdk_EventObjectClick()
If sdk.AwObjectAction = "whatever" Then
<code>
End If
End Sub

Or

(May be WAY off)
Private Sub sdk_EventCellObject()
If sdk.AwObjectClick = True Then
If sdk.AwObjectAction = "whatever" Then
End If
End If
End Sub


[View Quote]

billybob

May 15, 2001, 11:50pm
Anwser: well the sdk_object_click event does not give the AwObjectAction
back, it only gives AW_AVATAR_SESSION
AW_AVATAR_NAME
AW_CELL_X
AW_CELL_Z
AW_OBJECT_NUMBER

so u would have to search through a list of objects u queried for that
object(by object number) and then use that to get the action.

grimble

May 16, 2001, 1:54am
This might be off the point, I'm not sure exacly what you're asking,
TrekkerX.

The last time I played with bots picking up object clicks (wasn't that long
ago, but before build 375 was out), I found that the aw_event_object_click
event DOESN'T get fired if the object has an ACTIVATE command in the action
text (which was a real bummer at the time!).

That's what I thought you meant from the first part of your post, but the
second part just threw me.

Grims



[View Quote]

grimble

May 16, 2001, 2:08am
You know how you keep arrogantly harping on about people reading the help
files .... ???

You are a very misleading individual, Makaveli. The first "snippet" you
included is basically what TrekkerX posted and the second one it total (and
I mean TOTAL) crap! It doesn't help people!!

You don't have to respond to every post just because its there. Just post
where you have something of value to add and try to make sure its not total
garbage!

Grims.


[View Quote]

m a k a v e l i

May 16, 2001, 6:04pm
He read the help files, or else he wouldn't have a clue how to query now
would he? And if you would open your eyes and read I said "(This may be
what you had, I may have miscomprehended it.)". I also said this in the
second one "(May be WAY off)". I tried to help, I did not, what is your
point?

[View Quote]

grimble

May 16, 2001, 7:14pm
So what was the POINT of posting it? Wrong information is worse than no
information!

The second "snippet" shows that YOU don't understand property
surveys/queries so why did you feel the need to make it up? I mean ... If
AwObjectClick = TRUE?? C'mon! You invented that! ... and in an
EventCellObject too?

What you COULD have done is to NOT follow your compulsion to add to every
single thread and waitied for someone else to post something useful to it.
Then you learn too. Easy huh?.

Grims


[View Quote]

m a k a v e l i

May 16, 2001, 9:06pm
I don't use them so why should I know how to use them?


[View Quote]

agent1 agent1

May 16, 2001, 9:32pm
Then don't try to explian how "they" work to others...

-Agent1

[View Quote]

m a k a v e l i

May 17, 2001, 12:10am
I was making an educated guess, it never hurts to try.

[View Quote]

moria

May 17, 2001, 4:48am
why don't you get a book, learn how to program in VB and then and only then
get the sdk and try to program a bot. I think thats the advice you prefer
people to use.

Until then, stop trying to HELP others with misleading information and
incorrect guesswork, and possibly cause others grief and unnecessary work
trying to get your guesswork to work.

Why not just shut up, watch the replies from those that do know and learn.

Idiot.

Moria


[View Quote]

grimble

May 17, 2001, 6:55am
This is daft! Makaveli, how would you feel if your teacher at kindergarten
told you that WW2 ran from 1867 to 1872 because he/she wasn't sure and
decided to have a guess? What he/she would really do is either look it up
and tell you the right information OR NOT TELL YOU ANYTHING AT ALL.

.... and I'd like to understand your definition of "educated" too. Try just
posting when you know the answer, eh?

Grims


[View Quote]

grimble

May 17, 2001, 6:59am
ROFLMAO .... There's not really an answer to that (that hasn't already been
put forward).

Grims


[View Quote]

m a k a v e l i

May 17, 2001, 6:05pm
Get a book? I had a book before I even had the program. I have made 2
bots, which are flawless so far, I think you need to learn something about
what I do before you try to tell me I don't know how to use it.

[View Quote]

moria

May 17, 2001, 6:35pm
actually it was you that said you didn't know how to use it.

Moria


[View Quote]

agent1 agent1

May 17, 2001, 6:56pm
I seem to recall discovering a problem with your bank bot and negative amounts...

-Agent1

[View Quote]

m a k a v e l i

May 17, 2001, 8:49pm
Debugging is such a wonderful thing, I have fixed all problems with it, no
one has found a bug in it since. I am adding features therefore it is not
logged in most of the time.

[View Quote]

grimble

May 17, 2001, 9:13pm
Gimme gimme gimme !!!

[View Quote]

trekkerx

May 17, 2001, 9:41pm
So is there anygood way to do it without having to find out the Object
number?

[View Quote] > Anwser: well the sdk_object_click event does not give the AwObjectAction
> back, it only gives AW_AVATAR_SESSION
> AW_AVATAR_NAME
> AW_CELL_X
> AW_CELL_Z
> AW_OBJECT_NUMBER
>
> so u would have to search through a list of objects u queried for that
> object(by object number) and then use that to get the action.

grimble

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]

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2022. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn