Yoko

All sides of Injection
It is currently 2026-01-27 01:24:30

All times are UTC+02:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 2008-08-04 07:32:32 
Offline

Joined: 2006-07-14 11:15:15
Posts: 2
Вопрос таков - к примеру, есть такая штука

Code:
UO.WaitMenu ('Blacksmithing', 'Weapons', 'Weapons','Swords & Blades','Swords & Blades', 'cutlass (8 iron ingot)')


Можно ли каким-то образом забить массив и потом его перебрать, - или же прям туда запихнуть?
Что-то типа как в перле
uo.waitmenu("'".join("','",@x)."'");

?=)


Top
   
 Post subject:
PostPosted: 2008-08-04 08:27:19 
Offline

Joined: 2005-04-19 18:00:29
Posts: 2259
Location: Московская область
Code:
sub inscription() 
Var blanc='0x0E34'   # тип бланка
Var food='0x097B' # тип еды
Var sunduk=0x4027308F # ИД где лежат реги и бланки
Var a, k, z, f
Var b='Cure' # Имя вашего скрола
Var msg='You put'
Var msg1='You fail'
Var MaxWeight= 600
Var scroll='0x1F37' # Тип нарисованного скрола
a = 2 # !!!Круг в котором находится ваш спел!!!


 DIM reg[9]

        reg[0]=0x0F88
        reg[1]=0x0F85
        reg[2]=0x0F84
        reg[3]=0x0F8C
        reg[4]=0x0F8D
        reg[5]=0x0F7B
        reg[6]=0x0F7A
        reg[7]=0x0F86
        reg[8]=0x0E34
UO.UseObject(sunduk)
wait(1000)
if a==1 then
    k = 'First'
    uo.Print(' First Circles ')
  end if
  if a==2 then
    k = 'Second'
    uo.Print(' Second Circles ')
  end if
  if a==3 then
    k = 'Third'
    uo.Print(' Third Circles ')
  end if
  if a==4 then
    k = 'Fourth'
    uo.Print(' Fourth Circles ')
  end if
  if a==5 then
    k = 'Fifth
    uo.Print(' Fives Circles ')
  end if
  if a==6 then
    k = 'Sixth'
    uo.Print(' Sixth Circles ')
  end if
  if a==7 then
    k = 'Seventh'
    uo.Print(' Seventh Circles ')
  end if
  if a==8 then
    k = 'Eighth'
    uo.Print(' Eighth Circles ')
  end if
while not uo.Dead()
 
    for f=0 to 8
      if uo.Count(reg[f]) < 1 then
        uo.FindType(reg[f],'-1',sunduk)
          if UO.FindCount() > 0 then
            uo.moveitem('finditem','100')
            wait(1000)
          else
            UO.Print('There are no regs!!!')
            uo.exec("terminate inscription")
          end if
      end if
    next
    uo.WaitMenu('Spell',k,a,b)
    uo.UseType(blanc)
    z = 0
    uo.DeleteJournal()
    repeat
      wait(500)
      z = z + 1
    until uo.InJournal(msg) or uo.InJournal(msg1) or (z > 50)
    if uo.InJournal('hungry') or uo.InJournal('starving') then
      uo.FindType(food,'-1',sunduk)
      uo.moveitem('finditem','20')
      repeat
        uo.UseType(food)
        wait(750)
      until uo.InJournal('simply')
    end if
wend
end sub

Здесь сделано меню через переменные,-ты сделай через массив


Top
   
 Post subject:
PostPosted: 2008-08-04 10:07:35 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
Дык в чём проблема? - Джойна конечно нет, но есть руки, не так ли? -)
Code:
sub main()
   var count = 3
   DIM promts[ val( str( count ) ) ]
   DIM choice[ val( str( count ) ) ]
   promts[0] = "Blacksmithing"
   choice[0] = "Weapons"
   promts[1] = "Weapons"
   choice[1] = "Swords & Blades"
   promts[2] = "Swords & Blades"
   choice[2] = "cutlass (8 iron ingot)"
   WaitMenu( promts, choice, count )
endsub

sub WaitMenu( promts, choice, len )
   var i, menu = "waitmenu"
   for i = 0 to len -1
      menu = menu + " '" + promts[ i ] + "' '" + choice[ i ] + "'"
   next
   uo.exec( menu )
endsub


Теоретически должно работать, если кавычки не закосячит -)

PS: Вроде не сложная конструкция, странно почему раньше подобного не видел.

_________________
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
   
PostPosted: 2008-09-13 13:44:15 
Offline
User avatar

Joined: 2008-09-12 05:07:34
Posts: 247
Если я хочу, чтобы функция вернула мне несколько параметров, могу я в этой функции запихнуть эти параметры в массив и воткнуть в скрипте команду
Code:
returm massiv
, а в вызывающей функции проинициализировать массив и присвоить ему значение вызываемой функции? И если я не могу так сделать, то как мне вернуть членораздельно из функции несколько параметров, что б вызывающая функция знала где чего? Вот...


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 0 guests


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