Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Random


  • Please log in to reply
6 replies to this topic
Denethor
  • Guests
  • Last active:
  • Joined: --
Hello,


are new in using AutoHotKey ... I wanted to know if you could create a scriipt like this:


Variable 1 = Mark
Variable 2 = Andrea
Variable 3 = Luigi
Variable 4 = Francis

And Make a script that you type in a text box one of those random variables every 15 minutes! E se scrive per cinque volte lo stesso nome lo escluda dalla lista dei random ma senza cancellarlo..

Thanks

[Deleted double post. ~jaco0646]

Denethor
  • Guests
  • Last active:
  • Joined: --
Hello,


are new in using AutoHotKey ... I wanted to know if you could create a scriipt like this:


Variable 1 = Mark
Variable 2 = Andrea
Variable 3 = Luigi
Variable 4 = Francis

And Make a script that you type in a text box one of those random variables every 15 minutes! And if he writes five times the same name it excludes from the list of random but without deleting ..

Thanks

evan
  • Guests
  • Last active:
  • Joined: --
example:
Variable1 = Mark
Variable2 = Andrea
Variable3 = Luigi
Variable4 = Francis
count = 0
loop 4
{
item := Variable%A_index%
list = %item% %list%
}
loop
{
StringSplit, listArray, list, %A_space%
random, rand, 1, %listArray0%
new := listArray%rand%
if new = %old%
{
count++
if count = 5
{
StringReplace, list, list, %new%%A_space%,, All
excludelist = %new% %excludelist%
}
}
else
count = 0
msgbox, % listArray%rand%
old := listArray%rand%
}


Denethor
  • Guests
  • Last active:
  • Joined: --
Thank you .... and to only run the script every 15 minutes + a random time ranging from 1 to 10 minutes what should I add? Thank you very much!

BoBo³
  • Guests
  • Last active:
  • Joined: --

and to only run the script every 15 minutes + a random time ranging from 1 to 10 minutes

You'd use the script which I've posted already (at the other thread) :roll:

Denethor
  • Guests
  • Last active:
  • Joined: --
I used it the other script suggested in the thread and it works perfectly, but there is a problem:

I serve a function that after 5 times that between the random writes the same name from the list excludes


Or if you see better simulating the random exits

Marco
Andrea
John
Marco
Daniele
Marco
John
Marco
Marco
(By this time the script should be excluded from future releases Marco)

Thanks to all

evan
  • Guests
  • Last active:
  • Joined: --
this one is easier
Variable1 = Mark
Variable2 = Andrea
Variable3 = Luigi
Variable4 = Francis
count = 0
loop 4
{
item := Variable%A_index%
list = %item% %list%
}
loop
{
StringSplit, listArray, list, %A_space%
random, rand, 1, %listArray0%
this := listArray%rand%
count%this%++
if count%this% < 5
msgbox, %this%
else
safe++

if safe > 10000
break
}
msgbox, no more items