Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.39 KB | None | 0 0
  1. ;==========================================
  2. ; Vash Healer 4.0
  3. ;==========================================
  4. ;
  5. ; IMPORTANTE:
  6. ; -----------
  7. ; 1- Tenere sempre zaino e status aperti.
  8. ; 2- Attivare il Targeting System con l'apposita macro client.
  9. ; 3- Disattivare l'auto-accoda azioni di Razor.
  10. ; 4- Compatibile oslo con RunUO 2.0 e shard OSI-Style.
  11. ;
  12. ; Ecco le features dello script:
  13. ; ------------------------------
  14. ; 1) Avverte se le bende stanno per finire, e se finiscono
  15. ; č sufficiente rifornirsi, senza doverlo riavviare.
  16. ; 2) Controlla il journal per verificare che le bende siano
  17. ; state correttamente applicate, altrimenti riprova.
  18. ; 3) Mostra il tempo di bendata sulla testa del pg.
  19. ; 4) Potete precastare magie, e finchč c'č il target fuori,
  20. ; lo script non benderŕ.
  21. ; 5) Scarissima interferenza con i target delle spell.
  22. ; 6) Non benda da hiddati, per non venire revelati.
  23. ; 7) La bendata entrerŕ in azione subito dopo un mortal strike in modo da finire,
  24. ; se possibile, poco dopo la fine dell'effetto.
  25. ; 8) Auto cure e auto refresh.
  26. ;
  27. ; Fate il setup qui sotto, ricordando che vero č #true e falso č #false.
  28.  
  29. ; SETUP
  30. ; -----
  31. ; Settando counter a true, avrete il contatore sopra la testa del pg.
  32. set %counter #true
  33.  
  34. ; La prossima variabile indica il limite di hp al di sotto dei quali curare.
  35. ; Mettendo 5 ad esempio, se avete 100hp, benderŕ solo al di sotto di 95hp.
  36. set %limit 5
  37.  
  38. ; ANTIMORTAL
  39. ; ----------
  40. ; Se avete problemi con l'antimortal settato a 62, mettetelo a 64.
  41. ; Puň essere utile in caso di pc vecchio, lag, ecc.
  42. set %antimortal 64
  43.  
  44. ; POZIONI
  45. ; --------
  46. ; Qui avete due variabili da settare #true o #false.
  47. ; La prima farŕ bere in automatico allo script le pozze cure.
  48. ; La seconda berrŕ in automatico pozze refresh.
  49. set %cure #true
  50. set %refresh #true
  51. ; Se avete settato l'auto-refresh, settate al di sotto di quale
  52. ; valore della stamina č necessario berle:
  53. set %stamina 30
  54.  
  55. ; Sconsiglio vivamente queste opzioni su pg arciere, in quanto
  56. ; potreste bere in automatico la pozza in un momento critico,
  57. ; e non č bello venire disarmati in momenti critici.
  58.  
  59. ; Adesso, a seconda che utilizziate Razor o Injection e vogliate
  60. ; usare l'autocure o l'autorefresh, dovete farvi due macro.
  61. ; Una macro deve togliere scudo (o arma o libro) e bere la pozza cure,
  62. ; l'altra deve bere la pozza refresh.
  63. ; Dopodichč scrivete il nome della macro o della sub qui:
  64. set %macroCure drinkCure
  65. set %macroRefresh drinkRefresh
  66.  
  67. ; Infine, c'č quest'ultima variabile. Metti #true se utilizzi razor,
  68. ; altrimenti se utilizzi injection metti #false.
  69.  
  70. set %razor #false
  71.  
  72. ; Abbiamo finito il setup.
  73. ;==========================================
  74.  
  75. ;==========================================
  76. ; Main Loop
  77. ; ---------
  78. set #lpc 30
  79. set %mortal #false
  80.  
  81. if %cure
  82. {
  83. if %razor
  84. set %cureCmd -Macro , #spc , %macroCure
  85. else
  86. set %cureCmd ,exec , #spc , %macroCure
  87. }
  88.  
  89. if %refresh
  90. {
  91. if %razor
  92. set %refCmd -Macro , #spc , %macroRefresh
  93. else
  94. set %refCmd ,exec , #spc , %macroRefresh
  95. }
  96.  
  97. set %lastStamina #scnt
  98.  
  99. _mainloop:
  100.  
  101. if yes in #charghost
  102. {
  103. wait 1s
  104. goto _mainloop
  105. }
  106.  
  107. if ( ( ( #hits < ( #maxhits - %limit ) ) || C in #charstatus ) && H notin #charstatus )
  108. {
  109. set %hasRefresh #false
  110. set %hasCure #false
  111.  
  112. finditem NUF C_ , #backpackid
  113. if #findcnt > 0
  114. set %hasCure #true
  115.  
  116. finditem ZUF C_ , #backpackid
  117. if #findcnt > 0
  118. set %hasRefresh #true
  119.  
  120. GoSub CheckAids
  121. if #result = #true
  122. {
  123. if #targcurs = 1
  124. GoSub WaitCurs 0
  125.  
  126. set %delay ( ( 11 - ( #dex / 20 ) ) * 10 )
  127.  
  128. GoSub Apply
  129. if #result = #false
  130. goto _mainloop
  131.  
  132. GoSub Waitnew
  133. wait 1
  134. }
  135. }
  136.  
  137. goSub CheckStamina
  138. sleep 10
  139.  
  140. goto _mainloop
  141. ;==========================================
  142.  
  143. ;==========================================
  144. ; SUB WAITCURS
  145. ; ------------
  146. ; A questa sub si passano 1 o 2 argomenti.
  147. ; Il primo puň essere 1 o 0. Sta ad indicare
  148. ; il valore di #targcurs desiderato.
  149. ; Il secondo, opzionale, indica un timeout in decimi
  150. ; di secondo. In ogni caso, per evitare che rimanga
  151. ; all'infinito, c'č un timeout di base di 100 secondi.
  152.  
  153. Sub WaitCurs
  154.  
  155. if %0 = 2
  156. set %waitTimeout #scnt2 + %2
  157. else
  158. set %waitTimeout #scnt2 + 1000
  159.  
  160. while #targcurs <> %1
  161. {
  162. if #scnt2 > %waitTimeout
  163. return #false
  164.  
  165. sleep 5
  166. }
  167.  
  168. if %1 = 0
  169. wait 2 ; per non far fizzare il target appena lanciato
  170.  
  171. return #true
  172. ;==========================================
  173.  
  174. ;==========================================
  175. ; SUB CHECKAIDS
  176. ; -------------
  177. ; Controlla che ci siano bende nello zaino.
  178. ; Avverte se ne rimangono meno di 10.
  179. ; Mette lo script in attesa quando finiscono.
  180. ; Setta la variabile %aids.
  181.  
  182. Sub CheckAids
  183.  
  184. finditem ZLF CA_ , #BACKPACKID
  185. if #findstack = 0
  186. {
  187. event ExMsg #charID 3 0 No bandages found!
  188. wait 3s
  189. return #false
  190. }
  191.  
  192. if #findstack < 10 && #findcnt < 2
  193. event sysmessage ATTENZIONE! Ti rimangono solo #findstack bende!
  194.  
  195. set %aids #findid
  196.  
  197. return #true
  198. ;==========================================
  199.  
  200. ;==========================================
  201. ; SUB APPLY
  202. ; ---------
  203. ; NOTA: serve la variabile %aids.
  204. ; Questa sub benda il pg, facendo controlli
  205. ; di sicurezza per verificare che le bende siano state
  206. ; effettivamente applicate.
  207.  
  208. Sub Apply
  209.  
  210. _aidloop:
  211. if yes in #charghost
  212. return #false
  213.  
  214. set %startIndex #jindex
  215. finditem ZLF C_ , #BACKPACKID
  216. set #LOBJECTID #FINDID
  217. event Macro 17 0
  218. set %gowienko #SCNT + 2
  219. while #targcurs = 0
  220. {
  221. if %gowienko <= #SCNT
  222. return #false
  223. }
  224. event Macro 23 0
  225. set %start #scnt2
  226. wait 1
  227. if you_begin_applying in #sysmsg
  228. return #true
  229.  
  230. GoSub WaitStartMsg 3
  231. if #result <> 1
  232. return #false
  233.  
  234.  
  235. return #true
  236. ;==========================================
  237.  
  238. ;==========================================
  239. ; SUB WAITSTARTMSG
  240. ; ----------------
  241. ; Attende il messaggio di bendata.
  242. ; Vuole un argomento, il timeout in decimi di secondo.
  243. ; Restituisce 1 se benda, 0 se non č possibile bendare il pg,
  244. ; e -1 se le bende non entrano in azione completamente.
  245.  
  246. Sub WaitStartMsg
  247.  
  248. set %sysTimeout #scnt2 + %1
  249.  
  250. _waitsysmsgloop:
  251. if #jindex > %startIndex
  252. {
  253. set %startIndex %startIndex + 1
  254. scanjournal %startIndex
  255.  
  256. if you_begin_applying in #journal
  257. return 1
  258.  
  259. if that_being in #journal
  260. return 0
  261.  
  262. goto _waitsysmsgloop
  263. }
  264.  
  265. if #scnt2 < %sysTimeout
  266. {
  267. sleep 5
  268. goto _waitsysmsgloop
  269. }
  270.  
  271. return -1
  272. ;==========================================
  273.  
  274. ;==========================================
  275. ; SUB WAITNEW
  276. ; ----------------
  277. Sub WaitNew
  278.  
  279. set %keypressed 0
  280. set %end %delay + %start + 1
  281. set %limitcure %end - 17
  282. set %oldremaining 10
  283. wait 2
  284.  
  285. _waitloop:
  286. if %counter
  287. {
  288. set %remaining ( ( %end - #scnt2 ) / 10 ) + 1
  289. if %remaining <> %oldremaining
  290. {
  291. event ExMsg #charID 3 0 %remaining
  292. set %oldremaining %remaining
  293. }
  294. }
  295.  
  296. if D in #charstatus && %mortal = #false
  297. {
  298. set %mortal #true
  299. set %mortend #scnt2 + %antimortal
  300.  
  301. _mortloop:
  302. if ( ( %delay + #scnt2 ) > %mortend )
  303. return
  304. sleep 10
  305. goto _mortloop
  306. }
  307.  
  308. wait 1
  309.  
  310. if C in #charstatus && %cure = #true && %hasCure = #true
  311. {
  312. if #scnt2 > %limitcure && %keypressed = 0
  313. {
  314. msg $
  315. wait 1
  316. msg %cureCmd $
  317. set %keypressed 1
  318. }
  319. }
  320.  
  321. goSub CheckStamina
  322.  
  323. if #scnt2 >= %end + 2 || you_finish_applying in #sysmsg || you_apply_the in #sysmsg || you_heal in #sysmsg || the_bleeding in #sysmsg || you_have_failed in #sysmsg
  324. {
  325. if %mortal
  326. set %mortal #false
  327.  
  328. return
  329. }
  330.  
  331. goto _waitloop
  332.  
  333. return ; giusto per essere sicuri
  334. ;==========================================
  335.  
  336. ;==========================================
  337. ; SUB CHECKSTAMINA
  338. ; ----------------
  339. Sub CheckStamina
  340.  
  341. if %refresh = #false || %hasRefresh = #false
  342. return
  343.  
  344. if ( #stamina < %stamina )
  345. {
  346. if ( #scnt > ( %lastStamina + 3 ) )
  347. {
  348. set %lastStamina #scnt
  349. msg $
  350. wait 1
  351. msg %refCmd $
  352. }
  353. }
  354.  
  355. return
  356. ;==========================================__________________
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement