Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. var amount = 25 ;кол-во материала для изготовления 1 вещи (maksimalno)
  2. var material = '0x1bdd'
  3. var tool = '0x1035'
  4. var k = 0
  5. var jn
  6.  
  7. var returnn
  8.  
  9. sub main()
  10.  
  11. while not uo.dead()
  12.  
  13. uo.DeleteJournal()
  14.  
  15. if uo.Count(material) > amount then
  16.  
  17. CheckLag()
  18. cancelMT()
  19.  
  20. uo.waitmenu('Choose a category.','Misc','Choose an item','Recall Rune')
  21.  
  22. uo.waittargettype(material)
  23. wait(500)
  24. uo.usetype(tool)
  25. wait(500)
  26.  
  27. k=0
  28. while NOT UO.InJournal('You make') and NOT UO.InJournal('You create') AND NOT UO.InJournal('fail') AND NOT UO.InJournal('destroy') AND ( k < 30 )
  29. k = k + 1
  30. CheckLag()
  31. wait(500)
  32. wend
  33.  
  34. wait(1000)
  35.  
  36. eat() ;kushaem esli nado
  37.  
  38.  
  39. else
  40.  
  41. CheckLag()
  42. cancelMT()
  43.  
  44. grabim:
  45.  
  46. returnn = findGroundMaterial('0x1bdd')
  47.  
  48. if returnn==1 then
  49. uo.unsetreceivingcontainer()
  50. uo.grab(1000,'finditem')
  51. wait(1000)
  52. else
  53. repeat
  54. UO.Say('Material konchilsya, podloji')
  55. wait(10000)
  56. until returnn<>1
  57.  
  58. goto grabim
  59. endif
  60.  
  61. endif
  62.  
  63. wend
  64.  
  65. end sub
  66.  
  67. sub findGroundMaterial(obj)
  68. uo.set('finddistance',2)
  69. uo.findtype(obj,-1,'ground')
  70. if uo.FindCount() then
  71. return 1
  72. else
  73. return 0
  74. end if
  75.  
  76. end sub
  77.  
  78. Sub cancelMT()
  79.  
  80. uo.cancelmenu()
  81.  
  82. wait(200)
  83. if uo.Waiting() then
  84. uo.Canceltarget()
  85. wait(500)
  86. end if
  87.  
  88. end sub
  89.  
  90. Sub eat()
  91. if UO.Count('0x097b')>0 then
  92. UO.usetype ('0x097b')
  93. wait(500)
  94. end if
  95. if UO.Count('0x09f2')>0 then
  96. UO.usetype ('0x09f2')
  97. Wait(500)
  98. end if
  99. if UO.Count('0x09f2')==0 and UO.Count('0x097b')==0 then
  100. UO.Print('Еда закончилась')
  101. end if
  102. end sub
  103.  
  104. Sub CheckLag()
  105. repeat
  106. UO.Click('backpack')
  107. until backpack()==1
  108. end sub
  109.  
  110.  
  111. Sub backpack()
  112. var n
  113. for n=0 to 100
  114.  
  115. if uo.injournal('Backpack') then
  116. jn = uo.injournal('Backpack')
  117. uo.SetJournalLine(jn,'')
  118. return 1
  119. else
  120. wait(500)
  121. endif
  122.  
  123. if uo.injournal('backpack') then
  124. jn = uo.injournal('backpack')
  125. uo.SetJournalLine(jn,'')
  126. return 1
  127. else
  128. wait(500)
  129. endif
  130.  
  131. ws()
  132.  
  133. next
  134. return 0
  135. endsub
  136.  
  137.  
  138. Sub ws()
  139. if uo.journal(0)=='Saving World State' then
  140. repeat
  141. wait(1000)
  142. until uo.journal(0)<>'Saving World State complete.'
  143. endif
  144. endsub
  145.  
  146. Sub dropItem(obj)
  147.  
  148. if uo.Waiting() then
  149. uo.Canceltarget()
  150. wait(500)
  151. end if
  152.  
  153. if uo.Count(obj) then
  154. uo.waittargettype(obj)
  155. wait(500)
  156. uo.say('.drop')
  157. wait(500)
  158. endif
  159.  
  160. endsub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement