Вот часть скрипта , которая должна распознавать фразу и делать действие по указанному айди , пример фразы
Code:
UO.MSG(-'#Target: '+name+' '+serial)
убираем - , скрипт не реагирует , ТВИ стоит галочка , может еще какие надо ?
Code:
sub abs(number)
if number < 0 then
return number * (-1)
else
return number
endif
end sub
sub GuildCommandGetSerial(temp)
VAR len = strlen(temp)
if (temp[len-10]+temp[len-9] == '0x') then
return temp[len-10]+temp[len-9]+temp[len-8]+temp[len-7]+temp[len-6]+temp[len-5]+temp[len-4]+temp[len-3]+temp[len-2]+temp[len-1]
else
return '0x00000000'
endif
end sub
sub DeleteGuildCommands(command)
VAR stop = 0
VAR temp
while stop == 0
temp = OnGuildCommand(command)
if temp > -1 then
UO.SetJournalLine(temp, '*DELETED*')
else
stop = 1
endif
wend
end sub
sub CheckMsg()
UO.Msg('-+++ v0.5 + reflection')
end sub
sub OnGuildCommand(command)
VAR res
VAR number
VAR tempstr
VAR stop = 0
while stop == 0
number = UO.InJournal(command)
if number > 0 then
tempstr = UO.Journal(number-1)
if tempstr[0] <> '[' then
UO.SetJournalLine(number-1, '*NO BUGS*')
else
res = number-1
stop = 1
endif
else
res = -1
stop = 1
endif
wend
return res
end sub
sub GuildTargetClickNick()
VAR serial = UO.GetGlobal('GuildLastTarget')
if serial <> 'N/A' then
UO.Click(serial)
endif
end sub
sub click3time(serial, rastX, rastY)
if (rastX <= 18) and (rastY <= 18) then
if UO.GetGlobal('click3') == 'N/A' then
UO.Click(serial)
wait(50)
UO.Click(serial)
wait(50)
UO.Click(serial)
wait(50)
UO.SetGlobal('click3', 'TRUE')
endif
else
UO.SetGlobal('click3', 'N/A')
endif
end sub
sub GuildCommandsReaction()
VAR serial
VAR temp
VAR tempstr
VAR rastX
VAR rastY
VAR tempserial = UO.GetGlobal('GuildLastTarget')
if tempserial <> 'N/A' then
serial = tempserial
rastX = abs(UO.GetX(serial)-UO.GetX())
rastY = abs(UO.GetY(serial)-UO.GetY())
click3time(serial, rastX, rastY)
endif
temp = OnGuildCommand('#Script check')
if temp > -1 then
UO.SetJournalLine(temp, '*WORK DONE*')
CheckMsg()
else
temp = OnGuildCommand('#Target: ')
if temp > -1 then
tempstr = UO.Journal(temp)
UO.SetJournalLine(temp, '*WORK DONE*')
serial = GuildCommandGetSerial(tempstr)
rastX = abs(UO.GetX(serial)-UO.GetX())
rastY = abs(UO.GetY(serial)-UO.GetY())
if serial <> '0x00000000' then
UO.SetGlobal('GuildLastTarget', serial)
if (rastX <= 18) and (rastY <= 18) then
UO.SetGlobal('GuildTargetOutOfRange', 'N/A')
if UO.GetSerial('laststatus') <> serial then
UO.Attack(serial)
UO.PRINT('TARGET CHANGED TO '+UO.GetName(serial))
endif
else
UO.SetGlobal('GuildTargetOutOfRange', 'TRUE')
endif
endif
else
if UO.GetGlobal('GuildTargetOutOfRange') == 'TRUE' then
if (rastX <= 18) and (rastY <= 18) then
UO.SetGlobal('GuildTargetOutOfRange', 'N/A')
UO.Attack(serial)
UO.PRINT('TARGET CHANGED TO '+UO.GetName(serial))
endif
else
temp = OnGuildCommand('#Magic Arrow!')
if temp > -1 then
UO.SetJournalLine(temp, '*WORK DONE*')
if tempserial <> 'N/A' then
if (rastX <= 18) and (rastY <= 18) then
UO.Attack(serial)
UO.PRINT('Arrow in progress...')
CastGuild_Target('Magic Arrow', serial, 4, 12)
endif
endif
else
temp = OnGuildCommand('#Flame Strike!')
if temp > -1 then
UO.SetJournalLine(temp, '*WORK DONE*')
if tempserial <> 'N/A' then
if (rastX <= 18) and (rastY <= 18) then
if (rastX > 1) or (rastY > 1) then
UO.Attack(serial)
UO.PRINT('FS in progress...')
if CastGuild_Target('Flame Strike', serial, 40, 28) == 7 then
CastGuild_Target('Lightning', serial, 11, 20)
endif
endif
endif
endif
else
temp = OnGuildCommand('#Magic Reflection: ')
if temp > -1 then
tempstr = UO.Journal(temp)
UO.SetJournalLine(temp, '*WORK DONE*')
serial = GuildCommandGetSerial(tempstr)
if (serial <> '0x00000000') and (serial <> UO.GetSerial('self')) then
UO.PRINT('Reflection in progress...')
CastGuild_Target('Magic Reflection', serial, 14, 28)
endif
endif
endif
endif
endif
endif
endif
end sub
sub GuildCommands()
if UO.GetGlobal('guild_commands') == 'TRUE' then
UO.SetGlobal('guild_commands', 'N/A')
UO.PRINT('GUILD COMMANDS REACTION OFF')
else
UO.SetGlobal('guild_commands', 'TRUE')
UO.PRINT('GUILD COMMANDS REACTION ON')
UO.DeleteJournal()
VAR NickFloodTimer = 6
while UO.GetGlobal('guild_commands') == 'TRUE'
wait(200)
NickFloodTimer = NickFloodTimer - 1
GuildCommandsReaction()
if NickFloodTimer == 0 then
GuildTargetClickNick()
NickFloodTimer = 6
endif
wend
endif
end sub