Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void autofarming(ENetPeer* peer) {
- int items21 = pInfo(peer)->autofarm_id;
- int c_ = 0;
- modify_inventory(peer, items21, c_);
- if (pInfo(peer)->save_time + 65 < (duration_cast<milliseconds>(system_clock::now().time_since_epoch())).count()) {
- if (pInfo(peer)->save_time != 0) {
- if (pInfo(peer)->autofarm == true && c_ >= 2) {
- if (pInfo(peer)->y / 32 == pInfo(peer)->y / 32) {
- edit_tile(peer, pInfo(peer)->x / 32 + (pInfo(peer)->state == 16 ? -1 : 1), pInfo(peer)->y / 32, items21);
- edit_tile(peer, pInfo(peer)->x / 32 + (pInfo(peer)->state == 16 ? -2 : 2), pInfo(peer)->y / 32, items21);
- }
- else if (pInfo(peer)->x / 32 == pInfo(peer)->x / 32) {
- if (pInfo(peer)->y / 32 > pInfo(peer)->y / 32 || pInfo(peer)->y / 32 < pInfo(peer)->y / 32) {
- edit_tile(peer, pInfo(peer)->x / 32, pInfo(peer)->y / 32 + (pInfo(peer)->y / 32 > pInfo(peer)->y / 32 ? 1 : -1), 18);
- edit_tile(peer, pInfo(peer)->x / 32, pInfo(peer)->y / 32 + (pInfo(peer)->y / 32 > pInfo(peer)->y / 32 ? 2 : -2), 18);
- }
- }
- else if (pInfo(peer)->y / 32 < pInfo(peer)->y / 32 || pInfo(peer)->y / 32 > pInfo(peer)->y / 32) {
- 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);
- 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);
- }
- }
- }
- pInfo(peer)->save_time = (duration_cast<milliseconds>(system_clock::now().time_since_epoch())).count();
- }
- }
- void autofarming2(ENetPeer* peer) {
- if (pInfo(peer)->autofarm == true) {
- if (pInfo(peer)->save_time + 50 < (duration_cast<milliseconds>(system_clock::now().time_since_epoch())).count()) {
- if (pInfo(peer)->save_time != 0) {
- if (pInfo(peer)->y / 32 == pInfo(peer)->y / 32) {
- edit_tile(peer, pInfo(peer)->x / 32 + (pInfo(peer)->state == 16 ? -1 : 1), pInfo(peer)->y / 32, 18);
- edit_tile(peer, pInfo(peer)->x / 32 + (pInfo(peer)->state == 16 ? -2 : 2), pInfo(peer)->y / 32, 18);
- }
- else if (pInfo(peer)->x / 32 == pInfo(peer)->x / 32) {
- if (pInfo(peer)->y / 32 > pInfo(peer)->y / 32 || pInfo(peer)->y / 32 < pInfo(peer)->y / 32) {
- edit_tile(peer, pInfo(peer)->x / 32, pInfo(peer)->y / 32 + (pInfo(peer)->y / 32 > pInfo(peer)->y / 32 ? 1 : -1), 18);
- edit_tile(peer, pInfo(peer)->x / 32, pInfo(peer)->y / 32 + (pInfo(peer)->y / 32 > pInfo(peer)->y / 32 ? 2 : -2), 18);
- }
- }
- else if (pInfo(peer)->y / 32 < pInfo(peer)->y / 32 || pInfo(peer)->y / 32 > pInfo(peer)->y / 32) {
- 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);
- 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);
- }
- }
- }
- autofarming(peer);
- pInfo(peer)->save_time = (duration_cast<milliseconds>(system_clock::now().time_since_epoch())).count();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement