fakelush

fake love lush driver

  1. // ==UserScript==
  2. // @name fakelush
  3. // @description fake love lush driver
  4. // @namespace lovelush goes droopy
  5. // @include https://*.chaturbate.com/b/*
  6. // @include https://chaturbate.com/b/*
  7. // @include https://*.camgasm.com/b/*
  8. // @include https://camgasm.com/b/*
  9. // @version 1.1
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. // fake lovelush driver
  14.  
  15.  
  16. var busy=false;
  17. var tipque = [];
  18.  
  19. t1=3;
  20. t2=10;
  21. t3=30;
  22. t4=60;
  23. t5=130;
  24.  
  25. l1=15;
  26. l2=99;
  27. l3=499;
  28. l4=999;
  29. l5=10000;
  30.  
  31. a1="Low vibrations";
  32. a2="Low vibrations";
  33. a3="Medium vibrations";
  34. a4="Medium vibrations";
  35. a5="High vibrations";
  36.  
  37. p1="--------Lovense Toys respond to tips. Models can create their own levels. Here are my levels:";
  38. p2="--------[1 to "+l1+" tokens] = "+t1+" SECONDS ("+a1+").";
  39. p3="--------["+(l1+1)+" to "+l2+" tokens] = "+t2+" SECONDS ("+a2+").";
  40. p4="--------["+(l2+1)+" to "+l3+" tokens] = "+t3+" SECONDS ("+a3+").";
  41. p5="--------["+(l3+1)+" to "+l4+" tokens] = "+t4+" SECONDS ("+a4+").";
  42. p6="--------["+(l4+1)+" to "+l5+" tokens] = "+t5+" SECONDS ("+a5+").";
  43.  
  44. title="Lovense Lush : Device that vibrates longer at your tips and gives me pleasures.";
  45.  
  46. place=document.getElementById("defchat").getElementsByClassName('section')[0].nextSibling;
  47. info=document.createElement('div');
  48. info.style.textAlign="right";
  49. info.style.margin="10px";
  50. info.innerHTML='<b>lush on/off</b><input type="checkbox" id="onoff">';
  51. document.getElementById("defchat").insertBefore(info,place);
  52. document.getElementById("onoff").addEventListener('change',function(){onoff();}, false);
  53.  
  54. function onoff(){
  55. if (document.getElementById("onoff").checked){turnon()}
  56. else{turnoff()}
  57. }
  58.  
  59. function turnon(){
  60. getchat();
  61. t=setInterval(function(){ tipout() }, 500);
  62. u=setInterval(function(){ promo() }, 300000);
  63. promo();
  64. if (document.getElementById("roomtitle").innerHTML.indexOf("Lovense Lush :")==-1){
  65. setTimeout(function(){settit(title)},1000);
  66. }
  67. }
  68.  
  69. function turnoff(){
  70. ws_handler.consolelog=oldFunction;
  71. oldFunction="";
  72. clearInterval(t);
  73. clearInterval(u);
  74. tipque = [];
  75. busy=false;
  76. }
  77.  
  78.  
  79. function getchat(){
  80. oldFunction=ws_handler.consolelog;
  81. ws_handler.consolelog = function(msg2){
  82. if (msg2['method']){
  83. if (msg2['method']=='onNotify'){
  84. argm=JSON.parse(msg2.args[0]);
  85. if (argm.type=="tip_alert"){
  86. amount=argm.amount;
  87. user=argm.from_username;
  88. tipque.push(amount+";"+user);
  89. }
  90. }
  91. }
  92. return oldFunction(msg2);
  93. }
  94. }
  95.  
  96. function tipout(){
  97. if (busy==true){return}
  98. if (tipque.length==0){return}
  99. busy=true;
  100. tipque.reverse();
  101. tipinfo=tipque.pop();
  102. tipque.reverse();
  103. tipinfop=tipinfo.split(";");
  104. process(tipinfop[1],Number(tipinfop[0]));
  105. }
  106.  
  107. function process(tipper,tokens){
  108. ttime=t5;
  109. if (tokens<l4+1){ttime=t4}
  110. if (tokens<l3+1){ttime=t3}
  111. if (tokens<l2+1){ttime=t2}
  112. if (tokens<l1+1){ttime=t1}
  113. message="********My LOVENSE toy is now reacting to "+tipper+"'s tip. It will stop after "+ttime+" seconds!!";
  114. msend(message);
  115. document.getElementById("roomtitle").style.backgroundColor = "red";
  116. setTimeout(function(){ document.getElementById("roomtitle").style.backgroundColor = "white";busy=false }, ttime*1000);
  117. }
  118.  
  119. function promo(){
  120. msend (p1);
  121. msend (p2);
  122. msend (p3);
  123. msend (p4);
  124. msend (p5);
  125. msend (p6);
  126. }
  127.  
  128. function msend(message){
  129. window.defchat_settings.handler.message_outbound.send_room_message(message, '', '');
  130. }
  131.  
  132. function settit(titlemsg){
  133. window.defchat_settings.handler.message_outbound.send_change_title(titlemsg);
  134. }