Jump to content

Giving a random number


Recommended Posts

Is it possible to have a script type 7 random numbers on note pad, or present them in a msg box?

if so, how?

please and thank you

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

yes... it is... here you go.

Hotkeyset("{insert}", "makemerandoms")

While 1
sleep(1000)
WEnd

Func makemerandoms()
$randomnumb1 = Random(0,9,1)
$randomnumb2 = Random(0,9,1)
$randomnumb3 = Random(0,9,1)
$randomnumb4 = Random(0,9,1)
$randomnumb5 = Random(0,9,1)
$randomnumb6 = Random(0,9,1)
$randomnumb7 = Random(0,9,1)
$randomnumb8 = Random(0,9,1)
$randomnumb9 = Random(0,9,1)

Msgbox(0, "Randomnumbmaker by kickassjoe", "Randomnumbs:  " & $randomnumb1 & $randomnumb2 & _
$randomnumb3 & $randomnumb4 & $randomnumb5 & $randomnumb6 & $randomnumb7 & $randomnumb8 & _
$randomnumb9)
EndFunc

I dont no if thats what you were looking for... but I tried..

P.S. I really should have told you to look in the help file... but im bored.

EDIT: lmao it made :P a smilie face and made error in expression lmao! fixed i think

EDIT2: oops nvm i just forgot an "&" in there somewhere... sorry

Edited by Kickassjoe

What goes around comes around... Payback's a bitch.

Link to comment
Share on other sites

oh thanks! i didnt know random was an actual function, when i typed R in scythe, nothing came up so i though maybe it wasnt a real commmane, although this script worked better without the funtion and the wile loop.. misplaced perhaps?

thanks so much!

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

making a while loop (idling) is the only way i know of to set a hotkey and then have it not exit the program right away... and this way if you need more than 1 random number all you have to do is press insert again...

What goes around comes around... Payback's a bitch.

Link to comment
Share on other sites

A shorter version of the above code

Hotkeyset("{insert}", "makemerandoms")

While 1
sleep(1000)
WEnd

Func makemerandoms()
For $Int = 1 to 9
$randomnum[$Int] = Random(0,9,1)

Msgbox(0, "Randomnumbmaker by kickassjoe", "Randomnumbs:  " & $randomnum[1] & $randomnum[2] & _
$randomnum[3] & $randomnum[4] & $randomnum[5] & $randomnum[6] & $randomnum[7] & $randomnum[8] & _
$randomnum[9])
EndFunc
Link to comment
Share on other sites

Hi,

or

HotKeySet("{insert}", "makemerandoms")
Dim $out = ""
While 1
    Sleep(1000)
WEnd
Func makemerandoms()
    For $i = 1 To 9
        $out = $out & Random(0, 9, 1)
    Next
    MsgBox(0, "Randomnumbmaker :", "Randomnumbs:  " & $out)
EndFunc   ;==>makemerandoms

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...