$${
//Macro: RammStein Enchantment
//Versão do Jogo: 1.8
//Feito por: Dallas013/AsyNc
//Telegram: @BrenoXavier
//Macro desenvolvido para o clan RMS - RammStein
SET(vip);
TOGGLE(
@Dallas);
IF(
@Dallas);
ACHIEVEMENTGET("[ON] Versão 1.0","gold_block");
LOG("");
LOG("&3[AsyNc] &bAtivando macro &6AsyNc Enchantment&b.");
LOG("");
SET(@dallas_onchat);
IF(!@dallas_onchat);
LOG("");
LOG("&3[AsyNc] &bErro, &6AsyNc OnChat &bnão detectada.");
LOG("");
ACHIEVEMENTGET("[OFF] Versão 1.0","gold_block");
LOG("");
LOG("&3[AsyNc] &bDesativando macro &6AsyNc Enchantment&b.");
LOG("");
STOP;
ELSE;
SET(#teleport_delay,3);
IF(!vip);
SET(#teleport_delay,6);
ECHO(/pvp off);
ENDIF;
ECHO("/home anmob");
WAIT(%#teleport_delay%);
SET(#chest,1);
SET(#dye_chest,1);
SET(#store_chest,1);
SET(#store_chest_invert,1);
DO;
IF(%LEVEL%>=30);
DO;
IF(vip);
DO;
ECHO("/encantar");
WAIT(400MS);
UNTIL(%GUI%="GUIENCHANTMENT");
ELSE;
DO;
LOOK(0,30,0.4);
GUI("");
KEY(USE);
WAIT(400MS);
UNTIL(%GUI%="GUIENCHANTMENT");
ENDIF;
UNSAFE;
UNSET(#enchant_item_slot);
UNSET(#dye_slot);
FOR(#table,37,2);
GETSLOTITEM(%#table%,&table_item,#stack);
IF(!%#enchant_item_slot%);
IFMATCHES(%&table_item%,"^diamond_helmet$|^diamond_chestplate$|^diamond_leggings$|^diamond_boots$");
SET(#enchant_item_slot,%#table%);
ENDIF;
ENDIF;
IF(!%#dye_slot%);
IFMATCHES(%&table_item%,"^dye$");
IF(#stack>=3);
SET(#dye_slot,%#table%);
ENDIF;
ENDIF;
ENDIF;
IF(%#table%>=29);
IFMATCHES(%&table_item%,"^diamond_helmet$|^diamond_chestplate$|^diamond_leggings$|^diamond_boots$|^diamond_sword$|^diamond_axe$|^iron_sword$|^iron_axe$|^diamond_block$|^iron_block$|^dye$|^air$");
ELSE;
LOOK(358,343);
SLOTCLICK(%#table%,L,FALSE);
WAIT(200MS);
SLOTCLICK(-999,L,FALSE);
ENDIF;
ENDIF;
NEXT;
ENDUNSAFE;
SET(enchant);
DECODE(L2cgJmJlbmNhbnRlaSB1bSBwNHVtYjMgJjYjYXN5bmM=,&desenchant);
IF(!%#enchant_item_slot%);
UNSET(chest_pick_success);
DO;
UNSET(enchant);
DO;
GUI("");
IF(%#chest%=1);
LOOK(270,332,0.4);
ELSEIF(%#chest%=2);
LOOK(270,4,0.4);
ELSEIF(%#chest%=3);
LOOK(270,34,0.4);
ELSEIF(%#chest%=4);
LOOK(270,56,0.4);
ELSEIF(%#chest%=5);
LOOK(302,336,0.4);
ELSEIF(%#chest%=6);
LOOK(302,3,0.4);
ELSEIF(%#chest%=7);
LOOK(302,30,0.4);
ELSEIF(%#chest%=8);
LOOK(312,50,0.4);
ELSE;
ACHIEVEMENTGET("[OFF] Versão 1.0","gold_block");
LOG("");
LOG("&3[AsyNc] &bTodos os baus estão vazios.");
LOG("");
LOG("");
LOG("&3[AsyNc] &bDesativando macro &6AsyNc Enchantment&b.");
LOG("");
STOP;
ENDIF;
KEY(USE);
WAIT(400MS);
UNTIL(%GUI%="GUICHEST");
UNSAFE;
SET(#chest_empty,0);
FOR(#chest_slot,0,53);
GETSLOTITEM(%#chest_slot%,&chest_slot_item);
IFMATCHES(%&chest_slot_item%,"^diamond_helmet$|^diamond_chestplate$|^diamond_leggings$|^diamond_boots$");
SET(chest_pick_success);
SLOTCLICK(%#chest_slot%,L,TRUE);
WAIT(400MS);
BREAK;
ELSE;
INC(#chest_empty,1);
ENDIF;
IF(%#chest_empty%>=54);
INC(#chest,1);
ENDIF;
NEXT;
ENDUNSAFE;
UNTIL(chest_pick_success);
ENDIF;
IF(!%#dye_slot%);
UNSET(dye_stop);
DO;
UNSET(enchant);
DO;
GUI("");
IF(%#dye_chest%=1);
LOOK(240,7,0.4);
ELSEIF(%#dye_chest%=2);
LOOK(240,45,0.4);
ELSEIF(%#dye_chest%=3);
LOOK(180,61,0.4);
ELSEIF(%#dye_chest%=4);
LOOK(121,43,0.4);
ELSEIF(%#dye_chest%=5);
LOOK(121,6,0.4);
ELSE;
ACHIEVEMENTGET("[OFF] Versão 1.0","gold_block");
LOG("");
LOG("&3[AsyNc] &bTodos os baus estão vazios.");
LOG("");
LOG("");
LOG("&3[AsyNc] &bDesativando macro &6AsyNc Enchantment&b.");
LOG("");
STOP;
ENDIF;
KEY(USE);
WAIT(400MS);
UNTIL(%GUI%="GUICHEST");
UNSAFE;
SET(#dye_chest_empty);
UNSET(dye_pick_stop);
FOR(#dye_chest_slot,0,53);
GETSLOTITEM(%#dye_chest_slot%,&dye_chest_item,#dye_chest_stack);
IF(!dye_pick_stop);
IFMATCHES(%&dye_chest_item%,"^dye$");
SLOTCLICK(%#dye_chest_slot%,L,TRUE);
IF(%#dye_chest_stack%>=3);
SET(dye_pick_stop);
SET(dye_stop);
ENDIF;
ENDIF;
INC(#dye_chest_empty,1);
ENDIF;
IF(%#dye_chest_empty%>=54);
INC(#dye_chest,1);
ENDIF;
NEXT;
ENDUNSAFE;
UNTIL(dye_stop);
ENDIF;
IF(enchant);
SLOTCLICK(%#enchant_item_slot%,L,TRUE);
WAIT(400MS);
SLOTCLICK(%#dye_slot%,L,TRUE);
WAIT(1);
PRESSBUTTON(2);
WAIT(1);
SLOTCLICK(0,L,TRUE);
WAIT(400MS);
SLOTCLICK(1,L,TRUE);
WAIT(400MS);
FOR(#hotbar_enchant_slot,9,1);
SLOT(%#hotbar_enchant_slot%);
IFMATCHES(%ITEM%,"^diamond_helmet$|^diamond_chestplate$|^diamond_leggings$|^diamond_boots$");
BREAK;
ENDIF;
NEXT;
UNSET(protection);
UNSET(unbreaking);
UNSET(thorns);
LOG("");
LOG("&3[AsyNc] &bEncantamento(s)");
LOG("");
FOREACH(enchantments);
IFMATCHES(%ENCHANTMENT%,"^Protection IV$|^Proteção IV$");
SET(protection);
ENDIF;
IFMATCHES(%ENCHANTMENT%,"^Unbreaking III$|^Inquebrável III$");
SET(unbreaking);
ENDIF;
IFMATCHES(%ENCHANTMENT%,"^Thorns|^Espinhos");
SET(thorns);
ENDIF;
LOG("&3[AsyNc] &6%ENCHANTMENT%");
NEXT;
LOG("");
SET(store);
SET(#store_for_start,0);
SET(#store_for_end,53);
UNSET(invert);
IF((protection&&unbreaking)&&(!thorns));
SET(invert);
ECHO(%&desenchant%);
ELSE;
IF(vip);
ECHO("/desencantar");
UNSET(store);
ELSE;
SET(#store_for_start,53);
SET(#store_for_end,0);
ENDIF;
ENDIF;
IF(store);
UNSET(store_stop);
DO;
DO;
GUI("");
IF(vip||invert);
IF(%#store_chest%=1);
LOOK(90,332,0.4);
ELSEIF(%#store_chest%=2);
LOOK(90,4,0.4);
ELSEIF(%#store_chest%=3);
LOOK(90,34,0.4);
ELSEIF(%#store_chest%=4);
LOOK(90,56,0.4);
ELSEIF(%#store_chest%=5);
LOOK(57,336,0.4);
ELSEIF(%#store_chest%=6);
LOOK(57,3,0.4);
ELSEIF(%#store_chest%=7);
LOOK(57,30,0.4);
ELSEIF(%#store_chest%=8);
LOOK(46,50,0.4);
ENDIF;
ELSE;
IF(%#store_chest_invert%=8);
LOOK(88,332,0.4);
ELSEIF(%#store_chest_invert%=7);
LOOK(88,4,0.4);
ELSEIF(%#store_chest_invert%=6);
LOOK(88,34,0.4);
ELSEIF(%#store_chest_invert%=5);
LOOK(88,56,0.4);
ELSEIF(%#store_chest_invert%=4);
LOOK(56,336,0.4);
ELSEIF(%#store_chest_invert%=3);
LOOK(56,3,0.4);
ELSEIF(%#store_chest_invert%=2);
LOOK(56,30,0.4);
ELSEIF(%#store_chest_invert%=1);
LOOK(47,47,0.4);
ENDIF;
ENDIF;
IF(%#store_chest%>8);
ACHIEVEMENTGET("[OFF] Versão 1.0","gold_block");
LOG("");
LOG("&3[AsyNc] &bTodos os baus estão cheios.");
LOG("");
LOG("");
LOG("&3[AsyNc] &bDesativando macro &6AsyNc Enchantment&b.");
LOG("");
STOP;
ENDIF;
KEY(USE);
WAIT(400MS);
UNTIL(%GUI%="GUICHEST");
UNSAFE;
SET(#store_full,0);
UNSET(store_sucess);
FOR(#store_slot,%#store_for_start%,%#store_for_end%);
GETSLOTITEM(%#store_slot%,&store_chest_item);
IFMATCHES(%&store_chest_item%,"^air$");
FOR(#store_hotbar_slot,89,81);
IF(!store_sucess);
GETSLOTITEM(%#store_hotbar_slot%,&store_hotbar_item);
IFMATCHES(%&store_hotbar_item%,"^diamond_helmet$|^diamond_chestplate$|^diamond_leggings$|^diamond_boots$");
SLOTCLICK(%#store_hotbar_slot%,L,FALSE);
WAIT(400MS);
SLOTCLICK(%#store_slot%,L,FALSE);
WAIT(400MS);
SET(store_sucess);
SET(store_stop);
BREAK;
ENDIF;
ENDIF;
NEXT;
IF(store_sucess);
BREAK;
ENDIF;
ELSE;
INC(#store_full,1);
ENDIF;
IF(%#store_full%>=54);
IF(vip||invert);
INC(#store_chest,1);
ELSE;
INC(#store_chest_invert,1);
ENDIF;
ENDIF;
NEXT;
ENDUNSAFE;
UNTIL(store_stop);
ENDIF;
ENDIF;
UNTIL(%LEVEL%<30);
WAIT(400MS);
GUI("");
ENDIF;
IF(%GUI%="GUICHAT");
LOG("");
LOG("&3[AsyNc] &bChat detectado, feche para continuar.");
LOG("");
DO;
UNTIL(%GUI%="NONE");
ELSE;
IF(%GUI%!="NONE");
LOG("");
LOG("&3[AsyNc] &bJanela detectada, fechando em &65 segundos&b.");
LOG("");
UNSAFE;
FOR(#time,5,1);
IF(%GUI%="NONE");
BREAK;
ENDIF;
IF(%#time%=1);
SET(&text,"segundo");
ELSE;
SET(&text,"segundos");
ENDIF;
ACHIEVEMENTGET("Voltando em %#time% %&text%","gold_block");
WAIT(1);
NEXT;
GUI();
ENDUNSAFE;
ENDIF;
ENDIF;
LOOK(180,350);
PICK(diamond_sword,diamond_axe,iron_sword,iron_axe);
IF(%HIT%="ENTITY");
KEY(ATTACK);
ENDIF;
IF(%DURABILITY%<=50);
DO;
PICK(diamond_sword,diamond_axe,iron_sword,iron_axe);
LOOK(,90,0.4);
KEY(USE);
UNTIL(%DURABILITY%>50);
ENDIF;
LOOP;
ENDIF;
ELSE;
ACHIEVEMENTGET("[OFF] Versão 1.0","gold_block");
LOG("");
LOG("&3[AsyNc] &bDesativando macro &6AsyNc Enchantment&b.");
LOG("");
STOP;
ENDIF;
}$$