Code:
############################################################
# Контроль за опасностью
############################################################
sub Visor()
VAR asd
while 1
UO.deletejournal()
while not UO.InJournal(":")
wait(100)
wend
if UO.InJournal("Elemental") then
uo.SetGlobal("timeelem",time())
uo.textopen()
uo.textprint("Будет бой с элементалем")
UO.Exec("exec ElemKill")
UO.Exec("terminate Visor")
endif
if UO.InJournal("attacking you") then
UO.GetStatus("UO.JournalSerial(0)")
uo.SetGlobal("name",UO.GetName(UO.JournalSerial(0)))
log(9,uo.GetGlobal("name"),"")
uo.textopen()
uo.textprint("Эта крыса "+UO.GetName(UO.JournalSerial(0))+" внезапно атаковала!" )
UO.Exec("exec Escape")
UO.Exec("terminate Visor")
endif
asd=UO.GetNotoriety(UO.JournalSerial(0))
if asd==6 then
UO.GetStatus("UO.JournalSerial(0)")
uo.SetGlobal("name",UO.GetName(UO.JournalSerial(0)))
log(6,uo.GetGlobal("name"),"")
uo.textopen()
uo.textprint("В шахте оказался ПК - "+UO.GetName(UO.JournalSerial(0)))
UO.Exec("exec Escape")
UO.Exec("terminate Visor")
endif
if asd==5 then
UO.GetStatus("UO.JournalSerial(0)")
uo.SetGlobal("name",UO.GetName(UO.JournalSerial(0)))
log(8,uo.GetGlobal("name"),"")
uo.textopen()
uo.textprint("В шахте вражеский гильдмэн - "+UO.GetName(UO.JournalSerial(0)))
UO.Exec("exec Escape")
UO.Exec("terminate Visor")
endif
if asd==4 then
UO.GetStatus("UO.JournalSerial(0)")
uo.SetGlobal("name",UO.GetName(UO.JournalSerial(0)))
log(7,uo.GetGlobal("name"),"")
uo.textopen()
uo.textprint("В шахте оказался криминал - "+UO.GetName(UO.JournalSerial(0)))
UO.Exec("exec Escape")
UO.Exec("terminate Visor")
endif
wend
end sub