Results 1 to 3 of 3

Thread: Need help for my first RR plugin

  1. #1
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,769

    Smile Need help for my first RR plugin

    Hello,

    I try to play with the RR plugin and my first idea is a GmailNotifier plugin.

    Actually i play with the indicator and the ini files (don't laugh, i am a beginner in VB6).
    my ini file is:
    gmailnotifier.ini
    Code:
    [Gmail]
    PopServer=pop.gmail.com
    UserName=username
    PassWord=password
    [OnlineCMD]
    OnlineCMD1=OnlineCMD1
    OnlineCMD2=OnlineCMD2
    OnlineCMD3=OnlineCMD3
    [OfflineCMD]
    OfflineCMD1=OfflineCMD1
    OfflineCMD2=OfflineCMD2
    OfflineCMD3=OfflineCMD3
    my exectbl.ini file is:
    Code:
    /3 commands if RR is Online
    "ONLINECMD1","MENU;MessageBox.skin||SETVAR;INFOTITLE;NewMessage !!!||SETVAR;MESSAGE;YOU ARE ONLINE !!!"
    "ONLINECMD2",
    "ONLINECMD3",
    /3 commands if RR is Offline
    "OFFLINECMD1","MENU;MessageBox.skin||SETVAR;INFOTITLE;New Message !!!||SETVAR;MESSAGE;YOU ARE OFFLINE !!!"
    "OFFLINECMD2",
    "OFFLINECMD3",
    and my indicator part is:
    Code:
    Public Function ReturnIndicatorEx(IND As String) As String
    
        'Default (No Action)
        'ONLY return something else IF AND ONLY IF you process that code
        ReturnIndicatorEx = ""
    
        Select Case LCase(IND)
            Case "gmailnotifier"
                If RRSDK.GetInd("ONLINE") = "True" Then
                ReturnIndicatorEx = "True"
                    RRSDK.Execute (ReadINI("OnlineCMD", "OnlineCMD1"))
                    RRSDK.Execute (ReadINI("OnlineCMD", "OnlineCMD2"))
                    RRSDK.Execute (ReadINI("OnlineCMD", "OnlineCMD3"))
                Else
                    RRSDK.Execute (ReadINI("OfflineCMD", "OfflineCMD1"))
                    RRSDK.Execute (ReadINI("OfflineCMD", "OfflineCMD2"))
                    RRSDK.Execute (ReadINI("OfflineCMD", "OfflineCMD3"))
                End If
                
        End Select
    
    End Function
    Thus, i can to define 3 commands in the ini file when RR see a connection
    and 3 commands when RR is offline.

    That i want is that each command run one time !
    But actually, each command run and re again .
    I think that is normal because the indicator state is always tested by RR .

    If some body has an idea ?

    Thanks

  2. #2
    Maximum Bitrate
    Auto Apps:loading...
    lambosprit's Avatar
    Join Date
    Sep 2006
    Location
    UK
    Posts
    809
    I think its because indicators are called every second by RR to keep them up to date. Whats happening is RR calls gmailnotifier and your program detects this and runs your code. But then a second later RR again calls gmailnotifier so your code runs again.

    To get it to run once I would put a flag variable thats state is changed depending on if offline or not. So something like

    Code:
    If RRSDK.GetInd("ONLINE") = "True" and flag<>True Then
    flag=true
    ReturnIndicatorEx = "True"
                    RRSDK.Execute (ReadINI("OnlineCMD", "OnlineCMD1"))
                    RRSDK.Execute (ReadINI("OnlineCMD", "OnlineCMD2"))
                    RRSDK.Execute (ReadINI("OnlineCMD", "OnlineCMD3"))
    elseif RRSDK.GetInd("ONLINE") = "False" and flag=True then
         flag = false
         RRSDK.Execute (ReadINI("OfflineCMD", "OfflineCMD1"))
                    RRSDK.Execute (ReadINI("OfflineCMD", "OfflineCMD2"))
                    RRSDK.Execute (ReadINI("OfflineCMD", "OfflineCMD3"))
    End If
    a better way would be just to use the events online and offline as they are fired only when it changes.
    Gives you the idea anyway

  3. #3
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,769

    Smile

    Quote Originally Posted by lambosprit View Post
    I think its because indicators are called every second by RR to keep them up to date. Whats happening is RR calls gmailnotifier and your program detects this and runs your code. But then a second later RR again calls gmailnotifier so your code runs again.

    To get it to run once I would put a flag variable thats state is changed depending on if offline or not. So something like

    Code:
    If RRSDK.GetInd("ONLINE") = "True" and flag<>True Then
    flag=true
    ReturnIndicatorEx = "True"
                    RRSDK.Execute (ReadINI("OnlineCMD", "OnlineCMD1"))
                    RRSDK.Execute (ReadINI("OnlineCMD", "OnlineCMD2"))
                    RRSDK.Execute (ReadINI("OnlineCMD", "OnlineCMD3"))
    elseif RRSDK.GetInd("ONLINE") = "False" and flag=True then
         flag = false
         RRSDK.Execute (ReadINI("OfflineCMD", "OfflineCMD1"))
                    RRSDK.Execute (ReadINI("OfflineCMD", "OfflineCMD2"))
                    RRSDK.Execute (ReadINI("OfflineCMD", "OfflineCMD3"))
    End If
    a better way would be just to use the events online and offline as they are fired only when it changes.
    Gives you the idea anyway
    I did not know that ONLINE and OFFLINE exist , and it is why i should want try to create to events.
    I learn VB6 and RR plugin . Any idea can help me !

Similar Threads

  1. How to make Winamp TV Plugin work with RR
    By ramez75 in forum Road Runner
    Replies: 28
    Last Post: 09-03-2010, 12:17 AM
  2. Try to create a VB6 RR plugin
    By pierrotm777 in forum RR Plugins
    Replies: 0
    Last Post: 03-12-2010, 12:45 PM
  3. music defaults to first song on open
    By soundman98 in forum Road Runner
    Replies: 18
    Last Post: 11-23-2009, 02:36 AM
  4. List of available plugins and features
    By JohnWPB in forum RR Plugins
    Replies: 5
    Last Post: 10-25-2008, 06:16 PM
  5. IRMAN plugin
    By knyarko in forum StreetDeck
    Replies: 3
    Last Post: 01-05-2007, 08:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •