MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides  
Homepage Register FAQ Members Mark Forums Read Advertise Marketplace FPSowned


Go Back   MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides > Programming > Programming section > Misc
Reload this Page [DarkBASIC] Name Gen
Misc For other languages that don't fit elsewhere like KuRIoSaN or Lavishscript - PROGRAMMING WISE

Reply
 
LinkBack Thread Tools
[DarkBASIC] Name Gen
(#1)
Old
кιѕѕу's Avatar
кιѕѕу is Offline
Site Donator
Rep Power: 3
Reputation: 45
кιѕѕу is on a distinguished road
 
Posts: 214
Join Date: Jun 2006
Location: In The Upcoming Patc
[DarkBASIC] Name Gen - 06-24-2008

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.


Now doing Youtube view increasing, PM me with amount of views you want you'll offer in return
(No stupid amounts, you must have 50rep+. Video must be of good quality. I hold the right to refuse my service)

Reply With Quote

Donate to remove ads.
(#2)
Old
ReidE96's Avatar
ReidE96 is Offline
Contributor
Rep Power: 4
Reputation: 272
ReidE96 is a jewel in the roughReidE96 is a jewel in the roughReidE96 is a jewel in the rough
 
Posts: 805
Join Date: Dec 2006
Location: Scotland
06-25-2008

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.


Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vBulletin Skin developed by: vBStyles.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382