Advertisement
Guest User

Untitled

a guest
May 13th, 2017
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HQ9 Plus 17.19 KB | None | 0 0
  1. var psm = "Cups: %cups | Drunk: %drank | Funds: %money";
  2. var payment = 10000;
  3. var price = 1;
  4. var your_money = 500;
  5. var show_in_psm = true;
  6. var cups_drank = 0;
  7. var cups_owned = 0;
  8. var toast = true;
  9. var notify_contact = true;
  10. var Wnd;
  11. var total_length = 0;
  12. var total_messages = 0;
  13. var flood = false;
  14. var cups_bought = 0;
  15. var type = "coffee";
  16. var unlocked_hc = false;
  17. var espresso = 0;
  18. var mocha = 0;
  19. var hc = 0;
  20. var coffee = 0;
  21. var tea = 0;
  22.  
  23. function OnEvent_Initialize(){
  24.     if(Messenger.MyStatus > 1){
  25.         OnEvent_SigninReady(Messenger.MyEmail);
  26.     }  
  27. }
  28.  
  29. function OnEvent_SigninReady(email){
  30.     if(get("!")===-1){
  31.         _save();
  32.     }
  33.     _load();
  34.     MsgPlus.AddTimer("Save_Statistics",180000);
  35.     MsgPlus.AddTimer("Update_PSM",10000);
  36.     if(show_in_psm===-1||show_in_psm===true){
  37.         Messenger.MyPersonalMessage = "Plus! Café - Mocha: "+mocha+" | Tea: "+tea+" | HChocolate: "+hc+" | Espresso: "+espresso+" | "+ _parse(psm);
  38.     }
  39. }
  40.  
  41. function OnEvent_Uninitialize(){
  42.     _save();
  43. }
  44.  
  45. function parse_txt(){
  46.     var s = "Plus! Café - Statistics\n\n";
  47.     s += "Sent Messages: " + get("total_messages") + "\n";
  48.     s += "Total Length Of Messages: " + get("total_length") + "\n";
  49.     s += "Average Length Of Messages: " + Math.floor((get("total_length")*1)/(get("total_messages")*1)) + "\n";
  50.     s += "Funds: $" + _calc(get("your_money")) + "\n";
  51.     s += "Cups Bought: " + ((get("cups_owned")*1)+(get("cups_drank")*1)) + "\n";
  52.     s += "Cups Drank: " + get("cups_drank") + "\n";
  53.     s += "Statistics Collected Since: " + new Date(get("!")).toGMTString() + "\n";
  54.     return s;
  55. }
  56.  
  57. function parse_xml(){
  58.     var s = &quot;<Statistics>\n\n&quot;;
  59.     s += &quot;    <Sent_Messages>&quot; + get(&quot;total_messages&quot;) + &quot;</Sent_Messages>\n&quot;;
  60.     s += &quot;    <Total_Length_Of_Messages>&quot; + get(&quot;total_length&quot;) + &quot;</Total_Length_Of_Messages>\n&quot;;
  61.     s += &quot;    <Average_Length_Of_Messages>&quot; + Math.floor((get(&quot;total_length&quot;)*1)/(get(&quot;total_messages&quot;)*1)) + &quot;</Average_Length_Of_Messages>\n&quot;;
  62.     s += &quot;    <Cups_Owned>&quot; + ((get(&quot;cups_owned&quot;)*1)+(get(&quot;cups_drank&quot;)*1)) + &quot;</Cups_Owned>\n&quot;;
  63.     s += &quot;    <Cups_Drank>&quot; + get(&quot;cups_drank&quot;) + &quot;</Cups_Drank>\n&quot;;
  64.     s += &quot;    <Installed>&quot; + new Date(get(&quot;!&quot;)).toGMTString() + &quot;</Installed>\n</Statistics>&quot;;
  65.     return s;
  66. }
  67.  
  68. function SaveToFile(sText){
  69.     var fso = new ActiveXObject(&quot;Scripting.FileSystemObject&quot;);
  70.     var FileObject = fso.OpenTextFile(MsgPlus.ScriptFilesPath+&quot;\\Stats.txt&quot;, 2, true,0);
  71.     FileObject.write(sText);   
  72.     FileObject.close();
  73.     return true;
  74. }
  75.  
  76. function SaveToXMLFile(sText){
  77.     var fso = new ActiveXObject(&quot;Scripting.FileSystemObject&quot;);
  78.     var FileObject = fso.OpenTextFile(MsgPlus.ScriptFilesPath+&quot;\\Stats.xml&quot;, 2, true,0);
  79.     FileObject.write(sText);   
  80.     FileObject.close();
  81.     return true;
  82. }
  83.  
  84. function OnEvent_Timer(TimerId){
  85.     if(TimerId===&quot;Save_Statistics&quot;){
  86.         _save();
  87.         MsgPlus.AddTimer(&quot;Save_Statistics&quot;,180000);
  88.     }
  89.     if(TimerId===&quot;Flood&quot;){
  90.         flood = !flood;
  91.     }
  92.     if(TimerId===&quot;Update_PSM&quot;){
  93.         if(show_in_psm===-1||show_in_psm===true){
  94.         Messenger.MyPersonalMessage = &quot;Plus! Café - Mocha: &quot;+mocha+&quot; | Tea: &quot;+tea+&quot; | HChocolate: &quot;+hc+&quot; | Espresso: &quot;+espresso+&quot; | &quot;+ _parse(psm);
  95.             MsgPlus.AddTimer(&quot;Update_PSM&quot;,10000);
  96.         }
  97.     }
  98. }
  99.  
  100. function OpenSettings(){
  101.     Wnd = MsgPlus.CreateWnd(&quot;gui.xml&quot;,&quot;WndSettings&quot;);
  102.     Wnd.SetControlText(&quot;txt_string&quot;,psm);
  103.     Wnd.Button_SetCheckState(&quot;chk_psm&quot;,new Boolean(show_in_psm*-1));
  104.     Wnd.Button_SetCheckState(&quot;chk_toast&quot;,new Boolean(toast*-1));
  105.     Wnd.Button_SetCheckState(&quot;chk_notify&quot;,new Boolean(notify_contact*-1));
  106. }
  107.  
  108. function OnWndSettingsEvent_CtrlClicked(PlusWnd, ControlId){
  109.     if(ControlId===&quot;BtnOk&quot;){
  110.         show_in_psm = PlusWnd.Button_IsChecked(&quot;chk_psm&quot;);
  111.         toast = PlusWnd.Button_IsChecked(&quot;chk_toast&quot;);
  112.         notify_contact = PlusWnd.Button_IsChecked(&quot;chk_notify&quot;);
  113.         psm = PlusWnd.GetControlText(&quot;txt_string&quot;);
  114.         _save();
  115.         PlusWnd.Close(1);
  116.         if(toast===-1||toast===true){
  117.             MsgPlus.DisplayToastContact(&quot;Plus! Café&quot;,&quot;[b]Saved![/b]&quot;,&quot;Your settings have been saved&quot;);
  118.         }
  119.     }
  120. }
  121.  
  122. function _save(){
  123.     set(&quot;your_money&quot;,your_money);
  124.     set(&quot;show_in_psm&quot;,show_in_psm);
  125.     set(&quot;cups_drank&quot;,cups_drank);
  126.     set(&quot;cups_owned&quot;,cups_owned);
  127.     set(&quot;cups_bought&quot;,cups_bought);
  128.     set(&quot;toast&quot;,toast);
  129.     set(&quot;notify_contact&quot;,notify_contact);
  130.     set(&quot;psm&quot;,psm);
  131.     set(&quot;total_length&quot;,total_length);
  132.     set(&quot;total_messages&quot;,total_messages);
  133.     var d = new Date();
  134.     set(&quot;last_saved&quot;,d.getDate() + &quot;/&quot; + (d.getMonth()+1) + &quot;/&quot; + d.getYear() + &quot;   &quot; + d.getHours() + &quot;:&quot; + d.getMinutes() + &quot;:&quot; + d.getSeconds());
  135. }
  136.  
  137. function _load(){
  138.     your_money = get(&quot;your_money&quot;)*1;
  139.     show_in_psm = (get(&quot;show_in_psm&quot;)*-1)>0;
  140.     cups_drank = get(&quot;cups_drank&quot;)*1;
  141.     cups_owned = get(&quot;cups_owned&quot;)*1;
  142.     toast = (get(&quot;toast&quot;)*-1)>0;
  143.     cups_bought = get(&quot;cups_bought&quot;)*1;
  144.     notify_contact = (get(&quot;notify_contact&quot;)*-1)>0;
  145.     psm = get(&quot;psm&quot;);
  146.     total_length = get(&quot;total_length&quot;)*1;
  147.     total_messages = get(&quot;total_messages&quot;)*1;
  148. }  
  149.  
  150. function _calc(x){
  151.     x = x/100;
  152.     x = x.toString();
  153.     try{
  154.         x = x.split(&quot;.&quot;);
  155.         if(x[1].length<2){
  156.             x[1] = x[1]+&quot;0&quot;;
  157.         }
  158.         if(x.length>2){
  159.             x[1] = x[1].substr(0,2);
  160.         }
  161.     return x[0]+&quot;.&quot;+x[1];
  162.     }catch(e){
  163.         return x;
  164.     }  
  165. }
  166.  
  167. function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind){
  168.     if(Origin!==Messenger.MyName){
  169.         if(Message.search(&quot;!cafestats_msg&quot;)!==-1&&Message.search(&quot;_txt&quot;)===-1&&Message.search(&quot;_xml&quot;)===-1){
  170.             OnEvent_ChatWndSendMessage(ChatWnd, &quot;/cafestats_msg&quot;);
  171.             return &quot;Sending Stats&quot;;  
  172.         }
  173.         if(Message.search(&quot;!cafestats_txt&quot;)!==-1){
  174.             OnEvent_ChatWndSendMessage(ChatWnd, &quot;/cafestats_txt&quot;);
  175.             return &quot;Sending Stats&quot;;
  176.         }
  177.         if(Message.search(&quot;!cafestats_xml&quot;)!==-1){
  178.             OnEvent_ChatWndSendMessage(ChatWnd, &quot;/cafestats_xml&quot;);
  179.             return &quot;Sending Stats&quot;;  
  180.         }
  181.     }
  182. }
  183.  
  184. function OnEvent_ChatWndSendMessage(ChatWnd, Message){
  185.     if (/^\/([^\s\/]+)\s*([\s\S]*)$/.exec(Message) !== null) {
  186.         var command = RegExp.$1.toLowerCase();
  187.         var parameter = RegExp.$2;
  188.         switch (command) {
  189.         case 'cafestats_msg':
  190.                ChatWnd.SendMessage(parse_txt());
  191.                return &quot;&quot;;
  192.         case 'cafestats_txt':
  193.             if(SaveToFile(parse_txt())===true){ChatWnd.SendMessage(&quot;/sendfile &quot;+MsgPlus.ScriptFilesPath + &quot;\\&quot; + &quot;stats.txt&quot;);}
  194.                return &quot;&quot;;
  195.         case 'cafestats_xml':
  196.             if(SaveToXMLFile(parse_xml())===true){ChatWnd.SendMessage(&quot;/sendfile &quot;+MsgPlus.ScriptFilesPath + &quot;\\&quot; + &quot;stats.xml&quot;);}
  197.                return &quot;&quot;;
  198.         case 'dcoffee':
  199.              if(parameter.search(/max/i)!==-1){paramater=1000;}
  200.             if((parameter*1)>=1){
  201.                 b_toast = toast;
  202.                 b_notify_contact = notify_contact;
  203.                 DrinkCoffee(ChatWnd,(parameter*1));
  204.                 toast = b_toast;
  205.                 notify_contact = b_notify_contact;
  206.                }else{
  207.                 ChatWnd.SendMessage(&quot;/me has drunk a &quot;+type+&quot;!&quot;);
  208.                 cups_drunk++;            
  209.                }
  210.                return &quot;&quot;;
  211.           case 'bcoffee':
  212.             if(parameter.search(/max/i)!==-1){paramater=1000;}
  213.             if((parameter*1)>=1){
  214.                
  215.                 b_toast = toast;
  216.                 b_notify_contact = notify_contact;
  217.                     BuyCoffee(ChatWnd,(parameter*1));
  218.                 toast = b_toast;
  219.                 notify_contact = b_notify_contact;
  220.                }else{
  221.                 ChatWnd.SendMessage(&quot;/me has bought a &quot;+type+&quot;!&quot;);
  222.                 cups_owned++;            
  223.                }
  224.                return &quot;&quot;;
  225.            case 'scoffee':
  226.             if(parameter.search(/max/i)!==-1){paramater=1000;}
  227.             if((parameter*1)>=1){
  228.                 ChatWnd.SendMessage(&quot;/me sold &quot;+parameter+&quot; &quot;+type+&quot;!&quot;)
  229.                 cups_owned= cups_owned - parameter
  230.                 your_money += (parameter*100)
  231.  
  232.                }else{
  233.                     ChatWnd.SendMessage(&quot;/me sold a &quot;+type+&quot;!&quot;)
  234.                 cups_owned= cups_owned - 1
  235.                 your_money += 100          
  236.                }
  237.                return &quot;&quot;;
  238.                case 'throw':
  239.             if(parameter.search(/max/i)!==-1){paramater=1000;}
  240.             if((parameter*1)>=1){
  241.                 ChatWnd.SendMessage(&quot;/me threw &quot;+parameter+&quot; &quot;+type+&quot;!&quot;)
  242.                 cups_owned= cups_owned - parameter
  243.            
  244.                }else{
  245.                     ChatWnd.SendMessage(&quot;/me threw a &quot;+type+&quot; away!&quot;)
  246.                 cups_owned= cups_owned - 1
  247.                      
  248.                }
  249.                return &quot;&quot;;
  250.           case 'reset':
  251.           cups_owned = 0;
  252.           your_money = 0;
  253.           cups_drank = 0;
  254.           return &quot;&quot;;
  255.           case 'demontears':
  256.           ChatWnd.SendMessage(&quot;/me drank Demon Tears. Dark Powers surged through his veins.&quot;)
  257.           your_money+=1000000
  258.           return &quot;&quot;;
  259.           case 'getcoffee':
  260.           if(parameter==&quot;hotchocolate&quot;) {
  261.           if(your_money>1000){
  262.           your_money=your_money-1000
  263.           ChatWnd.SendMessage(&quot;/me unlocked Hot Chocolate for $10!&quot;)
  264.           unlocked_hc = true;
  265.           }
  266.           }
  267.           return &quot;&quot;;
  268.           case 'type':
  269.           if(parameter.search(/max/i)!==-1){paramater=1000;}
  270.           if(parameter==&quot;hotchocolate&quot;) {
  271.           if(unlocked_hc==true) {
  272.                 ChatWnd.SendMessage(&quot;/me is now using hot chocolate! It is $2.50 per cup.&quot;)
  273.                 price = 250;
  274.                 type=&quot;hot chocolate&quot;;
  275.                 }
  276.           }
  277.                 if(parameter==&quot;mocha&quot;) {
  278.                 ChatWnd.SendMessage(&quot;/me is now using mocha! It is $1 per cup.&quot;)
  279.                 price = 100;
  280.                 type=&quot;mocha&quot;;
  281.                 }
  282.                 if(parameter==&quot;espresso&quot;) {
  283.                 ChatWnd.SendMessage(&quot;/me is now using espresso! It is $0.15 per cup.&quot;)
  284.                 price = 15;
  285.                 type=&quot;espresso&quot;;
  286.                 }
  287.                 if(parameter==&quot;coffee&quot;) {
  288.                 ChatWnd.SendMessage(&quot;/me is now using coffee! It is $0.20 per cup.&quot;)
  289.                 price = 20;
  290.                 type=&quot;coffee&quot;;
  291.                 }
  292.                 if(parameter==&quot;tea&quot;) {
  293.                 ChatWnd.SendMessage(&quot;/me is now using tea! It is $0.10 per cup.&quot;)
  294.                 price = 10;
  295.                 type=&quot;tea&quot;;
  296.                 }
  297.                 if(!parameter==&quot;tea&quot;&&!parameter==&quot;espresso&quot;&&!parameter==&quot;coffee&quot;&&!parameter==&quot;mocha&quot;) {
  298.                 ChatWnd.SendMessage(&quot;Type not identified!&quot;)
  299.                 }
  300.           return &quot;&quot;;
  301.           case 'cafestats':
  302.                OnEvent_MenuClicked(&quot;stats&quot;);
  303.                return &quot;&quot;;
  304.             case 'cafeabout':
  305.             OnEvent_MenuClicked(&quot;about&quot;);        
  306.                 return &quot;&quot;;
  307.             }
  308.     }else{
  309.         if(flood===false){ 
  310.             your_money += payment;
  311.             total_length += Message.length;
  312.             total_messages++;
  313.             flood = !flood;
  314.             MsgPlus.AddTimer(&quot;Flood&quot;,5000);
  315.         }
  316.     }
  317.     if(show_in_psm===-1||show_in_psm===true){
  318.         Messenger.MyPersonalMessage = &quot;Plus! Café - Mocha: &quot;+mocha+&quot; | Tea: &quot;+tea+&quot; | HChocolate: &quot;+hc+&quot; | Espresso: &quot;+espresso+&quot; | &quot;+ _parse(psm);
  319.     }
  320.     return _parse(Message);
  321. }
  322.  
  323. function _parse(x){
  324.     x = x.replace(/%cups/gi,cups_owned).replace(/%drank/gi,cups_drank).replace(/%money/gi,&quot;$&quot;+_calc(your_money));
  325.     return x;
  326. }
  327.  
  328. function DrinkCoffee(x,y){
  329.         cups_drank+=y;
  330.         if(type==&quot;coffee&quot;) {
  331.         coffee=coffee-y;
  332.         }
  333.         if(type==&quot;hot chocolate&quot;) {
  334.         hc=hc-y;
  335.         }
  336.         if(type==&quot;tea&quot;) {
  337.         tea=tea-y;
  338.         }
  339.         if(type==&quot;mocha&quot;) {
  340.         mocha=mocha-y;
  341.         }
  342.         if(type==&quot;espresso&quot;) {
  343.         espresso=espresso-y;
  344.         }
  345.         if(notify_contact===true||notify_contact===-1){
  346.             if(typeof(y)!==&quot;undefined&quot;){
  347.                 x.SendMessage(&quot;/me has drank &quot;+y+&quot; cups of &quot;+ type +&quot;!&quot;);
  348.             }else{
  349.                 x.SendMessage(&quot;/me has drank a cup of &quot;+ type +&quot;!&quot;);           
  350.             }  
  351.         }
  352.         if(typeof(y)!==&quot;undefined&quot;){
  353.             x.DisplayInfoMessage(Messenger.MyName + &quot; has drank &quot;+y+&quot; cups of &quot;+ type +&quot;!&quot;);
  354.         }else{
  355.             x.DisplayInfoMessage(Messenger.MyName + &quot; has drank a cup of &quot;+ type +&quot;!&quot;);    
  356.         }
  357.         if(toast===-1||toast===true){
  358.             if(typeof(y)!==&quot;undefined&quot;){
  359.                 MsgPlus.DisplayToastContact(&quot;Plus! Café&quot;,&quot;·$4&quot;+MsgPlus.RemoveFormatCodes(Messenger.MyName),&quot;just drank &quot;+y+&quot; cups of &quot; + type + &quot;!&quot;);
  360.             }else{
  361.                 MsgPlus.DisplayToastContact(&quot;Plus! Café&quot;,&quot;·$4&quot;+MsgPlus.RemoveFormatCodes(Messenger.MyName),&quot;just drank a cup of&quot; + type + &quot;!&quot;);          
  362.             }
  363.         }
  364.    
  365.     if(show_in_psm===-1||show_in_psm===true){
  366.         Messenger.MyPersonalMessage = &quot;Plus! Café - Mocha: &quot;+mocha+&quot; | Tea: &quot;+tea+&quot; | HChocolate: &quot;+hc+&quot; | Espresso: &quot;+espresso+&quot; | &quot;+ _parse(psm);
  367.     }
  368. }
  369.  
  370. function BuyCoffee(x,y){
  371.         cups_owned+=y;
  372.         your_money=your_money-(price*y);
  373.         if(type==&quot;coffee&quot;) {
  374.         coffee+=y;
  375.         }
  376.         if(type==&quot;hot chocolate&quot;) {
  377.         hc+=y;
  378.         }
  379.         if(type==&quot;tea&quot;) {
  380.         tea+=y;
  381.         }
  382.         if(type==&quot;mocha&quot;) {
  383.         mocha+=y;
  384.         }
  385.         if(type==&quot;espresso&quot;) {
  386.         espresso+=y;
  387.         }
  388.         if(notify_contact===true||notify_contact===-1){
  389.             if(typeof(y)!==&quot;undefined&quot;){
  390.                 x.SendMessage(&quot;/me has bought &quot;+y+&quot; cups of &quot;+ type +&quot;!&quot;);
  391.             }else{
  392.                 x.SendMessage(&quot;/me has bought a cup of &quot;+ type +&quot;!&quot;);          
  393.             }  
  394.         }
  395.         if(typeof(y)!==&quot;undefined&quot;){
  396.             x.DisplayInfoMessage(Messenger.MyName + &quot; has bought &quot;+y+&quot; cups of &quot;+ type +&quot;!&quot;);
  397.         }else{
  398.             x.DisplayInfoMessage(Messenger.MyName + &quot; has bought a cup of &quot;+ type +&quot;!&quot;);       
  399.         }
  400.         if(toast===-1||toast===true){
  401.             if(typeof(y)!==&quot;undefined&quot;){
  402.                 MsgPlus.DisplayToastContact(&quot;Plus! Café&quot;,&quot;·$4&quot;+MsgPlus.RemoveFormatCodes(Messenger.MyName),&quot;just bought &quot;+y+&quot; cups of &quot; + type + &quot;!&quot;);
  403.             }else{
  404.                 MsgPlus.DisplayToastContact(&quot;Plus! Café&quot;,&quot;·$4&quot;+MsgPlus.RemoveFormatCodes(Messenger.MyName),&quot;just bought a cup of &quot; + type + &quot;!&quot;);        
  405.             }
  406.         }
  407.    
  408.     if(show_in_psm===-1||show_in_psm===true){
  409.         Messenger.MyPersonalMessage = &quot;Plus! Café - Mocha: &quot;+mocha+&quot; | Tea: &quot;+tea+&quot; | HChocolate: &quot;+hc+&quot; | Espresso: &quot;+espresso+&quot; | &quot;+ _parse(psm);
  410.     }
  411. }
  412.  
  413. function set(key, value){
  414.     try{
  415.         return new ActiveXObject(&quot;WScript.Shell&quot;).RegWrite(MsgPlus.ScriptRegPath + Messenger.MyUserID + &quot;\\&quot; + key, value, &quot;REG_SZ&quot;);
  416.     }catch(e){}
  417. }
  418.  
  419. function get(key){
  420.     try{
  421.         return new ActiveXObject(&quot;WScript.Shell&quot;).RegRead(MsgPlus.ScriptRegPath + Messenger.MyUserID + &quot;\\&quot; + key);
  422.     }catch(e){
  423.         if(key===&quot;!&quot;){
  424.             MsgPlus.DisplayToastContact(&quot;Plus! Café&quot;,&quot;[b]Thank you![/b]&quot;, &quot;for downloading Plus! Café\nplease enjoy&quot;);
  425.             set(&quot;!&quot;,new Date());
  426.             return -1
  427.         }else{
  428.             return false;
  429.         }
  430.     }
  431. }
  432.  
  433. function OnGetScriptMenu(nLocation) {
  434.     var s = &quot;<ScriptMenu>&quot;;
  435.     s += &quot;<MenuEntry Id='settings'>Settings</MenuEntry>&quot;;
  436.     s += &quot;<MenuEntry Id='stats'>Statistics</MenuEntry>&quot;;
  437.     s += &quot;<Separator/>&quot;;
  438.     s += &quot;<MenuEntry Id='about'>About</MenuEntry>&quot;;
  439.     s += &quot;</ScriptMenu>&quot;;
  440.     return s;
  441. }
  442.  
  443. function OnEvent_MenuClicked(sMenuItemId, nLocation, OriginWnd) {
  444.     if(sMenuItemId === &quot;settings&quot;) {
  445.         OpenSettings();
  446.     }
  447.     if(sMenuItemId === &quot;stats&quot;){
  448.         var stats = MsgPlus.CreateWnd(&quot;gui.xml&quot;, &quot;WndStats&quot;);
  449.         stats.SetControlText(&quot;txt_1&quot;,&quot;[c=4]&quot;+total_messages+&quot;[/c]&quot;);
  450.         stats.SetControlText(&quot;txt_2&quot;,&quot;[c=4]&quot;+total_length+&quot;[/c]&quot;);
  451.         stats.SetControlText(&quot;txt_3&quot;,&quot;[c=4]&quot;+Math.floor(total_length/total_messages)+&quot;[/c]&quot;);
  452.         stats.SetControlText(&quot;txt_4&quot;,&quot;[c=4]&quot;+cups_owned+&quot;[/c]&quot;);
  453.         stats.SetControlText(&quot;txt_5&quot;,&quot;[c=4]&quot;+cups_drank+&quot;[/c]&quot;);
  454.         stats.SetControlText(&quot;txt_6&quot;,&quot;[c=4]$&quot;+_calc(your_money)+&quot;[/c]&quot;);
  455.         var dat = get(&quot;!&quot;);
  456.         dat = dat.split(&quot; &quot;);
  457.         dat = dat[2]+&quot;/&quot;+dat[1]+&quot;/&quot;+dat[5]
  458.         stats.SetControlText(&quot;imp&quot;,&quot;[c=4]Since: &quot;+dat+&quot;[/c]&quot;);   
  459.     }
  460.     if(sMenuItemId === &quot;about&quot;) {
  461.         MsgPlus.CreateWnd(&quot;gui.xml&quot;, &quot;WndAbout&quot;);
  462.     }
  463. }
  464.  
  465. function OnGetScriptCommands(){
  466.     var commands = '<ScriptCommands>';
  467.             commands+='<Command>';
  468.                 commands+='<Name>bcoffee</Name>';
  469.                 commands+='<Description>Buy a cup of coffee</Description>';
  470.             commands+='</Command>';
  471.             commands+='<Command>';
  472.                 commands+='<Name>scoffee</Name>';
  473.                 commands+='<Description>Sell a cup of coffee</Description>';
  474.             commands+='</Command>';
  475.             commands+='<Command>';
  476.                 commands+='<Name>dcoffee</Name>';
  477.                 commands+='<Description>Drink a cup of coffee</Description>';
  478.             commands+='</Command>';
  479.             commands+='<Command>';
  480.                 commands+='<Name>cafestats</Name>';
  481.                 commands+='<Description>Stats from Plus! Café</Description>';
  482.             commands+='</Command>';
  483.             commands+='<Command>';
  484.                 commands+='<Name>cafeabout</Name>';
  485.                 commands+='<Description>About Plus! Café</Description>';
  486.             commands+='</Command>';
  487.             commands+='<Command>';
  488.                 commands+='<Name>cafestats_msg</Name>';
  489.                 commands+='<Description>Send Plus! Café statistics to a contact as a MESSAGE</Description>';
  490.             commands+='</Command>';
  491.             commands+='<Command>';
  492.                 commands+='<Name>cafestats_txt</Name>';
  493.                 commands+='<Description>Send Plus! Café statistics to a contact as a TXT FILE</Description>';
  494.             commands+='</Command>';
  495.             commands+='<Command>';
  496.                 commands+='<Name>cafestats_xml</Name>';
  497.                 commands+='<Description>Send Plus! Café statistics to a contact as an XML FILE</Description>';
  498.             commands+='</Command>';
  499.             commands+='<Command>';
  500.                 commands+='<Name>reset</Name>';
  501.                 commands+='<Description>Reset the stats.</Description>';
  502.             commands+='</Command>';
  503.             commands+='<Command>';
  504.                 commands+='<Name>type</Name>';
  505.                 commands+='<Description>Change the cup type.</Description>';
  506.             commands+='</Command>';
  507.             commands+='<Command>';
  508.                 commands+='<Name>throw</Name>';
  509.                 commands+='<Description>Throw the cup away.</Description>';
  510.             commands+='</Command>';
  511.             commands+='<Command>';
  512.                 commands+='<Name>demontears</Name>';
  513.                 commands+='<Description>A powerful substance found in a rare cave within the shadow realm.</Description>';
  514.             commands+='</Command>';
  515.             commands+='<Command>';
  516.                 commands+='<Name>getcoffee</Name>';
  517.                 commands+='<Description>Unlock a specific coffee.</Description>';
  518.             commands+='</Command>';
  519.             commands+='</ScriptCommands>';
  520.     return commands;
  521. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement