Results 1 to 3 of 3

Thread: Simple Code shortening

  1. #1
    Join Date
    Oct 2011
    Posts
    62
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Simple Code shortening

    Not too drastic but how do i shorten this?

    I'm not sure if i can use 'with ... do ... ' here.

    Simba Code:
    case Strings[0] of      // the DTM's are for the spell...
        'Sapphire'   : begin
                          Ench:= DTMFromString('m6wAAAHic42ZgYGhlYmDoAOJuIG4A4mYobgfiLqh4B1TMkxEVuwGxExQ7A7EvEPtDMafrRwae7F8MBvLMYPz792+G78+5GEpiDYDYEMw/tECAIduHhYEV6A5iMSMJGAkAADhqGJ4=');
                          case Strings[1] of
                            'Ring'     : Str2 := '';
                            'Necklace' : Str2 := '';
                            'Bracelet' : Str2 := '';
                            'Amulet'   : Str2 := '';
                          end;
                       end;
        'Emerald'    : begin
                          Ench:= DTMFromString('');
                          case Strings[1] of
                            'Ring'     : Str2 := '';
                            'Necklace' : Str2 := '';
                            'Bracelet' : Str2 := '';
                            'Amulet'   : Str2 := '';
                          end;
                       end;
        'Ruby'       : begin
                          Ench:= DTMFromString('');
                          case Strings[1] of
                            'Ring'     : Str2 := '';
                            'Necklace' : Str2 := '';
                            'Bracelet' : Str2 := '';
                            'Amulet'   : Str2 := '';
                          end;
                       end;
        'Diamond'    : begin
                          Ench:= DTMFromString('');
                          case Strings[1] of
                            'Ring'     : Str2 := '';
                            'Necklace' : Str2 := '';
                            'Bracelet' : Str2 := '';
                            'Amulet'   : Str2 := '';
                          end;
                       end;
        'Dragonstone': begin
                          Ench:= DTMFromString('');
                          case Strings[1] of
                            'Ring'     : Str2 := '';
                            'Necklace' : Str2 := '';
                            'Bracelet' : Str2 := '';
                            'Amulet'   : Str2 := '';
                          end;
                       end;
      end;

    ty
    Last edited by logical; 12-14-2011 at 06:10 PM.

  2. #2
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    That is about as short as it's going to get, Tho I'd suggest lowercasing.

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  3. #3
    Join Date
    Oct 2011
    Posts
    62
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    no one? >.<

    bump

    I changed the script a little.
    If there is no way to shorten it tell me plz.

    Edit: o..didn't see your post Dgby...did you see it after the edit?
    thanks for responding though

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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