Thread: Incoming User Function Changes

Page 3 of 3 FirstFirst 123
Results 41 to 45 of 45
  1. Collapse Details
    Re: Incoming User Function Changes 
    #41
    Junior Member
    MainSecondary
    Join Date
    Jan 2017
    Posts
    8
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site
    Thanks so much brolly. You are correct, I was quite confused. I really appreciate it.
     

  2. Collapse Details
    Re: Incoming User Function Changes 
    #42
    RocketLauncher Developer

    MainSecondary
    Join Date
    Apr 2014
    Posts
    4,596
    Edited my previous post, you didn't change the class name so that would never work like that.
     

  3. Collapse Details
    Re: Incoming User Function Changes 
    #43
    Junior Member
    MainSecondary
    Join Date
    Jan 2017
    Posts
    8
    Hey Again,

    I'm still getting an error on game launch from Hyperspin with the below MAME.ahk.

    Here's the code again:
    Code:
    class SystemUserFunction extends UserFunction {
    
    ; Use this function to define any code you want to run in every module on start
    StartUserFeatures() {
    Global RLLog, romName, emupath, ListXMLInfo
    
    RLLog.Info(A_ThisFunc . " - Starting")
    
    ListMameTable := []
    ListMameTable := ListXMLInfo%zz%(romName)
    RotationAngle := ListMameTable[2]
    
    If (romName == "punchout")
    {
    RLLog.Info("RotateFunctions - Override Punchout")
    Run, %emupath%\maestro -p, %emupath%\, hide
    RLLog.Info("RotateFunctions - Rotating Portrait")
    }
    Else If (RotationAngle != "0")
    {
    Run, %emupath%\maestro -p, %emupath%\, hide
    RLLog.Info("RotateFunctions - Rotating Portrait")
    } Else {
    Run, %emupath%\maestro -l, %emupath%\, hide
    RLLog.Info("RotateFunctions - Rotating Landscape")
    }
    RLLog.Info(A_ThisFunc . " - Ending")
    }
    
    ; Use this function to define any code you may need to stop or clean up in every module on exit
    StopUserFeatures() {
    Global RLLog, emupath
    RLLog.Info(A_ThisFunc . " - Starting")
    
    Run, %emupath%\maestro -l, %emupath%\, hide
    RLLog.Info("RotateFunctions - Rotating Landscape")
    }
    RLLog.Info(A_ThisFunc . " - Ending")
    }
    Here's the error:
    MAME_ahk_error.png

    Any idea why I might be getting this? Thanks
    Last edited by reddye5 ; 11-16-2017 at 12:49 AM.
     

  4. Collapse Details
    Re: Incoming User Function Changes 
    #44
    Senior Member agent47's Avatar
    MainSecondary
    Join Date
    Jan 2016
    Posts
    575
    The line the error message mentions is outside of the StopUserFeatures function so it needs to be moved. This should work:

    Code:
    class SystemUserFunction extends UserFunction {
    
    	; Use this function to define any code you want to run in every module on start
    	StartUserFeatures() {
    		Global RLLog, romName, emupath, ListXMLInfo
    
    		RLLog.Info(A_ThisFunc . " - Starting")
    
    		ListMameTable := []
    		ListMameTable := ListXMLInfo%zz%(romName)
    		RotationAngle := ListMameTable[2]
    
    		If (romName == "punchout")
    		{
    			RLLog.Info("RotateFunctions - Override Punchout")
    			Run, %emupath%\maestro -p, %emupath%\, hide
    			RLLog.Info("RotateFunctions - Rotating Portrait")
    		}
    		Else If (RotationAngle != "0")
    		{
    			Run, %emupath%\maestro -p, %emupath%\, hide
    			RLLog.Info("RotateFunctions - Rotating Portrait")
    		} 
    		Else {
    			Run, %emupath%\maestro -l, %emupath%\, hide
    			RLLog.Info("RotateFunctions - Rotating Landscape")
    		}
    		RLLog.Info(A_ThisFunc . " - Ending")
    	}
    
    	; Use this function to define any code you may need to stop or clean up in every module on exit
    	StopUserFeatures() {
    		Global RLLog, emupath
    		RLLog.Info(A_ThisFunc . " - Starting")
    
    		Run, %emupath%\maestro -l, %emupath%\, hide
    		RLLog.Info("RotateFunctions - Rotating Landscape")
    		RLLog.Info(A_ThisFunc . " - Ending")
    	}
    }
     

  5. Collapse Details
    Re: Incoming User Function Changes 
    #45
    Junior Member
    MainSecondary
    Join Date
    Jan 2017
    Posts
    8
    Thank you agent47. I appreciate it.
     

Posting Permissions

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