Magic wand

Ask for scripts here

Moderators: Murderator+, Murderator

korzh
Posts: 220
Joined: 2007-04-26 23:35:15

Post by korzh »

rvk wrote:Вот здесь parse error

Code: Select all

DIM WandT[WC] 


Исправь на

Code: Select all

DIM WandT[ val( str( WC ) ) ]
Yura
Posts: 71
Joined: 2008-03-03 09:19:21
Location: SPB

Post by Yura »

rvk wrote:Вот здесь parse error

Code: Select all

DIM WandT[WC] 


Code: Select all

DIM WandT[тут просто вбей число с количесвом типов] 
rvk
Posts: 20
Joined: 2008-03-20 07:31:02

Post by rvk »

Ипсравил, кастует лишь со свитков и с книги. С ванды отказывается. Возможно я что-то не так вписал.

Code: Select all

sub explosion()
var i=1,wandT=0
var NN='a Magic wand of Explosion'
UO.DeleteJournal()
UO.Set('lasttarget','laststatus')
begin:
if uo.Waiting() then
uo.canceltarget()
endif
wandT=wandsearch(NN)
if wandT<>0 then
i=1
if uo.ObjAtLayer('Rhand')=="" and uo.ObjAtLayer('Lhand')<>"" then
uo.addobject('weapon',uo.ObjAtLayer('Lhand'))
else
if uo.ObjAtLayer('Rhand')<>"" then
uo.addobject('weapon',uo.ObjAtLayer('Rhand'))
else
i=0
endif
endif
UO.WaitTargetObject('lasttarget')
UO.UseObject(WandT)
wait(500)
if UO.InJournal("It seems to be out of charges") then
UO.Deletejournal()
UO.Ignore(WandT)
if i<>0 then
uo.waittargetself()
UO.UseObject('weapon')
wait(500)
endif
goto begin
endif
if i<>0 then
uo.waittargetself()
UO.UseObject('weapon')
endif
else
UO.FindType('0x1F57',-1,'my')
If UO.GetQuantity('finditem')>0 then
if UO.Mana>=14 then
UO.WaitTargetObject('lasttarget')
UO.UseObject('finditem')
UO.Print("Scroll")
else
UO.Print("Low mana!!! Scroll!")
endif
else
if UO.Mana>=28 then
UO.Cast('Explosion','laststatus')
UO.Print("Spell")
else
UO.Print("Low mana!!! Spell!")
endif
endif
endif
end sub

sub wandsearch(NugnoeName)
var WC = 3 ;сколько типов
DIM WandT[ val( str( WC ) ) ]
WandT[0] ='0x0DF3'
wandT[1] ='0x0DF4'
wandT[2] ='0x0DF5'
var x
For x=0 to WC-1
UO.findtype()
While UO.FindCount() <>0
if NugnoeName==UO.GetName('finditem') then
return 'finditem'
else
UO.Ignore('finditem')
UO.FindType(WandT[x])
endif
wend
next
uo.print(NugnoeName + ' Ne naideno')
return 0
Endsub


Или вместо

Code: Select all

NugnoeName
надо вписывать само название ванды?
Yura
Posts: 71
Joined: 2008-03-03 09:19:21
Location: SPB

Post by Yura »

Code: Select all

sub wandsearch(NugnoeName) 
var WC = 3 ;ñêîëüêî âñåãî òèïîâ
DIM WandT[ val( str( WC ) ) ]
WandT[0] ='0x0DF3'
wandT[1] ='0x0DF4'
wandT[2] ='0x0DF5'
var x
For x=0 to WC-1
UO.findtype(WandT[X])
While UO.FindCount() <>0
if NugnoeName==UO.GetName('finditem') then
return 'finditem'
else
UO.Ignore('finditem')
UO.FindType(WandT[x])
endif
wend
next
uo.print(NugnoeName + ' Ne naideno')
return 0
Endsub
rvk
Posts: 20
Joined: 2008-03-20 07:31:02

Post by rvk »

Нет, Юр. Не кастует с ванды. Лишь со свитка или с книги.
Yura
Posts: 71
Joined: 2008-03-03 09:19:21
Location: SPB

Post by Yura »

