Difference between revisions of "Mono:Lua:mono invoke method"

From Cheat Engine
Jump to navigation Jump to search
(Examples)
(Function Parameters)
Line 5: Line 5:
  
  
== '''Function Parameters''' ==
+
===Function Parameters===
 
+
{|width="85%" cellpadding="10%" cellpadding="5%" cellspacing="0" border="0"
'''Parameter Type Description'''
+
!align="left"|Parameter
 
+
!align="left"|Type
domain string the domain's name
+
!style="width: 80%;background-color:white;" align="left"|Description
 
+
|-
method string The methods name
+
|domain
 
+
|string
instanseAddress integer The address of instanse (?)
+
|The namespace of the method
 
+
|-
args table the arguments
+
|methodId
 
+
|integer
 
+
|The method's id
 +
|-
 +
|instanseAddress
 +
|integer
 +
|The address of instanse
 +
|-
 +
|args
 +
|table
 +
|The arguments
 +
|}
  
 
----
 
----

Revision as of 12:52, 17 December 2018

function mono_invoke_method(domain, method, instanseAddress, args): mono_readObject()??




Function Parameters

Parameter Type Description
domain string The namespace of the method
methodId integer The method's id
instanseAddress integer The address of instanse
args table The arguments

Examples

  local methodId = mono_findMethod('', 'PlayerStatsManager', 'TakeDamage')
  local c = mono_method_getClass(methodId)
  mono_class_findInstancesOfClass(nil,c,function(m)          -- asynchronously
    local fl = createFoundList(m) 
    fl.initialize()
    if fl.Count >0 then
      InstancesAddress=fl[0]
      mono_invoke_method('' , methodId , InstancesAddress , {{100}} )
    else
      print('Faild to find Instances')
    end
    fl.destroy()
    m.destroy()
    end
    )