Issue with scripts not recognizing I am the GM

edited November 2009 in ScreenMonkey General
OK, so for a couple of the scripts I have tried that check to see if you are the GM, I get the error message "Only The GM can run this command" I have seen this for the /Initall command and for the script that shows the individual dice rolls so far. I am the GM and it even Says "The GM says" in the chat line when I chat

Anyone seen this? Any ideas?

Thanks

Zandel

Comments

  • I use the init script and I have no problems. What other scripts are you having problems with?

    Try pressing F9 to refresh your scripts... then try the /init stuff again... Make sure you set up the inits as well by using:

    /initdice

    Then login as a player and try using the:
    /initmod command

    then as the GM use:
    /initall

    hope this helps.
  • Also, I am assuming your HOSTING SM on your system, not loggin into some elses SM as the GM.
  • Yes it is running locally on my computer, I get with any script that requires you be the GM to run for example I was trying to use the roll replacement to show the results of each dice and I get "TheGM attempted to edit a /roll property: Only the GM can edit /roll properties", if i try /clearinits, I get "TheGM says: [Sorry, only the GM can clear the initiatives!]"

    It some how is failing when it tests to see if I am the GM
  • ok, this may not have anything to do with it but....

    When you logged into your Computer (not ScreenMonkey), are you the Admin? Not sure if that has anything to do with it, but it cant hurt. If not, try doing that and then testing your scripts.
  • Yes I am logged on as administrator
  • Show code please. Hard to decipher what is wrong if we can't see it. Thanks! :-)

    *editing my own post*

    Here is one way to test if you are the GM:

    curSession = GetCurrentSession()
    gm = curSession.GM

    If "gm" is null - then you are not the GM. Here is another:

    curPlayer = GetCurrentPlayer()
    if( curPlayer.IsGM )then

    Both ways will let you know if you are the GM. How are you doing it?
  • Well, not really a programmer, I am using the scripts I downloaded, the ClearInit section of the Initivetools script has this in it

    Sub ClearInits
    cs = GetChatSession()
    ci = cs.GetLastItem()
    os = GetCurrentSession()

    op = GetCurrentPlayer()
    If op.IsGM Then
    os.Sync
    n = os.GetSyncCharCount()
    For i = 1 to n
    c = os.GetSyncChar( i)
    sInit = c.GetField( "initroll")
    If Len( Trim( sInit)) > 0 Then
    c.SetField "initroll", ""
    End If
    Next

    ci.Action = "reports"
    ci.Text = "initiatives cleared"
    Else
    ci.PlayerTo = ci.PlayerFrom
    ci.Text = "<i>[Sorry, only the GM can clear the initiatives!]</i>"
    End If

    End Sub


    I can see its checking in the script and I am obviously taking the Else branch because thats whats getting returned, the thing I can't figure out is why, I am running the DM client not logging in as a player. The other perplexing part is it returns "TheGM says: [Sorry, only the GM can clear the initiatives!]" so TheGM says leads to believe that the player would be TheGM
  • well I see this in the HTTP monitor it looks like it says player = The+GM, I am not sure why it takes the else branch, anyone have any clues?

    Files\nbos\ScreenMonkey\Campaigns\Default\screenmonkey.cgi action=62&player=The+GM&password=xxxxxxxx&chattext=/clearinits&ts=12590879595

Leave a Comment