[DarkBASIC] Name Gen menu

User Tag List

Results 1 to 2 of 2
  1. #1
    Kissy's Avatar Active Member
    Reputation
    60
    Join Date
    Jun 2006
    Posts
    332
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [DarkBASIC] Name Gen

    Ok noticed alotta DB threads about, just thought i'd throw some code i found awhile ago.

    As title says its a name gen, Very basic, not styling to it so expected the usal big black screen lol

    Code:
    sync on
    sync rate 60
    
    sync
    sync
    
    randomize timer()
    
    start:
    cls
    choice = 0
    
    repeat
       print "1-save 100 random names to a file"
       print "2-choose a certain length, create names of that length, and save them to a file"
       print "3-choose a first letter, create names that use it, and save them to a file"
       print "4-do both option 2 and 3 (set your own length AND first letter)"
       print "5-Exit"
       print "What would you like to do?"
       sync
       input "",choice
       if choice > 0 and choice < 6
          valid = 1
       else
          valid = 0
          CLS
          print "You must enter a number between 1 and 5"
          print " "
          sync
       endif
    until valid=1
    
    sync
    
    if choice = 1
       cls
    
       file$ = getfilename()
    
       if file exist(file$ + ".txt") then delete file file$ + ".txt"
    
       open to write 1, file$ + ".txt"
    
       for i=1 to 100
          length = rnd(4)+3
          write string 1, name(length, "")
          sync
       next i
    
       close file 1
    
       print "The 100 names have been saved to '" + file$ + ".txt'"
       print "Press any key to continue"
       sync
       wait key
       goto start
    endif
    
    
    if choice = 2
       cls
    
       length = getlength()
    
       num = 0
       print "How many names do you want to save to the file?"
       sync
       input "",num
    
       file$ = getfilename()
    
       if file exist(file$ + ".txt") then delete file file$ + ".txt"
    
       open to write 1, file$ + ".txt"
    
       for i=1 to num
          write string 1, name(length, "")
          sync
       next i
    
       close file 1
    
       print "The names have been saved to '" + file$ + ".txt'"
       print "Press any key to continue"
       sync
       wait key
       goto start
    endif
    
    
    if choice = 3
       cls
       first$ = ""
       length = 0
    
       print "Enter the letter you want your names to start with"
       sync
       input "",first$
    
       num = 0
       print "How many names do you want to save to the file?"
       sync
       input "",num
    
       file$ = getfilename()
    
       if file exist(file$ + ".txt") then delete file file$ + ".txt"
    
       open to write 1, file$ + ".txt"
    
       for i=1 to num
          length = rnd(4)+3
          write string 1, name(length, first$)
          sync
       next i
    
       close file 1
    
       print "The names have been saved to '" + file$ + ".txt'"
       print "Press any key to continue"
       sync
       wait key
       goto start
    endif
    
    if choice = 4
       cls
       first$ = ""
       length = 0
    
       print "Enter the letter you want your names to start with"
       sync
       input "",first$
    
       length = getlength()
    
       num = 0
       print "How many names do you want to save to the file?"
       sync
       input "",num
    
       file$ = getfilename()
    
       if file exist(file$ + ".txt") then delete file file$ + ".txt"
    
       open to write 1, file$ + ".txt"
    
       for i=1 to num
          write string 1, name(length, first$)
          sync
       next i
    
       close file 1
    
       print "The names have been saved to '" + file$ + ".txt'"
       print "Press any key to continue"
       sync
       wait key
       goto start
    endif
    
    if choice = 5
       end
    endif
    
    
    
    
    function name(length, first$)
       select length
    
          case 3
             name$ = firstletter(first$) + lower$(midletter()) + lower$(lastletter())
             break
          endcase
    
          case 4
             name$ = firstletter(first$) + lower$(midletter()) + lower$(lastletter()) + lower$(midletter())
             break
          endcase
    
          case 5
             name$ = firstletter(first$) + lower$(midletter()) + lower$(lastletter()) + lower$(midletter()) + lower$(lastletter())
             break
          endcase
    
          case 6
             name$ = firstletter(first$) + lower$(midletter()) + lower$(lastletter()) + lower$(midletter()) + lower$(firstletter("")) + lower$(midletter())
             break
          endcase
    
          case 7
             name$ = firstletter(first$) + lower$(midletter()) + lower$(lastletter()) + lower$(midletter()) + lower$(firstletter("")) + lower$(midletter()) + lower$(lastletter())
             break
          endcase
    
       endselect
    endfunction name$
    
    function firstletter(rule$)
       if rule$=""
          num = rnd(2)+1
          select num
             case 1
                letters$ = "BCDLMNRS"
             endcase
             case 2
                letters$ = "BCDFGHKLMNPRSTW"
             endcase
             case 3
                letters$ = "BCDFGHJKLMNPQRSTVWXYZ"
             endcase
          endselect
    
          a$ = mid$(letters$, rnd(len(letters$)-1)+1)
       else
          a$ = rule$
       endif
    
    endfunction a$
    
    function midletter()
       letters$ = "AEIOU"
       a$ = mid$(letters$, rnd(len(letters$)-1)+1)
    endfunction a$
    
    
    function lastletter()
       letters$ = "RTNHLMNB"
       a$ = mid$(letters$, rnd(len(letters$)-1)+1)
    endfunction a$
    
    function getlength()
    
       length = 0
       print "Enter the length you want your names to be. From 3 to 7"
       sync
       input "",length
       repeat
          if length > 2 and length < 8
             complete = 1
          else
             cls
             print "That is an illegal length! please enter a length between 3 and 7"
             sync
             input "",length
             complete = 0
          endif
       until complete = 1
    endfunction length
    
    function getfilename()
       complete = 0
       repeat
          file$ = ""
          print "Enter a name for the file"
          sync
          input "",file$
    
          ask$ = ""
          if file exist(file$ + ".txt")
             print "That file exists, overwrite? y/n"
             sync
             input "",ask$
             if ask$ = "y"
                complete = 1
             else
                complete = 0
                cls
             endif
          else
             complete = 1
          endif
       until complete = 1
    endfunction file$
    As i said i found this but i think am gonna try and build on this one and make a wow name gen (Yea i know theres loads but the names are pretty common gonna try make this one create more unique names and replace the file dump to onscreen dump, or maybe both)

    Post in here what name gens you come up with using Darkbasic pro only.

    [DarkBASIC] Name Gen
  2. #2
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Neer, DarkBASIC and DarkBASIC Pro can both run the same code. Pro just has a slightly different syntax for some things, and better net support. It also has a more traditional editor view.

    On to the code, nice find! I had a quick look over it and don't see anything wrong with it, syntax wise. As to a WoW name generator, it'd just have to have a whole boatload of names and randomly pick one. Only way it could feasibly work.

Similar Threads

  1. Name change exploit (one that works..)
    By XxKajxX in forum World of Warcraft Exploits
    Replies: 22
    Last Post: 11-17-2006, 09:17 AM
  2. [Exploit] Name Change
    By Ced in forum World of Warcraft Exploits
    Replies: 22
    Last Post: 09-02-2006, 03:00 AM
  3. Buying Colour in your name
    By Cush in forum Community Chat
    Replies: 8
    Last Post: 07-08-2006, 10:58 PM
  4. Blank hunter pet name
    By zamp in forum World of Warcraft General
    Replies: 1
    Last Post: 05-31-2006, 08:38 PM
  5. Name Change Exploit
    By Matt in forum World of Warcraft Exploits
    Replies: 3
    Last Post: 05-16-2006, 12:50 PM
All times are GMT -5. The time now is 01:06 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search