Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
isn't that a bit predictable? like if you time the press right you would get the same result over again? I am looking for maybe 3 or 4 random true or false results at the press of a button, but totally random every time.
so press d0
s d1 result 1
s d2 result 2
and so on.
rand
https://stationeers-wiki.com/MIPS
may be a loop with a few to r0 to r3 then add em?
Multiplication and addition can move the random value to a desired interval
The Klaxon Speaker has 3 songs on mode 7,8 and 9. The script below plays one at random when a button is pushed. Buttons are quirky and will sometimes be "1" during two ticks, the script solves that problem by using an extra yield instruction.
alias klaxon d0
alias button d1
main:
yield
l r0 button Activate
beqz r0 main
#swap the klaxans on state with a not-gate
l r0 klaxon On
seqz r0 r0
s klaxon On r0
#pick a random song
rand r0
mul r0 r0 3
#trunc r0 r0 #optional, removes decimals
add r0 r0 7
s klaxon Mode r0 #play sound 7, 8 or 9
yield #counters the buttons double activation bug
j main
I missed that, think I should read the list through again! Thanks.
That's awesome! Thank you. I might just use that in my habitat section... when I build it, lol.
Start:
yield
rand r0
mul r1 r0 Digit_Numer
trunc r1 r1
j Start
If you don't specify enough numbers of digits, the same number will likely occur.
Expanding on these, you could use pippin2006's original multiplier (I'll say 10000, since Lion said maybe 4 true/false results and this will give 4 numbers) idea, makes sure the random number doesn't make it 5 digits (I saw somewhere said "inclusive" but it may be wrong, check and possibly subtract 1 if needed, just to make sure), but then take each digit using a modulus (10,100,1000,10000), then divide by 10/100/1000/10000, round to get either 0 or 1 each, then yield again at the end for Ketrix's button bug fix. Also, you don't have to truncate the number, but you may if you want to.