Advertisement
Embrosy

Kogama Console

Oct 24th, 2022
79
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.19 KB | None | 0 0
  1.  
  2.  
  3. // ==UserScript==
  4. // @name Kogama Console
  5. // @run-at document-start
  6. // @version 0.1 alpha
  7. // @description kogama console
  8. // @author Exnonull
  9. // @match https://www.kogama.com/page/webgl-frame/*
  10. // @match https://kogama.com.br/page/webgl-frame/*
  11. // @match https://friends.kogama.com/page/webgl-frame/*
  12. // @grant none
  13. // @namespace https://greasyfork.org/users/668500
  14. // ==/UserScript==
  15.  
  16. /*sniffers*/
  17. WS_Original = WebSocket;
  18. WebSocket = function(url, type){
  19. let ws = new WS_Original(url, type);
  20. kcc.ws = ws;
  21.  
  22. ws._send = ws.send;
  23. ws.send = kcc.injectClient;
  24. kcc.logClient('injected client');
  25. function waitServer(e){
  26. kcc.injectServer(e);
  27. if(!this.editServer){
  28. this.removeEventListener('message', waitServer);
  29. this._msg = this.onmessage;
  30. this.onmessage = kcc.injectServer;
  31. }
  32. kcc.logServer('injected server');
  33. }
  34. ws.addEventListener('message', waitServer);
  35.  
  36. return ws;
  37. };
  38.  
  39. /*Utils*/
  40. Uint8Array.prototype.equals=
  41. Array.prototype.equals=function(array){
  42. if(!(array&&this.length==array.length))return false;
  43. for(var i=0,l=this.length;i<l;i++){
  44. if(this[i] instanceof Array&&array[i] instanceof Array){
  45. if(!this[i].equals(array[i]))return false;
  46. }else if(this[i]!=array[i]){return false;}
  47. }
  48. return true;
  49. }
  50. Object.defineProperty(window.Uint8Array.prototype,"equals",{enumerable:false});
  51. Object.defineProperty(window.Array.prototype,"equals",{enumerable:false});
  52. decode=d=>new TextDecoder().decode(d);
  53. encode=d=>new TextEncoder().encode(d);
  54. top.toByte16=toByte16=num=>new Uint8Array(new Uint16Array([num]).buffer).reverse();
  55. top.toNum16Sign=toNum16Sign=nums=>new Int16Array(new Uint8Array(nums).reverse().buffer)[0];
  56. top.toNum16=toNum16=nums=>new Uint16Array(new Uint8Array(nums).reverse().buffer)[0];
  57. top.unsign16=unsign16=num=>new Uint16Array([num])[0];
  58. top.toByte32=toByte32=num=>new Uint8Array(num?new Uint32Array([num]).buffer:[]).reverse();
  59. top.toNum32=toNum32=nums=>new Uint32Array(nums?new Uint8Array(nums).reverse().buffer:0)[0];
  60. getJSON=str=>{
  61. let pos=0,left=0,i=0,arr=[];
  62. while(i++<str.length){
  63. if(str[i]=='{'&&str[i+1]=='"'){
  64. if(!left)pos=i;
  65. left++;
  66. }
  67. if(str[i]=='}'){
  68. if(left>0){
  69. left--;
  70. if(!left)arr.push(str.slice(pos,i+1));
  71. }
  72. }
  73. }
  74. return arr.map(a=>JSON.parse(a));
  75. }
  76. top.format=format=str=>{//ff0011->[255,0,17]
  77. let rez=[];
  78. let n=0;
  79. for(let i=0;i<str.length;i++){
  80. rez.push(str[i]);
  81. if((i+2-n)%3==0){n+=2;rez.push(" ");}
  82. }
  83. rez.pop();
  84. return new Uint8Array(rez.join('').split(' ').map(n=>parseInt(n,16)))
  85. };
  86.  
  87. /*kogama console*/
  88. {
  89. window.html=top.html=id=>top.document.getElementById(id);
  90. window.make=top.make=tag=>top.document.createElement(tag);
  91. window.kc=top.kc={green:'#43B581',red:'#F04747',blue:'#72A9DA',
  92. cubegun:()=>{
  93. kcc.ws._send(new Uint8Array([
  94. 243,2,25,0,2,22,105,...toByte32(kcc.self),70,68,0,0,0,1,115,0,11,99,117,114,114,101,110,116,73,116,101,109,68,0,0,0,4,115,0,4,116,121,112,101,105,0,0,0,11,115,0,9,118,97,114,105,97,110,116,73,100,105,0,0,0,0,115,0,15,117,112,100,97,116,101,73,116,101,109,83,116,97,116,101,105,0,0,0,4,115,0,8,105,116,101,109,68,97,116,97,68,0,0,0,1,115,0,8,109,97,116,101,114,105,97,108,98,20
  95. ]));
  96. kcc.ws._msg({data:new Uint8Array([
  97. 243,4,29,0,3,22,105,...toByte32(kcc.self),70,68,0,0,0,1,115,0,11,99,117,114,114,101,110,116,73,116,101,109,68,0,0,0,4,115,0,4,116,121,112,101,105,0,0,0,11,115,0,9,118,97,114,105,97,110,116,73,100,105,0,0,0,0,115,0,15,117,112,100,97,116,101,73,116,101,109,83,116,97,116,101,105,0,0,0,4,115,0,8,105,116,101,109,68,97,116,97,68,0,0,0,1,115,0,8,109,97,116,101,114,105,97,108,98,20,254,105,0,0,0,0
  98. ]).buffer});
  99. },
  100. action:(actionId,PID=kcc.self)=>kcc.ws.send(new Uint8Array([243,2,27,0,2,22,105,...toByte32(PID),83,68,0,0,0,1,98,0,120,0,0,0,2,1,actionId])),
  101. freeze:(PID=kcc.self)=>kcc.ws.send(new Uint8Array([243,2,27,0,2,22,105,...toByte32(PID),83,68,0,0,0,1,98,0,120,0,0,0,2,1,11])),
  102. damadge:(PID=kcc.self)=>kcc.ws.send(new Uint8Array([243,2,27,0,2,22,105,...toByte32(PID),83,68,0,0,0,1,98,0,120,0,0,0,2,1,10])),
  103. heal:(PID=kcc.self)=>kcc.ws.send(new Uint8Array([243,2,27,0,2,22,105,...toByte32(PID),83,68,0,0,0,1,98,0,120,0,0,0,2,1,27])),
  104. big:(PID=kcc.self)=>kcc.ws.send(new Uint8Array([243,2,27,0,2,22,105,...toByte32(PID),83,68,0,0,0,1,98,0,120,0,0,0,2,1,17])),
  105. small:(PID=kcc.self)=>kcc.ws.send(new Uint8Array([243,2,27,0,2,22,105,...toByte32(PID),83,68,0,0,0,1,98,0,120,0,0,0,2,1,16])),
  106. mutant_kill:(PID=kcc.self)=>kcc.ws.send(new Uint8Array([243,2,27,0,2,22,105,...toByte32(PID),83,68,0,0,0,1,98,0,120,0,0,0,2,1,6])),
  107. rail_kill:(PID=kcc.self)=>kcc.ws.send(new Uint8Array([243,2,27,0,2,22,105,...toByte32(PID),83,68,0,0,0,1,98,0,120,0,0,0,2,1,4])),
  108. invisible:(PID=kcc.self)=>kcc.ws.send(new Uint8Array([243,4,2,0,8,22,105,0,3,...toByte32(PID),70,68,0,0,0,1,115,0,17,115,112,97,119,110,82,111,108,101,77,111,100,101,84,121,112,101,105,0,0,0,4])),
  109. finish:()=>kcc.ws.send(new Uint8Array([243,2,23,0,1,191,105,0,3,0,0])),
  110. log:(msg,clr='#FFF')=>{
  111. if(html('console_log').lastChild&&msg==html('console_log').lastChild.textContent){
  112. let counter=html('console_log').lastChild.children[0];
  113. if(counter){
  114. counter.value=1+Number(counter.value);
  115. }else{
  116. counter=make('input');
  117. counter.style=`height:20px;width:20px;
  118. text-align:center;padding:0px;
  119. background:${kc.green};color:#FFFA;
  120. border:none;border-radius:100%;cursor:default;`;
  121. counter.value=2;
  122. counter.disabled=true;
  123. html('console_log').lastChild.appendChild(counter)
  124. }
  125. return;
  126. }
  127. let scroll=html('console_log').scrollTop/(html('console_log').scrollHeight-html('console_log').offsetHeight);
  128. if(isNaN(scroll)||scroll>0.9)scroll=true;
  129. else scroll=false;
  130. let el=make('div');
  131. el.style='padding:2% 1% 0px 2%;width:100%;color:'+clr+';';
  132. el.textContent=msg;
  133. html('console_log').appendChild(el);
  134. if(scroll)html('console_log').scrollTop=html('console_log').scrollHeight-html('console_log').offsetHeight;
  135. },
  136. command:str=>{
  137. kc.log(str,'#FFF8');
  138. }
  139. };
  140. window.makeCheat=top.makeCheat=(name='unknown',clr='#888',func=()=>{})=>{
  141. let el=make('input');
  142. el.id=name;
  143. el.value=name;
  144. el.className='cheat_element';
  145. el.type='button';
  146. el.style=`color:${clr};background-color:#4f545c;border-radius:10px;border:none;padding:2px;`;
  147. el.addEventListener('click',func);
  148. html('cheat_box').appendChild(el);
  149. };
  150. window.addBB=top.addBB=(name='unknown',id='unknown',box='unknown_box',choosen=0)=>{
  151. let el=make('div');
  152. el.id=box;
  153. el.style=`
  154. position:absolute;
  155. display:${choosen?'block':'none'};
  156. width:75%;height:90%;
  157. top:10%;
  158. right:0px;
  159. `;
  160. html('console').appendChild(el);
  161. el=make('div');
  162. el.id='console_bar_'+id;
  163. el.className='bar_element bar_element_'+(choosen?'on':'off');
  164. el.textContent=name;
  165. el.addEventListener('click',function(e){
  166. if(this!=html('console_bar').cur){
  167. html(box).style.display='block';
  168. html('console').cur.style.display='none';
  169. html('console').cur=html(box);
  170. this.className='bar_element bar_element_on';
  171. html('console_bar').cur.className='bar_element bar_element_off';
  172. html('console_bar').cur=this;
  173. }
  174. });
  175. html('console_bar').appendChild(el);
  176. };
  177. var sheet=top.document.head.appendChild(make('style')).sheet;
  178. sheet.insertRules=rules=>rules.replace(/\}/g,'}^').split('^').map(r=>(r.indexOf('{')+1)&&sheet.insertRule(r));
  179. sheet.insertRules(`
  180. .scroller{overflow-y:auto;}
  181. .scroller::-webkit-scrollbar{
  182. width:10px;
  183. }
  184. .scroller::-webkit-scrollbar-thumb{
  185. background-color:rgba(0,0,0,.4);
  186. -webkit-box-shadow:inset 0 0 2px rgba(0,0,0,.5);
  187. box-shadow:inset 0 0 2px rgba(0,0,0,.5);
  188. }
  189. .scroller::-webkit-scrollbar-track{
  190. background-color:rgba(0,0,0,.3);
  191. }
  192. .scroller::-webkit-scrollbar-thumb{
  193. background:#000;
  194. }
  195. .bar_element:hover{
  196. opacity:0.9;
  197. background:#40444bAA;
  198. transition-duration: 0.3s;
  199. }
  200. .bar_element{
  201. color:#FFF;
  202. line-height: 200%;
  203. cursor:pointer;
  204. height:10%;
  205. width:100%;
  206. }
  207. .cheat_element:hover{
  208. color:#FFF !important;
  209. }
  210. .bar_element_off{
  211. opacity:0.5;
  212. background:#0000;
  213. }
  214. .bar_element_on{
  215. opacity:1;
  216. background:#40444b;
  217. }
  218. `);
  219. let el=make('div');
  220. top.document.body.appendChild(el);
  221. el.id='console';
  222. el.style=`
  223. position:fixed;
  224. display:none;
  225. z-index:9999;
  226. background-color:#36393f;
  227. text-align:center;
  228. border-radius:10px;
  229. border:3px #36393F solid;
  230. `;
  231. top.addEventListener('resize',function(){
  232. html('console').style.width=top.outerWidth*0.35+'px';
  233. html('console').style.height=top.outerHeight*0.35+'px';
  234. });
  235. top.dispatchEvent(new Event('resize'));
  236. top.document.addEventListener('mouseup',e=>{
  237. if(html('console').movement){
  238. html('console').movement=false;
  239. e.preventDefault();
  240. e.stopPropagation();
  241. }
  242. })
  243. top.document.addEventListener('mousemove',e=>{
  244. if(html('console').movement){
  245. html('console').style.left=(html('console').startPos.x+e.x-html('console').startPos.mx)+'px';
  246. html('console').style.top=(html('console').startPos.y+e.y-html('console').startPos.my)+'px';
  247. if(html('console').offsetTop<0)html('console').style.top='0px';
  248. e.preventDefault();
  249. e.stopPropagation();
  250. }
  251. });
  252. top.document.addEventListener('contextmenu', e=>{
  253. if(e.target==top.document.querySelector('#profile-extended-toggle>a>i')){
  254. html('console').style.display='block';
  255. e.preventDefault();
  256. }
  257. });
  258. el=make('div');
  259. el.id='console_head';
  260. el.innerHTML='KoGaMa Cheat Console by Exnonull';
  261. el.style=`
  262. width:100%;height:10%;
  263. background-color:#202225;
  264. cursor:default;
  265. border-top-left-radius:10px;
  266. border-top-right-radius:10px;
  267. `;
  268. html('console').appendChild(el);
  269. html('console_head').addEventListener('mousedown',e=>{
  270. html('console').movement=true;
  271. html('console').startPos={x:html('console').offsetLeft,y:html('console').offsetTop,mx:e.x,my:e.y};
  272. e.preventDefault();
  273. e.stopPropagation();
  274. });
  275. el=make('input');
  276. el.id='console_close';
  277. el.type='button';
  278. el.value='X';
  279. el.style=`
  280. position:absolute;
  281. height:10%;width:10%;
  282. right:0px;
  283. background-color:${kc.red};
  284. color:#FFF;line-height:0.5;
  285. border:none;
  286. border-top-right-radius:10px;
  287. `;
  288. html('console_head').appendChild(el);
  289. html('console_close').addEventListener('mousedown',e=>{
  290. if(e.which==1){
  291. pos={x:html('console').offsetLeft,y:html('console').offsetTop};
  292. html('console').style.display='none';
  293. html('console').style.left=pos.x+'px';
  294. html('console').style.top=pos.y+'px';
  295. }
  296. e.preventDefault();
  297. e.stopPropagation();
  298. });
  299. el=make('div');
  300. el.id='console_bar';
  301. el.style=`
  302. position:absolute;
  303. top:10%;left:0px;
  304. width:25%;height:90%;
  305. background-color:#2f3136;
  306. `;
  307. html('console').appendChild(el);
  308.  
  309. addBB('Console','console','console_box',1);
  310. html('console').appendChild(el);
  311. el=make('input');
  312. el.id='console_input';
  313. el.placeholder='Enter command...';
  314. el.style=`
  315. position:absolute;
  316. width:95%;height:10%;
  317. bottom:2.5%;right:2.5%;
  318. background-color:#4f545c;
  319. border:none;color:#FFF8;
  320. border-radius:15px;
  321. text-align:center;
  322. cursor:text;
  323. `;
  324. html('console_box').appendChild(el);
  325. html('console_input').index=-1;
  326. html('console_input').old=[];
  327. html('console_input').addEventListener('keydown',function(e){
  328. switch(e.keyCode){
  329. case 13:
  330. if(this.value){
  331. kc.command(this.value);
  332. if(this.old[this.old.length-1]!=this.value)this.old.push(this.value);
  333. if(this.old>30)this.old.splice(0,1);
  334. this.was=undefined;
  335. this.index=this.old.length;
  336. this.value='';
  337. }
  338. break;
  339. case 38://up
  340. this.index-=2;
  341. case 40://down
  342. this.index++;
  343. if(this.index>this.old.length-1)this.index=this.old.length;
  344. if(this.index<0)this.index=0;
  345. if(this.index>this.old.length-1){
  346. if(this.was!==undefined)this.value=this.was;
  347. this.was=undefined;
  348. }else{
  349. if(this.was===undefined)this.was=this.value;
  350. this.value=this.old[this.index];
  351. }
  352. break;
  353. }
  354. });
  355. el=make('div');
  356. el.id='console_log';
  357. el.className='scroller';
  358. el.style=`
  359. position:absolute;
  360. text-align:left;
  361. width:100%;height:85%;
  362. word-break:break-all;
  363. `;
  364. html('console_box').appendChild(el);
  365.  
  366. html('console').cur=html('console_box');
  367. html('console_bar').cur=html('console_bar_console');
  368.  
  369. addBB('Cheat List','list','cheat_box');
  370. html('cheat_box').className='scroller';
  371. makeCheat('finish',kc.blue,()=>kc.finish());
  372. makeCheat('mutant kill',kc.red,()=>Object.keys(kcc.names).map(n=>kcc.self!=kcc.names[n]&&kc.mutant_kill(kcc.names[n])));
  373. makeCheat('rail kill',kc.red,()=>Object.keys(kcc.names).map(n=>kcc.self!=kcc.names[n]&&kc.rail_kill(kcc.names[n])));
  374. makeCheat('autodamadge',kc.red,()=>{
  375. if(kc.idDamadge){clearInterval(kc.idDamadge);kc.idDamadge=0;}
  376. else kc.idDamadge=setInterval(()=>Object.keys(kcc.names).map(n=>kc.damadge(kcc.names[n])),5e2);
  377. });
  378. makeCheat('autofreeze',kc.green,()=>{
  379. if(kc.idFreeze){clearInterval(kc.idFreeze);kc.idFreeze=0;}
  380. else kc.idFreeze=setInterval(()=>Object.keys(kcc.names).map(n=>kc.freeze(kcc.names[n])),5e2);
  381. });
  382. makeCheat('autoheal',kc.green,()=>{
  383. if(kc.idHeal){clearInterval(kc.idHeal);kc.idHeal=0;}
  384. else kc.idHeal=setInterval(()=>Object.keys(kcc.names).map(n=>kc.heal(kcc.names[n])),2e2);
  385. });
  386. makeCheat('autobig',kc.green,()=>{
  387. if(kc.idBig){clearInterval(kc.idBig);kc.idBig=0;}
  388. else kc.idBig=setInterval(()=>Object.keys(kcc.names).map(n=>kc.big(kcc.names[n])),5e2);
  389. });
  390. makeCheat('autosmall',kc.green,()=>{
  391. if(kc.idSmall){clearInterval(kc.idSmall);kc.idSmall=0;}
  392. else kc.idSmall=setInterval(()=>Object.keys(kcc.names).map(n=>kc.small(kcc.names[n])),5e2);
  393. });
  394. makeCheat('heal',kc.green,()=>kc.heal());
  395. document.addEventListener('keydown',e=>{
  396. switch(e.key){
  397. case '`':
  398. kc.cubegun();
  399. break;
  400. case '-':
  401. kc.small();
  402. break;
  403. case '+':
  404. kc.big();
  405. break;
  406. }
  407. });
  408. makeCheat('big',kc.green,()=>kc.big());
  409. makeCheat('small',kc.green,()=>kc.small());
  410. makeCheat('cubegun',kc.blue,()=>kc.cubegun());
  411. makeCheat('cubenormal',kc.blue,()=>kcc.cubeMode=0);
  412. makeCheat('cubeplane',kc.blue,()=>kcc.cubeMode=1);
  413. makeCheat('cubegiant',kc.blue,()=>kcc.cubeMode=2);
  414. makeCheat('cuberoom',kc.blue,()=>kcc.cubeMode=3);
  415. makeCheat('cubexm',kc.blue,()=>kcc.cubeMode=4);
  416. makeCheat('cubexp',kc.blue,()=>kcc.cubeMode=5);
  417. makeCheat('cubezm',kc.blue,()=>kcc.cubeMode=6);
  418. makeCheat('cubezp',kc.blue,()=>kcc.cubeMode=7);
  419. makeCheat('normal',kc.blue,()=>kcc.cubeId=0);
  420. makeCheat('superbounce',kc.blue,()=>kcc.cubeId=kcc.superbounce);
  421. makeCheat('ice',kc.blue,()=>kcc.cubeId=kcc.ice);
  422. makeCheat('poison',kc.blue,()=>kcc.cubeId=kcc.poison);
  423. makeCheat('magma',kc.blue,()=>kcc.cubeId=kcc.magma);
  424. makeCheat('bounce',kc.blue,()=>kcc.cubeId=kcc.bounce);
  425. makeCheat('blackice',kc.blue,()=>kcc.cubeId=kcc.blackice);
  426. }
  427.  
  428. /*Kogama Cheat Client*/
  429. window.kcc=top.kcc={
  430. ws:{},
  431. self:0,
  432. pos:[0,0,0],
  433. names:{},
  434. parts:[],
  435. cubeSize:4,
  436. cubeD:1812,
  437. superbounce:1846,
  438. poison:1820,
  439. blackice:1835,
  440. ice:1817,
  441. magma:1818,
  442. bounce:1819,
  443. cubeId:0,
  444. cubeXZ:10,
  445. roomSize:4,
  446. cubeMode:0,
  447. cubeWay:50,
  448. cubeServer:(randomId=kcc.self,x=0,y=0,z=0,material)=>new Uint8Array([243,4,10,0,3,47,105,...toByte32(randomId),49,120,0,0,0,...(material?[9,2]:[7,0]),...toByte16(x),...toByte16(y),...toByte16(z),...(material?toByte16(material):[]),254,105,0,0,0,material?3:1]),
  449. cube:(randomId=kcc.self,x=0,y=0,z=0,material)=>new Uint8Array([243,2,7,0,2,47,105,...toByte32(randomId),49,120,0,0,0,...(material?[9,2]:[7,0]),...toByte16(x),...toByte16(y),...toByte16(z),...(material?toByte16(material):[])]),
  450. logClient:(msg,...items)=>{
  451. console.log.apply(console,['%c'+msg,"background-color:#0808;",...items]);
  452. },
  453. logServer:(msg,...items)=>{
  454. console.log.apply(console,['%c'+msg,"background-color:#F808;",...items]);
  455. },
  456. injectClient:function(data){
  457. data = new Uint8Array(data);
  458. data = kcc.separator(data);
  459. if(data)this._send(data);
  460. },
  461. injectServer:function(e){
  462. let data = new Uint8Array(e.data);
  463. if(this != kcc.ws){
  464. kcc.logServer(`wait injection: [${data.toString()}]`);
  465. return;
  466. }
  467. data = kcc.separator(data);
  468. if(data)this._msg({data:data.buffer});
  469. }
  470. };
  471.  
  472. /*requests separating*/
  473. kcc.no_sense=data=>{
  474. if(data.length<7)return true;//not action
  475. return false;
  476. /*
  477. if(data.equals([243,4,81,0,0])){//each tick
  478. //kcc.logServer('short_ping');
  479. return true;
  480. }else if(data.equals([243,2,58,0,0])){//1 time
  481. //kcc.logClient('short_ping(1)');
  482. return true;
  483. }else if(data.equals([243,2,102,0,0])){//1 time
  484. //kcc.logClient('short_ping(2)');
  485. return true;
  486. }else if(data.equals([243,2,95,0,0])){//1 time
  487. //kcc.logClient('short_ping(3)');//build->game, once
  488. return true;
  489. }else if(data.equals([243,1,0])){//1 time
  490. kcc.logServer('open connection');
  491. return true;
  492. }
  493. */
  494. }
  495.  
  496. kcc.separator=data=>{
  497. if(kcc.no_sense(data))return data;
  498.  
  499. head = data.slice(0,7);//[243, (client:2|6, server:4|7), actionId(u32), 105]
  500. reqId = head.slice(2,6);
  501. /*
  502. 2,6 - client
  503. 4,7 - server
  504. */
  505. source = (head[1]==2||head[1]==6)?"client":"server";
  506.  
  507. return new Uint8Array([...head, ...kcc[source+"Separator"](toNum32(reqId), data.slice(7))]);
  508. }
  509.  
  510. kcc.clientSeparator=(reqId,data)=>{
  511. switch(reqId){
  512. case 117441071://[7,0,2,47] 26->19 bytes
  513. let id=toNum32(data.slice(0,4));
  514. let material=toNum16(data.slice(17,19));
  515. let x=toNum16Sign(data.slice(11,13));
  516. let y=toNum16Sign(data.slice(13,15));
  517. let z=toNum16Sign(data.slice(15,17));
  518. //kc.log(`cubegun:{id:${id},x:${x},y:${y},z:${z},material:${material}}`,'#080');
  519. if(kcc.cubeMode){
  520. let arr=[];
  521. if(kcc.cubeMode==1){//plane
  522. for(let i=x-kcc.cubeXZ;i<=x+kcc.cubeXZ;i++)
  523. for(let i2=y-1;i2<=y-1;i2++)
  524. for(let i3=z-kcc.cubeXZ;i3<=z+kcc.cubeXZ;i3++){
  525. arr.push({x:unsign16(i),y:unsign16(i2),z:unsign16(i3)});
  526. }
  527. }else if(kcc.cubeMode==2){//giant
  528. for(let i=x-kcc.cubeSize;i<=x+kcc.cubeSize;i++)
  529. for(let i2=y-kcc.cubeSize;i2<=y+kcc.cubeSize;i2++)
  530. for(let i3=z-kcc.cubeSize;i3<=z+kcc.cubeSize;i3++){
  531. arr.push({x:unsign16(i),y:unsign16(i2),z:unsign16(i3)});
  532. }
  533. }else if(kcc.cubeMode==3){//room
  534. for(let i=x-kcc.roomSize;i<=x+kcc.roomSize;i++)
  535. for(let i2=y-1;i2<=y+kcc.roomSize*2-1;i2++)
  536. for(let i3=z-kcc.roomSize;i3<=z+kcc.roomSize;i3++){
  537. if(i==x-kcc.roomSize||i==x+kcc.roomSize||
  538. i2==y+kcc.roomSize*2-1||i2==y-1||
  539. i3==z-kcc.roomSize||i3==z+kcc.roomSize){
  540. arr.push({x:unsign16(i),y:unsign16(i2),z:unsign16(i3)});
  541. }
  542. }
  543. }else if(kcc.cubeMode==4){//xm
  544. for(let i=x-kcc.cubeWay;i<=x;i++)
  545. for(let i2=y-1;i2<=y-1;i2++)
  546. for(let i3=z-2;i3<=z+2;i3++){
  547. arr.push({x:unsign16(i),y:unsign16(i2),z:unsign16(i3)});
  548. }
  549. }else if(kcc.cubeMode==5){//xp
  550. for(let i=x;i<=x+kcc.cubeWay;i++)
  551. for(let i2=y-1;i2<=y-1;i2++)
  552. for(let i3=z-2;i3<=z+2;i3++){
  553. arr.push({x:unsign16(i),y:unsign16(i2),z:unsign16(i3)});
  554. }
  555. }else if(kcc.cubeMode==6){//zm
  556. for(let i=x-2;i<=x+2;i++)
  557. for(let i2=y-1;i2<=y-1;i2++)
  558. for(let i3=z-kcc.cubeWay;i3<=z;i3++){
  559. arr.push({x:unsign16(i),y:unsign16(i2),z:unsign16(i3)});
  560. }
  561. }else if(kcc.cubeMode==7){//zp
  562. for(let i=x-2;i<=x+2;i++)
  563. for(let i2=y-1;i2<=y-1;i2++)
  564. for(let i3=z;i3<=z+kcc.cubeWay;i3++){
  565. arr.push({x:unsign16(i),y:unsign16(i2),z:unsign16(i3)});
  566. }
  567. }
  568. arr.map((pos,i)=>{
  569. kcc.ws._msg({data:kcc.cubeServer(id,pos.x,pos.y,pos.z,kcc.cubeId?kcc.cubeId:material).buffer});
  570. kcc.ws._send(kcc.cube(id,pos.x,pos.y,pos.z,kcc.cubeId?kcc.cubeId:material));
  571. });
  572. }
  573. break;
  574. case 33556246://[2,0,7,22], 47->40 bytes
  575. //kc.log('moving','#080');
  576. //let PID=data.slice(0,4);//36 bytes
  577. kcc.pos=data.slice(4);
  578.  
  579. break;
  580. case 16777473://[1,0,1,1]
  581. //kcc.logClient('ping time');//(11)
  582. break;
  583. case 4278192982://toNum32([255,0,11,86]):
  584. kc.log('login','#080');
  585. break;
  586. case 1040188095://toNum32([62,0,2,191]):
  587. kc.log('[image part]','#080');
  588. break;
  589. case 385876415://toNum32([23,0,1,191]):
  590. kc.log('finish','#080');
  591. break;
  592. case 419430934://toNum32([25,0,2,22]):
  593. //kcc.self=toNum32(data.slice(0,4));
  594. break;
  595. case 654311702://toNum32([39,0,1,22]):
  596. //kcc.logClient('add model to inventory');
  597. break;
  598. case 738198312://toNum32([44,0,3,40]):
  599. //kcc.logClient('push model to the marketplace');
  600. break;
  601. case 218104104://toNum32([13,0,1,40]):
  602. //kcc.logClient('delete model from inventory');
  603. break;
  604. case 452985366://toNum32([27,0,2,22]):
  605. //kcc.logClient('use effect on player');
  606. break;
  607. }
  608. return data;
  609. }
  610. kcc.serverSeparator=(reqId,data)=>{
  611. //server:243,4,10,0,3,47,105,...toByte32(randomId),49,120,0,0,0,9,2,...toNum16(x),...toNum16(y),...toNum16(z),7,material,254,105,0,0,0,3
  612.  
  613. //client:243,2,7,0,2,47,105, 0,0,5,196,49,120,0,0,0,9,2,255,211,0,4,255,225
  614. // 243,4,10,0,3,47,105,0,0,5,207,49,120,0,0,0,7,0,255,229,0,4,255,213,254,105,0,0,0,1
  615.  
  616. //243,4,86,0,5,220,105,0,0,41,254,219,98,2,209,105,0,0,0,0,85,105,0,0,0,10,254,105,0,0,0,1
  617. switch(reqId){
  618. case toNum32([10,0,3,47])://case toNum32([86,0,5,220]):
  619. //kc.log('cubegun another');
  620. break;
  621. case toNum32([1,0,0,42]):
  622. //kcc.logServer('ping time');//(20)
  623. break;
  624. case toNum32([255,0,6,89]):
  625. {
  626. top.keks=top.keks?top.keks:[];
  627. let info=getJSON(decode(data))[0];
  628. top.keks.push(info);
  629. //kc.log(`[${info.UserName}]->joining`,'#F80');
  630. kcc.parts.push(info.UserName);
  631. }
  632. break;
  633. case toNum32([104,0,2,245]):
  634. {
  635. top.keks=top.keks?top.keks:[];
  636. let info=getJSON(decode(data))[0];
  637. top.keks.push(info);
  638. let pid=info.SpawnRolesRuntimeData.activeSpawnRole;//.spawnRoleAvatarIds[0];
  639. let name=kcc.parts.pop();
  640. kc.log(`[${name},${pid}]->joined`,'#F80');
  641. kcc.names[name]=pid;
  642. }
  643. break;
  644. case toNum32([102,0,10,245]):case toNum32([61,0,10,245]):
  645. {
  646. kc.log('joined','#F80');
  647. let info=getJSON(decode(data));
  648. top.kek=info;
  649. kcc.self=info[info.length-1].spawnRolesDefaultTypeWoIDMap;
  650. kcc.self=kcc.self?kcc.self.DefaultPlayModeSpawnRole:info[info.length-1].DefaultPlayModeSpawnRole;
  651. info=info.slice(1,info.length-1);
  652. for(let k=0;k<info.length;k+=3){
  653. kcc.names[info[k].UserName]=info[k+2].activeSpawnRole;
  654. }
  655. kc.log(`Player List:${JSON.stringify(kcc.names)}`,'#F80');
  656. }
  657. break;
  658. case toNum32([6,0,11,22]):
  659. {
  660. let id=toNum32(data.slice(0,4))-1;
  661. for(let k in kcc.names)if(kcc.names[k]==id){
  662. kc.log(`[${k},${id}]->left`,'#F80');
  663. delete kcc.names[k];break;
  664. }
  665. }
  666. break;
  667. }
  668. return data;
  669. }
  670.  
  671.  
Tags: Hack kogama
Advertisement
Comments
  • Embrosy
    1 year
    # text 0.33 KB | 0 0
    1. this cheat only
    2. kogama.com
    3.  
    4. kogama.com.br
    5.  
    6. and friends.kogama.com
    7.  
    8. works! 20/07/2020
    9.  
    10. --------setup hack!---------
    11. when the game is opened and
    12.  
    13. Right click on 3 lines next to your profile
    14.  
    15. here: https://prnt.sc/tl19bs
    16.  
    17. this will open: https://prnt.sc/tl1anx
    18.  
    19. you will click the cheat list..
    20.  
    21. https://prnt.sc/tl1glt enjoy !
Add Comment
Please, Sign In to add comment
Advertisement