annuncio

Comprimi
Ancora nessun annuncio.

[OpenEUO HELP] come funziona il "finditem" in lua?

Comprimi
X
 
  • Filtro
  • Ora
  • Visualizza
Elimina tutto
nuovi messaggi

  • [OpenEUO HELP] come funziona il "finditem" in lua?

    ebbene si, sto provando a scrivere qualcosa in LUA, ma non ho capito ancora come funziona il finditem :S ho capito solo che scanitem puo trovare oggetti visibili o non visibili. Il problema sta nel fatto che con easuo fai finditem %id o %type e scegli tra C o G, con lua nn ho capito nulla xD se insieme alla teoria mi fate vedere anche 2 esempi di script per trovare le bene una volta nel backpack e una volta per terra (come la guida di vash) ve ne sarei grato ^^

  • #2
    c'è un esempio sul forum ufficiale...


    serve però una premessa. finditem era una funzione che dati id/type e contenitore in cui cercare dava dei risultati "filtrati" di id. questo adesso deve essere fatta dallo scripter, OpenEUO da a disposizione le funzioni ScanItems e GetItem, la prima dice quanti oggetti ci sono in memoria, la seconda recupera i dati di ogni oggetto, il filtraggio va quindi fatto passando da 1 a " ScanItems " oggetti e cercando quelli che vogliamo...

    l'esempio scorre tutti gli oggetti in memoria (oggetti, mostri, statici) e stampa tutte le variabili che si possono ottenere di volta in volta.
    codice:
    function scanitems()
    local cnt = UO.ScanItems(false) --;Calls the ScanItems command and sets the return value to the local variable cnt
    
    i=0
       while i ~= cnt do --; While i does not equal the cnt returned, loop.
       
       local ID,Type,Kind,ContID,X,Y,Stack,Rep,Col = UO.GetItem(i) --;Set all these vars to the scanned item under i, starting at 1 and ending at cnt
    
       local Name,Info = UO.Property(ID) --; Same thing as the last line, setting 2 variables with the return values of property, using ID defined in the line above.
    
       print("Item ID Is:" .. ID,"Item Type Is:" .. Type) --; You'll notice the .. in my print message here, this is how you concatenate items to the same line. Used to be . in old EUOX code.
    
       print("Item Name Is:" .. Name,"Item Properties Are:" ..Info)
    
       print("Press F9 while this window is active for the next item.")
    
       pause()
    
       i = i+1 --; Increment var to look at the next item, return to top until expression evaluates to false.
    
       end --; Always end (case sensitive) your while/for/if's!! Will cause headaches if you do not remember!
    
    end
    
    while true do --; Loop to initialize the function.
    scanitems()
    end
    Ultima modifica di fengyr; 10-01-2011, 13:47.
    ____________________________________________________________________

    Il p Fengyr
    ____________________________________________________________________
    : algander#6292

    Commenta


    • #3
      uhm penso di aver capito, poi provo a tradurre qualche script in lua e vedo se riesco, grazie

      Commenta

      Sto operando...
      X