Ошибка в скрипте или..?

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
Mihail
Expert!
Posts: 548
Joined: 2005-05-20 20:30:10
Contact:

Ошибка в скрипте или..?

Post by Mihail »

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

Code: Select all

sub drop1()
if uo.getglobal('drop')=='on' then
uo.print('*DROP is allready running!!*')
goto q
end if
 var s
 dim d[6]
  d[0]=0x1B9B
  d[1]=0x1B9C
  d[2]=0x1B9D
  d[3]=0x1B9E
 d[4]=0x09AA
 d[5]=0x0E7D
 for s=0 to 5
uo.setglobal('drop','on')
uo.set('lasttarget','laststatus')
x=uo.getserial('lasttarget')
uo.findtype(d[s])
if uo.findcount('finditem') then
if uo.getdistance('finditem')<3 then
end if
  uo.drop("1",str(uo.getx(x)-1),str(uo.gety(x)),0,"finditem")
end if
wait(267)
uo.findtype(d[s])
if uo.findcount('finditem') then
if uo.getdistance('finditem')<3 then
end if
uo.drop("1",str(uo.getx(x)),str(uo.gety(x)+1),0,"finditem")
end if
wait(432)
uo.findtype(d[s])
if uo.findcount('finditem') then
if uo.getdistance('finditem')<3 then
end if
 uo.drop("1",str(uo.getx(x)+1),str(uo.gety(x)),0,"finditem")
end if
wait(600)
uo.findtype(d[s])
if uo.findcount('finditem') then
if uo.getdistance('finditem')<3 then
end if
uo.drop("1",str(uo.getx(x)),str(uo.gety(x)-1),0,"finditem")
end if
uo.setglobal('drop','off')
uo.print('.....d o n e.....')
q:
end sub
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

Что именно ему не нравится?
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.
Telegram: @tatikom
Mihail
Expert!
Posts: 548
Joined: 2005-05-20 20:30:10
Contact:

Post by Mihail »

на строчке

Code: Select all

wait 267
он говорит что изменчивая переменная "X"

p.s. вообще я пытался написать скрипт кидающий любые из вышезаданных предметов вокруг врага, при этом если расстояния становится больше 3 тайлов, то выводит сообщение и выключается.. а получилось... ничего не получилось..
Edred
Expert!
Posts: 2544
Joined: 2004-04-03 17:36:29
Location: Saint-Petersburg

Post by Edred »

Ты забыл в начале скрипта объявить переменную X.


ЗЫ: А wait(267) меня просто убил. Как ты умудрился так точно замерить необходимую тебе паузу? :shock: Именно 0.267 секунды, ни на одну тысячную больше или меньше... :shock: :shock: :shock:
Mihail
Expert!
Posts: 548
Joined: 2005-05-20 20:30:10
Contact:

Post by Mihail »

Edred wrote:Ты забыл в начале скрипта объявить переменную X.


ЗЫ: А wait(267) меня просто убил. Как ты умудрился так точно замерить необходимую тебе паузу? :shock: Именно 0.267 секунды, ни на одну тысячную больше или меньше... :shock: :shock: :shock:

Code: Select all

sub drop1() 
if uo.getglobal('drop')=='on' then
uo.print('*DROP is allready running!!*')
goto q
end if
 var s
 dim d[6]
  d[0]=0x1B9B
  d[1]=0x1B9C
  d[2]=0x1B9D
  d[3]=0x1B9E
 d[4]=0x09AA
 d[5]=0x0E7D
 for s=0 to 5
uo.setglobal('drop','on')
uo.set('lasttarget','laststatus')
x=uo.getserial('lasttarget')

x=uo.getserial('lasttarget')
вот вроде пытался тут задать икс..
p.s. задержку я такую от балды ставил, в рассчете на то, что в логах сферы будет отображаться как рандомное кидание веток (если бы я везде поставил 500, то в логах бы везде наверное тоже были 500) - но на счет этого не уверен :)
Solaire
Posts: 163
Joined: 2005-05-21 07:12:12
Location: DRW

Post by Solaire »

Mihail wrote:x=uo.getserial('lasttarget')
вот вроде пытался тут задать икс..

Через VAR объявляются переменные. :)
Post Reply