O.P. RE: i have a problem with my script
k then heres the script
var ScriptName = "Pizza Shop 1.0";
var nbrPizza;
var nbrEaten;
var nbrMoney;
var lang;
var givPizza = false;
var givMoney = false;
var givMoneyS = false;
var hmmcig = [25, 50, 75, 100, 500, 1000, 5000, 10000, 100000];
var ungivPizza = false;
var ungivMoney = false;
var ungivMoneyS = false;
var nbrDonEachMess = 50;
var toastEn;
function OnEvent_Initialize(MessengerStart)
{
Debug.Trace("Welcome To The Pizza Shop!");
}
function OnEvent_Uninitialize(MessengerExit)
{
}
function OnEvent_Signin(Email)
{
if(Email == "michael1194@roadrunner.com")
{
var Message = "Hello " + Messenger.MyName + "!";
Message = MsgPlus.RemoveFormatCodes(Message);
MsgPlus.DisplayToast("", Message);
}
}
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
nbrMoney = nbrDonEachMess+Number(nbrMoney); // I give you money when you speek
switch (Message) {
case "!givePizza": //you want give him/her a pizza
if (nbrPizza >= 1){
if (!givPizza) {
givPizza = ChatWnd;
if (toastEn == "Yes") MsgPlus.DisplayToast("Pizza Shop", lang[11]);
} else {
return "!cancelgivepizza";
}
} else {
if (toastEn == "Yes") MsgPlus.DisplayToast("PizzaShop", lang[11]);
return "";
}
nbrMoney -= nbrDonEachMess; // No give Money
break;
case "!cancelgivepizza": // you dont want to give him/her a pizza
if (!givPizza) {
return "!givepizza";
} else {
givPizza = false;
if (toastEn == "yes") MsgPlus.DisplayToast("PizzaShop", lang[19]);
}
nbrMoney -= 50 // No give money
break;
case "!cancelgivemoney": //you dont want to give him/her money
if (!givMoney) {
return "";
} else {
givMoney = false;
givMoneyS = false;
if (toastEn == "Yes") MsgPlus.DisplayToast("PizzaShop", lang[19]);
}
nbrMoney -= nbrDonEachMess; // No give money
break;
case "!nogivepizza": // you dont want a pizza
if (!ungivPizza) {
return "";
} else {
ungivPizza = false;
}
nbrMoney -= nbrDonEachMess; // No give money
break;
case "!yesgivepizza": //you want a pizza
if (!ungivPizza) {
return "";
} else {
ungivPizza = false
nbrPizza++;
}
nbrMoney -=nbrDonEachMess; // No give Money
break;
case "!nogivemoney": //you dont want money
if (ungivMoney) {
return "";
} else {
ungivMoney = false;
}
nbrMoney -= nbrDonEachMess; // No give money
break;
case "!yesgivemoney": // you want money
if (ungivMoney) {
return "";
} else {
ungivMoney = false;
nbrMoney += hmmcig[ungivMoneyS];
ungivMoneyS = false;
}
nbrMoney -= nbrDonEachMess; // No give money
break;
}
if (Message.substring(0, 11) == "!givemoney ") { // you want to give him/her money
if (!givMoney) {
if (nbrMoney >= hmmcig[Message.substring(11, Message.length)]) {
givMoney = ChatWnd;
givMoneyS = Message.substring(11, Message.length);
if (toastEn == "Yes") MsgPlus.DisplayToast("PizzaShop", lang[18]);
} else {
return "";
}
} else {
return "";
}
nbrMoney -=nbrDonEachMess; // No give money
}
saveAll(); // I save the data
|