Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dofile(getinstalldir().."/libs/FindItems.lua")
- local instrumentTypes = {3741, 3763, 3764, 3762, 3740, 10247}
- local nextPlay = getticks()
- local nextPeace = nextPlay
- local ref, cnt = UO.ScanJournal(0)
- local minMusi = 700
- function CheckJournal()
- ref, cnt = UO.ScanJournal(ref)
- for j = 1, cnt do
- local text = UO.GetJournal(j)
- if (string.find(text, "play poorly") or string.find(text, "attempt to calm")) then
- nextPeace = nextPeace + 5000
- end
- end
- end
- function Target(timeout)
- local timeout = getticks() + timeout
- while (getticks() < timeout and not UO.TargCurs) do
- wait(100)
- end
- end
- function FindInstruments()
- return ScanItems(true, {Type=instrumentTypes, ContID=UO.BackpackID})
- end
- while true do
- local instruments = FindInstruments()
- if (#instruments == 0) then
- stop()
- end
- local ticks = getticks()
- if (ticks >= nextPlay) then
- UO.LObjectID = instruments[1].ID
- UO.Macro(17, 0)
- nextPlay = ticks + 6500
- end
- local _, musi = UO.GetSkill("musi")
- local _, peace, peaceCap = UO.GetSkill("peace")
- if (ticks > nextPeace and peace < peaceCap and musi >= minMusi) then
- UO.Macro(13, 9)
- Target(5000)
- UO.Macro(23, 0)
- nextPeace = ticks + 5500
- end
- CheckJournal()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement