Code/Example Add time to a timer running

Coding and examples for future Pinball and BAM

AnonTet

Pinball Master
Site Supporters
Joined
Jun 21, 2020
Messages
2,036
Solutions
1
Reaction score
1,198
Points
125
Favorite Pinball Machine
Indiana Jones
So, I'm trying to add a feature to another table I'm doing and while in ball bonus (special case) that lasts for 30s. The problem is that the award in this mode is more... ball bonus (or 30s more) so I need to add time on top of a running timer.

I came up with a solution and it is working but to be honest I wonder if FP has an undocumented feature for this., some vbscript trick I can use instead and simply add more time :)

This is just example code for a solution I came up with not actual table code. Quite convoluted for what I think should a simple task... any ideias or should I simply go with this and call it a day?

Code:
Sub trigger1_hit()
    if timer1.enabled = true then
        timer1.userdata = timer1.userdata + 1
        adddebugtext "userdata: " &timer1.userdata
     Else
        bulb1.state = bulbon
        timer1.set True, 5000
    End if
End Sub

Sub Timer1_expired()
    if timer1.Userdata > 0 then
        timer1.set True, 5000
        timer1.userdata = timer1.userdata - 1
        adddebugtext "userdata_expire: " &timer1.userdata
     Else
         timer1.enabled = false
         bulb1.state = bulboff
    end if
End Sub
 
Hi AnonTet,

I am no coder... but, what you have provided seems very simple (and not at all convoluted in my opinion). I suppose we shall have to wait to see what other approaches are identified by those who do code ?
 
Guess I didn't want to believe that is not possible to add time to a timer with a simple math operation! Something like
Code:
timer1.interval = timer1.interval + extra_time

Maybe I was missing something in the syntax (happens to me quite often).

Anyway, I think i'm going to use that and call it day. Thank you Gin
 
Hi AnonTet,

I have created an 'Example Timer' table using similar code to what you have quoted above (Line 22 [ ExampleModeTimer1.Interval = ExampleModeTimer1.Interval + 1000 ]), and it works; for me at least. I am attaching my 'very basic' attempt for you to see if it works for you (Run in Debug Mode (F9)); as commented earlier...
I am no coder
but I do like to try and learn.
 

Attachments

So timer.interval = timer.inter (insert math operation here) value does work. I wonder what the hell happened when I tried!

Well, you showed me it works so it was my fault. I'm glad I asked :)

PS: for someone not a coder I think you underestimate yourself a lot. I still have the code you did really quick for this same table I'm coming back to, finally.
 
General chit-chat
Help Users
You can interact with the ChatGPT Bot in any Chat Room and there is a dedicated room. The command is /ai followed by a space and then your ? or inquiry.
ie: /ai What is a EM Pinball Machine?
  • No one is chatting at the moment.
  • Chat Bot Mibs Chat Bot Mibs:
    knaxit has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    dw1 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    allamain has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    johnny4545 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    mranderson has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    PinballFan1984 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Darkchylde has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Jeff X has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    SireB has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    francisghost has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    grumpycat has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    KingKongs has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Marthani has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    sandrosws has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    GUNSMOKE has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    lshjs has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Printz has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    id11179 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Thalamus has left the room.
  • AI Bot @ AI Bot:
    @, To remove or disable Two-Factor Authentication (2FA) from an account, you'll typically need to go through the platform where you've enabled 2FA. Here's a general guide:

    ### Steps to Remove Two-Factor Authentication (2FA):

    1. **Log in to your account** on the service (e.g., Google, Facebook, Apple, etc.).
    2. **Go to the Security or Account Settings** section.
    3. Find the **Two-Factor Authentication (2FA)** or **Two-Step Verification** option.
    4. Select **Disable**, **Turn Off**, or remove the 2FA method(s).
    5. You may be required to **enter a verification code** or **confirm your password**.

    ---

    ### If You Don't Have Access to Your 2FA Method:
    If you lost access to your 2FA device (like a phone or authenticator app):

    - Look for an option like **"Can't access your 2FA?”**, **“Need help?”**, or **"Account recovery"** on the login screen.
    - Contact the platform’s **customer support** for help.
    - You may need to verify your identity by answering security questions or providing ID.

    ---

    If you tell me which service or platform you want to remove 2FA from (e.g., Google, Facebook, Instagram, etc.), I can give you more specific instructions.
    Quote
  • Chat Bot Mibs Chat Bot Mibs:
    Guest pinball nirvana has joined the room.
  • P (Guest) pinball nirvana:
    how can I remove my 2factor
    Quote
  • P (Guest) pinball nirvana:
    remove my 2FA
    Quote
  • P (Guest) pinball nirvana:
    hi
    Quote
  • P (Guest) pinball nirvana:
    how to remove my 2factor from pinball nirvana
    Quote
      P (Guest) pinball nirvana: how to remove my 2factor from pinball nirvana
      Back
      Top