04.04.2010, 19:34
Hi, I need help with reading files made by dini, I have made the file with dini and I get it to save everything that someone says on IRC to a file
that basically makes the file AWords.ini and acts like a second log but what im trying to do is to read any random sentence from this file
this is the function that reads from AWords.ini then says it back on irc, but it only ever says the very LAST word said.
So i am wondering if it is possible to read any random line in the AWords.ini and then get the bot to say it back
Код:
dini_Create("AWords.ini"); // creates AWords.ini format(temp, sizeof(temp), "\n%s", message); //Saves messages on new lines dini_Set("AWords.ini", message, temp2); //Stores the message with new strings
this is the function that reads from AWords.ini then says it back on irc, but it only ever says the very LAST word said.
Код:
forward Botread(conn, channel[], user[], params[]); public Botread(conn, channel[], user[], params[]) { new string[128]; dini_Get("AWords.ini",temp); format(string, sizeof(string), "%s", temp); printf("%s", string); SetTimer("Bobread", randomEx(300000, 600000), false); return 1; }