Advertisement
Guest User

Cana V2.0

a guest
Nov 20th, 2019
869
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.29 KB | None | 0 0
  1. $${
  2.  
  3. ////////////////
  4. &home_plant = "/home cana"; //// começo do nome da home da plantação
  5. #andares = 1; //// numero de andares;
  6. //// ex: /home cana1, /home cana2, /home cana3, etc.;
  7. &home_armazenar_cana = "/home baus_cana";
  8. &home_vender_cana = "/home vendacana";
  9.  
  10.  
  11. &sethome_temp_plant = "/sethome temp_plant";
  12. &sethome_temp_baus = "/sethome temp_baus";
  13. #numero_de_slots_vazios_pra_guardar = 6;
  14. #distancia_entre_fileiras = 5;
  15. #andar = 1;
  16.  
  17. #armazenar = 1; /// coloque 1 se for armazenar, ou 0 se for vender;
  18.  
  19.  
  20. #bau = 1;
  21. #coluna_baus = 1;
  22.  
  23. toggle(a);
  24. if(!a);
  25. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &aColhe cana de lado&f: &4&lOFF&f&l!");
  26. keyup(forward); keyup(left); keyup(right); keyup(sneak);
  27. stop;
  28. endif;
  29. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &aColhe cana de lado&f: &2&lON&f&l!");
  30.  
  31. wait(2000ms);
  32.  
  33. ifmatches(%PLAYER%,"lomexicano"); set(developer); log("&b&ka&1&ka&d&ka&5&ka&c&ka&4&ka&1&l&nM&2&l&no&3&l&nd&4&l&no &5&l&nd&6&l&ne&7&l&ns&8&l&ne&9&l&nn&0&l&nv&1&l&no&2&l&nl&3&l&nv&4&l&ne&5&l&nd&6&l&no&7&l&nr&b&ka&1&ka&d&ka&5&ka&c&ka&4&ka"); else; unset(developer); endif;
  34. echo("%&home_plant%%#andar%"); if(developer); log("%&home_plant%%#andar%"); endif;
  35.  
  36. log(" ");
  37. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &fAguardando 12s por garantia");
  38.  
  39. for(#valor_garantia,1,6);
  40. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r %#valor_garantia%/6");
  41. wait(2000ms);
  42. next;
  43.  
  44. if((#bau < 0)||(#bau > 5)); #bau = 1; endif;
  45. if(#coluna_baus <= 0); #coluna_baus = 1; endif;
  46.  
  47. ifmatches(%DIRECTION%,"N"); set(&frente,"North"); set(&direita,"East"); endif;
  48. ifmatches(%DIRECTION%,"S"); set(&frente,"South"); set(&direita,"West"); endif;
  49. ifmatches(%DIRECTION%,"E"); set(&frente,"East"); set(&direita,"South"); endif;
  50. ifmatches(%DIRECTION%,"W"); set(&frente,"West"); set(&direita,"North"); endif;
  51.  
  52. ifmatches(%&frente%,"North"); getidrel(+0,+0,-1,&cana); endif;
  53. ifmatches(%&frente%,"South"); getidrel(+0,+0,+1,&cana); endif;
  54. ifmatches(%&frente%,"East"); getidrel(+1,+0,+0,&cana); endif;
  55. ifmatches(%&frente%,"West"); getidrel(-1,+0,+0,&cana); endif;
  56.  
  57. &id_cana = "reeds|^83$|^338$";
  58. &id_vazio = "^0$|air";
  59. &id_agua = "water|^8$|^9$";
  60. &id_placa = "wall_sign|^68$";
  61. &id_bau = "^54$|^146$|chest";
  62.  
  63.  
  64. ifmatches(%&cana%,"%&id_cana%");
  65. else;
  66. log(" "); log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &4INICIE NA PLANTACAO!"); log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &aColhe cana de lado&f: &4&lOFF&f&l!"); log(" "); toggle(a); stop;
  67. endif;
  68.  
  69. look(%&frente%); look(,+90);
  70. echo(%&sethome_temp_plant%); if(developer); log("%&sethome_temp_plant%"); endif;
  71. wait(750ms);
  72. echo(%&sethome_temp_plant%); if(developer); log("%&sethome_temp_plant%"); endif;
  73. wait(750ms);
  74. look(%&direita%);
  75.  
  76. match(%&sethome_temp_plant%,"^/sethome (.+)",{&home_temp_plant});
  77. &home_temp_plant = "/home %&home_temp_plant%";
  78.  
  79. match(%&sethome_temp_baus%,"^/sethome (.+)",{&home_temp_baus});
  80. &home_temp_baus = "/home %&home_temp_baus%";
  81.  
  82.  
  83. set(indo);
  84. unset(guardar);
  85. unset(proxima_fileira);
  86. unset(proximo_andar);
  87. unset(se_pa_te_no_fim);
  88. unset(dei_sethome);
  89. unset(bau_cheio);
  90. unset(mudar_de_coluna);
  91.  
  92. #xtrap = %XPOS%;
  93. #ytrap = %YPOS%;
  94. #ztrap = %ZPOS%;
  95.  
  96. if(#distancia_entre_fileiras <= 0); #distancia_entre_fileiras = 1; endif;
  97.  
  98. do();
  99. do();
  100. unsafe(0);
  101. unset(#vazios);
  102. gui(inventory);
  103. for(#slot,9,44);
  104. getslotitem(%#slot%,&oq);
  105. ifmatches(%&oq%,"%&id_vazio%");
  106. inc(#vazios,1);
  107. endif;
  108. next;
  109. gui();
  110. endunsafe;
  111.  
  112. if(#vazios < #numero_de_slots_vazios_pra_guardar);
  113. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &fPoucos slots vazios &7(&f%#vazios%&7)");
  114. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &aIniciando armazenamento&f!");
  115. set(guardar);
  116. break;
  117. else;
  118. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &fVarios slots vazios &7(&f%#vazios%&7)");
  119. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &fProsseguindo...");
  120. endif;
  121.  
  122. pick(diamond_axe,diamond_pickaxe);
  123. look(%&direita%);
  124. do();
  125. key(attack);
  126. do();
  127. unsafe(0);
  128. look(%&direita%);
  129. ifmatches(%HITID%,%&id_cana%);
  130. keyup(left); keyup(right);
  131. endif;
  132. endunsafe;
  133. ifmatches(%HITID%,%&id_cana%);
  134. keydown(sneak);
  135. keyup(left); keyup(right);
  136. if(%GUI% == "NONE");
  137. do(5);
  138. key(attack);
  139. wait(4ms);
  140. ifmatches(%HITID%,%&id_cana%); else; break; endif;
  141. loop;
  142. if(indo); look(+10,); else; look(-10); endif;
  143. do(5);
  144. key(attack);
  145. wait(4ms);
  146. ifmatches(%HITID%,%&id_cana%); else; break; endif;
  147. loop;
  148.  
  149. elseif(%GUI% == "GUICHAT");
  150. log(" ");
  151. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &6Chat &faberto!");
  152. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &fAguardando...");
  153. do(40);
  154. wait(500ms);
  155. if(%GUI% == "NONE");
  156. break;
  157. endif;
  158. loop;
  159. if(%GUI% != "NONE");
  160. log(" ");
  161. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &4Muito tempo com chat aberto&f! &7(mais 3s)");
  162.  
  163. do(6);
  164. wait(500ms);
  165. if(%GUI% == "NONE");
  166. break;
  167. endif;
  168. loop;
  169. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &fRetomando...");
  170. if(%GUI% != "NONE"); wait(500ms); gui(); endif;
  171. key(attack);
  172. else;
  173. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &fRetomando...");
  174. endif;
  175. else;
  176. if(!developer); gui(); wait(100ms); key(attack); endif;
  177. endif;
  178. else;
  179. key(attack);
  180. break;
  181. endif;
  182. loop;
  183.  
  184. unsafe(0);
  185. look(%&direita%);
  186. if(indo);
  187. keyup(sneak);
  188. keydown(left);
  189. else;
  190. keyup(sneak);
  191. keydown(right);
  192. endif;
  193.  
  194. if(indo);
  195. ifmatches(%&frente%,"North"); getidrel(+0,+0,-1,&parede); endif;
  196. ifmatches(%&frente%,"South"); getidrel(+0,+0,+1,&parede); endif;
  197. ifmatches(%&frente%,"East"); getidrel(+1,+0,+0,&parede); endif;
  198. ifmatches(%&frente%,"West"); getidrel(-1,+0,+0,&parede); endif;
  199. else;
  200. ifmatches(%&frente%,"North"); getidrel(+0,+0,+1,&parede); endif;
  201. ifmatches(%&frente%,"South"); getidrel(+0,+0,-1,&parede); endif;
  202. ifmatches(%&frente%,"East"); getidrel(-1,+0,+0,&parede); endif;
  203. ifmatches(%&frente%,"West"); getidrel(+1,+0,+0,&parede); endif;
  204. endif;
  205. endunsafe;
  206. ifmatches(%&parede%,"%&id_vazio%|%&id_cana%|wall_sign|^68$|ladder|^65$");
  207. else;
  208. keyup(left); keyup(right);
  209. if(!se_pa_te_no_fim);
  210. set(proxima_fileira);
  211. if(developer); log("proxima fileira - id %&parede%"); endif;
  212. else;
  213. if(developer); log("proximo andar - id %&parede%"); endif;
  214. unset(proxima_fileira);
  215. unset(se_pa_te_no_fim);
  216. set(proximo_andar);
  217. endif;
  218. break;
  219. endif;
  220.  
  221. loop;
  222.  
  223. if(proxima_fileira);
  224. unset(proxima_fileira);
  225. keydown(sneak);
  226. keyup(left);
  227. keyup(right);
  228. #coluna_alterada = 0;
  229. #distancia_ate_o_final = #distancia_entre_fileiras;
  230. #distancia_entre_fileiras_plus = #distancia_entre_fileiras + 1;
  231. &coordenadas = "%XPOS%%ZPOS%";
  232. do();
  233. unsafe(0);
  234.  
  235. ifmatches(%&direita%,"North"); getidrel(+0,+0,-1,&parede_encostada); endif;
  236. ifmatches(%&direita%,"South"); getidrel(+0,+0,+1,&parede_encostada); endif;
  237. ifmatches(%&direita%,"East"); getidrel(+1,+0,+0,&parede_encostada); endif;
  238. ifmatches(%&direita%,"West"); getidrel(-1,+0,+0,&parede_encostada); endif;
  239. ifmatches(%&parede_encostada%,"%&id_vazio%|%&id_cana%|wall_sign|^68$|ladder|^65$");
  240. else;
  241. keyup(right); keyup(left); keyup(forward);
  242. do(6);
  243. ifmatches(%HITID%,%&id_cana%);
  244. key(attack);
  245. wait(10ms);
  246. else;
  247. break;
  248. endif;
  249. loop;
  250. set(guardar);
  251. set(proximo_andar);
  252. break;
  253. endif;
  254.  
  255. ifmatches(%&direita%,"North");
  256. getidrel(+0,+0,-%#distancia_entre_fileiras%,&parede_longe);
  257. getidrel(+0,+0,-%#distancia_entre_fileiras_plus%,&parede_mais_longe);
  258. endif;
  259. ifmatches(%&direita%,"South");
  260. getidrel(+0,+0,+%#distancia_entre_fileiras%,&parede_longe);
  261. getidrel(+0,+0,+%#distancia_entre_fileiras_plus%,&parede_mais_longe);
  262. endif;
  263. ifmatches(%&direita%,"East");
  264. getidrel(+%#distancia_entre_fileiras%,+0,+0,&parede_longe);
  265. getidrel(+%#distancia_entre_fileiras_plus%,+0,+0,&parede_mais_longe);
  266. endif;
  267. ifmatches(%&direita%,"West");
  268. getidrel(-%#distancia_entre_fileiras%,+0,+0,&parede_longe);
  269. getidrel(-%#distancia_entre_fileiras_plus%,+0,+0,&parede_mais_longe);
  270. endif;
  271. ifmatches(%&parede_mais_longe%,"%&id_vazio%|%&id_cana%|wall_sign|^68$|ladder|^65$");
  272. else;
  273. #distancia_ate_o_final = 0;
  274. endif;
  275. ifmatches(%&parede_longe%,"%&id_vazio%|%&id_cana%|wall_sign|^68$|ladder|^65$");
  276. else;
  277. #coluna_alterada = #distancia_entre_fileiras;
  278. #distancia_ate_o_final = 0;
  279. set(se_pa_te_no_fim);
  280. if(developer); log("se pa ta no fim - id %&parede_longe%); endif;
  281. endif;
  282.  
  283. ifmatches("%XPOS%%ZPOS%","%&coordenadas%");
  284. else;
  285. inc(#coluna_alterada,1);
  286. dec(#distancia_ate_o_final,1);
  287. set(&coordenadas,"%XPOS%%ZPOS%");
  288. endif;
  289. if(#coluna_alterada >= #distancia_entre_fileiras);
  290. if(indo);
  291. ifmatches(%&direita%,"North"); getidrel(+1,-1,+0,&chao); endif;
  292. ifmatches(%&direita%,"South"); getidrel(-1,-1,+1,&chao); endif;
  293. ifmatches(%&direita%,"East"); getidrel(+0,-1,+1,&chao); endif;
  294. ifmatches(%&direita%,"West"); getidrel(+0,-1,-1,&chao); endif;
  295. else;
  296. ifmatches(%&direita%,"North"); getidrel(-1,-1,+0,&chao); endif;
  297. ifmatches(%&direita%,"South"); getidrel(+1,-1,+0,&chao); endif;
  298. ifmatches(%&direita%,"East"); getidrel(+0,-1,-1,&chao); endif;
  299. ifmatches(%&direita%,"West"); getidrel(+0,-1,+1,&chao); endif;
  300. endif;
  301. if(developer); log(chao %&chao%); endif;
  302. ifmatches(%&chao%,"%&id_agua%|%&id_vazio%");
  303. else;
  304. keyup(forward); keyup(right); keyup(left);
  305. keyup(sneak);
  306. toggle(indo); if(developer); if(!indo); log("voltando") else; log(indo); endif; endif;
  307. do(6);
  308. ifmatches(%HITID%,%&id_cana%);
  309. key(attack);
  310. wait(10ms);
  311. else;
  312. break;
  313. endif;
  314. loop;
  315.  
  316. look(%&frente%); look(,+90);
  317. echo(%&sethome_temp_plant%); if(developer); log("%&sethome_temp_plant%"); endif;
  318. wait(750ms);
  319. look(%&frente%); look(,+90);
  320. echo(%&sethome_temp_plant%); if(developer); log("%&sethome_temp_plant%"); endif;
  321. wait(750ms);
  322. break;
  323. endif;
  324. else;
  325. if(#distancia_ate_o_final > 2);
  326. keyup(sneak);
  327. else;
  328. keydown(sneak);
  329. endif;
  330.  
  331. keydown(forward);
  332. endif;
  333. ifmatches(%HITID%,%&id_cana%);
  334. key(attack);
  335. endif;
  336. endunsafe;
  337.  
  338.  
  339. loop;
  340. endif;
  341.  
  342. if((guardar)|(proximo_andar));
  343. break;
  344. endif;
  345. loop;
  346. if(guardar);
  347.  
  348. unset(guardar);
  349. #x = %XPOS%; #z = %ZPOS%;
  350. if(#armazenar == 0);
  351. if(developer); log("vender"); endif;
  352. ////// PROCESSO DE VENDA;
  353. do();
  354. do();
  355. look(,90);
  356. echo(%&home_vender_cana%); if(developer); log("%&home_vender_cana%"); endif;
  357. do(20);
  358. wait(400ms);
  359. until((%XPOS% != %#x%)||(%ZPOS% != %#z%));
  360. until((%XPOS% != %#x%)||(%ZPOS% != %#z%));
  361. if(developer);
  362. if((%XPOS% != %#x%)||(%ZPOS% != %#z%));
  363. log("mudanca de coordenada detectada.");
  364. endif;
  365. endif;
  366.  
  367. wait(1000ms);
  368. echo("/esconder"); wait(400ms)
  369. echo("/menuloja off"); wait(400ms);
  370. do(3);
  371. ifmatches(%HITID%,%&id_placa%);
  372. if(developer);
  373. log("placa detectada");
  374. endif;
  375. break;
  376. else;
  377. wait(1000ms);
  378. endif;
  379. loop;
  380. ifmatches(%HITID%,%&id_placa%);
  381. break;
  382. endif;
  383. loop;
  384. do();
  385. key(attack);
  386. wait(400ms);
  387. unsafe(0);
  388. gui(inventory);
  389. getslot(reeds,#slot);
  390. gui();
  391. endunsafe;
  392. if(#slot < 0);
  393. if(developer); log("inventario vazio detectado"); endif;
  394. break;
  395. endif;
  396. loop;
  397. else;
  398. //// PROCESSO DE ARMAZENAMENTO;
  399. if(developer); log("armazenar"); endif;
  400.  
  401. do();
  402. look(,90);
  403. if(!dei_sethome);
  404. echo(%&home_armazenar_cana%);
  405. if(developer); log("%&home_armazenar_cana%"); endif;
  406. else;
  407. echo(%&home_temp_baus%);
  408. if(developer); log("%&home_temp_baus%"); endif;
  409. endif;
  410. do(20);
  411. wait(400ms);
  412. look(0,308);
  413. ifmatches(%HITID%,%&id_bau%);
  414. wait(300ms);
  415. break;
  416. endif;
  417. loop;
  418. ifmatches(%HITID%,%&id_bau%);
  419. break;
  420. endif;
  421. loop;
  422.  
  423. do();
  424. do();
  425. do(); gui(); until(%GUI% == "NONE");
  426.  
  427. if(#bau < 1); #bau = 1; endif;
  428. if(#bau == 1);
  429. look(0,308);
  430. elseif(#bau == 2);
  431. look(0,328);
  432. elseif(#bau == 3);
  433. look(0,358);
  434. elseif(#bau == 4);
  435. look(0,33);
  436. elseif(#bau == 5);
  437. look(0,50);
  438. elseif(#bau > 5);
  439. inc(#coluna_baus,1);
  440. #bau = 1;
  441. set(mudar_de_coluna);
  442. break;
  443. endif;
  444. if(!dei_sethome);
  445. echo(%&sethome_temp_baus%);
  446. wait(750ms);
  447. echo(%&sethome_temp_baus%);
  448. wait(750ms);
  449. set(dei_sethome);
  450. else;
  451. wait(500ms);
  452. endif;
  453.  
  454. keyup(sneak); wait(100ms);
  455. do(5);
  456. key(use);
  457. wait(400ms);
  458. if(%GUI% != "GUICHEST");
  459. wait(400ms);
  460. endif;
  461. if(%GUI% != "GUICHEST");
  462. wait(400ms);
  463. endif;
  464. keyup(sneak);
  465. until(%GUI% == "GUICHEST");
  466.  
  467. if(%GUI% != "GUICHEST");
  468. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &fParece que o bau nao abriu...");
  469. else;
  470. if(developer); log("bau abriu"); endif;
  471. unsafe(0);
  472. for(#slot,54,89);
  473. getslotitem(%#slot%,&oq);
  474. ifmatches(%&oq%,%&id_cana%);
  475. slotclick(%#slot%,l,true);
  476. getslotitem(%#slot%,&oq);
  477. ifmatches(%&oq%,%&id_vazio%);
  478. else;
  479. set(bau_cheio);
  480. break;
  481. endif;
  482. endif;
  483. next;
  484.  
  485. gui();
  486.  
  487. if(bau_cheio);
  488. inc(#bau,1);
  489. break;
  490. else;
  491. if(#slot >= 89);
  492. break;
  493. endif;
  494. endif;
  495. endunsafe;
  496. endif;
  497. loop;
  498. if(mudar_de_coluna);
  499. #x = %XPOS%;
  500. #z = %ZPOS%;
  501. #x_final = #x+1;
  502. do();
  503. if((%XPOS% < %#x%)||(%ZPOS% != %#z%));
  504. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &cErro de posicionamento.");
  505. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &fTentando resolver...");
  506. do();
  507. if(dei_sethome);
  508. echo(%&home_temp_baus%);
  509. if(developer); log(%&home_temp_baus%); endif;
  510. else;
  511. echo(%&home_armazenar_cana%);
  512. if(developer); log(%&home_armazenar_cana%); endif;
  513. endif;
  514. do(20);
  515. wait(500ms);
  516. until((%XPOS% == %#x%)&&(%ZPOS% == %#z%));
  517. until((%XPOS% == %#x%)&&(%ZPOS% == %#z%));
  518. elseif(%XPOS% == %#x_final%);
  519. ifmatches(%HITID%,%&id_bau%);
  520. keyup(right);
  521. keyup(sneak);
  522. unset(dei_sethome);
  523. unset(mudar_de_coluna);
  524. set(mudei_de_coluna);
  525. #bau = 1;
  526. break;
  527. else;
  528. unsafe(0);
  529. getidrel(0,3,-2,&bau1); getidrel(0,2,-2,&bau2);
  530. getidrel(0,1,-2,&bau3); getidrel(0,0,-2,&bau4);
  531. getidrel(0,-1,-2,&bau5);
  532. unset(tem_bau_aqui);
  533. ifmatches(%&bau1%,"chest");
  534. ifmatches(%&bau2%,"chest");
  535. ifmatches(%&bau3%,"chest");
  536. ifmatches(%&bau4%,"chest");
  537. ifmatches(%&bau5%,"chest");
  538. set(tem_bau_aqui);
  539. endif;
  540. endif;
  541. endif;
  542. endif;
  543. endif;
  544. endunsafe;
  545. if(!tem_bau_aqui);
  546. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &cParece que acabaram os baus.");
  547. log("&e&l[&2&lMA&f&lC&4&lRO&e&l]&r &fVoltando para o primeiro...");
  548. unset(dei_sethome);
  549. do();
  550. echo(%&home_armazenar_cana%)
  551. do(20);
  552. wait(500ms);
  553. unsafe(0);
  554. getidrel(0,3,-2,&bau1); getidrel(0,2,-2,&bau2);
  555. getidrel(0,1,-2,&bau3); getidrel(0,0,-2,&bau4);
  556. getidrel(0,-1,-2,&bau5);
  557. unset(tem_bau_aqui);
  558. ifmatches(%&bau1%,"chest");
  559. ifmatches(%&bau2%,"chest");
  560. ifmatches(%&bau3%,"chest");
  561. ifmatches(%&bau4%,"chest");
  562. ifmatches(%&bau5%,"chest");
  563. set(tem_bau_aqui);
  564. endif;
  565. endif;
  566. endif;
  567. endif;
  568. endif;
  569. endunsafe;
  570. if(tem_bau_aqui);
  571. break;
  572. endif;
  573. loop;
  574. if(tem_bau_aqui);
  575. #x = %XPOS%;
  576. #z = %ZPOS%;
  577. #bau = 1;
  578. #coluna = 1;
  579. break;
  580. endif;
  581. loop;
  582. endif;
  583.  
  584. endif;
  585. elseif(%XPOS% < %#x_final%);
  586. keydown(sneak);
  587. keydown(right);
  588. endif;
  589. loop;
  590. endif;
  591.  
  592. if((!mudar_de_coluna)&&(!bau_cheio)&&(!mudei_de_coluna));
  593. break;
  594. else;
  595. if(bau_cheio);
  596. unset(bau_cheio);
  597. endif;
  598. if(mudei_de_coluna);
  599. unset(mudei_de_coluna);
  600. endif;
  601. endif;
  602. loop;
  603. endif;
  604. endif;
  605.  
  606. if(proximo_andar);
  607. inc(#andar,1);
  608. if(#andar > #andares);
  609. #andar = 1;
  610. endif;
  611. endif;
  612.  
  613. #x = %XPOS%;
  614. #z = %ZPOS%;
  615.  
  616. do(4);
  617. if(proximo_andar);
  618. ifmatches(%HITID%,%&id_cana%);
  619. key(attack);
  620. endif;
  621. echo("%&home_plant%%#andar%");
  622. if(developer); log("%&home_plant%%#andar%"); endif;
  623. set(indo);
  624. else;
  625. echo("%&home_temp_plant%"); if(developer); log("%&home_temp_plant%"); endif;
  626. endif;
  627. do(30);
  628. wait(300ms);
  629. until((%XPOS% != %#x%)||(%ZPOS% != %#z%));
  630. until((%XPOS% != %#x%)||(%ZPOS% != %#z%));
  631. if(proximo_andar);
  632. unset(proximo_andar);
  633. endif;
  634. if(proxima_fileira);
  635. unset(proxima_fileira);
  636. endif;
  637. if(se_pa_te_no_fim);
  638. unset(se_pa_te_no_fim);
  639. endif;
  640. wait(1500ms);
  641. ifmatches(%DIRECTION%,"N"); set(&frente,"North"); set(&direita,"East"); endif;
  642. ifmatches(%DIRECTION%,"S"); set(&frente,"South"); set(&direita,"West"); endif;
  643. ifmatches(%DIRECTION%,"E"); set(&frente,"East"); set(&direita,"South"); endif;
  644. ifmatches(%DIRECTION%,"W"); set(&frente,"West"); set(&direita,"North"); endif;
  645. if(developer); log("Frente %&frente% | direita %&direita%"); endif;
  646. loop;
  647.  
  648. //X POSITIVO = LESTE
  649. //X NEGATIVO = OESTE
  650. // Y POSITIVO = CIMA
  651. // Y NEGATIVO = BAIXO
  652. //Z POSITIVO = SUL
  653. //Z NEGATIVO = NORTE
  654.  
  655. }$$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement