--on hot key
if getkey('z') then
while getkey('z') do wait(1) end --have fun if you forget this.
UO.ScanItems(false)
local nCnt = UO.FilterItems(2,xType)
if nCnt < 1 print("funny messages :D :D :D LOL") else
UO.LObjectID = UO.GetItems(0)
UO.Macro(17,0)
local ref,cnt = UO.ScanJournal(0)
local timer,err = getticks()+500,3
while not UO.TargCurs do
if err < 1 then break
elseif timer < getticks() then
UO.Macro(17,0)
timer,err = getticks()+500,err-1
else wait(50) end
end
local msg = false
while not msg do
ref,cnt = UO.ScanJournal(ref)
for i = 0, cnt-1 do
local line = UO.GetJournal(i)
if line:match("Secret Code!") then msg = true break end
end
end
--UO.LTargetID = sometarget or is it already set
UO.LTargetKind = 1
UO.Macro(22,0)
end
end