rvk wrote:Нет, Юр. Не кастует с ванды. Лишь со свитка или с книги.

Вариант 1

Code: Select all

For x=0 to WC-1
UO.findtype(WandT[X])
###########
UO.print(UO.GetName('finditem'))
###########
blablabla

2

Code: Select all

For x=0 to WC-1
UO.findtype(WandT[X])
#########
uo.click('finditem')
UO.print(UO.GetName('finditem'))
##########
blablabla


В каком варианте он выдает правильное имя?
Last edited by Yura on 2008-03-23 01:37:10, edited 1 time in total.
rvk
Posts: 20
Joined: 2008-03-20 07:31:02

Post by rvk »

Code: Select all

For x=0 to WC-1
UO.findtype(WandT[X])
While UO.FindCount() <>0
if NugnoeName==UO.GetName('finditem') then
return 'finditem'
else
UO.Ignore('finditem')
UO.FindType(WandT[x])
endif
wend
next
uo.print(NugnoeName + ' Ne naideno')
return 0
Endsub

в этом пишет что "a Magic wand of Explosion" не найдена
Last edited by rvk on 2008-03-23 01:35:12, edited 2 times in total.
Yura
Posts: 71
Joined: 2008-03-03 09:19:21
Location: SPB

Post by Yura »

rvk wrote:

Code: Select all

For x=0 to WC-1
UO.findtype(WandT[X])
While UO.FindCount() <>0

в этом пишет что такая то ванда не найдена


Прочитай внимательней предыдущий пост, там добавились команды вывода.
rvk
Posts: 20
Joined: 2008-03-20 07:31:02

Post by rvk »

Я не понимаю, что из этих строчек надо заменить, а что оставить, то, как я заменил вывело ошибку:

Code: Select all

Label defined outside proc- BEGIN

в строчке 6
Yura
Posts: 71
Joined: 2008-03-03 09:19:21
Location: SPB

Post by Yura »

rvk wrote:Я не понимаю, что из этих строчек надо заменить, а что оставить, то, как я заменил вывело ошибку:

Code: Select all

Label defined outside proc- BEGIN

в строчке 6


Что то я закосячил... исправим для начала

Code: Select all

if NugnoeName==UO.GetName('finditem') then 
return 'finditem'
else

на

Code: Select all

if NugnoeName==UO.GetName('finditem') then 
return UO.getserial('finditem')
else


У меня данный скриптик заработал...

с begin странно... ты все ковычки закрыл когда переменные
объявлял?

Code: Select all

sub wandsearch(NugnoeName) 
var WC = 3 ;ñêîëüêî âñåãî òèïîâ
DIM WandT[ val( str( WC ) ) ]
WandT[0] ='0x0DF3'
wandT[1] ='0x0DF4'
wandT[2] ='0x0DF5'
var x
For x=0 to WC-1
UO.findtype(WandT[X])
UO.Print(UO.GetName('finditem'))
While UO.FindCount() <>0
if NugnoeName==UO.GetName('finditem') then
return UO.getserial('finditem')
else
UO.Ignore('finditem')
UO.FindType(WandT[x])
endif
wend
next
uo.print(NugnoeName + ' Ne naideno')
return 0
Endsub


Он так что выводит на экран?
Last edited by Yura on 2008-03-23 01:58:53, edited 1 time in total.
rvk
Posts: 20
Joined: 2008-03-20 07:31:02

Post by rvk »

Во втором варианте. он берет в руки все ванды по очереди, чем физлит начатый каст.
rvk
Posts: 20
Joined: 2008-03-20 07:31:02

Post by rvk »

исправил, как ты написал ранее, не кастует почему-то с ванды. со свитка и книги- легко, с ванды никак. Пишет не найдено

Code: Select all

