Jump to content

Recommended Posts

Posted (edited)

Dear readers,

Mij code is as displayed here:

$msgrand = 1

$text0 = "....."
$text1 = "....."
$text2 = "....."
$text3 = "....."

Now I do this:

if $msgrand >= 1 Then
    $nr = Random(0, 9)
;WHAT HERE?
EndIf

The problem is, that it wont send the chosen text. Can someone tell me what I am doing wrong?

I want to display (send) one of the random text that has been set with $text0 up to $text3.

Best regards

P.S. the ;WHAT HERE? part should need a code, but I dont know the correct one!

something like Send($text[$nr]) maybe?

Edited by Valkyrie
Posted

Use arrays instead.

Local $Texts[4]=["This","Array","Contains","Text"]

$Rand=Random(0,UBound($Texts)-1,1)

Send($Texts[$Rand])

Broken link? PM me and I'll send you the file!

Posted

  Valkyrie said:

I cant use

local $text = ["world domination!?", "level?", "boooooorrrringgg!"]

gives me the error:

C:\Users\Angelo\Desktop\sknnr.au3(4,9) : ERROR: syntax error

which points to:

local $text = ["world domination!?", "level?", "boooooorrrringgg!"]
Look at my code again. Notice that I specified how many items I was adding.

Broken link? PM me and I'll send you the file!

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
  • Recently Browsing   0 members

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