ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
aw_wait modification (Sdk)
aw_wait modification // SdkjeanphiNov 8, 1998, 2:54pm
Hello,
I wrote a bot program that is supposed to shutdown himself when a specific avatar tells him 'bot14 close'. But it seems that because the aw_wait function is still active during this time my prgram bugs ! I was thinking about maybe Roland could implement a function that stops waiting, or is there another way to face my problem ? thank you edward sumerfieldNov 8, 1998, 4:55pm
You can set flags in your callback functions that are checked in the main
program loop. bool finish = 0; main() { while (aw_wait(1000)) { if (finish == 1) break; } } void chat_callback() { if (chat message == "quit") finish = 1; } Make sure that the finish flag is global or at least addressable by both functions. Edward Sumerfield. [View Quote] > Hello, > > I wrote a bot program that is supposed to shutdown himself when a specific > avatar tells him 'bot14 close'. > > But it seems that because the aw_wait function is still active during this > time my prgram bugs ! > > I was thinking about maybe Roland could implement a function that stops > waiting, or is there another way to face my problem ? > > thank you |