Hello!
I love your script, its realy cool!
But, i cant use it.. =/
I tryd this script:
http://www.msgpluslive.net/scripts/view/119-Answering-Machine-Plus/
Its a autokaller...!
And i look at the screenshot.. wtf i thout.. thats not that script
When I go to the script database and klick 2 times on ANSWERING MASHINE than this come:
PLZ !!! help me, than i can use your script! =D
Send me a mail, thats the best, or PM !
r0b92@hotmail.com
------------------------------------------------------------------------------------------------
//Global Vars
var alWnd = null;//Answer List
var hWnd = null;//Help
var aeWnd = null;//Add/Edit
var sWnd = null;//Status
var pWnd = null;//ChatWnd
var ReplyNum = new Array();
var _TYPE = new Array("Fragment","Word","Sentence","RegExp");
var _WHO = new Array("Contact","Self","Both");
var _CASE = 1;
var _GLOBAL = 2;
var _MULTILINE = 4;
var _CONTACT = 8;
var _SELF = 16;
var _FIRST = 32;
var _LAST = 64;
var _WHOLE = 128;
var _RAND = 256;
var _STATUS = new Array("1","2","4","8","16","32","64","128");
var StopAll = 0;
var SW_HIDE = 0;
var SW_SHOW = 5;
var LB_SETSEL = 0x185;
var LB_GETSELCOUNT = 0x190;
var LB_GETSELITEMS = 0x191;
var Enabled = 1;
var tmrIdx = 0;
var GlobalDelay = 0;
var DAnswer = "";
function OnGetScriptMenu(iLocation){
var sMenu = "<ScriptMenu>";
sMenu += "<MenuEntry Id=\"Configure\">Configure Answers</MenuEntry>";
if(Enabled)
sMenu += "<MenuEntry Id=\"EnabledToggle\">Disable Answering</MenuEntry>";
else
sMenu += "<MenuEntry Id=\"EnabledToggle\">Enable Answering</MenuEntry>";
sMenu += "<MenuEntry Id=\"About\">About</MenuEntry>";
sMenu += "</ScriptMenu>";
return sMenu;
}
function BuildWindow() {
if(alWnd == null) {
alWnd = MsgPlus.CreateWnd("Dialog.xml","Configure");
PopulateWindow();
}
}
function PopulateWindow() {
var iCount = alWnd.LstView_GetCount("LsvAnswers");
//Remove old Entries
for(var h = 0; h<iCount; h++)
alWnd.LstView_RemoveItem("LsvAnswers",0);
//Populate ListView with New Entries
for(var j = 0; j<_TYPE.length; j++) {
var aData = GetXMLInfo(_TYPE[j]);
for(var i = 0; i<aData.length; i++) {
var idx = alWnd.LstView_AddItem("LsvAnswers", aData[i][0],j);
alWnd.LstView_SetItemText("LsvAnswers", idx, 1, aData[i][1]);
alWnd.LstView_SetItemText("LsvAnswers", idx, 2, aData[i][2]);
alWnd.LstView_SetItemText("LsvAnswers", idx, 3, aData[i][3]);
alWnd.LstView_SetItemText("LsvAnswers", idx, 4, aData[i][4]);
alWnd.LstView_SetCheckedState("LsvAnswers", idx, aData[i][6]);
}
}
var GDelay = xmlReadDelay();
alWnd.Button_SetCheckState("ChkGlobalDelay",((GDelay[0] === "1") ? true : false));
alWnd.SetControlText("EdtGlobalDelay",GDelay[1]);
}
function BuildEditWindow(iIdx) {
if(!checkXMLExists()) {
PopulateWindow();
return;
}
if(aeWnd != null) return;
aeWnd = MsgPlus.CreateWnd("Dialog.xml","AddEdit");
//Change Title of Window
Interop.Call('user32', 'SetWindowTextW', aeWnd.Handle, "Edit Answer");
//Set Properties
for(var i = 0; i<_TYPE.length; i++)
aeWnd.Combo_AddItem("CmbBoxType",_TYPE[i],i);
for(var i = 0; i<_WHO.length; i++)
aeWnd.Combo_AddItem("CmbBoxWho",_WHO[i],i);
aeWnd.Combo_SetCurSel("CmbBoxType",alWnd.LstView_GetItemData("LsvAnswers",iIdx));
aeWnd.Button_SetCheckState("RdoEdit",true);
aeWnd.SetControlText("EdtOldName",alWnd.LstView_GetItemText("LsvAnswers",iIdx,0));
aeWnd.SetControlText("EdtName",alWnd.LstView_GetItemText("LsvAnswers",iIdx,0));
aeWnd.SetControlText("EdtReceive",alWnd.LstView_GetItemText("LsvAnswers",iIdx,1));
aeWnd.SetControlText("EdtAnswer",alWnd.LstView_GetItemText("LsvAnswers",iIdx,2));
aeWnd.SetControlText("EdtMatchCount",getValue(alWnd.LstView_GetItemText("LsvAnswers",iIdx,0),"MatchCount",1));
aeWnd.SetControlText("EdtStatuses",getValue(alWnd.LstView_GetItemText("LsvAnswers",iIdx,0),"Status",255));
aeWnd.SetcontrolText("EdtDelay",getValue(alWnd.LstView_GetItemText("LsvAnswers",iIdx,0),"Delay",0));
var flags = alWnd.LstView_GetItemText("LsvAnswers",iIdx,4);
if(flags & _CASE) aeWnd.Button_SetCheckState("ChkCase",true);
if(flags & _RAND) aeWnd.Button_SetCheckState("ChkRandomize",true);
if(flags & _GLOBAL) {
aeWnd.Button_SetCheckState("ChkGlobal",true);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('LblMatchCount'), SW_SHOW);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('EdtMatchCount'), SW_SHOW);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('LblMatchCount2'), SW_SHOW);
}
if(flags & _MULTILINE) aeWnd.Button_SetCheckState("ChkMultiline",true);
if(flags & _WHOLE) aeWnd.Button_SetCheckState("ChkWholeMessage",true);
if(flags & _FIRST) aeWnd.Button_SetCheckState("RdoFWord",true);
else if(flags & _LAST) aeWnd.Button_SetCheckState("RdoLWord",true);
else aeWnd.Button_SetCheckState("RdoAnyWord",true);
if((flags & _SELF) && (flags & _CONTACT)) aeWnd.Combo_SetCurSel("CmbBoxWho",2);
else if(flags & _CONTACT) aeWnd.Combo_SetCurSel("CmbBoxWho",0);
else aeWnd.Combo_SetCurSel("CmbBoxWho",1);
//Determine which controls to show
switch(aeWnd.GetControlText("CmbBoxType")) {
case "RegExp":
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoFWord'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoLWord'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoAnyWord'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('ChkWholeMessage'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('ChkMultiline'), SW_SHOW);
break;
case "Sentence":
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('ChkMultiline'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoFWord'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoLWord'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoAnyWord'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('ChkWholeMessage'), SW_SHOW);
break;
case "Fragment":
case "Word":
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('ChkMultiline'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('ChkWholeMessage'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoFWord'), SW_SHOW);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoLWord'), SW_SHOW);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoAnyWord'), SW_SHOW);
break;
}
}
//aData[i][0] = Name(String)
//aData[i][1] = Receive(String)
//aData[i][2] = Answer(String)
//aData[i][3] = Type(String)
//aData[i][4] = Flags(Bitwise Integer)
//aData[i][5] = MatchCount(Integer)
//aData[i][6] = Enabled(Integer:0-1)
//aData[i][7] = Status(Bitwise Integer)
//aData[i][8] = Delay(Integer)
function CheckMessage(sOrigin,sMessage,Wnd) {
//Loop through and check each message
for(var j = 0; j<_TYPE.length; j++) {
var aData = GetXMLInfo(_TYPE[j]);
for(var i = 0; i<aData.length; i++) {
//Debug.Trace("Loop: "+j+" Interation: "+i);
if(aData[i][6] === 0) continue;
if(!(aData[i][7] & _STATUS[Messenger.MyStatus-2])) continue;
var sReceive = aData[i][1];
var sAnswer = aData[i][2];
var sName = aData[i][0];
var Type = aData[i][3];
var iFlags = aData[i][4];
var iMatchCount = aData[i][5];
var iDelay = aData[i][8];
var bRandomize = false;
if(iFlags & _RAND) bRandomize = true;
var RegFlags = "";
if(!(iFlags & _SELF))
if(sOrigin === Messenger.MyName)
continue;
if(!(iFlags & _CONTACT))
if(sOrigin !== Messenger.MyName)
continue;
if(iFlags & _GLOBAL) RegFlags += "g";
if(iFlags & _CASE) RegFlags += "i";
var RegEx;
//Create Searches
switch(Type) {
case "Fragment":
if(iFlags & _FIRST) sReceive = "^"+sReceive;
else if(iFlags & _LAST) sReceive += "$";
RegEx = new RegExp(sReceive,RegFlags);
break;
case "Word":
if(iFlags & _FIRST) sReceive = "^"+sReceive+"\\b";
else if(iFlags & _LAST) Receive = "\\b"+sReceive+"$";
else sReceive = "\\b"+sReceive+"\\b";
RegEx = new RegExp(sReceive,RegFlags);
break;
case "Sentence":
if(iFlags & _WHOLE) sReceive = "^"+sReceive+"$";
RegEx = new RegExp(sReceive,RegFlags);
break;
case "RegExp":
if(iFlags & _MULTILINE) RegFlags += "m";
if(!(iFlags & _GLOBAL)) RegFlags += "g";
RegEx = new RegExp(sReceive,RegFlags);
break;
}
//Match them
var Matches = sMessage.match(RegEx);
if(Matches != null) {
for(var m = 1; m<Matches.length+1; m++) {
var Reg = new RegExp("\\$"+m+"\\b","g");
if(Matches[m-1] != null) sAnswer = sAnswer.replace(Reg,Matches[m-1]);
if(m === 9) break;
}
sAnswer = sAnswer.replace(/\$[0-9]/g,"");
if(Matches.length >= iMatchCount || !(iFlags & _GLOBAL)) {
//Randomize! or not.
var Answers = sAnswer.split("|");
if(bRandomize) {
if(Answers.length > 1) sAnswer = Answers[Math.round(Math.random()*(Answers.length-1))];
} else {
if(ReplyNum[i] == null || ReplyNum[i] == undefined) ReplyNum[i] = 0;
if(Answers.length > 1) sAnswer = Answers[ReplyNum[i]++];
if(ReplyNum[i] === Answers.length) ReplyNum[i] = 0;
}
if(!GlobalDelay)
iDelay = Math.abs(Math.round((iDelay>100) ? iDelay : iDelay*1000));
else {
var gDelay = xmlReadDelay();
iDelay = Math.abs(Math.round((gDelay[1]>100) ? gDelay[1] : gDelay[1]*1000));
}
//We don't like 100second+ delays.
if(iDelay > 100000)
iDelay = 100000;
if(iDelay < 0)
iDelay = 0;
if(iDelay === 0) {
Wnd.SendMessage(sAnswer);
StopAll = 1; //Stop replies for 1 second to reduce likelyhood of spam.
MsgPlus.AddTimer("Stop",1000);
} else {
pWnd = Wnd;
DAnswer = sAnswer;
MsgPlus.AddTimer("Delay",iDelay);
StopAll = 1;
MsgPlus.AddTimer("Stop",iDelay+1000);
}
return;
}
}
}
}
}
+
------------------------------------------------------------------------------------------------
PLZ !!! help me, than i can use your script! =D
Send me a mail, thats the best, or PM !
r0b92@hotmail.com