Suvarii commited on
Commit
1c0b198
·
verified ·
1 Parent(s): bd2cadc

Update bot.js

Browse files
Files changed (1) hide show
  1. bot.js +8 -7
bot.js CHANGED
@@ -175,8 +175,7 @@ function createBot() {
175
  pos: e.position ? { x: Number(e.position.x.toFixed(2)), y: Number(e.position.y.toFixed(2)), z: Number(e.position.z.toFixed(2)) } : null
176
  }));
177
  // Sadece tek satır JSON; istersen tamamen kapatabilirsin
178
- console.log("/home sonrası kısa entity listesi:");
179
- console.log(JSON.stringify(minimal));
180
  } catch (e) {
181
  // sessizce geç
182
  }
@@ -528,11 +527,13 @@ function createBot() {
528
  if (minyoncani <= 2) {
529
  bot.clickWindow(36, 0, 0);
530
  logger.info(`[${config["bot-account"]["username"]}] Minyon canı ${minyoncani} olduğu için besleyici minyon beslendi.`);
531
- try { bot.chat(`Minyon canı ${minyoncani} olduğu için besleyici ile beslendi.`); } catch (e) {}
 
532
  bot.closeWindow(window);
533
  } else {
534
  logger.info(`[${config["bot-account"]["username"]}] Minyon canı ${minyoncani} olduğu için yenilenmedi.`);
535
- try { bot.chat(`Minyon canı ${minyoncani} olduğu için yenilenmedi.`); } catch (e) {}
 
536
  bot.closeWindow(window);
537
  }
538
  } else {
@@ -647,9 +648,9 @@ const port = process.env.PORT || 7860;
647
 
648
  app.get("/", (req, res) => res.send("Pinglendi"));
649
 
650
- app.listen(port, () => console.log(`Bot bu adres üzerinde çalışıyor: http://localhost:${port}`));
651
 
652
  process.on("uncaughtException", function (err) {
653
- console.error("Hata aldım!");
654
- console.log(err);
655
  });
 
175
  pos: e.position ? { x: Number(e.position.x.toFixed(2)), y: Number(e.position.y.toFixed(2)), z: Number(e.position.z.toFixed(2)) } : null
176
  }));
177
  // Sadece tek satır JSON; istersen tamamen kapatabilirsin
178
+ logger.info("/home sonrası kısa entity listesi: " + JSON.stringify(minimal));
 
179
  } catch (e) {
180
  // sessizce geç
181
  }
 
527
  if (minyoncani <= 2) {
528
  bot.clickWindow(36, 0, 0);
529
  logger.info(`[${config["bot-account"]["username"]}] Minyon canı ${minyoncani} olduğu için besleyici minyon beslendi.`);
530
+ // Sunucuya mesaj atmak yerine logger.info ile kaydediyoruz
531
+ logger.info(`Minyon canı ${minyoncani} olduğu için besleyici ile beslendi.`);
532
  bot.closeWindow(window);
533
  } else {
534
  logger.info(`[${config["bot-account"]["username"]}] Minyon canı ${minyoncani} olduğu için yenilenmedi.`);
535
+ // Sunucuya mesaj atmak yerine logger.info ile kaydediyoruz
536
+ logger.info(`Minyon canı ${minyoncani} olduğu için yenilenmedi.`);
537
  bot.closeWindow(window);
538
  }
539
  } else {
 
648
 
649
  app.get("/", (req, res) => res.send("Pinglendi"));
650
 
651
+ app.listen(port, () => logger.info(`Bot bu adres üzerinde çalışıyor: http://localhost:${port}`));
652
 
653
  process.on("uncaughtException", function (err) {
654
+ logger.error("Hata aldım!");
655
+ logger.error(err && err.stack ? err.stack : err);
656
  });