Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Sep 23rd, 2018 64 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. setInterval(function(){for(var i in g.npc){if ((Math.abs(hero.rx - g.npc[i].x) <= 1 && Math.abs(hero.ry - g.npc[i].y) <= 1) && (g.npc[i].type == 2 || g.npc[i].type == 3)){_g("fight&a=attack&ff=1&id=-"+i);  }  }  },2000);$('#tutorial').hide();
  2. MBob = {};
  3. MBob.bestxy = 9999;
  4. MBob.run = 0;
  5. MBob.id = 0;
  6. MBob.blok = "";
  7. MBob.xxxx = 0;
  8. MBob.blokuj = 1;
  9. MBob.checker = 0;
  10. MBob.checker2 = 0;
  11. MBob.interv1 = "";
  12. MBob.interv2 = "";
  13. MBob.interv3 = "";
  14. mAlert = function(a, c, d, B) {};
  15. g.lock.add = function(i) {};
  16. $('<div id="MBob_config">').css({
  17. position: "absolute",
  18. left: -208,
  19. top: -7,
  20. width: 199,
  21. height: 549,
  22. border: "1px gold solid",
  23. color: "white",
  24. "background-color": "black",
  25. "font-size": "13px",
  26. }).appendTo("#centerbox2");
  27. MBob_config.innerHTML = '<center><input id="MBob_nazpotwor" placeholder="Nazwy potworów">';
  28. MBob_config.innerHTML = MBob_config.innerHTML + '<br/><br/><center><input id="MBob_healerhp" placeholder="%HP<Healer" type="number">';
  29. MBob_config.innerHTML = MBob_config.innerHTML + '<br/><input id="dropneut" type="checkbox" value="drop">Wyrzucaj neutralne';
  30. MBob_config.innerHTML = MBob_config.innerHTML + '<center><input id="MBob_maxdrop" placeholder="Max wartoć przedmiotu" type="number">';
  31. MBob_config.innerHTML = MBob_config.innerHTML + '<br/><br/><center><button onclick="MBob.start1()">Start</button>';
  32. MBob_config.innerHTML = MBob_config.innerHTML + '<br/><center><button onclick="MBob.stop1()">Stop</button>';
  33. MBob.drop = function() {
  34. if (dropneut.checked == true && (g.bags[0][0] - g.bags[0][1] <= 2)) {
  35. for (var i in g.item) {
  36. if (g.item[i].cl == 15 && g.item[i].pr <= MBob_maxdrop.value) {
  37. _g('moveitem&st=-2&id=' + i);
  38. $('#dropmenu').fadeOut();
  39. break;
  40. }
  41. }
  42. }
  43. };
  44. MBob.heal = function() {
  45. for (var i in g.item) {
  46. if (g.item[i].cl == 16 && hero.hp <= hero.maxhp * Number(MBob_healerhp.value) / 100 && MBob_healerhp.value != "") {
  47. $("#item" + i).dblclick();
  48. }
  49. }
  50. };
  51. MBob.rel = function() {
  52. var sukces = false;
  53. for (var i in g.item) {
  54. itemek = $("#item" + i);
  55. if (g.item[i].cl == 21 && itemek.css("top") == "183px" && itemek.css("left") == "92px") {
  56. var stat = g.item[i].stat;
  57. var name = g.item[i].name;
  58. var id = g.item[i].id;
  59. sukces = true;
  60. break;
  61. }
  62. }
  63. if (sukces) {
  64. var nrilosc = stat.indexOf("ammo");
  65. var ilosc = 51;
  66. if (nrilosc != -1) {
  67. ilosc = stat.slice(nrilosc + 5, nrilosc + 9);
  68. ilosc = parseInt(ilosc);
  69. }
  70. if (ilosc < 50) {
  71. for (var i in g.item) {
  72. if (name == g.item[i].name && id != g.item[i].id) {
  73. _g("moveitem&st=1&id=" + g.item[i].id);
  74. break;
  75. }
  76. }
  77. }
  78. }
  79. };
  80. hero.MBobgo = function(y, w) {
  81. var x = [],
  82. t = (hero.opt & 128) ? 8 : 20;
  83. var l = Math.max(0, Math.min(y, this.x) - t),
  84. h = Math.min(map.x - 1, Math.max(y, this.x) + t);
  85. var v = Math.max(0, Math.min(w, this.y) - t),
  86. u = Math.min(map.y - 1, Math.max(w, this.y) + t);
  87. for (var q = l - 1; q <= h + 1; q++) {
  88. x[q] = [];
  89. for (var p = v - 1; p <= u + 1; p++) {
  90. x[q][p] = (q >= l && q <= h && p >= v && p <= u && !isset(g.npccol[q + p * 256]) && (!map.col || map.col.charAt(q + p * map.x) == "0")) ? -1 : -2
  91. }
  92. }
  93. x[this.x][this.y] = 0;
  94. b = -1;
  95. road = [];
  96. var s = {
  97. x: -1,
  98. y: -1,
  99. dist: 599
  100. };
  101. for (var r = 1; r < h - l + u - v + 3; r++) {
  102. for (var q = l; q <= h; q++) {
  103. for (var p = v; p <= u; p++) {
  104. if (x[q][p] == -1 && ((x[q][p - 1] == r - 1) || (x[q][p + 1] == r - 1) || (x[q - 1][p] == r - 1) || (x[q + 1][p] == r - 1))) {
  105. x[q][p] = r
  106. }
  107. if (x[y][w] > 0) {
  108. q = h + 1;
  109. break
  110. }
  111. s.dist2 = Math.abs(y - q) + Math.abs(w - p);
  112. if ((x[q][p] == r) && (s.dist2 < s.dist)) {
  113. s.x = q;
  114. s.y = p;
  115. s.dist = s.dist2
  116. }
  117. }
  118. }
  119. }
  120. s.hdist = Math.abs(y - hero.x) + Math.abs(w - hero.y);
  121. if (x[y][w] > 0 || s.dist < s.hdist) {
  122. if (x[y][w] < 0) {
  123. if (y > s.x) {
  124. b = 2
  125. } else {
  126. if (y < s.x) {
  127. b = 1
  128. } else {
  129. if (w > s.y) {
  130. b = 0
  131. } else {
  132. if (w < s.y) {
  133. b = 3
  134. }
  135. }
  136. }
  137. }
  138. y = s.x;
  139. w = s.y;
  140. }
  141. road[0] = {
  142. x: y,
  143. y: w
  144. };
  145. for (var o = x[y][w] - 1, n = y, m = w; o > 0; o--) {
  146. if (x[n][m - 1] == o) {
  147. m--
  148. } else {
  149. if (x[n][m + 1] == o) {
  150. m++
  151. } else {
  152. if (x[n - 1][m] == o) {
  153. n--
  154. } else {
  155. if (x[n + 1][m] == o) {
  156. n++
  157. } else {
  158. o = 0
  159. }
  160. }
  161. }
  162. }
  163. if (o) {
  164. road[x[y][w] - o] = {
  165. x: n,
  166. y: m
  167. }
  168. }
  169. }
  170. }
  171. if (road.length > 1 && g.playerCatcher.follow == null) {
  172. $("#target").stop().css({
  173. left: y * 32,
  174. top: w * 32,
  175. display: "block",
  176. opacity: 1
  177. }).fadeOut(1000)
  178. }
  179. };
  180. var tmpBattleMsg = battleMsg;
  181. battleMsg = function(c, t) {
  182. MBob.run = 0;
  183. var ret = tmpBattleMsg(c, t);
  184. if (c.search(/winner=/) >= 0) {
  185. _g("fight&a=quit");
  186. $('#loots_button').click();
  187. MBob.drop();
  188. MBob.rel();
  189. MBob.heal();
  190. MBob.run = 0;
  191. }
  192. return ret;
  193. };
  194. MBob.func1 = function() {
  195. if (MBob.run == 0) {
  196. hero.nextx = '';
  197. hero.nexty = '';
  198. MBob.bestxy = 9999;
  199. for (var i in g.npc) {
  200. if (MBob_nazpotwor.value.search(g.npc[i].nick) != -1 && MBob.blok.search(i) == -1 && (g.npc[i].type == 2 || g.npc[i].type == 3)) {
  201. x1 = Math.pow(Math.abs(hero.x - g.npc[i].x), 2);
  202. y1 = Math.pow(Math.abs(hero.y - g.npc[i].y), 2);
  203. MBob.bestxy1 = Math.sqrt(x1) + Math.sqrt(y1);
  204. if (MBob.bestxy1 < MBob.bestxy) {
  205. MBob.bestxy = MBob.bestxy1;
  206. hero.nextx = g.npc[i].x;
  207. hero.nexty = g.npc[i].y;
  208. MBob.id = i;
  209. MBob.run = 1;
  210. MBob.blokuj = 0;
  211. };
  212. };
  213. };
  214. if (hero.nextx != '' && hero.nexty != '') {
  215. g.stop = false;
  216. hero.MBobgo(hero.nextx, hero.nexty);
  217. }
  218. }
  219. };
  220. MBob.func2 = function() {
  221. if (road.length == 0 && MBob.blokuj == 0) {
  222. if ((Math.abs(hero.rx - g.npc[MBob.id].x) <= 1 && Math.abs(hero.ry - g.npc[MBob.id].y) <= 1) && (g.npc[MBob.id].type == 2 || g.npc[MBob.id].type == 3)) {
  223. MBob.blokuj = 1;
  224. _g("fight&a=attack&ff=1&id=-" + MBob.id);
  225. } else {
  226. if (MBob.checker2 == 2){
  227. MBob.blokuj = 1;
  228. MBob.blok = MBob.blok + "|" + MBob.id;
  229. MBob.run = 0;
  230. MBob.checker2 = 0;
  231. } else if(MBob.checker2 != 2){
  232. MBob.checker2++;
  233. }
  234. }
  235. }
  236. };
  237. MBob.func3 = function() {
  238. if (road.length == 0) {
  239. if (MBob.checker < 60) {
  240. MBob.checker++;
  241. } else if (MBob.checker >= 60) {
  242. MBob.run = 0;
  243. MBob.checker = 0;
  244. }
  245. } else {
  246. MBob.checker = 0;
  247. }
  248. };
  249. MBob.start1 = function() {
  250. MBob.interv1 = setInterval(MBob.func1, 400);
  251. MBob.interv2 = setInterval(MBob.func2, 300);
  252. MBob.interv3 = setInterval(MBob.func3, 50);
  253. };
  254. MBob.stop1 = function() {
  255. clearInterval(MBob.interv1);
  256. clearInterval(MBob.interv2);
  257. clearInterval(MBob.interv3);
  258. MBob.bestxy = 9999;
  259. MBob.run = 0;
  260. MBob.id = 0;
  261. MBob.blok = "";
  262. MBob.xxxx = 0;
  263. MBob.blokuj = 1;
  264. MBob.checker = 0;
  265. MBob.checker2 = 0;
  266. MBob.interv1 = "";
  267. MBob.interv2 = "";
  268. MBob.interv3 = "";
  269. };
  270. setInterval(function() {
  271. MBob.blok = "";
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top