yolkbot 0.1.1-alpha.25 → 0.1.1-alpha.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yolkbot",
3
3
  "description": "create a shell shockers (self) bot in under 10 lines.",
4
- "version": "0.1.1-alpha.25",
4
+ "version": "0.1.1-alpha.26",
5
5
  "keywords": [
6
6
  "shell shockers",
7
7
  "shellshock.io",
package/src/bot.js CHANGED
@@ -1076,6 +1076,18 @@ export class Bot {
1076
1076
  const serverStateIdx = CommIn.unPackInt8U();
1077
1077
  player.serverStateIdx = serverStateIdx;
1078
1078
 
1079
+ /*
1080
+ l = Rh.unPackInt8U();
1081
+ var I = Rh.unPackInt8U();
1082
+ var P = Rh.unPackInt8U();
1083
+ p = Rh.unPackFloat();
1084
+ _ = Rh.unPackFloat();
1085
+ g = Rh.unPackFloat();
1086
+ var k = Rh.unPackInt8U();
1087
+ var D = Rh.unPackInt8U();
1088
+ var O = Rh.unPackInt8U();
1089
+ */
1090
+
1079
1091
  const newX = CommIn.unPackFloat();
1080
1092
  const newY = CommIn.unPackFloat();
1081
1093
  const newZ = CommIn.unPackFloat();
@@ -1518,6 +1530,7 @@ export class Bot {
1518
1530
  this.emit('packet', packet);
1519
1531
 
1520
1532
  let lastCommand = 0;
1533
+ let lastCode = 0;
1521
1534
  let abort = false;
1522
1535
 
1523
1536
  while (CommIn.isMoreDataAvailable() && !abort) {
@@ -1663,13 +1676,14 @@ export class Bot {
1663
1676
  break;
1664
1677
 
1665
1678
  default:
1666
- console.error(`handlePacket: I got but did not handle a: ${Object.keys(CommCode).find(k => CommCode[k] === cmd)}`);
1667
- if (lastCommand) console.error(`handlePacket: It may be a result of the ${lastCommand} command.`);
1679
+ console.error(`handlePacket: I got but did not handle a: ${Object.keys(CommCode).find(k => CommCode[k] === cmd)} ${cmd}`);
1680
+ if (lastCommand) console.error(`handlePacket: It may be a result of the ${lastCommand} command (${lastCode}).`);
1668
1681
  abort = true
1669
1682
  break;
1670
1683
  }
1671
1684
 
1672
1685
  lastCommand = Object.keys(CommCode).find(k => CommCode[k] === cmd);
1686
+ lastCode = cmd;
1673
1687
  }
1674
1688
  }
1675
1689