Advertisement
LordFuton

Untitled

Mar 27th, 2023
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.05 KB | None | 0 0
  1. void autofarming(ENetPeer* peer) {
  2.     int items21 = pInfo(peer)->autofarm_id;
  3.     int c_ = 0;
  4.     modify_inventory(peer, items21, c_);
  5.     if (pInfo(peer)->save_time + 65 < (duration_cast<milliseconds>(system_clock::now().time_since_epoch())).count()) {
  6.         if (pInfo(peer)->save_time != 0) {
  7.             if (pInfo(peer)->autofarm == true && c_ >= 2) {
  8.                 if (pInfo(peer)->y / 32 == pInfo(peer)->y / 32) {
  9.                     edit_tile(peer, pInfo(peer)->x / 32 + (pInfo(peer)->state == 16 ? -1 : 1), pInfo(peer)->y / 32, items21);
  10.                     edit_tile(peer, pInfo(peer)->x / 32 + (pInfo(peer)->state == 16 ? -2 : 2), pInfo(peer)->y / 32, items21);
  11.                 }
  12.                 else if (pInfo(peer)->x / 32 == pInfo(peer)->x / 32) {
  13.                     if (pInfo(peer)->y / 32 > pInfo(peer)->y / 32 || pInfo(peer)->y / 32 < pInfo(peer)->y / 32) {
  14.                         edit_tile(peer, pInfo(peer)->x / 32, pInfo(peer)->y / 32 + (pInfo(peer)->y / 32 > pInfo(peer)->y / 32 ? 1 : -1), 18);
  15.                         edit_tile(peer, pInfo(peer)->x / 32, pInfo(peer)->y / 32 + (pInfo(peer)->y / 32 > pInfo(peer)->y / 32 ? 2 : -2), 18);
  16.                     }
  17.                 }
  18.                 else if (pInfo(peer)->y / 32 < pInfo(peer)->y / 32 || pInfo(peer)->y / 32 > pInfo(peer)->y / 32) {
  19.                     edit_tile(peer, pInfo(peer)->x / 32 + (pInfo(peer)->state == 16 ? -1 : 1), pInfo(peer)->y / 32 + (pInfo(peer)->y / 32 < pInfo(peer)->y / 32 ? -1 : 1), 18);
  20.                     edit_tile(peer, pInfo(peer)->x / 32 + (pInfo(peer)->state == 16 ? -2 : 2), pInfo(peer)->y / 32 + (pInfo(peer)->y / 32 < pInfo(peer)->y / 32 ? -2 : 2), 18);
  21.                 }
  22.             }
  23.         }
  24.         pInfo(peer)->save_time = (duration_cast<milliseconds>(system_clock::now().time_since_epoch())).count();
  25.     }
  26. }
  27.  
  28. void autofarming2(ENetPeer* peer) {
  29.     if (pInfo(peer)->autofarm == true) {
  30.         if (pInfo(peer)->save_time + 50 < (duration_cast<milliseconds>(system_clock::now().time_since_epoch())).count()) {
  31.             if (pInfo(peer)->save_time != 0) {
  32.                 if (pInfo(peer)->y / 32 == pInfo(peer)->y / 32) {
  33.                     edit_tile(peer, pInfo(peer)->x / 32 + (pInfo(peer)->state == 16 ? -1 : 1), pInfo(peer)->y / 32, 18);
  34.                     edit_tile(peer, pInfo(peer)->x / 32 + (pInfo(peer)->state == 16 ? -2 : 2), pInfo(peer)->y / 32, 18);
  35.                 }
  36.                 else if (pInfo(peer)->x / 32 == pInfo(peer)->x / 32) {
  37.                     if (pInfo(peer)->y / 32 > pInfo(peer)->y / 32 || pInfo(peer)->y / 32 < pInfo(peer)->y / 32) {
  38.                         edit_tile(peer, pInfo(peer)->x / 32, pInfo(peer)->y / 32 + (pInfo(peer)->y / 32 > pInfo(peer)->y / 32 ? 1 : -1), 18);
  39.                         edit_tile(peer, pInfo(peer)->x / 32, pInfo(peer)->y / 32 + (pInfo(peer)->y / 32 > pInfo(peer)->y / 32 ? 2 : -2), 18);
  40.                     }
  41.                 }
  42.                 else if (pInfo(peer)->y / 32 < pInfo(peer)->y / 32 || pInfo(peer)->y / 32 > pInfo(peer)->y / 32) {
  43.                     edit_tile(peer, pInfo(peer)->x / 32 + (pInfo(peer)->state == 16 ? -1 : 1), pInfo(peer)->y / 32 + (pInfo(peer)->y / 32 < pInfo(peer)->y / 32 ? -1 : 1), 18);
  44.                     edit_tile(peer, pInfo(peer)->x / 32 + (pInfo(peer)->state == 16 ? -2 : 2), pInfo(peer)->y / 32 + (pInfo(peer)->y / 32 < pInfo(peer)->y / 32 ? -2 : 2), 18);
  45.                 }
  46.             }
  47.         }
  48.         autofarming(peer);
  49.         pInfo(peer)->save_time = (duration_cast<milliseconds>(system_clock::now().time_since_epoch())).count();
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement