[Question] Pick random string? menu

Shout-Out

User Tag List

Results 1 to 6 of 6
  1. #1
    Erase's Avatar Banned
    Reputation
    229
    Join Date
    Jun 2008
    Posts
    990
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Question] Pick random string?

    Hey guys, I want to make a program which will be used to make the so called ''What class are you'' test. I don't want it to be advanced, and make the result depend on what you type and choose.
    But I will add some stuff like What is your name, how old are you, and such. To make people feel it is real.
    But what I seek is a code that makes e.g. sets the text of label1 to ''Hunter'' and label2 to some information about the hunter class.
    So basicly it picks one out of the 10 different classes, and puts in the text for that class.
    I made an example to show what I mean.

    [Question] Pick random string?
  2. #2
    Sychotix's Avatar Moderator Authenticator enabled
    Reputation
    1441
    Join Date
    Apr 2006
    Posts
    3,996
    Thanks G/R
    294/585
    Trade Feedback
    1 (100%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    if memo1.text = 'Hunter' then
    label1.caption := 'Hunter' //Change Label to Hunter
    if memo1.text = 'Rogue' then
    label1.caption := 'Rogue' // Change Label to Rogue

    etc...

    EDIT: Oh, and if you wanted it to randomly pick a class...
    var
    classnum : Integer;
    begin
    classnum := Random(10); //Generate a Random number greater than or equal to 0, and below 10... meaning 0-9
    if classnum = 0 then
    label1.caption := 'Hunter';
    if classnum = 1 then
    label1.caption := 'Rogue';

    etc...
    Last edited by Sychotix; 09-05-2009 at 01:14 PM.

  3. #3
    maclone's Avatar / Authenticator enabled
    Reputation
    2420
    Join Date
    Nov 2007
    Posts
    8,726
    Thanks G/R
    0/1029
    Trade Feedback
    0 (0%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Dictionary.
    Zomfg. And no, don't ask. - Dombo did it.

  4. #4
    CimSlunt's Avatar Contributor Authenticator enabled
    Reputation
    154
    Join Date
    Nov 2008
    Posts
    691
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know its onli a Demo but i would change it from "Use theier guns" to Use Ranged attacks" lol.

    Cool idea tho


  5. #5
    Erase's Avatar Banned
    Reputation
    229
    Join Date
    Jun 2008
    Posts
    990
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know I know... Just made up something fast.

  6. #6
    Senoska's Avatar Member
    Reputation
    1
    Join Date
    Sep 2009
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In vb.net, don't use the method posted above.

    The following code will work [tested]:
    Code:
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim rand As New Random
            Dim min As Integer = 0
            Dim max As Integer = 10
    
            Dim returned As Integer = rand.Next(min, max)
    
            Select Case returned
                Case 1
                    Label1.Text = "Hunter"
                    Label2.Text = "Blahblahblah"
                Case 2
                    Label1.Text = "Rogue"
                    Label2.Text = "Cheap class."
            End Select
    
        End Sub

Similar Threads

  1. Question about DBC string reading
    By Game2Mesh in forum WoW Memory Editing
    Replies: 0
    Last Post: 01-12-2015, 10:45 AM
  2. [question/idea] Random values and events
    By kamil234 in forum WoW Memory Editing
    Replies: 6
    Last Post: 02-27-2010, 06:15 PM
  3. Password and random string generator
    By someone32 in forum Community Chat
    Replies: 1
    Last Post: 05-03-2009, 12:41 PM
  4. [Question] Getting Random Loot Out Of A Bag...
    By Bumbo in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 12-16-2007, 11:28 PM
All times are GMT -5. The time now is 06:20 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search