Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=================================================
- (* show random english words *)
- procedure RandomEnglishProc;
- var EnglishWord : array[1..10] of integer;
- Dictionary : TStringList;
- i,k,z : integer;
- j : string;
- begin
- //==========
- if Form1.RandomEnglish.Checked = True then
- begin
- i := 0;
- k := 0;
- j := '';
- if FileExists(ChosenDictionary) then
- begin
- Dictionary := TStringList.Create;
- Dictionary.LoadFromFile(ChosenDictionary);
- //==========
- for z := 1 to 5 do
- if AnsiStartsStr(Form1.Nickname.Text+endchar[z]+' words',SpokenText) then
- begin
- i := Random(6) + 1; // generate the number of words up to 6 and make sure it is always more then 1 word
- for k := 1 to i do
- begin
- EnglishWord[k] := Random(Dictionary.Count)+1;
- j := j + Dictionary[EnglishWord[k]]+' ';
- end;
- Form1.Telnet.SendMessage('PRIVMSG '+Form1.Channel.Text+' :'+j+#10#13);
- Form1.Memo1.Lines.Add('['+TimeToStr(now)+'] '+Form1.Nickname.Text+': '+j);
- FunCounter.RandomCount := FunCounter.RandomCount + 1;
- Form4.Label14.Caption := 'Random sentances: '+IntToStr(FunCounter.RandomCount);
- end
- else Exit;
- //==========
- end
- else ShowMessage('File '+ExtractFileName(ChosenDictionary)+' does not exist in '+ExtractFilePath(ChosenDictionary)+' or is renamed.'+#10#13+
- 'It must be in the same folder and named so. It is Case Insensitive');
- end;
- end;
- //=================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement