Sběr munice s přepínačem od Sykece

15.12.2012 12:48
################################################################
# - Skript na sbírání munice.                                  #
# - Vlakno pro sběr munice      - sber                         #
#              přepínání modu   - prepinacsipu                 #
#              nastavení batohu - batohssipkama                #
#                                                              #
# - Funkce:                                                    #
#   Skript automaticky sbírá nastavenou munici v dosahu tří    #
#   políček od hráče.                                          #
################################################################

sub prepinacsipu()
if NOT UO.GetGlobal('prepinacsipu')=='1' and NOT UO.GetGlobal('prepinacsipu')=='2' then
 UO.SetGlobal('prepinacsipu','1')
end if
if UO.GetGlobal('prepinacsipu')=='1' then
 UO.CharPrint(0x0058,'Sbírám pouze šipky a zubaté.')
 UO.SetGlobal('druhsipek','1')
 UO.SetGlobal('prepinacsipu','2')
 UO.Exec('terminate prepinacsipu')
end if
if UO.GetGlobal('prepinacsipu')=='2' then
 UO.CharPrint(0x005D,'Sbírám šipky, zubaté a šípy.')
 UO.SetGlobal('druhsipek','2')
 UO.SetGlobal('prepinacsipu','1')
 UO.Exec('terminate prepinacsipu')
end if
end sub

sub sber()
if NOT UO.GetGlobal('prepinacsipu')=='1' and NOT UO.GetGlobal('prepinacsipu')=='2' then
 UO.SetGlobal('prepinacsipu','1')
 UO.SetGlobal('druhsipek','1')
 UO.CharPrint(0x0035,'Přepínač není nastaven...')
 Wait(500)
 UO.CharPrint(0x0058,'Nastavuji skript na sběr šipek a zubatek.')
end if
if NOT UO.GetGlobal('sbersipek')=='zapnuto' then
 UO.SetGlobal('sbersipek','zapnuto')
 UO.CharPrint(0x0044,"Zapínám sběr munice.")
 var a
 var druh
 DIM munice[3]
 munice[0] = '0x1BFB' #šipky
 munice[1] = '0x38D8' #zubatky
 munice[2] = '0x0F3F' #šípy
 While not uo.dead()
  druh = val(uo.getglobal('druhsipek'))
  uo.set('finddistance','3')
  FOR a = 0 to druh
  repeat
   UO.FindType(munice[a],'-1','ground')
   if UO.FindCount() > 0 then
    UO.MoveItem('finditem','-1','batohnasipky')
    if UO.InJournal('Ne tak rychle') then
     uo.deletejournal()
     Wait(600)
    end if
    Wait(600)
   end if
  until UO.FindCount() < 1
  Wait(1000)
  NEXT
  Wait(1000)
 Wend
else
 UO.SetGlobal('sbersipek','vypnuto')
 UO.CharPrint(0x0026,'Vypínám sběr munice.')
 UO.Exec('terminate sber')
end if
end sub

sub batohssipkama()
UO.CharPrint(0x0035,'Vyberte batoh do kterého chcete sbírat munici.')
UO.AddObject('batohnasipky')
Wait(200)
While UO.Targeting()
 Wait(200)
Wend
UO.CharPrint(0x0035,'Batoh byl uložen.')
end sub