fakelush

fake love lush driver

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