Jump to content

Recommended Posts

Posted

Can somebody make me a script so when i activate it, it will randomly send a letter. When I press esc it will turn off, thanks Please reply soon.

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

  • Developers
Posted

Can somebody make me a script so when i activate it, it will randomly send a letter. When I press esc it will turn off, thanks Please reply soon.

This is a joke right ?

What about trying to do it yourself since it sounds pretty simple?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)

I know how to do a random send, but not with using letters. Other wise I would do it myself.

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Posted (edited)

Well how do you do your random send? That's a start.

Send(random)

Func Random()
Send(". " & Random(0, 99, 1) )
EndFunc

Letters ascii values range from 65-90 for A-Z and 97-122 for a-z

So how could I do that ^ with the code above? Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Posted (edited)

u could always make an array with the characters in it... and do something like send($Array[random(0, 50, 1)])

that will work...

example:

Dim $AlphaB[5]
$AlphaB[0] = "a"
$AlphaB[1] = "b"
$AlphaB[2] = "c"
$AlphaB[3] = "d"
$AlphaB[4] = "e"

Send($AlphaB[Random(0, 4, 1)])


;or


$Letter = Asc(random(67, 90, 1)); something like that
Edited by CHRIS95219
  • Developers
Posted

Send(random)

Func Random()
Send(". " & Random(0, 99, 1) )
EndFunc

So how could I do that ^ with the code above?

Heres one way of doing it... by the way, you shouldn't give your Func that name of an existing internal function...

Func SendRandom()
    Do 
        $RandChar = Random(65, 122, 1)
    Until $RandChar < 91 Or $RandChar > 96
    Send(". " & Chr($RandChar))
EndFunc

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)

Post #7 Worked

Post #8 (the one above) worked also

GOOD JOB AND THAT YOU PEOLE!

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Posted (edited)

whats about:

For $i = 1 To 100 Step 1
    If Random() = 0 Then
        $letter = Random(65, 90)
    EndIf
    Else
        $letter = Random(97, 122)
    EndIf
    Send(Chr($letter))
Next

Sends 100 letters... if you want it to be run until you press ESC take this:

HotKeySet("{ESC}", "Exit1")

While 1
    If Random() = 0 Then
        $letter = Random(65, 90)
    EndIf
    Else
        $letter = Random(97, 122)
    EndIf
    Send(Chr($letter))
WEnd

Func Exit1()
    Exit
End Func
Edited by Lord_Doominik
Posted

That one seems to work very well also. Thank you everybody I got it working

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Posted

I don't see anything in that, that says anything about letters

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Posted

Having trouble reading?

;Random letter
If Random() < 0.5 Then
   ;Capitals
    $Letter = Chr(Random(Asc("A"), Asc("Z"), 1))
Else
   ;Lower case
    $Letter = Chr(Random(Asc("a"), Asc("z"), 1))
Endif
Posted

Hmm, guess I missed that part. But anyway thanks to the people that helped. Now I won't fail Language arts. (Don't ask, it's for a project we are doing)

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Posted

I think people see the long description of how it works, and don't bother reading through all the stuff. Although, since they ought to know that there are always code examples at the end, they should read through the whole code section...

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
×
×
  • Create New...