Results 1 to 3 of 3

Thread: to_item("[XXX]") return $item[none] for non-valid [XXX] strings

  1. #1
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    928

    Default to_item("[XXX]") return $item[none] for non-valid [XXX] strings

    Per this discussion, make to_item("[XXX]") return $item[none] for [XXX] strings that are not valid item id numbers.

  2. #2
    Senior Member
    Join Date
    Jun 2016
    Posts
    362

    Default

    Maybe unless the string as a whole is a valid item id name. Like say: "[glitch season reward name]".
    That item has had OCD inventory control's item handling confused ever since I've had it in my inventory, but that's a separate kind of issue that just amuses me, given what the item stands for.

  3. #3
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,313

    Default

    Revision 19436:

    Code:
    > ash to_item( 0 ).to_string()
    
    Returned: none
    
    > ash to_item( 1 ).to_string()
    
    Returned: seal-clubbing club
    
    > ash to_item( 1111111 ).to_string()
    
    Returned: none
    
    > ash to_item( "[0]" ).to_string()
    
    Returned: none
    
    > ash to_item( "[1]" ).to_string()
    
    Returned: seal-clubbing club
    
    > ash to_item( "[1111111]" ).to_string()
    
    Returned: none
    
    > ash to_item( "[hello]" ).to_string()
    
    Returned: none
    
    > ash to_item( "[glitch season reward name]" ).to_string()
    
    Returned: [glitch season reward name]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •