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
  3. Greetings Guest, Having Login Issues? Check this thread!
    Dismiss Notice
  4. Hail Guest!,
    Please take a moment to read this post reminding you all of the importance of Account Security.
    Dismiss Notice
  5. Author Wes Locher has teamed up with Stratics for a giveaway of his new book Braving Britannia. This book explores the history and impact of Ultima Online and includes interviews from current and past dev team members as well as many UO and Stratics community members. Click here for more details!
    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,758
    Likes Received:
    934
    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 Stratics Legend

    Joined:
    Apr 22, 2004
    Messages:
    2,357
    Likes Received:
    5
    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,758
    Likes Received:
    934
    :O so all you have to write is or ... wow, that's simple enough! lol thank you Gildar :)