Shoutbox

[req] User command script - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [req] User command script (/showthread.php?tid=74862)

[req] User command script by Gosan on 05-30-2007 at 02:12 PM

Hi all! Im looking for just the shell of a script that will allow users to type a command and respond automatically with a text from a book.

Having worked a little on irc bots, i understand i will have to post each sentance of the chapters up myself etc. all im looking for is the coding.

For example:

User A types: Q 1:1-3

I auto respond with:

Chapter 1: Name
Verse 1: osithoeish
Verse 2: oawithawoith
Verse 3: oawiah

Sorry if this has already been requested before, but ive had a snoop around and couldnt find anything. THanks in advance!


RE: [req] User command script by Volv on 05-30-2007 at 02:25 PM

Reproducing content from books without explicit authorisation from the owner is a breach of copyright and can have very significant consequences, so I hope that you do indeed have permission to do so.


RE: [req] User command script by Gosan on 05-30-2007 at 02:35 PM

its a religious book that has no copywrite on it so dont worry about that. Its solely for my msn list rather than a global script release or anything like that. Thats why im solely requesting the coding only , and ill do the rest myself.

Edit: I was reading on patchous website the following:


// Reads the full contents of a text file to a variable
function ReadFile (file) {
  var fileObj = fsObj.OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, 1);
  var contents = fileObj.ReadAll();
  fileObj.Close();
  return contents;
}

//Read line at position X from a text file. To read the second line of the file, use ReadLineFromFile('test.txt', 1); (the first line corresponds to index 0)
function ReadLineFromFile (file, line) {
  var fileObj = fsObj.OpenTextFile(MsgPlus.ScriptFilesPath + '\\' + file, 1);
  var lineResult = fileObj.ReadAll();
  lineResult = lineResult.split('\r\n');
  fileObj.Close();
  return lineResult[line];
}


- using this - how would i make it so that if another user requested a line it would return the line to them, instead of just me typing the command?