Yoko

All sides of Injection
It is currently 2025-12-12 12:33:46

All times are UTC+02:00




Post new topic  Reply to topic  [ 11 posts ] 
Author Message
PostPosted: 2007-05-10 20:27:13 
Offline
User avatar

Joined: 2005-05-13 19:59:40
Posts: 10
Суть идеи: скрипт непрерывно проверяет расстояние до противника и если тот подходит в упор - меняет лук на оружие ближнего боя.
Но (!) только если в руках экипирован лук в этот момент.

Я дошёл вот до этого:

Code:
sub AutoChange()
while not uo.Dead()
UO.GetX('laststatus')
UO.GetY('laststatus')
if (UO.GetX('laststatus')-UO.GetX('self'))<2 or (UO.GetY('laststatus')-UO.GetY('self'))<2
and if UO.Equipt('Lhand','0x13B1')
then
UO.Exec("exec sword") ##[sub sword() - скрипт одевания меча и щита]
end if
wend
endsub


Был ещё вариант аналогичный, но через

Code:
uo.GetDistance('laststatus')
...
 if uo.GetDistance('laststatus')<2



Ошибка выскакивает в строчке с if - очевидно, что так сравнивать нельзя...


Подскажите пожалуйста как правильно сделать?



.


Last edited by ArNeithen on 2007-05-12 00:32:11, edited 1 time in total.

Top
   
 Post subject:
PostPosted: 2007-05-10 21:30:56 
Offline

Joined: 2005-01-06 11:49:28
Posts: 205
Если я не ошибаюсь, надо юзать такую конструкцию
Code:
str(uo.getX....
str(uo.getY...

в сравнениях, т.к. нам нужно число в сравнениях, а uo.getX передаёт чтото другое (в одной теме Дестракшен чтото такое обьяснял)

тоесть твой текст должен быть таким
Code:
if (str(UO.GetX('laststatus'))-str(UO.GetX('self')))<2 or (str(UO.GetY('laststatus'))-str(UO.GetY('self')))<2 
and if UO.Equipt('Lhand','0x13B1')
then


Top
   
 Post subject:
PostPosted: 2007-05-10 21:34:51 
Offline
User avatar

Joined: 2005-05-13 19:59:40
Posts: 10
Rivory wrote:
Если я не ошибаюсь, надо юзать такую конструкцию

.....



То есть модификация в исходном виде:


Code:
sub AutoChange()
while not uo.Dead()
str(UO.GetX('laststatus'))
str(UO.GetY('laststatus'))
if (str(UO.GetX('laststatus'))-str(UO.GetX('self')))<2 or (str(UO.GetY('laststatus'))-str(UO.GetY('self')))<2
and if UO.Equipt('Lhand','0x13B1')
then
UO.Exec("exec sword")
end if
wend
endsub



А всё равно parse error в стоке с if ...


.


Top
   
 Post subject:
PostPosted: 2007-05-10 22:39:01 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
Code:
uo.getdistance([object])

Code:
UO.Exec("exec sword") 

на
Code:
uo.usetype('0x0000')


Code:
if UO.Equipt('Lhand','0x13B1') 

здесь неправильно...

Code:
sub main()
while 1
if uo.getdistance('lastattack') < 2 and uo.getlayer('_0x13B1')=="Rhand" then
uo.usetype('0x13FC')
end if
wait(250)
wend
end sub

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject:
PostPosted: 2007-05-11 07:46:42 
Offline
User avatar

Joined: 2005-05-13 19:59:40
Posts: 10
Не проходит проверка

Code:
uo.getlayer('0x13B1')=="Rhand"


Тест такой был:

Code:
sub AutoChange() 
while 1
if uo.getlayer('0x13B1')=="Rhand" then
uo.usetype('0x13FC')
end if
wait(250)
wend
end sub


Ведь по идее в таком виде он должен вообще сразу менять оружие
если вдруг лук да окажется в руках, м? Не проходит... =/


Top
   
 Post subject:
PostPosted: 2007-05-11 08:22:51 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
возьми глаза в руки

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject:
PostPosted: 2007-05-11 09:23:44 
Offline
User avatar

Joined: 2005-05-13 19:59:40
Posts: 10
Mr Nmy wrote:
возьми глаза в руки


Если вы про

Code:
uo.getlayer('_0x13B1')=="Rhand" 


То со слэшем тоже не работает...
Rhand или Lhand не влияет...


Top
   
 Post subject:
PostPosted: 2007-05-11 12:21:38 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
я тестил и у меня все работало
а зачем слеш нужен- зайди в хелпе, посмотри линк objects

обрати внимание
Code:
if uo.getdistance('lastattack') < 2 and uo.getlayer('_0x13B1')=="Rhand" then 

если последний атакуемый в растояние меньше чем в 2 клетки и одет такой тип в руке, то переодевать то и то

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject:
PostPosted: 2007-05-11 12:42:56 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
Code:
sub WeaponChanger()
var bow = "0x0000" ; тип лука
var chg = "0x0000" ; тип ближнего оружия
repeat
   if uo.getDistance( 'laststatus' ) < 2 && uo.getGraphic( uo.objatlayer( 'Rhand' ) ) == bow then
      uo.equipt( chg )
   endif
   wait( 100 )
until false
endsub

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Last edited by Destruction on 2007-05-12 01:20:25, edited 1 time in total.

Top
   
 Post subject:
PostPosted: 2007-05-11 13:00:18 
Offline
User avatar

Joined: 2005-05-13 19:59:40
Posts: 10
2Mr Nmy Ага, нашёл у себя ошибку ) Огромное спасибо, теперь всё работает. )
2Destruction За ваш вариант - отдельно, то что нужно ) Благодарю


Top
   
 Post subject:
PostPosted: 2007-05-12 01:20:11 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
ArNeithen wrote:
2Mr Nmy Ага, нашёл у себя ошибку ) Огромное спасибо, теперь всё работает. )
2Destruction За ваш вариант - отдельно, то что нужно ) Благодарю

У меня пустой цикл был.. поправил :)

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 11 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited