ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
(Newbie) - How to use an object's name in an object search? (Bots)
(Newbie) - How to use an object's name in an object search? // Botsthe architectMay 27, 2003, 2:35pm
Hey there. My name is Chris, and I have just started playing around
with writing bots. I am using AX Logic's Java implementation (http://www.axlogic.com/aw/). Is there any way (short of String parsing with the action field) to use an object's name in an object search? If not, I think that splitting out the name into a new field would be a good idea for a future release. Otherwise, how do you search for a specific object among several using the same model? Use coordinates? I would think name would be the most logical way. Anyway, thanks for listening to the ramblings of a newbie. I hope to learn enough to contribute at some point, instead of just ask questions. - Chris strike rapierMay 27, 2003, 3:14pm
What Langauge?
Its quite simple.. but better suited for the SDK NG... You get the action command and parse it first by ';' into tokens. Sleepy had the best idea... static char Tokens[AW_MAX_ATTRIBUTE_LENGTH][AW_MAX_ATTRIBUTE_LENGTH]; Once you have done that you then do a loop, and tokenize each token within that to ',' You can then loop though each 1 and use stricmp on the first 5 bytes of it to see if its 'name ' and the token is the name, then its just a matter of strlen(Tokens[iInternalToken])-5 Hope that helps, its the only way to do it really. - Mark [View Quote] milestegMay 27, 2003, 7:48pm
Hi Chris,
There's no integrated search engine in the aw sdk, You will need to query the world and parse the action field yourself. Remember that the scripting function 'name' allow several objects to use the same name :) Regards, MilesTeg "the architect" <user at domain.invalid> a écrit dans le message de news: 3ed393c9$2 at server1.Activeworlds.com... > Hey there. My name is Chris, and I have just started playing around > with writing bots. I am using AX Logic's Java implementation > (http://www.axlogic.com/aw/). > > Is there any way (short of String parsing with the action field) to use > an object's name in an object search? > > If not, I think that splitting out the name into a new field would be a > good idea for a future release. Otherwise, how do you search for a > specific object among several using the same model? Use coordinates? I > would think name would be the most logical way. > > Anyway, thanks for listening to the ramblings of a newbie. I hope to > learn enough to contribute at some point, instead of just ask questions. > > - Chris > |