- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Collapse
You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:
- You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
- You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
- If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
Logging in...
Previously on "events not always processed in correct order"
Collapse
-
Cheers all - am happy it's "good enough" now (the 'clicked' check seemed to do the trick) and is super simple so we'll see how we go...
-
Originally posted by eek View Post
Which was my suggestion in post 2 - record the timestamps and use that to display who won.
Leave a comment:
-
actually I think it's good enough now - back to one page but the 'clicked' variable seems to do the trick to stop it processing the other click - will do some testing. Thanks all!
Leave a comment:
-
Originally posted by NotAllThere View Post
To be exact, the scenario you need to address is that the VAR can't ever see the difference. It's always going to be possible for the "wrong" person to get it - even if you need ultra-high speed video cameras to spot it!
My son adds these comments:
woody1 Thanks for the explanation.
Leave a comment:
-
Originally posted by mudskipper View Post
Yeah this is the scenario I need to address - with the top countdown players most conundrum solves are pretty much instant. Thanks for checking!
My son adds these comments:
A better solution to using the clean would be to use timestamps + IDs, so you know the time when each person buzzed.
Even better: The click function should know nothing of the state of the buzzer. That should be handled by a separate class. The 'clicked' function informs the game of the click and the game handles what to do with it.
Leave a comment:
-
OK, I got it to work locally on my laptop, as follows:
(NB. this was with Opera; other browsers may be different)
1. Created a folder TEMP on the desktop
2. Opened http://topffl.co.uk/fiona/buzzer.html
3. Saved "complete webpage" in TEMP as buzzer (.html)
4. Pressed Player 1
5. Saved "complete webpage" in TEMP as player1 (.html)
6. Pressed Reset
7. Pressed Player 2
8. Saved "complete webpage" in TEMP as player2 (.html)
Now, if I go to TEMP, and double-click buzzer, it runs with the network disconnected.Last edited by woody1; 3 July 2024, 11:47.
Leave a comment:
-
Originally posted by mudskipper View Post
Yeah it redirects - I needed to stop it processing further messages - originally I had it on the same page but would sometimes get the first then second message. But the code is dead simple. I think it is better now that I added the 'clicked' check, but still not perfect.
If you could get it to run on the phone/tablet, with the network disabled, then it might solve the problem.Last edited by woody1; 3 July 2024, 11:00.
Leave a comment:
-
Originally posted by woody1 View Post
If the webpage was hosted on the phone, yes. But not so sure if it's on a remote internet site. Any network latency would certainly explain discrepancies, especially over slower mobile internet.
I opened http://topffl.co.uk/fiona/buzzer.html in my browser, and then switched off my router. When I press the button, I get a "no internet" error. That suggests there's communication taking place with the remote server.
Thanks all - probably gonna be more hassle than it's worth.
NLUK - happy to take 10%
Leave a comment:
-
This is great. You should release it on an app and call it Contractor Cash Generator. I just spent an hour playing this and earned 100's of pounds.
I found it a bit complex at first but great fun when I got the hang of it.
Leave a comment:
-
Originally posted by NotAllThere View Post
Are the players using a single smartphone between them? If that's the case, I can't understand how you'd be able to get a noticeable discrepancy. The code is running on the phone. Maybe you need to upgrade your phone.
I opened http://topffl.co.uk/fiona/buzzer.html in my browser, and then switched off my router. When I press the button, I get a "no internet" error. That suggests there's communication taking place with the remote server.Last edited by woody1; 3 July 2024, 10:20.
Leave a comment:
-
Originally posted by NotAllThere View PostIt's possible for someone to press very shortly before someone else, but not get the buzz.
Leave a comment:
-
I got an answer from my son. The program polls each buzzer in turn to see if its pressed. If it is, it lights up that buzzer and cause it to buzz and tell the others to stop. It's possible for someone to press very shortly before someone else, but not get the buzz.
Relevant source code below.
Code:var clicked = false; function clicked1() { if (!clicked) { // disablebutton; clicked = true; window.location.replace("player1.html"); } } function clicked2() { if (!clicked) { // disablebutton1 clicked = true; window.location.replace("player2.html"); } }
Leave a comment:
-
yeah I suspect timestamps are the way to go if you can't be sure one button press will be processed before the other but sounds like more effort than I wanted to expend
Leave a comment:
-
Are you running it on this website topffl? Via 4/5G? If so, latency (round-trip time) won't be helping.
Try pinging topffl.co.uk to see how many milliseconds it takes.
It might be better if you could run the webpage on the device (phone/tablet) itself. (But don't ask me how you do that)
Thinking outside the box, I was also wondering if you could do something with a native application running on the device. Does Excel have buttons?
Leave a comment:
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Labour’s plan to regulate umbrella companies: a closer look Nov 21 09:24
- When HMRC misses an FTT deadline but still wins another CJRS case Nov 20 09:20
- How 15% employer NICs will sting the umbrella company market Nov 19 09:16
- Contracting Awards 2024 hails 19 firms as best of the best Nov 18 09:13
- How to answer at interview, ‘What’s your greatest weakness?’ Nov 14 09:59
- Business Asset Disposal Relief changes in April 2025: Q&A Nov 13 09:37
- How debt transfer rules will hit umbrella companies in 2026 Nov 12 09:28
- IT contractor demand floundering despite Autumn Budget 2024 Nov 11 09:30
- An IR35 bill of £19m for National Resources Wales may be just the tip of its iceberg Nov 7 09:20
- Micro-entity accounts: Overview, and how to file with HMRC Nov 6 09:27
Leave a comment: