Thread

removing cits when leaving area (Bots)

removing cits when leaving area // Bots

1  |  

swe

Oct 23, 2001, 5:18pm
Hey,i was wondering if anyone could help me with this question. Im new to
bot programing(well just accully took a intrest in it) so dont go dissing
me:

k,well on my bot,i put a list,with the names of all the people who are in
the area,i could get the list of names to show,but i cant get the names
removed when someone leaves. I tried putting
Private Sub sdk_EventAvatarDelete()
List1.RemoveItem sdk.AwAvatarName
End Sub

but that dont seem to work,error is caused evertime someone leaves, so can
anyone tell me the right way of doing this?

Thanks
SWE(327320)

lanezeri

Oct 23, 2001, 5:22pm
Private Sub sdk_EventAvatarDelete()
List1.Text = sdk.AwAvatarName
List1.RemoveItem List1.ListIndex
End Sub


--

Lanezeri
Degtur Solutions
http://www.degtur.com
Stuff-X
http://aw.stuff-x.com


[View Quote]

swe

Oct 23, 2001, 5:37pm
One last question, im tring to get it so that u type ur citnum and ppw and
the world and all in text things i put th following code in the top:
Private Const CitizenNumber = citnum.text

but i get a error says "Compile error:
Constand expression required

Oh and thanks for the help in the first one lanezeri
[View Quote]

agent1

Oct 23, 2001, 7:13pm
I'm not sure about VB, but maybe citnum.text isn't a constant, so it can't be put into a constant value. I'm not sure.

-Agent1

[View Quote]

lanezeri

Oct 23, 2001, 8:41pm
SWE one thing you will ALWAYS want to do is name your controls correctly..

citnum.text is a bad way to name a textbox, what if you have a constant of
citnum?

Textboxes = txtText
Labels = lblLabel
Frames = fraFrame

There are too many to list, but it's something to do.. if you make the name
txtCitNum it may relieve you of the error..

--

Lanezeri
Degtur Solutions
http://www.degtur.com
Stuff-X
http://aw.stuff-x.com


[View Quote]

ox64

Oct 23, 2001, 11:28pm
What was the exact error message and/or error number you received when it
attempted to execute the line?

Ox64

[View Quote]

ox64

Oct 23, 2001, 11:33pm
Ignore my post....I did not see the replies from other people to your post
when I submitted this. Either I was blind or my news program was behind on
the times :-)

[View Quote]

baron

Oct 24, 2001, 2:02am
I am sure you are right:)
You have to understand the difference of constants and variables swe. When you declare a constant you set its value in design time e.g. Private Const CitizenNumber = 327320.
If you want the citnum to be user defined, to be changed in runtime, then it can't be a constant, it has to be a variable
for example:
Dim CitNum as Long
CitNum=Val(citnum.Text)

Baron


[View Quote]

swe

Oct 24, 2001, 10:12am
Well thanx everyone for ur help :) but Cozmo showed me how its done
yesterday :)

SWE(327320)
[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