Help with code - 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: Help with code (/showthread.php?tid=87079) Help with code by Jonte135 on 11-04-2008 at 07:38 PM
Me, with help of my friend, made this code (mainly my friend ) and I want it to react on words that I have in a file. The problem is that it responds to anything now. In the file I have: quote: My friend also told me that I should but the code in functions, I know what functions are and how they work but I don't really understand how I should do it. Help please? jscript code: RE: Help with code by SmokingCookie on 11-04-2008 at 07:43 PM
First, why do you use the long path in OpenTextFile(), while you can also use MsgPlus.ScriptFilesPath + "\\text.txt"? RE: Help with code by Jonte135 on 11-05-2008 at 06:33 PM It works, just now when someone says anything it replies RE: Help with code by SmokingCookie on 11-05-2008 at 06:50 PM
Sorry for prev. post, forgot to read RE: Help with code by roflmao456 on 11-05-2008 at 06:57 PM
iirc, activexobjects aren't recommended to be defined as a global variable jscript code: RE: Help with code by Jonte135 on 11-05-2008 at 07:00 PM Now it doesn't work at all RE: Help with code by SmokingCookie on 11-05-2008 at 07:30 PM
Got it! RE: Help with code by Jonte135 on 11-06-2008 at 07:20 PM Now it only does it once, if I don't close the window, I want it to reply everytime RE: Help with code by SmokingCookie on 11-06-2008 at 07:42 PM Post updated RE: Help with code by Jonte135 on 11-06-2008 at 07:49 PM It worked most of the time, but when the friend that tested it said this: quote:it responded It shouldn't do that Now it doesn't respond at all RE: Help with code by SmokingCookie on 11-06-2008 at 08:16 PM
That;s what I meant with the last sentence RE: Help with code by Jonte135 on 11-06-2008 at 08:53 PM 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:work? RE: Help with code by SmokingCookie on 11-06-2008 at 08:59 PM
Yes you can: jscript code: Now I can imagine you'd want to use the current user's email as file name right? RE: Help with code by Jonte135 on 11-06-2008 at 09:02 PM Thanks I will reply if I have some other problems later RE: Help with code by Jonte135 on 11-07-2008 at 04:04 PM 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 RE: Help with code by SmokingCookie on 11-07-2008 at 05:27 PM 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.. RE: Help with code by matty on 11-07-2008 at 06:52 PM
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: RE: RE: Help with code by Jonte135 on 11-07-2008 at 11:53 PM
quote: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 (). But then when, because I have the same script, it goes on it answers immediately. I want it to do immediately all the time. RE: Help with code by SmokingCookie on 11-08-2008 at 02:40 PM
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. RE: Help with code by Jonte135 on 11-08-2008 at 07:30 PM 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 "? RE: Help with code by SmokingCookie on 11-08-2008 at 07:51 PM
Because they load the file on startup, so you can not add any words to the file during runtime. RE: Help with code by Jonte135 on 11-08-2008 at 07:56 PM
Well the loading thingy solved itself, it was just when I talked with the bot that it took a long time. RE: Help with code by SmokingCookie on 11-08-2008 at 07:58 PM
I might be able to do that, but it's ben a busy day so.. might take a while jscript code: RE: Help with code by Jonte135 on 11-08-2008 at 08:03 PM Sure I can wait It will take way longer if I try to do it myself RE: Help with code by SmokingCookie on 11-08-2008 at 08:07 PM Okay, you may not have noticed it (email?), but I've updated the code again, after the first edit. Now it uses your email as text file (for eample "my@email.com.txt"). RE: Help with code by Jonte135 on 11-08-2008 at 08:14 PM Why should I have it like that? *confused* RE: Help with code by SmokingCookie on 11-08-2008 at 08:15 PM
To allow for multiple users RE: Help with code by Jonte135 on 11-08-2008 at 08:18 PM I don't get it RE: Help with code by SmokingCookie on 11-08-2008 at 08:35 PM
Never mind, it works now.
Make sure you're not on 2 accounts at the same time. Sending "hello" will result in the script responding to its own messages. Your PC will not be made any faster by this.. RE: RE: Help with code by Jonte135 on 11-08-2008 at 09:10 PM
quote:Lol. Thanks a lot! Do you know if it's possible to have different script settings for different users if you are logged in at the same time with two accounts? RE: Help with code by SmokingCookie on 11-08-2008 at 09:13 PM That is a lot of work, it's 22.13 over here.. Not today I'm afraid RE: RE: Help with code by Jonte135 on 11-08-2008 at 09:15 PM
quote:Ya but do you know if it's possible through MSN+ itself? RE: Help with code by Jonte135 on 11-16-2008 at 06:41 PM
Isn't it possible to just do like: "if email = [the bots email] { do code bla bla bla } else { do nothing }" RE: Help with code by SmokingCookie on 11-23-2008 at 10:14 AM
It probably only does, when "hit" is the very first word of the sentence.. RE: RE: Help with code by Jonte135 on 11-23-2008 at 11:21 AM
quote:Ok, well take the time you need. I thought you forgot the thread that's all |