What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Another Little Problem! For u no problem!

Another Little Problem! For u no problem!
Author: Message:
NorteX
New Member
*


Posts: 8
Joined: Mar 2009
O.P. Another Little Problem! For u no problem!
Hey,

i have already 2 scripts who tell the ppl random 25 sentences automatically when i type /sc1 and /sc2 that are the 2 scripts for conversations... Example: I type with my best friend and type /sc1 then i press the enter button and the script replace it with a random sentence from my script....

now thats the problem ....i wanted to do a third script that when i type for exemple /both that he replaces this with either /sc1 or /sc2 ... i have made such a script... he also replaces and types but then when i use this script ... he only types /sc1 or /sc2 and sends it .... not even replace it ... (u know? ^^) then when i would type with my fingers the /sc1 or /sc2 ... its as normal (replaced through random sentences...)


so i ask u why its not working?




my script for the /both is:

function OnEvent_ChatWndSendMessage(ChatWnd,Message){
var rn_txt = new Array();

rn_txt[1] = "hmmm...";
rn_txt[2] = "/sc1";
rn_txt[3] = "Hey This is a Bot ";
rn_txt[4] = "/sc2";


var i = Math.round(4*Math.random());
var RANDOMISM = Message.replace(/\/both/,rn_txt[i]);
return RANDOMISM;
}




Hope someone can help me in both Topics
03-25-2009 04:51 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Another Little Problem! For u no problem!
I am so confused...

Are you saying that when you try to develop a script and use /both as the command it is supposed to replace /both with either /sc1 or /sc2 but instead it just sends the text? Am I understanding that correctly?
03-25-2009 05:25 PM
Profile E-Mail PM Find Quote Report
NorteX
New Member
*


Posts: 8
Joined: Mar 2009
O.P. RE: Another Little Problem! For u no problem!
yeah i have 2 plugins which when i type /sc1 in chat with my friend, it types a random sentence from 50 sentences which are saved - the second plugin replaces it when I type /sc2 .... so now i want a third script that when i go AWAY( idle) autoanswers /both (or something like this) which now will be the plugin that /both is replaced through /sc1 or /sc2 in random .... but my script which i posted always only writes the /sc1 and /sc2 to my friend in chat instead of replacing it automatically with the plugin based sentences for this 2 commands (sc1 and sc2) .... but when i then type it again to check if the other 2 plugins are possibly not working i am surprised to see that if i press enter the plugins replace it....

so shortly my third plugin types the /sc1 and /sc2 but then when the plugin sends the letters its not replaced through the sc1 and sc2 plugin-sentences - when i myself type the /sc1 and press [Enter] it is replaced...


some kind of confusing to me because in the other script i only said type and send /sc1 or /sc2 and it does but it doesnt replace ...-.-

i hope u understand xD
03-25-2009 05:59 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Another Little Problem! For u no problem!
Number one solution: make those three seperate scripts into one script.

Because, as it is now, you most likely also have a lot of double code in script 1 (/sc1) and 2 (/sc2). If you find a bug in script 1, you might forget to fix it in script 2, updating means you need to update 2 scripts each time, etc... There are a lot of disadvantages if you work with three different (yet 99,999% the same) scripts like that. So, I bet those 3 scripts can be made in just one, much shorter, script.

There are a lot of examples on this forum and on the official scripts database which show you how to react on different commands from within the same script.

;)
.-= A 'frrrrrrrituurrr' for Wacky =-.
03-26-2009 02:23 AM
Profile PM Find Quote Report
« 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