What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Help with code

Pages: (4): « First « 1 [ 2 ] 3 4 » Last »
Help with code
Author: Message:
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: Help with code
That;s what I meant with the last sentence

LOL works too well: I'm signed in on 2 accounts, I send "hello" to myself and the script keeps responding :P Don't try this at home :P

Updated code:
[see last post]

This post was edited on 11-08-2008 at 08:08 PM by SmokingCookie.
11-06-2008 08:16 PM
Profile PM Find Quote Report
Jonte135
Junior Member
**


Posts: 57
– / – / Flag
Joined: Aug 2007
O.P. RE: Help with code
It seems to work, is there anyway to put that code into functions so I can easily do the same thing over and over but with a different text file? And how does
quote:
/* devide by number of lines */
work? :s
11-06-2008 08:53 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: Help with code
Yes you can:

jscript code:
function myFunc /* Function's name */ (Argument /* I believe no. of arguments is unlimited. Can be anything */ ) {
      Debug.Trace("Hello World!");
      Debug.Trace("  The argument was: " + Argument);
}

function OnEvent_Initialize(bMgStart) {
      myFunc("HI there!");
}

Now I can imagine you'd want to use the current user's email as file name right?


This post was edited on 11-08-2008 at 08:05 PM by SmokingCookie.
11-06-2008 08:59 PM
Profile PM Find Quote Report
Jonte135
Junior Member
**


Posts: 57
– / – / Flag
Joined: Aug 2007
O.P. RE: Help with code
Thanks :) I will reply if I have some other problems later :)
11-06-2008 09:02 PM
Profile E-Mail PM Find Quote Report
Jonte135
Junior Member
**


Posts: 57
– / – / Flag
Joined: Aug 2007
O.P. RE: Help with code
Found a problem, if someone says like "oh hi" it doesn't respond. I want it to react if it's in a sentence too :)
11-07-2008 04:04 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: Help with code
Then you should put "oh hi" in the list as well, as the script can not think like "this sentence is a greeting, but the other one is not". I'm sorry..
11-07-2008 05:27 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Help with code
I don't understand some of your logic. Why would you read the entire file then seperate it by line when you can do this

jscript code:
function ReadFile(File) {
    var oLineArray = new Array();
    var oFile = FileSys.OpenTextFile(File, 1 /* ForReading */, false);
    while (!oFile.AtEndOfStream) oLineArray.push(oFile.ReadLine());
    return oLineArray;
}
11-07-2008 06:52 PM
Profile E-Mail PM Find Quote Report
Jonte135
Junior Member
**


Posts: 57
– / – / Flag
Joined: Aug 2007
O.P. RE: RE: Help with code
quote:
Originally posted by SmokingCookie
Then you should put "oh hi" in the list as well, as the script can not think like "this sentence is a greeting, but the other one is not". I'm sorry..
I mean that the code itself will look if there is, for example, hi in something that it receives. So "hi" is the same for the code as "bla bla bla bla bla hi bla bla bla bla" because it looks for "hi".

EDIT: It also has some kind of delay when I talk to my bot (:P). But then when, because I have the same script, it goes on it answers immediately. I want it to do immediately all the time.

This post was edited on 11-08-2008 at 01:06 AM by Jonte135.
11-07-2008 11:53 PM
Profile E-Mail PM Find Quote Report
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
RE: Help with code
I'm afraid the computers do not yet allow to do it all in a split-second: they're not fast enough to check if a file exists, read (or create) it, create an array of text, close the file again, check for matches and return a random number, rounded and between 0 and the length of the array. That's a lot.

Second: if I let the script respond to "bla bla bla bla bla hi bla bla bla bla", it'll also respond to "hightlight", "high" and such.
11-08-2008 02:40 PM
Profile PM Find Quote Report
Jonte135
Junior Member
**


Posts: 57
– / – / Flag
Joined: Aug 2007
O.P. RE: Help with code
How does other scripts do then? Some downloadable scripts have so it answers immediately. And also isn't it possible to separate words like it will only respond to "hi" as in " hi "?
11-08-2008 07:30 PM
Profile E-Mail PM Find Quote Report
Pages: (4): « First « 1 [ 2 ] 3 4 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On