Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1.  
  2. dofile(getinstalldir().."/libs/FindItems.lua")
  3.  
  4. local instrumentTypes = {3741, 3763, 3764, 3762, 3740, 10247}
  5.  
  6. local nextPlay = getticks()
  7. local nextPeace = nextPlay
  8. local ref, cnt = UO.ScanJournal(0)
  9. local minMusi = 700
  10.  
  11. function CheckJournal()
  12. ref, cnt = UO.ScanJournal(ref)
  13. for j = 1, cnt do
  14. local text = UO.GetJournal(j)
  15. if (string.find(text, "play poorly") or string.find(text, "attempt to calm")) then
  16. nextPeace = nextPeace + 5000
  17. end
  18. end
  19. end
  20.  
  21. function Target(timeout)
  22. local timeout = getticks() + timeout
  23. while (getticks() < timeout and not UO.TargCurs) do
  24. wait(100)
  25. end
  26. end
  27.  
  28. function FindInstruments()
  29. return ScanItems(true, {Type=instrumentTypes, ContID=UO.BackpackID})
  30. end
  31.  
  32. while true do
  33. local instruments = FindInstruments()
  34. if (#instruments == 0) then
  35. stop()
  36. end
  37. local ticks = getticks()
  38. if (ticks >= nextPlay) then
  39. UO.LObjectID = instruments[1].ID
  40. UO.Macro(17, 0)
  41. nextPlay = ticks + 6500
  42. end
  43. local _, musi = UO.GetSkill("musi")
  44. local _, peace, peaceCap = UO.GetSkill("peace")
  45. if (ticks > nextPeace and peace < peaceCap and musi >= minMusi) then
  46. UO.Macro(13, 9)
  47. Target(5000)
  48. UO.Macro(23, 0)
  49. nextPeace = ticks + 5500
  50. end
  51. CheckJournal()
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement