Random Name Generator from list

Post here if you need help using Actiona
Post Reply
bingojack
Posts: 2
Joined: 01 Apr 2018, 17:10

Random Name Generator from list

Post by bingojack »

Hello I need help i try to make some script to use a variable with algorithm for random name generator but not succes.
If you can help my I am new in C++.
I need variable witch can pick random name from list in the script and use it to write it on a txt file.
I think is possible but I am not sure how is work actually actiona .I try with array but i do somthing wrong probably.
Thank you very much for the help .
francois
Posts: 456
Joined: 18 Oct 2010, 10:33
Location: France

Re: Random Name Generator from list

Post by francois »

Hello,

An example :

Code: Select all

var t_villes = ["lille", "paris", "lyon","marseille"];
au_hasard = t_villes[Algorithms.randomInteger(0, (t_villes.length-1))]
Console.print(au_hasard)
If you can help my I am new in C++.
with actiona, we code in ECMAScript which looks like Javascript.

Francois
bingojack
Posts: 2
Joined: 01 Apr 2018, 17:10

Re: Random Name Generator from list

Post by bingojack »

Thank you very much this was in help.But I have one more one question.I try to set a variable in key function in Actiona but i think is not save it .I try to make to press random key from a numpad of the keyboard .I write random numbers witch i want to be pressed but not effect.I will be thankful. This is the code in the variable
var y = ["1", "9", "5","8","3"];
var p = y[Algorithms.randomInteger(0,(y.length))]
Console.print(p)
Thank you again.
francois
Posts: 456
Joined: 18 Oct 2010, 10:33
Location: France

Re: Random Name Generator from list

Post by francois »

Hello,

Here I don't use the numpad of the keyboard but "writeText" :

Code: Select all

var souris=new Mouse()
var clavier= new Keyboard();

var list_ = [1, 9, 5,8,3];
rnd_= list_[Algorithms.randomInteger(0, (list_.length-1))] ;

clavier.writeText(rnd_);
souris.click();
Limason
Posts: 1
Joined: 07 Apr 2018, 17:08

Re: Random Name Generator from list

Post by Limason »

Nice but i wondering how can be make to choice value from the array in normal position of the list.
To write it on a file also and too be numerical order from first position to last one.Have a good day.
Post Reply