Discuss how to create custom stats, reports and HUD profiles and share your creations.
Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators
by Olaf72 » Tue Apr 02, 2013 6:43 am
I'd like to have a random Number in the HUD.
It should change every HUD-update.
It doesn't have to be that perfectly random. The milliseconds or seconds of an actual timestamp would do.
-
Olaf72
-
- Posts: 50
- Joined: Fri Jan 30, 2009 10:29 am
by kraada » Tue Apr 02, 2013 8:04 am
This can be done. What kind of precision did you want - from 1 to 10, 1 to 100, 1 to 1000?
-
kraada
- Moderator
-
- Posts: 54431
- Joined: Wed Mar 05, 2008 2:32 am
- Location: NY
by Olaf72 » Tue Apr 02, 2013 8:41 am
Great - thanks.
1 to 100 would be fine
-
Olaf72
-
- Posts: 50
- Joined: Fri Jan 30, 2009 10:29 am
by kraada » Tue Apr 02, 2013 10:45 am
Create a new column as follows:
live_random_number: (SELECT extract(milliseconds from now())::int % 100) * (live_cash_table.amt_bb / live_cash_table.amt_bb)
This will give you the last two digits of the current time to the millisecond. Create a stat using it and you should see it working in your HUD directly.
-
kraada
- Moderator
-
- Posts: 54431
- Joined: Wed Mar 05, 2008 2:32 am
- Location: NY
by Olaf72 » Tue Apr 02, 2013 3:30 pm
Didn't work.
But this one does.
(SELECT extract(milliseconds from now())::int % 100) * max(cash_hand_summary.id_hand / cash_hand_summary.id_hand)
thanks.
-
Olaf72
-
- Posts: 50
- Joined: Fri Jan 30, 2009 10:29 am
by kraada » Tue Apr 02, 2013 4:23 pm
That one works but you must name the column starting with "live_". It should work better for you as time goes on as the live stats are just based on the very last hand data and will be queried separately.
-
kraada
- Moderator
-
- Posts: 54431
- Joined: Wed Mar 05, 2008 2:32 am
- Location: NY
by Olaf72 » Wed Apr 03, 2013 10:43 am
Aha... That live_..... columns don't work with Pokerstars-Zoom-Tables? right?
-
Olaf72
-
- Posts: 50
- Joined: Fri Jan 30, 2009 10:29 am
by kraada » Wed Apr 03, 2013 12:07 pm
I think it still should but I haven't tested it.
-
kraada
- Moderator
-
- Posts: 54431
- Joined: Wed Mar 05, 2008 2:32 am
- Location: NY
by QqNwG207phyYezgo » Fri Mar 20, 2015 1:16 pm
Hi,
I want to add 3 a 6 random numbers in my HUD.
I have used the following for first one and it works.
live_random_number: (SELECT extract(milliseconds from now())::int % 100) * (live_cash_table.amt_bb / live_cash_table.amt_bb)
The moment I copy the above in a second column (in an attempt to create another random number) it just generates the same output as the first column.
Something like
SELECT RAND() AS [live_random_number02]
and some variations upon it also does not works.
Do you know a method to create multiple random numbers?
Thanks in advance
-
QqNwG207phyYezgo
-
- Posts: 1
- Joined: Sun Nov 04, 2012 9:10 am
by kraada » Fri Mar 20, 2015 2:28 pm
You'll get the same number for your second column because the query for live tables are all run at the same instant - so you'll only get one millisecond answer.
The actual postgres function is called random() so what's probably easiest is to create a custom non cached column that just reads:
select random()
and then a stat whose value expression is that number. random() gives you a random number between 0 and 1 -- see
here for more details.
-
kraada
- Moderator
-
- Posts: 54431
- Joined: Wed Mar 05, 2008 2:32 am
- Location: NY
Return to Custom Stats, Reports and HUD Profiles
Users browsing this forum: No registered users and 21 guests