Регистрация | Вход
TextBegin(user_text$) While TextReadWord() AddToKnowledgeWord(g_text_word); Wend SeedRnd(MilliSecs()); txt$="" w$="" words_num=Rand(1,4); For i=1 To words_num.a2 word=knowledge(Rand(1, MAX_WORDS-1)) txt$=txt+word+" "; prev_w=word Next ai_re_prev=txt TextBegin(txt) While TextReadWord() AddToKnowledgeWord(g_text_word) Wend AddToChat(name+"- "+txt)
Global g_text_pos = 0;Global g_text$;Global g_text_word$;Function TextBegin(text_$) g_text=text_ g_text_pos = 1 g_text_word=""End Function Function TextReadWord() g_text_word ="" If (g_text_pos > Len(g_text))Return 0; While (Mid(g_text,g_text_pos,1) = " ") : g_text_pos=g_text_pos+1 : Wend While (Mid(g_text,g_text_pos,1) <> " " And g_text_pos<=Len(g_text)) g_text_word =g_text_word+ Mid(g_text,g_text_pos,1); g_text_pos=g_text_pos+1 Wend g_text_pos=g_text_pos+1; Return 1;End Function