Advertisement
Guest User

Untitled

a guest
Sep 26th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.64 KB | None | 0 0
  1. ///////////////////////
  2. //Peace/Tame script ///
  3. //Made by Aga ///
  4. //Do not loop ///
  5. ///////////////////////
  6. @clearlist 'nameoftames'
  7. @clearlist 'numberoffollowers'
  8. @clearlist 'peacemakeyesorno'
  9. @clearlist 'pathfinding'
  10. @clearlist 'tameables'
  11. @createlist 'nameoftames'
  12. @createlist 'numberoffollowers'
  13. @createlist 'peacemakeyesorno'
  14. @createlist 'pathfinding'
  15. /////////////////////////
  16. //Setup section ////
  17. /////////////////////////
  18. pushlist 'nameoftames' 'bored' //Change thxaga to whatever name you want
  19. pushlist 'numberoffollowers' '1' //Change 1 to however many followers you currently have
  20. pushlist 'peacemakeyesorno' 'no' //yes or no if you want to peacemake
  21. pushlist 'pathfinding' 'yes' //yes or no if you want to pathfind to tame
  22. /////////////////////////
  23. //End Setup ////
  24. /////////////////////////
  25. @clearjournal
  26. if not timerexists 'skilltimer'
  27. createtimer 'skilltimer'
  28. settimer 'skilltimer' 10000
  29. endif
  30. @createlist 'unstuck'
  31. if list 'unstuck' == 0
  32. pushlist 'unstuck' 'east'
  33. pushlist 'unstuck' 'west'
  34. pushlist 'unstuck' 'south'
  35. pushlist 'unstuck' 'north'
  36. endif
  37. @clearlist 'timestried'
  38. @createlist 'timestried'
  39. @createlist 'tameables'
  40. unsetalias 'currentlytaming'
  41. unsetalias 'found'
  42. pushlist 'tameables' 0xe8 //Bull
  43. pushlist 'tameables' 0xe9 //Bull2
  44. pushlist 'tameables' 0x22 //White Wolf
  45. pushlist 'tameables' 0x25 //White Wolf2
  46. pushlist 'tameables' 0x41 //Snow leopard
  47. pushlist 'tameables' 0x40 //Snow leopard
  48. pushlist 'tameables' 0xea //Great Hart
  49. pushlist 'tameables' 0xd4 //grizzly bear
  50. pushlist 'tameables' 0xd5 //polar bear
  51. pushlist 'tameables' 0xdd //walrus
  52. pushlist 'tameables' 0x40 //snow leapord
  53. pushlist 'tameables' 0xbc //Savage Ridgeback
  54. pushlist 'tameables' 0x50 //Giant Toad
  55. pushlist 'tameables' 0x122 //Boar
  56. pushlist 'tameables' 0xe1 //Timber Wolf
  57. pushlist 'tameables' 0xed //Hind
  58. pushlist 'tameables' 0x51 //Bullfrog
  59. pushlist 'tameables' 0xd3 //Black Bear
  60. pushlist 'tameables' 0x124 //Pack Llama
  61. pushlist 'tameables' 0x123 //Pack Horse
  62. pushlist 'tameables' 0xc8 //Horse
  63. pushlist 'tameables' 0xcc //Horse
  64. pushlist 'tameables' 0xe2 //Horse2
  65. pushlist 'tameables' 0xe4 //Horse3
  66. pushlist 'tameables' 0xca //Alligator
  67. pushlist 'tameables' 0x3f //Cougar
  68. pushlist 'tameables' 0xd6 //Panther
  69. pushlist 'tameables' 0xa7 //Brown Bear
  70. pushlist 'tameables' 0x19 //Gray wolf
  71. pushlist 'tameables' 0x1b //Gray wolf2
  72. while not dead 'self'
  73. if list 'timestried' > 15
  74. clearlist 'timestried'
  75. ignoreobject 'currentlytaming'
  76. unsetalias 'currentlytaming'
  77. removetimer 'stucktimer'
  78. headmsg 'Tried more than 10 times to tame. Ignoring' 5
  79. endif
  80. warmode 'on'
  81. warmode 'off'
  82. if hits 'self' != maxhits 'self'
  83. if @inlist 'peacemakeyesorno' 'Yes' or @inlist 'peacemakeyesorno' 'yes'
  84. getenemy 'red' 'criminal' 'nearest'
  85. while war 'enemy'
  86. if timer 'skilltimer' > 10000
  87. @cleartargetqueue
  88. @canceltarget
  89. while not targetexists 'any'
  90. useskill 'Peacemaking'
  91. endwhile
  92. settimer 'skilltimer' 0
  93. target 'enemy'
  94. if war 'self'
  95. warmode 'off'
  96. endif
  97. endif
  98. endwhile
  99. endif
  100. endif
  101. if not @inrange 'currentlytaming' 12
  102. @headmsg 'Too far away! Ignoring for now.' 34 'currentlytaming'
  103. @unsetalias 'currentlytaming'
  104. removetimer 'stucktimer'
  105. for 0 to 'tameables'
  106. if @findtype tameables[] 'any' 'ground' 1 8
  107. @setalias 'currentlytaming' 'found'
  108. createtimer 'stucktimer'
  109. settimer 'stucktimer' 0
  110. createtimer 'imstuck'
  111. settimer 'imstuck' 0
  112. if innocent 'currentlytaming'
  113. @headmsg 'This is already tame' 34 'currentlytaming'
  114. ignoreobject 'currentlytaming'
  115. unsetalias 'currentlytaming'
  116. removetimer 'stucktimer'
  117. removetimer 'imstuck'
  118. endif
  119. endif
  120. endfor
  121. endif
  122. if not @inrange 'currentlytaming' 2
  123. @headmsg 'Not close enough!' 34 'currentlytaming'
  124. endif
  125. if @inlist 'peacemakeyesorno' 'Yes' or @inlist 'peacemakeyesorno' 'yes'
  126. if war 'currentlytaming'
  127. if war 'self'
  128. warmode 'off'
  129. endif
  130. if timer 'skilltimer' > 10000
  131. @cleartargetqueue
  132. @canceltarget
  133. if not targetexists 'any'
  134. useskill 'Peacemaking'
  135. endif
  136. if @injournal 'Whom do you wish to calm?' 'system'
  137. settimer 'skilltimer' 0
  138. clearjournal
  139. endif
  140. target 'currentlytaming'
  141. if war 'self'
  142. warmode 'off'
  143. endif
  144. endif
  145. endif
  146. endif
  147. if @inlist 'peacemakeyesorno' 'No' or @inlist 'peacemakeyesorno' 'no'
  148. if @inrange 'currentlytaming' 2
  149. if war 'self'
  150. warmode 'off'
  151. endif
  152. if timer 'skilltimer' > 10000
  153. @cleartargetqueue
  154. @canceltarget
  155. @clearjournal
  156. if not targetexists 'any'
  157. useskill 'Animal Taming'
  158. endif
  159. pause 500
  160. if @injournal 'Tame which animal?' 'system'
  161. pushlist 'timestried' 1
  162. @settimer 'skilltimer' 0
  163. @clearjournal
  164. endif
  165. target 'currentlytaming'
  166. pause 500
  167. if @injournal 'That is too far away' 'system' or @injournal 'Target cannot be seen' 'system'
  168. settimer 'skilltimer' 10501
  169. ignoreobject 'currentlytaming'
  170. unsetalias 'currentlytaming'
  171. removetimer 'stucktimer'
  172. removetimer 'imstuck'
  173. clearlist 'timestried'
  174. @clearjournal
  175. endif
  176. if @injournal 'You fail to tame the creature' 'system' or @injournal 'You must wait a few moments to use another skill' 'system'
  177. settimer 'skilltimer' 10501
  178. @clearjournal
  179. endif
  180. if @injournal 'You have no chance of taming this creature' 'system' or @injournal 'do not have a clear path to the animal' 'system'
  181. ignoreobject 'currentlytaming'
  182. settimer 'skilltimer' 10501
  183. unsetalias 'currentlytaming'
  184. removetimer 'stucktimer'
  185. removetimer 'imstuck'
  186. clearlist 'timestried'
  187. @clearjournal
  188. endif
  189. if @injournal 'This animal has had too many owners' 'system' or @injournal 'That animal looks tame already' 'system'
  190. settimer 'skilltimer' 10501
  191. ignoreobject 'currentlytaming'
  192. unsetalias 'currentlytaming'
  193. removetimer 'stucktimer'
  194. removetimer 'imstuck'
  195. clearlist 'timestried'
  196. @clearjournal
  197. endif
  198. endif
  199. endif
  200. endif
  201. if @inlist 'peacemakeyesorno' 'Yes' or @inlist 'peacemakeyesorno' 'yes'
  202. if not war 'currentlytaming'
  203. if @inrange 'currentlytaming' 2
  204. if war 'self'
  205. warmode 'off'
  206. endif
  207. if timer 'skilltimer' > 10500
  208. @cleartargetqueue
  209. @canceltarget
  210. @clearjournal
  211. if not targetexists 'any'
  212. useskill 'Animal Taming'
  213. endif
  214. pause 500
  215. if @injournal 'Tame which animal?' 'system'
  216. pushlist 'timestried' 1
  217. @settimer 'skilltimer' 0
  218. @clearjournal
  219. endif
  220. target 'currentlytaming'
  221. pause 500
  222. if @injournal 'That is too far away' 'system' or @injournal 'Target cannot be seen' 'system'
  223. settimer 'skilltimer' 10501
  224. ignoreobject 'currentlytaming'
  225. unsetalias 'currentlytaming'
  226. removetimer 'stucktimer'
  227. removetimer 'imstuck'
  228. clearlist 'timestried'
  229. @clearjournal
  230. endif
  231. if @injournal 'You fail to tame the creature' 'system' or @injournal 'You must wait a few moments to use another skill' 'system'
  232. settimer 'skilltimer' 10501
  233. @clearjournal
  234. endif
  235. if @injournal 'You have no chance of taming this creature' 'system' or @injournal 'do not have a clear path to the animal' 'system'
  236. ignoreobject 'currentlytaming'
  237. settimer 'skilltimer' 10501
  238. unsetalias 'currentlytaming'
  239. removetimer 'stucktimer'
  240. removetimer 'imstuck'
  241. clearlist 'timestried'
  242. @clearjournal
  243. endif
  244. if @injournal 'This animal has had too many owners' 'system' or @injournal 'That animal looks tame already' 'system'
  245. settimer 'skilltimer' 10501
  246. ignoreobject 'currentlytaming'
  247. unsetalias 'currentlytaming'
  248. removetimer 'stucktimer'
  249. removetimer 'imstuck'
  250. clearlist 'timestried'
  251. @clearjournal
  252. endif
  253. endif
  254. endif
  255. endif
  256. endif
  257. if @inlist 'numberoffollowers' '0'
  258. while followers > 0
  259. pause 500
  260. @rename 'currentlytaming' nameoftames[0]
  261. pause 500
  262. if name 'currentlytaming' == nameoftames[0]
  263. waitforcontext 'currentlytaming' 8 15000
  264. while not @gumpexists 0x909cc741
  265. pause 500
  266. endwhile
  267. pause 500
  268. replygump 0x909cc741 2
  269. clearlist 'timestried'
  270. ignoreobject 'currentlytaming'
  271. unsetalias 'currentlytaming'
  272. removetimer 'stucktimer'
  273. removetimer 'imstuck'
  274. pause 500
  275. endif
  276. endwhile
  277. endif
  278. if @inlist 'numberoffollowers' '1'
  279. while followers > 1
  280. pause 500
  281. @rename 'currentlytaming' nameoftames[0]
  282. pause 500
  283. if name 'currentlytaming' == nameoftames[0]
  284. waitforcontext 'currentlytaming' 8 15000
  285. while not @gumpexists 0x909cc741
  286. pause 500
  287. endwhile
  288. pause 500
  289. replygump 0x909cc741 2
  290. clearlist 'timestried'
  291. ignoreobject 'currentlytaming'
  292. unsetalias 'currentlytaming'
  293. removetimer 'stucktimer'
  294. removetimer 'imstuck'
  295. pause 500
  296. endif
  297. endwhile
  298. endif
  299. if @inlist 'numberoffollowers' '2'
  300. while followers > 2
  301. pause 500
  302. @rename 'currentlytaming' nameoftames[0]
  303. pause 500
  304. if name 'currentlytaming' == nameoftames[0]
  305. waitforcontext 'currentlytaming' 8 15000
  306. while not @gumpexists 0x909cc741
  307. pause 500
  308. endwhile
  309. pause 500
  310. replygump 0x909cc741 2
  311. clearlist 'timestried'
  312. ignoreobject 'currentlytaming'
  313. unsetalias 'currentlytaming'
  314. removetimer 'stucktimer'
  315. removetimer 'imstuck'
  316. pause 500
  317. endif
  318. endwhile
  319. endif
  320. if @inlist 'numberoffollowers' '3'
  321. while followers > 3
  322. pause 500
  323. @rename 'currentlytaming' nameoftames[0]
  324. pause 500
  325. if name 'currentlytaming' == nameoftames[0]
  326. waitforcontext 'currentlytaming' 8 15000
  327. while not @gumpexists 0x909cc741
  328. pause 500
  329. endwhile
  330. pause 500
  331. replygump 0x909cc741 2
  332. clearlist 'timestried'
  333. ignoreobject 'currentlytaming'
  334. unsetalias 'currentlytaming'
  335. removetimer 'stucktimer'
  336. removetimer 'imstuck'
  337. pause 500
  338. endif
  339. endwhile
  340. endif
  341. if @inlist 'numberoffollowers' '4'
  342. while followers > 4
  343. pause 500
  344. @rename 'currentlytaming' nameoftames[0]
  345. pause 500
  346. if name 'currentlytaming' == nameoftames[0]
  347. waitforcontext 'currentlytaming' 8 15000
  348. while not @gumpexists 0x909cc741
  349. pause 500
  350. endwhile
  351. pause 500
  352. replygump 0x909cc741 2
  353. clearlist 'timestried'
  354. ignoreobject 'currentlytaming'
  355. unsetalias 'currentlytaming'
  356. removetimer 'stucktimer'
  357. removetimer 'imstuck'
  358. pause 500
  359. endif
  360. endwhile
  361. endif
  362. if @inlist 'pathfinding' 'yes' or @inlist 'pathfinding' 'Yes'
  363. if timerexists 'stucktimer'
  364. if @inrange 'currentlytaming' 1
  365. settimer 'stucktimer' 0
  366. settimer 'imstuck' 0
  367. endif
  368. if not @inrange 'currentlytaming' 1
  369. if timer 'imstuck' >= 20000
  370. headmsg 'Stuck. Ignoring current animal' 5
  371. ignoreobject 'currentlytaming'
  372. unsetalias 'currentlytaming'
  373. removetimer 'stucktimer'
  374. removetimer 'imstuck'
  375. endif
  376. if timer 'stucktimer' >= 5000
  377. if direction == 0
  378. @poplist 'unstuck' 'north'
  379. elseif direction == 2
  380. @poplist 'unstuck' 'east'
  381. elseif direction == 4
  382. @poplist 'unstuck' 'south'
  383. elseif direction == 6
  384. @poplist 'unstuck' 'west'
  385. endif
  386. if list 'unstuck' != 0
  387. headmsg 'Trying to pathfind' 5
  388. for 5
  389. run 'unstuck[0]'
  390. pause 100
  391. endfor
  392. poplist 'unstuck' 'front'
  393. settimer 'stucktimer' 0
  394. endif
  395. endif
  396. if @x 'currentlytaming' > x 'self' and @y 'currentlytaming' > y 'self'
  397. walk 'Southeast'
  398. elseif @x 'currentlytaming' < x 'self' and @y 'currentlytaming' > y 'self'
  399. walk 'Southwest'
  400. elseif @x 'currentlytaming' > x 'self' and @y 'currentlytaming' < y 'self'
  401. walk 'Northeast'
  402. elseif @x 'currentlytaming' < x 'self' and @y 'currentlytaming' < y 'self'
  403. walk 'Northwest'
  404. elseif @x 'currentlytaming' > x 'self' and @y 'currentlytaming' == y 'self'
  405. walk 'East'
  406. elseif @x 'currentlytaming' < x 'self' and @y 'currentlytaming' == y 'self'
  407. walk 'West'
  408. elseif @x 'currentlytaming' == x 'self' and @y 'currentlytaming' > y 'self'
  409. walk 'South'
  410. elseif @x 'currentlytaming' == x 'self' and @y 'currentlytaming' < y 'self'
  411. walk 'North'
  412. endif
  413. endif
  414. endif
  415. endif
  416. endwhile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement