1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Greetings Guest!!

    In order to combat SPAM on the forums, all users are required to have a minimum of 2 posts before they can submit links in any post or thread.

    Dismiss Notice

[Tech Help] How do you write an OR statement when you write Mods?

Discussion in 'UO Enhanced Client Discussion' started by G.v.P, Sep 16, 2010.

  1. G.v.P

    G.v.P Stratics Legend
    Stratics Veteran Stratics Legend

    Joined:
    Jul 11, 2004
    Messages:
    9,644
    Likes Received:
    831
    Hi guys I'm editing the Item Properties Evaluator so it doesn't show mods for Spellbooks and the like and was wondering how you can write an OR statement (If A = B or A = C then X = Y).

    I was thinking I could use ||, like for example this works for one string:

    if wstring.find(title, L"spellbook") then
    ItemPropertiesEvaluator.ItemType = ItemPropertiesEvaluator.TYPE_SKIP
    return
    end

    And I thought I could add before "then":

    || wstring.find(title, L"scrapper's compendium")

    But it doesn't work so was wondering what the code is for an OR operator.

    Also, what's the best format to save in if you run notepad? ANSI, Unicode, Unicode big endian, or UTF-8? I know you have to save as .LUA, but was just curious if one encoding was preferred by modders (for basic HTML I always use UTF-8).

    Thanks!
     
  2. Gildar

    Gildar Babbling Loonie
    Stratics Veteran

    Joined:
    Apr 22, 2004
    Messages:
    2,354
    Likes Received:
    4
    if wstring.find(title, L"spellbook") or wstring.find(title, L"scrapper's compendium") then


    I try to use || instead of or all the time :)
     
  3. G.v.P

    G.v.P Stratics Legend
    Stratics Veteran Stratics Legend

    Joined:
    Jul 11, 2004
    Messages:
    9,644
    Likes Received:
    831
    :O so all you have to write is or ... wow, that's simple enough! lol thank you Gildar :)