sub explosion()
var i=1,wandT=0
var NN='a Magic wand of Explosion'
UO.DeleteJournal()
UO.Set('lasttarget','laststatus')
begin:
if uo.Waiting() then
uo.canceltarget()
endif
wandT=wandsearch(NN)
if wandT<>0 then
i=1
if uo.ObjAtLayer('Rhand')=="" and uo.ObjAtLayer('Lhand')<>"" then
uo.addobject('weapon',uo.ObjAtLayer('Lhand'))
else
if uo.ObjAtLayer('Rhand')<>"" then
uo.addobject('weapon',uo.ObjAtLayer('Rhand'))
else
i=0
endif
endif
UO.WaitTargetObject('lasttarget')
UO.UseObject(WandT)
wait(500)
if UO.InJournal("It seems to be out of charges") then
UO.Deletejournal()
UO.Ignore(WandT)
if i<>0 then
uo.waittargetself()
UO.UseObject('weapon')
wait(500)
endif
goto begin
endif
if i<>0 then
uo.waittargetself()
UO.UseObject('weapon')
endif
else
UO.FindType('0x1F57',-1,'my')
If UO.GetQuantity('finditem')>0 then
if UO.Mana>=14 then
UO.WaitTargetObject('lasttarget')
UO.UseObject('finditem')
UO.Print("Scroll")
else
UO.Print("Low mana!!! Scroll!")
endif
else
if UO.Mana>=28 then
UO.Cast('Explosion','laststatus')
UO.Print("Spell")
else
UO.Print("Low mana!!! Spell!")
endif
endif
endif
end sub

sub wandsearch(NugnoeName)
var WC = 3
DIM WandT[ val( str( WC ) ) ]
WandT[0] ='0x0DF3'
wandT[1] ='0x0DF4'
wandT[2] ='0x0DF5'
var x
For x=0 to WC-1
UO.findtype(WandT[X])
While UO.FindCount() <>0
if NugnoeName==UO.GetName('finditem') then
return 'finditem'
else
UO.Ignore('finditem')
UO.FindType(WandT[x])
endif
wend
next
uo.print(NugnoeName + ' Ne naideno')
return 0
End sub

У меня все правильно?
rvk
Posts: 20
Joined: 2008-03-20 07:31:02

Post by rvk »

Yura wrote:

Code: Select all

sub wandsearch(NugnoeName) 
var WC = 3 ;ñêîëüêî âñåãî òèïîâ
DIM WandT[ val( str( WC ) ) ]
WandT[0] ='0x0DF3'
wandT[1] ='0x0DF4'
wandT[2] ='0x0DF5'
var x
For x=0 to WC-1
UO.findtype(WandT[X])
UO.Print(UO.GetName('finditem'))
While UO.FindCount() <>0
if NugnoeName==UO.GetName('finditem') then
return UO.getserial('finditem')
else
UO.Ignore('finditem')
UO.FindType(WandT[x])
endif
wend
next
uo.print(NugnoeName + ' Ne naideno')
return 0
Endsub


Он так что выводит на экран?

Тоже самое. a Magic wand of Explosion Ne naideno
Yura
Posts: 71
Joined: 2008-03-03 09:19:21
Location: SPB

Post by Yura »

а перед этим ниче не пишет?
rvk
Posts: 20
Joined: 2008-03-20 07:31:02

Post by rvk »

Yura wrote:а перед этим ниче не пишет?

абсолютно нет
Yura
Posts: 71
Joined: 2008-03-03 09:19:21
Location: SPB

Post by Yura »

rvk wrote:
Yura wrote:а перед этим ниче не пишет?

абсолютно нет

В начале скрипта поставь

Code: Select all

UO.IgnoreReset()
rvk
Posts: 20
Joined: 2008-03-20 07:31:02

Post by rvk »

Yura wrote:
rvk wrote:
Yura wrote:а перед этим ниче не пишет?

абсолютно нет

В начале скрипта поставь

Code: Select all

UO.IgnoreReset()


Code: Select all

Unhandled exeption in parser


:(
Yura
Posts: 71
Joined: 2008-03-03 09:19:21
Location: SPB

Post by Yura »

Обнови инжект
Kynep
Expert!
Posts: 1348
Joined: 2006-02-07 08:51:40
Location: г. Старый Оскол
Contact:

Post by Kynep »

Может в домино? :lol:
Yura
Posts: 71
Joined: 2008-03-03 09:19:21
Location: SPB

Post by Yura »

Мне кажется, Вашу любовь к домино нужно обсуждать здесь
viewforum.php?f=6
Post Reply