main.lua 121 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605
  1. --This lua script gets loaded when Cheat Engine loads
  2. --You can use this to define some often used functions and libraries you'd like to use
  3. require("defines")
  4. --[[
  5. List of CE specific functions and variables:
  6. TrainerOrigin : A variable that contains the path of the trainer that launched cheat engine (Only set when launched as a trainer)
  7. process : A variable that contains the main modulename of the currently opened process
  8. getCEVersion(): Returns a floating point value specifying the version of cheat engine
  9. activateProtection(): Prevents basic memory scanners from opening the cheat engine process
  10. fullAccess(address,size): Changes the protection of a block of memory to writable and executable
  11. loadTable(filename, merge OPTIONAL): Loads a .ct or .cetrainer. If merge is provided and set to true it will not clear the old table
  12. loadTable(stream ,merge OPTIONAL, ignoreluascriptdialog BOOLEAN): Loads a table from a stream object
  13. saveTable(filename, protect OPTIONAL): Saves the current table. If protect is provided and set to true and the filename has the .CETRAINER extension, it will protect it from reading normally
  14. note: addresses can be strings, they will get interpreted by ce's symbolhandler
  15. readBytes(address,bytecount, ReturnAsTable ) : returns the bytes at the given address. If ReturnAsTable is true it will return a table instead of multiple bytes
  16. Reads the bytes at the given address and returns a table containing the read out bytes
  17. writeBytes(address, x,x,x,x,...) : Write the given bytes to the given address from a table
  18. writeBytes(address, table) : Write the given bytes to the given address from a table
  19. readInteger(address) : Reads an integer from the specified address
  20. readQword(address): Reads a 64-bit integer from the specified address
  21. readPointer(address): In a 64-bit target this equals readQword, in a 32-bit target readInteger()
  22. readFloat(address) : Reads a single precision floating point value from the specified address
  23. readDouble(address) : Reads a double precision floating point value from the specified address
  24. readString(address, maxlength, widechar OPTIONAL) : Reads a string till it encounters a 0-terminator. Maxlength is just so you won't freeze for too long, set to 6000 if you don't care too much. Set WideChar to true if it is encoded using a widechar formatting
  25. writeInteger(address,value) : Writes an integer to the specified address. Returns true on success
  26. writeQword(address, value): Write a 64-bit integer to the specified address
  27. writeFloat(address,value) : Writes a single precision floating point to the specified address. Returns true on success
  28. writeDouble(address,value) : Writes a double precision floating point to the specified address. Returns true on success
  29. writeString(address,text, widechar OPTIONAL) : Write a string to the specified address. Returns true on success
  30. readBytesLocal(address,bytecount, ReturnAsTable) : See readBytes but then it's for Cheat engine's memory
  31. readIntegerLocal(address) : Reads an integer from the specified address in CE's memory
  32. readQwordLocal(address) : Reads a 64-bit integer from the specified address in CE's memory
  33. readPointerLocal(address) : ReadQwordLocal/ReadIntegerLocal depending on the cheat engine build
  34. readFloatLocal(address) : Reads a single precision floating point value from the specified address in CE's memory
  35. readDoubleLocal(address) : Reads a double precision floating point value from the specified address in CE's memory
  36. readStringLocal(address, maxlength, widechar OPTIONAL)
  37. writeIntegerLocal(address,value) : Writes an integer to the specified address in CE's memory. Returns true on success
  38. writeQwordLocal(address,value) : Writes a 64-bit integer to the specified address in CE's memory. Returns true on success
  39. writeFloatLocal(address,value) : Writes a single precision floating point to the specified address in CE's memory. Returns true on success
  40. writeDoubleLocal(address,value) : Writes a double precision floating point to the specified address in CE's memory. Returns true on success
  41. writeStringLocal(address,string, widechar OPTIONAL)
  42. writeBytesLocal(address, x,x,x,x,...) : See writeBytes but then it's for Cheat Engine's memory
  43. writeBytesLocal(address, table, , count) : See writeBytes but then it's for Cheat Engine's memory
  44. wordToByteTable(number): {} - Converts a word to a bytetable
  45. dwordToByteTable(number): {} - Converts a dword to a bytetable
  46. qwordToByteTable(number): {} - Converts a qword to a bytetable
  47. floatToByteTable(number): {} - Converts a float to a bytetable
  48. doubleToByteTable(number): {} - Converts a double to a bytetable
  49. stringToByteTable(string): {} - Converts a string to a bytetable
  50. wideStringToByteTable(string): {} - Converts a string to a widestring and converts that to a bytetable
  51. byteTableToWord(table): number - Converts a bytetable to a word
  52. byteTableToDword(table): number - Converts a bytetable to a dword
  53. byteTableToQword(table): number - Converts a bytetable to a qword
  54. byteTableToFloat(table): number - Converts a bytetable to a float
  55. byteTableToDouble(table): number - Converts a bytetable to a double
  56. byteTableToString(table): string - Converts a bytetable to a string
  57. byteTableToWideString(table): string - Converts a bytetable to a widestring and convets that to a string
  58. bOr(int1, int2) : Binary Or
  59. bXor(int1, int2) : Binary Xor
  60. bAnd(int1, int2) : Binary And
  61. bShl(int, int2) : Binary shift left
  62. bShr(int, int2) : Binary shift right
  63. bNot(int) : Binary not
  64. writeRegionToFile(filename, sourceaddress,size) : Writes the given region to a file. Returns the number of bytes written
  65. readRegionFromFile(filename, destinationaddress)
  66. resetLuaState(): This will create a new lua state that will be used. (Does not destroy the old one, so memory leak)
  67. createRef(...): integer - Returns an integer reference that you can use with getRef. Useful for objects that can only store integers and need to reference lua objects. (Component.Tag...)
  68. getRef(integer): ... - Returns whatever the reference points out
  69. destroyRef(integer) - Removes the reference
  70. encodeFunction(function): string - Converts a given function into an encoded string that you can pass on to decodeFunction
  71. decodeFunction(string): function - Converts an encoded string back into a function. Note that the string must be made on the same architecture as it is currently running. 32-bit can onyl load 32-bit, 64-bit can only load 64-bit. So either have two scripts ready, or limit to only one architecture. (Like .EXE trainers)
  72. reloadSettingsFromRegistry(): This will cause cheat engine to reload the settings from the registry and apply them
  73. getTranslationFolder(): Returns the path of the current translation files. Empty if there is no translation going on
  74. loadPOFile(path): Loads a .PO file used for translation
  75. translate(string): Returns a translation of the string. Returns the same string if it can't be found
  76. translateID(translationid: string, originalstring: string OPTIONAL): Returns a translation of the string id
  77. ansiToUtf8(string): Converts a string in Ansi encoding to UTF8
  78. utf8ToAnsi(string): Converts a string in UTF8 encoding to Ansi
  79. Note: GUI components mainly show in UTF8, some other functions use Ansi, try to find out which ones...
  80. enumModules(processid OPTIONAL):
  81. Returns a table containing information about each module in the current process, or the specified processid
  82. Each entry is a table with fields
  83. Name : String containing the modulename Address: Integer representing the address the module is loaded
  84. Is64Bit: Boolean set to true if it's a 64-bit module
  85. PathToFile: String to the location this module is loaded
  86. md5memory(address, size): Returns a md5 sum calculated from the provided memory.
  87. md5file(pathtofile): Returns a md5 sum calculated from the file.
  88. getFileVersion(pathtofile): returns the 64-bit file version, and a table that has split up the file version into major, minor, release and build
  89. getFileList(Path:string, searchMask:string OPTIONAL, SearchSubDirs: boolean, DirAttrib: integer): Returns an indexed table with filenames
  90. getDirectoryList(Path:string, SearchSubDirs: boolean): Returns an indexed table with directory names
  91. getAddress(string, local OPTIONAL): returns the address of a symbol. Can be a modulename or an export. set Local to true if you wish to querry the symboltable of the ce process
  92. getSymbolInfo(symbolname): Returns a table as defined by the SymbolList class object (modulename, searchkey, address, size)
  93. getModuleSize(modulename): Returns the size of a given module (Use getAddress to get the base address)
  94. reinitializeSymbolhandler(waittilldone: BOOLEAN OPTIONAL, default=TRUE): reinitializes the symbolhandler. E.g when new modules have been loaded
  95. reinitializeDotNetSymbolhandler(modulename OPTIONAL): Reinitializes only the DotNet part of the symbol list. (E.g After an ILCode has been JITed) (6.4+)
  96. errorOnLookupFailure(state): If set to true (default) address lookups in stringform will raise an error if it can not be looked up. This includes symbolnames that are not defined and pointers that are bad. If set to false it will return 0 in those cases
  97. (Useful for pointers that don't work 100% of the time)
  98. 6.4+:Returns the original state
  99. generateAPIHookScript(address, addresstojumpto, addresstogetnewcalladdress OPT) : Generates an auto assembler script which will hook the given address when executed
  100. autoAssemble(text, targetself OPTIONAL) : runs the auto assembler with the given text. Returns true on success (if targetself is set it will assemble into Cheat Engine itself)
  101. registerExeTrainerFeature(FeatureName:String, function():table): adds a new feature to the exe trainer generator window, and calls your function when the user builds an .exe trainer. The function should return a table with table entries: PathToFile and RelativePath.
  102. example output:
  103. [1]:
  104. PathToFile=c:\cefolder\autorun\mycode.lua
  105. RelativePath="autorun\"
  106. [2]:
  107. PathToFile=c:\cefolder\autorun\dlls\mycode.lua
  108. RelativePath="autorun\mylib.dll"
  109. registerAutoAssemblerCommand(command, function(parameters, syntaxcheckonly)): Registers an auto assembler command to call the specified function. The command will be replaced by the string this function returns when executed. The function can be called twice. Once for syntax check and symbol lookup(1), and the second time for actual execution by the assembler(2) if it has not been removed in phase1.
  110. Note: The callback function can return multiple values
  111. Nil, <String>: Will raise an error with the given string
  112. MultilineString: Replaces the line in the script with the given strings.
  113. If the function returns nil, and as secondary parameter a string, this will make the auto assembler fail with that error
  114. unregisterAutoAssemblerCommand(command)
  115. registerSymbolLookupCallback(function(string):integer, location): ID 6.4+
  116. Registers a function to be called when a a symbol is parsed
  117. Location determines at what part of the symbol lookup the function is called
  118. slStart: The very start of a symbol lookup. Before tokenization
  119. slNotInt: Called when it has been determined it's not a hexadecimal only string. Before tokenization
  120. --The following locations can be called multiple times for one string as they are called for each token and appended token
  121. slNotModule: Called when it has been determined the current token is not a modulename
  122. slNotUserdefinedSymbol: Called when it has been determined it's not a userdefined symbol
  123. slNotSymbol: Called when it has been determined it's not a symbol in the symbollist
  124. slFailure: Called when it has no clue what the given string is
  125. Note: slNotSymbol and slFailure are similar, but failure comes only if there's no token after the current token that can be concatenated. Else slNotSymbol will loop several times till all tokens make up the full string
  126. Return an Integer with the corresponding address if you found it. Nil or 0 if you didn't.
  127. unregisterSymbolLookupCallback(ID): Removes the callback
  128. registerAddressLookupCallback(function(integer):string): ID
  129. Registers a function to be called when the name of an address is requested
  130. unregisterAddressLookupCallback(ID): Removes the callback
  131. registerStructureDissectOverride(function(structure, baseaddress): table):
  132. same as onAutoGuess, but is called by the structure dissect window when the user chooses to let cheat engine guess the structure for him.
  133. Use the structure object to fill it in
  134. Return true if you have filled it in, or false or nil if you did not
  135. Tip: Use inputQuery to ask the user the size if your function doesn't do that automatically
  136. unregisterStructureDissectOverride(ID)
  137. registerStructureNameLookup(function(address): name, address OPTIONAL):
  138. Registers a function to be called when dissect data asks the user for the name of a new structure define. If you have code that can look up the name of a structure, and perhaps also the real starting point, you can use this to improve the data dissection.
  139. unregisterStructureNameLookup(ID)
  140. registerAssembler(function(address, instruction):bytetable)
  141. Registers a function to be called when the single line assembler is invoked to convert an instruction to a list of bytes
  142. Return a bytetable with the specific bytes, or nil if you wish to let another function, or the original x86 assembler to assemble it
  143. unregisterAssembler(ID): Unregisters the registered assembler
  144. registerAutoAssemblerPrologue(function(script, syntaxcheck), postAOB:boolean=false)
  145. Registers a function to be called when the auto assembler is about to parse an auto assembler script. The script you get is after the [ENABLE] and [DISABLE] tags have been used to strip the script to the according one, but before comment stripping and trimming has occured
  146. script is a Strings object which when changed has direct effect to the script
  147. unregisterAutoAssemblerPrologue(ID)
  148. registerAutoAssemblerTemplate(name, function(script: TStrings; sender: TFrmAutoInject): id - Registers an template for the auto assembler. The script parameter is a TStrings object that has a direct connection to the current script. (All script parsing is up to you...). Returns an ID
  149. unregisterAutoAssemblerTemplate(ID)
  150. generateCodeInjectionScript(script: Tstrings, address: string): Adds a default codeinjection script to the given script
  151. generateAOBInjectionScript(script: Tstrings, symbolname: string, address: string): Adds an AOB injection script to the given script
  152. generateFullInjectionScript(script: Tstrings, address: string): Adds a Full Injection script to the given script
  153. showMessage(text) : shows a messagebox with the given text
  154. inputQuery(caption, prompt, initialstring): Shows a dialog where the user can input a string. This function returns the given string, or nil on cancel CE6.4+
  155. messageDialog(text, type, buttons...) : pops up a messagebox with a specific icon/sound with the specified buttons (mbok, mbyes, ....)
  156. sleep(milliseconds): pauses for the number of specified milliseconds (1000= 1 sec...)
  157. getProcesslist(Strings): Fills a Strings inherited object with the processlist of the system. Format: %x-pidname
  158. getProcesslist(): Returns a table with the processlist (pid - name )
  159. getWindowlist(Strings): Fills a Strings inherited object with the top-window list of the system. Format: %x-windowcaption
  160. getWindowlist(): Returns a table with the windowlist (pid - window caption )
  161. getThreadlist(List): fills a List object with the threadlist of the currently opened process. Format: %x
  162. function onOpenProcess(processid):
  163. If this function is defined it will be called whenever cheat engine opens a process.
  164. Note: The the same process might be opened multiple times in a row internally
  165. Note 2: This function is called before attachment is fully done. You can call reinitializeSymbolhandler() to force the open to complete, but it will slow down process opens. Alternatively, you could launch a timer which will run when the opening has finished
  166. getOpenedProcessID() : Returns the currently opened process. If none is open, returns 0
  167. getProcessIDFromProcessName(name) : returns a processid
  168. openProcess(processid) : causes cheat engine to open the given processid
  169. openProcess(processname): causes cheat engine to find and open the given process
  170. setPointerSize(size): Sets the size cheat engine will deal with pointers in bytes. (Some 64-bit processes can only use 32-bit addresses)
  171. pause() : pauses the current opened process
  172. unpause(): resumes the current opened process
  173. getCPUCount(): Returns the number of CPU's
  174. getPixel(x,y) : returns the rgb value of the pixel at the specific screen coordinate
  175. getMousePos: returns the x,y coordinates of the mouse
  176. setMousePos(x,y): sets the mouse position
  177. isKeyPressed(key) : returns true if the specified key is currently pressed
  178. keyDown(key) : causes the key to go into down state
  179. keyUp(key) :causes the key to go up
  180. doKeyPress(key) : simulates a key press
  181. mouse_event(flags, x OPTIONAL, y OPTIONAL, data OPTIONAL, extra OPTIONAL) - The mouse_event windows API. Check MSDN for information on how to use
  182. shortCutToText(shortcut): Returns the textual representation of the given shortut value (integer) (6.4+)
  183. textToShortCut(shortcutstring): Returns an shortcut integer that the given string represents. (6.4+)
  184. convertKeyComboToString(key1,...): Returns a string representation of the given keys like the hotkey handler does
  185. convertKeyComboToString({key1,...}): ^
  186. outputDebugString(text): Outputs a message using the windows OutputDebugString message. You can use tools like dbgview to read this. Useful for testing situations where the GUI freezes
  187. shellExecute(command, parameters OPTIONAL, folder OPTIONAL, showcommand OPTIONAL): Executes a given command
  188. getTickCount() : Returns the current tickcount since windows was started. Each tick is one millisecond
  189. processMessages() : Lets the main eventhandler process the new messages (allows for new button clicks)
  190. inMainThread(): Returns true if the current code is running inside the main thread (6.4+)
  191. integerToUserData(int): Converts a given integer to a userdata variable
  192. userDataToInteger(UserDataVar): Converts a given userdata variable to an integer
  193. synchronize(function(...), ...): Calls the given function from the main thread. Returns the return value of the given function
  194. queue(function(...),...): calls the given function from the main thread. Does not wait for the result
  195. checkSynchronize(): Calls this from an infinite loop in the main thread when using threading and synchronize calls. This will execute any queued synchronize calls
  196. writeToClipboard(text): Writes the given text to the clipboard
  197. readFromClipboard(): Reads the text from the clipboard
  198. speedhack_setSpeed(speed) : Enables the speedhack if needed and sets the specific speed
  199. speedhack_getSpeed(): Returns the last set speed
  200. injectDLL(filename): Injects a dll, and returns true on success
  201. executeCode(address, parameter OPTIONAL, timeout OPTIONAL) : address - Executes a stdcall function with 1 parameter at the given address in the target process and wait for it to return. The return value is the result of the function that was called
  202. executeCodeLocal(addres, parameter OPTIONAL): address - Executes a stdcall function with 1 parameter at the given address in the target process. The return value is the result of the function that was called
  203. loadPlugin(dllnameorpath): Loads the given plugin. Returns nil on failure. On success returns a value of 0 or greater
  204. loadFontFromStream(memorystream) : Loads a font from a memory stream and returns an id (handle) to the font for use with unloadLoadedFont
  205. unloadLoadedFont(id)
  206. registerCustomTypeLua(typename, bytecount, bytestovaluefunction, valuetobytesfunction, isFloat)
  207. Registers a Custom type based on lua functions
  208. The bytes to value function should be defined as "function bytestovalue (b1,b2,b3,b4)" and return an integer as result
  209. The value to bytes function should be defined as "function valuetobytes (integer)" and return the bytes it should write
  210. registerCustomTypeAutoAssembler(script)
  211. Registers a custom type based on an auto assembler script. The script must allocate an "ConvertRoutine" and "ConvertBackRoutine"
  212. onAutoGuess(function) :
  213. Registers an function to be called whenever autoguess is used to predict a variable type
  214. function override (address, ceguess): Return the variable type you want it to be. If no change, just return ceguess
  215. closeCE() : just closes ce
  216. hideAllCEWindows() : makes all normal ce windows invisible (e.g trainer table)
  217. unhideMainCEwindow() : shows the main cheat engine window
  218. getAutoAttachList(): returns the AutoAttach StringList object. It can be controlled with the stringlist_ routines (it's not recommended to destroy this list object)
  219. AOBScan(x,x,x,x,...):
  220. scans the currently opened process and returns a StringList object containing all the results. don't forget to free this list when done
  221. Bytevalue of higher than 255 or anything not an integer will be seen as a wildcard
  222. AOBScan(aobstring): see above but here you just input one string
  223. Regarding eventhandlers. You can initialize them using both a string of a functionname or the function itself.
  224. If initialized using a function itself it won't be able to get saved in the table
  225. allocateSharedMemory(name, size):
  226. Creates a shared memory object of the given size if it doesn't exist yet. If size is not given and there is no shared region with this name then the default size of 4096 is used
  227. It then maps this shared memory block into the currently targeted process. It returns the address of mapped region in the target process
  228. getForegroundProcess() : Returns the processID of the process that is currently on top
  229. findWindow(classname OPTIONAL, caption OPTIONAL): windowhandle - Finds a window with the given classname and/or windowname
  230. getWindow(windowhandle, command) : windowhandle - Gets a specific window based on the given window (Check MSDN getWindow for the command description)
  231. getWindowCaption(windowhandle) : string - Returns the caption of the window
  232. getWindowClassName(windowhandle): string - Returns the classname of the window
  233. getWindowProcessID(windowhandle): processid - Returns the processid of the process this window belongs to
  234. getForegroundWindow() - windowhandle : Returns the windowhandle of the topmost window
  235. sendMessage(hwnd, msg, wparam, lparam): result - Sends a message to a window. Those that wish to use it, should know how to use it (and fill in the msg id's yourself)
  236. hookWndProc(hwnd, function(hwnd, msg, wparam, lparam), ASYNC: BOOL) - Hooks a window's wndproc procedure. The given function will receive all functions. Return 0 to say you handled it. 1 to let the default windows handler deal with it. Or anything else, to let the original handler deal with it. Besides the return value, you can also return hWnd, Msg, lParam and wParam, modified, or nil for the original value. Set ASYNC to true if you don't want to run this in the CE GUI. (faster, but you can't touch gui objects)
  237. unhookWndProc(hwnd) - call this when done with the hook. Not calling this will result in the process window behaving badly when you exit CE
  238. cheatEngineIs64Bit(): Returns true if CE is 64-bit, false if 32-bit
  239. targetIs64Bit(): Returns true if the target process is 64-bit, false if 32-bit
  240. getCheatEngineDir(): Returns the folder Cheat Engine is located at
  241. disassemble(address): Disassembles the given address and returns a string in the format of "address - bytes - opcode : extra"
  242. splitDisassembledString(disassembledstring): Returns 4 strings. The address, bytes, opcode and extra field
  243. getInstructionSize(address): Returns the size of an instruction (basically it disassembles the instruction and returns the number of bytes for you)
  244. getPreviousOpcode(address): Returns the address of the previous opcode (this is just an estimated guess)
  245. beep() : Plays the fabulous beep/ping sound!
  246. playSound(stream, waittilldone OPTIONAL): Plays the given memorystream containing a .WAV formatted memory object. If waittilldone is true the script will stop executing till the sound has stopped
  247. playSound(tablefile, waittilldone OPTIONAL) : Takes the memorystream from the tablefile and plays it.
  248. There are two tablefiles predeclared inside cheat engine "Activate" and "Deactivate" . You are free to use or override them
  249. speak(text, waittilldone OPTIONAL): Speaks a given text. If waitTillDone is true the thread it's in will be frozen till it is done
  250. speak(text, flags): Speaks a given text using the given flags. https://msdn.microsoft.com/en-us/library/speechplatform_speakflags.aspx
  251. speakEnglish(text, waittilldone OPTIONAL) - will try the English voice by wrapping the given text into an XML statement specifying the english voice. Will not say anything if no Egnlish language is present. Do not use SPF_IS_NOT_XML flag and SPF_PARSE_SSML won't work in this situation
  252. getUserRegistryEnvironmentVariable(name): string - Returns the environment variable stored in the user registry environment
  253. setUserRegistryEnvironmentVariable(name, string) - Sets the environment variable stored in the user registry environment
  254. broadcastEnvironmentUpdate() : Call this when you've changed the environment variables in the registry. This will cause at least the shell to update so you don't have to reboot. (It's always recommended to reboot though)
  255. stringToMD5String(string): Returns an md5 hash string from the provided string
  256. getFormCount() : Returns the total number of forms assigned to the main CE application
  257. getForm(index): Returns the form at the specific index
  258. registerFormAddNotification(function(form)): Registers a function to be called when a form is attached to ce's form list. This is useful for extentions that add new functionality to certain existing forms. It returns an object you can use with unregisterFormAddNotification
  259. unregisterFormAddNotification(Object)
  260. getSettingsForm(): Returns the main settings form
  261. getMemoryViewForm() : Returns the main memoryview form class object which can be accessed using the Form_ class methods and the methods of the classes it inherits from. There can be multiple memory views, but this will only find the original/base
  262. getMainForm() : Returns the main form class object which can be accessed using the Form_ class methods and the methods of the classes it inherits from
  263. getLuaEngine() : Returns the lua engine form object (Creates it if needed)
  264. getApplication() : Returns the application object. (the titlebar)
  265. getAddressList() : Returns the cheat table addresslist object
  266. getFreezeTimer() : Returns the freeze timer object
  267. getUpdateTimer() : Returns the update timer object
  268. setGlobalKeyPollInterval(integer): Sets the global keypoll interval. The interval determines the speed of how often CE checks if a key has been pressed or not. Lower is more accurate, but eats more cpu power
  269. setGlobalDelayBetweenHotkeyActivation(integer): Sets the minimum delay between the activation of the same hotey in milliseconds. Affects all hotkeys that do not set their own minimum delay
  270. getXBox360ControllerState(ControllerID OPTIONAL) : table - Fetches the state of the connected xbox controller. Returns a table containing the following fields on success:
  271. ControllerID : The id of the controller (between 0 and 3)
  272. PacketNumber : The packet id of the state you see. (use to detect changes)
  273. GAMEPAD_DPAD_UP : D-PAD Up (boolean)
  274. GAMEPAD_DPAD_DOWN: D-PAD Down (boolean)
  275. GAMEPAD_DPAD_LEFT: D-PAD Left (boolean)
  276. GAMEPAD_DPAD_RIGHT: D-PAD Right (boolean)
  277. GAMEPAD_START: Start button (boolean)
  278. GAMEPAD_BACK: Back button (boolean)
  279. GAMEPAD_LEFT_THUMB: Left thumb stick down (boolean)
  280. GAMEPAD_RIGHT_THUMB: Right thumb stick down (boolean)
  281. GAMEPAD_LEFT_SHOULDER: Left shoulder button (boolean)
  282. GAMEPAD_RIGHT_SHOULDER: Right shoulder button (boolean)
  283. GAMEPAD_A: A button (boolean)
  284. GAMEPAD_B: B button (boolean)
  285. GAMEPAD_X: X button (boolean)
  286. GAMEPAD_Y: Y button (boolean)
  287. LeftTrigger: Left trigger (integer ranging from 0 to 255)
  288. RightTrigger: Right trigger (integer ranging from 0 to 255)
  289. ThumbLeftX: Horizontal position of the left thumbstick (-32768 to 32767)
  290. ThumbLeftY: Verital position of the left thumbstick (-32768 to 32767)
  291. ThumbRightX: Horizontal position of the right thumbstick (-32768 to 32767)
  292. ThumbRightY: Vertical position of the right thumbstick (-32768 to 32767)
  293. setXBox360ControllerVibration(ControllerID, leftMotor, rightMotor) - Sets the speed of the left and right vibrating motor inside the controller. Range (0 to 65535 where 0 is off)
  294. connectToCEServer(hostname,port) - Connects to the given host and port. On success, most commands subsequent will be handled by the server. Like processlist, memory reading, etc...
  295. undefined property functions. Not all properties of all classes have been explicitly exposed to lua, but if you know the name of a property of a specific class you can still access them (assuming they are declared as published in the pascal class declaration)
  296. getPropertyList(class) : Returns a stringlist object containing all the published properties of the specified class (free the list when done) (Note, not all classed with properties have 'published' properties. E.g: stringlist)
  297. setProperty(class, propertyname, propertyvalue) : Sets the value of a published property of a class (Won't work for method properties)
  298. getProperty(class, propertyname) : Gets the value of a published property of a class (Won't work for method properties)
  299. setMethodProperty(class, propertyname, function): Sets the method property to the specific function
  300. getMethodProperty(Class, propertyname): Returns a function you can use to call the original function
  301. registerSymbol(symbolname, address, OPTIONAL donotsave): Registers a userdefined symbol. If donotsave is true this symbol will not get saved when the table is saved
  302. unregisterSymbol(symbolname)
  303. getNameFromAddress(address): Returns the given address as a string. Registered symbolname, modulename+offset, or just a hexadecimal string depending on what address
  304. inModule(address) : returns true if the given address is inside a module
  305. inSystemModule(address) : returns true if the given address is inside a system module
  306. getCommonModuleList: Returns the commonModuleList stringlist. (Do not free this one)
  307. AOBScan("aobstring", protectionflags OPTIONAL, alignmenttype OPTIONAL, alignmentparam HALFOPTIONAL):
  308. protectionflags is a string.
  309. X=Executable W=Writable memory C=Copy On Write. Add a + to indicate that flag MUST be set and a - to indicate that that flag MUST NOT be set. (* sets it to don't care)
  310. Examples:
  311. +W-C = Writable memory exluding copy on write and doesn't care about the Executable flag
  312. +X-C-W = Find readonly executable memory
  313. +W = Finds all writable memory and don't care about copy on write or execute
  314. "" = Find everything (is the same as "*X*C*W" )
  315. alignmenttype is an integer:
  316. 0=No alignment check
  317. 1=Address must be dividable by alignmentparam
  318. 2=Address must end with alignmentparam
  319. alignmentparam is a string which either holds the value the addresses must be dividable by or what the last digits of the address must be
  320. -debugging
  321. debug variables
  322. EFLAGS
  323. 32/64-bit: EAX, EBX, ECX, EDX, EDI, ESI, EBP, ESP, EIP
  324. 64-bit only: RAX, RBX, RCX, RDX, RDI, RSI, RBP, RSP, RIP, R8, R9, R10, R11, R12, R13, R14, R15 : The value of the register
  325. Debug related routines:
  326. function debugger_onBreakpoint():
  327. When a breaking breakpoint hits (that includes single stepping) and the lua function debugger_onBreakpoint() is defined it will be called and the global variables EAX, EBX, .... will be filled in
  328. Return 0 if you want the userinterface to be updated and anything else if not (e.g: You continued from the breakpoint in your script)
  329. createProcess(path, parameters OPTIONAL, debug OPTIONAL, breakonentrypoint OPTIONAL) : Creates a process. If debug is true it will be created using the windows debugger and if breakonentry is true it will cause a breakpoint to occur on entrypoint
  330. debugProcess(interface OPT): starts the debugger for the currently opened process (won't ask the user) Optional interface: 0=default, 1=windows debug, 2=VEHDebug, 3=Kerneldebug
  331. debug_isDebugging(): Returns true if the debugger has been started
  332. debug_getCurrentDebuggerInterface() : Returns the current debuggerinterface used (1=windows, 2=VEH 3=Kernel, nil=no debugging active)
  333. debug_canBreak(): Returns true if there is a possibility the target can stop on a breakpoint. 6.4+
  334. debug_isBroken(): Returns true if the debugger is currently halted on a thread
  335. debug_getBreakpointList(): Returns a lua table containing all the breakpoint addresses
  336. debug_addThreadToNoBreakList(threadid): This will cause breakpoints on the provided thread to be ignored
  337. debug_removeThreadFromNoBreakList(threadid): removed the threadid from the list
  338. debug_setBreakpoint(address, size OPTIONAL, trigger OPTIONAL, breakpointmethod OPTIONAL, functiontocall() OPTIONAL) : sets a breakpoint of a specific size at the given address. if trigger is bptExecute then size is ignored. If trigger is ignored then it will be of type bptExecute, which obviously also ignores the size then as well
  339. debug_setBreakpoint(address, size OPTIONAL, trigger OPTIONAL, functiontocall() OPTIONAL)
  340. debug_setBreakpoint(address, functiontocall() OPTIONAL)
  341. debug_removeBreakpoint(address) : if the given address is a part of a breakpoint it will be removed
  342. debug_continueFromBreakpoint(continueMethod) : if the debugger is currently waiting to continue you can continue with this. Valid parameters are :co_run (just continue), co_stepinto(when on top of a call, follow it), co_stepover (when on top of a call run till after the call)
  343. debug_getXMMPointer(xmmregnr) :
  344. Returns the address of the specified xmm register of the thread that is currently broken
  345. This is a LOCAL Cheat Engine address. Use Local memory access functions to read and modify
  346. xmmregnr can be 0 to 15 (0 to 7 on 32-bit)
  347. The following routines describe last branch recording. These functions only work when kernelmode debugging is used and using windows XP (vista and later work less effective or not at all because the operating system interferes. Might also be intel specific. A dbvm upgrade in the future might make this work for windows vista and later)
  348. debug_setLastBranchRecording(boolean): When set the Kernel debugger will try to record the last branch(es) taken before a breakpoint happens
  349. debug_getMaxLastBranchRecord() : Returns the maximum branch record your cpu can store (-1 if none)
  350. debug_getLastBranchRecord(index): Returns the value of the Last Branch Record at the given index (when handling a breakpoint)
  351. function debugger_onModuleLoad(modulename, baseaddress) :
  352. this routine is called when a module is loaded. Only works for the windows debugger
  353. return 1 if you want to cause the debugger to break
  354. Changing registers:
  355. When the debugger is waiting to continue you can change the register variables. When you continue those register values will be set in the thread's context
  356. If the target is currently stopped on a breakpoint, but not done through an onBreakpoint function. The context won't be set.
  357. You can get and set the context back with these functions before execution continues"
  358. debug_getContext(BOOL extraregs) - Fills the global variables for the regular registers. If extraregs is true, it will also set FP0 to FP7 and XMM0 to XMM15
  359. debug_setContext(BOOL extraregs)
  360. debug_updateGUI() - Will refresh the userinterface to reflect the new context if the debugger was broken
  361. detachIfPossible() : Detaches the debugger from the target process (if it was attached)
  362. getComment(address) : Gets the userdefined comment at the specified address
  363. setComment(address, text) : Sets a userdefined comment at the specifried address. %s is used to display the autoguess value if there is one
  364. getHeader(address) : Gets the userdefined header at the specified address
  365. setHeader(address) : Sets the userdefined header at the specified address
  366. registerBinUtil(config) Registers a binutils toolset with CE (for assembling and disassembling in other cpu instruction sets)
  367. config is a table containing several fields that describe the tools, and lets you specify extra parameters
  368. Name : The displayed name in the binutils menu in memview
  369. Description: The description for this toolset
  370. Architecture: used by the objdump -m<architecture> (required)
  371. ASParam : extra parameters to pass on to AS (optional)
  372. LDParam : extra parameters to pass on to LD
  373. OBJDUMPParam: extra parameters to pass on to OBJDUMP
  374. OnDisassemble: a lua function that gets called each time an address is disassembled. The return value will be passed on to OBJDUMP
  375. Path: filepath to the binutils set
  376. Prefix: prefix (e.g: "arm-linux-androideabi-")
  377. DisassemblerCommentChar: Depending on which target you're disassembling, the comment character can be different. (ARM=";" x86='#' )
  378. class helper functions
  379. inheritsFromObject(object): Returns true if given any class
  380. inheritsFromComponent(object): Returns true if the given object inherits from the Component class
  381. inheritsFromControl(object): Returns true if the given object inherits from the Control class
  382. inheritsFromWinControl(object): Returns true if the given object inherits from the WinControl class
  383. createClass(classname): Creates an object of the specified class (Assuming it's a registered class and has a default constructor)
  384. createComponentClass(classname, owner): Creates an object of the specified component inherited class
  385. Class definitions
  386. Object class: (Inheritance: )
  387. Properties:
  388. ClassName: String - The name of class (Read only)
  389. Methods:
  390. getClassName(): Returns the classname
  391. destroy(): Destroys the object
  392. Component Class: (Inheritance: Object)
  393. properties
  394. ComponentCount: Integer - Number of child components . Readonly
  395. Component[int]: Component - Array containing the child components. Starts at 0. Readonly
  396. ComponentByName[string]: Component - Returns a component based on the name. Readonly
  397. Name: string - The name of the component
  398. Tag: integer - Free to use storage space. (Useful for id's)
  399. Owner: Component - Returns the owner of this object. Nil if it has none
  400. methods
  401. getComponentCount() : Returns the number of components attached to his component
  402. getComponent(index) : Returns the specific component
  403. findComponentByName(name) : Returns the component with this name
  404. getName() : Return the name
  405. setName(newname) : Changes the name
  406. getTag() : Sets an integer value. You can use this for ID's
  407. setTag(tagvalue) : Get the tag value
  408. getOwner() : Returns the owner of this component
  409. Control Class: (Inheritance: Component->Object)
  410. properties:
  411. Caption: string - The text of a control
  412. Top : integer - The x position
  413. Left : integer - The y position
  414. Width : integer - The width of the control
  415. Height : integer - The height of the control
  416. ClientWidth: integer - The usable width inside the control (minus the borders)
  417. ClientHeight: integer - The usable height the control (minus the borders)
  418. Align: AlignmentOption - Alignment of the control
  419. Enabled: boolean - Determines if the object is usable or greyed out
  420. Visible: boolean - Determines if the object is visible or not
  421. Color: ColorDefinition/RGBInteger - The color of the object. Does not affect the caption
  422. Parent: WinControl - The owner of this control
  423. PopupMenu: PopupMenu - The popup menu that shows when rightclicking the control
  424. Font: Font - The font class associated with the control
  425. OnClick: function - The function to call when a button is pressed
  426. methods:
  427. getLeft()
  428. setLeft(integer)
  429. getTop()
  430. setTop(integer)
  431. getWidth()
  432. setWidth(integer)
  433. getHeight()
  434. setHeight()
  435. setCaption(caption) : sets the text on a control. All the GUI objects fall in this category
  436. getCaption() : Returns the text of the control
  437. setPosition(x,y): sets the x and y position of the object base don the top left position (relative to the client array of the owner object)
  438. getPosition(): returns the x and y position of the object (relative to the client array of the owner object)
  439. setSize(width,height) : Sets the width and height of the control
  440. getSize() : Gets the size of the control
  441. setAlign(alignmentoption): sets the alignment of the control
  442. getAlign(alignmentoption): gets the alignment of the control
  443. getEnabled() : gets the enabled state of the control
  444. setEnabled(boolean) : Sets the enabled state of the control
  445. getVisible() : gets the visible state of the control
  446. setVisible(boolean) : sets the visible state of the control
  447. getColor() : gets the color
  448. setColor(rgb) : Sets the color
  449. getParent() : Returns nil or an object that inherits from the Wincontrol class
  450. setParent(wincontrol) : Sets the parent for this control
  451. getPopupMenu()
  452. setPopupMenu()
  453. getFont(): Returns the Font object of this object
  454. setFont(): Assigns a new font object. (Not recommended to use. Change the font object that's already there if you wish to change fonts)
  455. repaint(): Invalidates the graphical area of the control and forces and update
  456. update() : Only updates the invalidated areas
  457. setOnClick(functionnameorstring) : Sets the onclick routine
  458. getOnClick(): Gets the onclick function
  459. doClick(): Executes the current function under onClick
  460. bringToFront(): Changes the z-order of the control so it'd at the top
  461. sendToBack(): Changes the z-order of the control so it'd at the back
  462. GraphicsObject : (GraphicsObject->Object)
  463. Region Class : (Region->GraphicsObject->Object)
  464. createRegion(): Created an empty region
  465. properties
  466. -
  467. methods
  468. addRectangle(x1, y1, x2, y2): Adds a rectangle to the region
  469. addPolygon(tablewithcoordinates): Adds an array of 2D locations. (example : {{0,0},{100,100}, {0,100}} for a triangle )
  470. WinControl Class: (Inheritance: Control->Component->Object)
  471. properties
  472. Handle: Integer - The internal windows handle
  473. DoubleBuffered: boolean - Graphical updates will go to a offscreen bitmap which will then be shown on the screen instead of directly to the screen. May reduce flickering
  474. ControlCount : integer - The number of child controls of this wincontrol
  475. Control[] : Control - Array to access a child control
  476. OnEnter : function - Function to be called when the WinControl gains focus
  477. OnExit : function - Function to be called when the WinControl loses focus
  478. methods
  479. getControlCount() Returns the number of Controls attached to this class
  480. getControl(index) : Returns a WinControl class object
  481. getControlAtPos(x,y): Gets the control at the given x,y position relative to the wincontrol's position
  482. canFocus(): returns true if the object can be focused
  483. focused(): returns boolean true when focused
  484. setFocus(): tries to set keyboard focus the object
  485. setShape(Region): Sets the region object as the new shape for this wincontrol
  486. setShape(Bitmap):
  487. setOnEnter(function) : Sets an onEnter event. (Triggered on focus enter)
  488. getOnEnter()
  489. setOnExit(function) : Sets an onExit event. (Triggered on lost focus)
  490. getOnExit()
  491. setLayeredAttributes(Key, Alpha, Flags) : Sets the layered state for the control if possible (Only Forms are supported in in windows 7 and earlier)
  492. flags can be a combination of LWA_ALPHA and/or LWA_COLORKEY
  493. See msdn SetLayeredWindowAttributes for more information
  494. MenuItem class(Inheritance: Component->Object)
  495. createMenuItem(ownermenu) : Creates a menu item that gets added to the owner menu
  496. properties
  497. Caption : String - Text of the menu item
  498. Shortcut : string - Shortcut in textform to trigger the menuitem
  499. Count : integer - Number of children attached to this menuitem
  500. Menu: Menu - The menu this item resides in
  501. Parent: MenuItem - The menuitem this item hangs under
  502. MenuIndex: integer - The position this menu item is in it's parent
  503. Item[] : Array to access each child menuitem
  504. [] : Item[]
  505. OnClick: Function to call when the menu item is activated
  506. methods
  507. getCaption() : Gets the caption of the menu item
  508. setCaption(caption) : Sets the caption of the menu item
  509. getShortcut(): Returns the shortcut for this menu item
  510. setShortcut(shortcut): Sets the shortcut for this menuitem. A shortcut is a string in the form of ("ctrl+x")
  511. getCount()
  512. getItem(index) : Returns the menuitem object at the given index
  513. add(menuitem) : Adds a menuItem as a submenu item
  514. insert(index, menuitem): Adds a menuItem as a submenu item at the given index
  515. delete(index)
  516. setOnClick(function) : Sets an onClick event
  517. getOnClick()
  518. doClick(): Executes the onClick method if one is assigned
  519. Menu Class: (Inheritance: Component->Object)
  520. properties
  521. Items : MenuItem - The base MenuItem class of this menu (readonly)
  522. methods
  523. getItems() : Returns the main MenuItem of this Menu
  524. MainMenu Class: (Inheritance: Menu->Component->Object)
  525. createMainMenu(form)
  526. The mainmenu is the menu at the top of a window
  527. PopupMenu Class: (Inheritance: Menu->Component->Object)
  528. createPopupMenu(owner)
  529. The popup menu is the menu that pops up when showing the (rightclick) context of an control
  530. Strings Class: (Inheritance : Object) (Mostly an abstract class)
  531. properties
  532. Text : String - All the strings in one string
  533. Count: Integer - The number of strings in this list
  534. String[]: String - Array to access one specific string in the list
  535. [] = String[]
  536. methods
  537. clear() : Deletes all strings in the list
  538. add(string) : adds a string to the list
  539. delete(index) : Deletes a string from the list
  540. getText() : Returns all the strings as one big string
  541. setText() : Sets the strings of the given strings object to the given text (can be multiline)
  542. indexOf(string): Returns the index of the specified string. Returns -1 if not found
  543. insert(index, string): Inserts a string at a specific spot moving the items after it
  544. getCount(): Returns the number is strings in the list
  545. remove(string); Removes the given string from the list
  546. loadFromFile(filename) : Load the strings from a textfile
  547. saveToFile(filename) : Save the strings to a textfile
  548. getString(index) : gets the string at the given index
  549. setString(index, string) : Replaces the string at the given index
  550. Stringlist Class: (Inheritance : Strings->Object)
  551. createStringlist() : Creates a stringlist class object (for whatever reason, lua strings are probably easier to use)
  552. properties
  553. Duplicates : DuplicatesType - Determines how duplicates should be handled
  554. Sorted : boolean - Determines if the list should be sorted
  555. CaseSensitive: boolean - Determines if the list is case sensitive or not.
  556. methods
  557. getDuplicates() : returns the duplicates property
  558. setDuplicates(Duplicates) : Sets the duplicates property (dupIgnore, dupAccept, dupError)
  559. getSorted() : returns true if the list has the sorted property
  560. setSorted(boolean) : Sets the sorted property
  561. getCaseSensitive() : Returns true if the case sensitive property is set
  562. setCaseSensitive(boolean): Sets the case sensitive property
  563. Application Class: (Inheritance: CustomApplication->Component->Object)
  564. properties
  565. Title: The title of cheat engine in the bar
  566. Icon: The icon of Cheat Engine inn the bar
  567. methods
  568. bringToFront(): Shows the cheat engine app
  569. processMessages()
  570. terminate()
  571. minimize()
  572. Form Class: (Inheritance: ScrollingWinControl->CustomControl->WinControl->Control->Component->Object)
  573. properties
  574. AllowDropFiles: boolean - Allows files to be dragged into the form
  575. ModalResult: integer - The current ModalResult value of the form. Note: When this value gets set the modal form will close
  576. Menu: MainMenu - The main menu of the form
  577. OnClose: function(sender) - The function to call when the form gets closed
  578. OnDropFiles: function(sender, {filenames}) - Called when files are dragged on top of the form. Filenames is an arraytable with the files
  579. methods
  580. centerScreen(); : Places the form at the center of the screen
  581. hide() : Hide the form
  582. show() : show the form
  583. close(): Closes the form. Without an onClose this will be the same as hide
  584. bringToFront(): Brings the form to the foreground
  585. showModal() : show the form and wait for it to close and get the close result
  586. isForegroundWindow(): returns true if the specified form has focus
  587. setOnClose(function) : function (sender) : Return a CloseAction to determine how to close the window
  588. getOnClose() : Returns the function
  589. getMenu() : Returns the mainmenu object of this form
  590. setMenu(mainmenu)
  591. setBorderStyle( borderstyle): Sets the borderstyle of the window
  592. getBorderStyle()
  593. printToRasterImage(rasterimage): Draws the contents of the form to a rasterimage class object
  594. dragNow(): Call this on mousedown on any object if you wish that the mousemove will drag the whole form arround. Useful for borderless windows (Dragging will stop when the mouse button is released)
  595. CEForm Class: (Inheritance: Form->ScrollingWinControl->CustomControl->WinControl->Control->Component->Object)
  596. createForm(visible OPT): creates a CEForm class object(window) and returns the pointer for it. Visible is default true but can be changed
  597. createFormFromFile(filename): Returns the generated CEform
  598. properties
  599. DoNotSaveInTable: boolean - Set this if you do not wish to save the forms in the table
  600. methods
  601. saveToFile(filename): Saves a userdefined form
  602. getDoNotSaveInTable(): Returns the DoNotSaveInTable property
  603. setDoNotSaveInTable(boolean): Sets the DoNotSaveInTable property
  604. GraphicControl Class: (Inheritance: Control->Component->Object)
  605. properties
  606. Canvas: Canvas - The canvas for rendering this control
  607. methods
  608. getCanvas() : Returns the Canvas object for the given object that has inherited from customControl
  609. PaintBox class: (Inheritance: GraphicControl->Control->Component->Object)
  610. createPaintBox(owner): Creates a Paintbox class object
  611. Label Class: (Inheritance: GraphicControl->Control->Component->Object)
  612. createLabel(owner): Creates a Label class object which belongs to the given owner. Owner can be any object inherited from WinControl
  613. Splitter Class: (Inheritance: CustomControl->WinControl->Control->Component->Object)
  614. createSplitter(owner): Creates a Splitter class object which belongs to the given owner. Owner can be any object inherited from WinControl
  615. Panel Class: (Inheritance: CustomControl->WinControl->Control->Component->Object)
  616. createPanel(owner): Creates a Panel class object which belongs to the given owner. Owner can be any object inherited from WinControl
  617. properties
  618. Alignment: alignment
  619. BevelInner: panelBevel
  620. BevelOuter: panelBevel
  621. BevelWidth: Integer
  622. FullRepaint: boolean
  623. methods
  624. getAlignment() : gets the alignment property
  625. setAlignment(alignment) : sets the alignment property
  626. getBevelInner()
  627. setBevelInner(PanelBevel)
  628. getBevelOuter()
  629. setBevelOuter(PanelBevel)
  630. getBevelWidth()
  631. setBevelWidth(BevelWidth)
  632. getFullRepaint()
  633. setFullRepaint(boolean)
  634. Image Class: (Inheritance: GraphicControl->Control->Component->Object)
  635. createImage(owner): Creates an Image class object which belongs to the given owner. Owner can be any object inherited from WinControl
  636. properties
  637. Canvas: Canvas - The canvas object to access the picture of the image
  638. Transparent: boolean - Determines if some parts of the picture are see through (usually based on the bottomleft corner)
  639. Stretch: boolean - Determines if the picture gets stretched when rendered in the image component
  640. Picture: Picture - The picture to render
  641. methods
  642. loadImageFromFile(filename)
  643. getStretch()
  644. setStretch(boolean)
  645. getTransparent()
  646. setTransparent(boolean)
  647. getCanvas()
  648. setPicture(picture)
  649. getPicture() : Returns the Picture object of this image
  650. Edit Class: (Inheritance: WinControl->Control->Component->Object)
  651. createEdit(owner): Creates an Edit class object which belongs to the given owner. Owner can be any object inherited from WinControl
  652. properties
  653. Text: string - The current contents of the editfield
  654. SelText: string - The current selected contents of the edit field (readonly)
  655. SelStart: number - The starting index of the current selection (zero-indexed, readonly)
  656. SelLength: number - The length of the current selection. (readonly)
  657. OnChange: function - The function to call when the editfield is changed
  658. OnKeyPress: function - The function to call for the KeyPress event.
  659. OnKeyUp: function - The function to call for the KeyUp event.
  660. OnKeyDown: function - The function to call for the KeyDown event.
  661. methods
  662. clear()
  663. copyToClipboard()
  664. cutToClipboard()
  665. pasteFromClipboard()
  666. selectAll()
  667. select(start, length OPTIONAL)
  668. selectText(start, length OPTIONAL) : Set the control's current selection. If no length is specified, selects everything after start.
  669. clearSelection()
  670. getSelText()
  671. getSelStart()
  672. getSelLength()
  673. getOnChange()
  674. setOnChange(function)
  675. getOnKeyPress()
  676. setOnKeyPress(function)
  677. getOnKeyUp()
  678. setOnKeyUp(function)
  679. getOnKeyDown()
  680. setOnKeyDown(function)
  681. Memo Class: (Inheritance: Edit->WinControl->Control->Component->Object)
  682. createMemo(owner): Creates a Memo class object which belongs to the given owner. Owner can be any object inherited from WinControl
  683. properties
  684. Lines: Strings - Strings object for this memo
  685. WordWrap: boolean - Set if words at the end of the control should go to the next line
  686. WantTabs: Boolean - Set if tabs will add a tab to the memo. False if tab will go to the next control
  687. WantReturns: Boolean - Set if returns will send a event or not
  688. Scrollbars: Scrollstyle - Set the type of ascrollbars to show (ssNone, ssHorizontal, ssVertical, ssBoth,
  689. ssAutoHorizontal, ssAutoVertical, ssAutoBoth)
  690. methods
  691. append(string)
  692. getLines() : returns a Strings class
  693. getWordWrap()
  694. setWordWrap(boolean)
  695. getWantTabs()
  696. setWantTabs(boolean)
  697. getWantReturns()
  698. setWantReturns(boolean)
  699. getScrollbars()
  700. setScrollbars(scrollbarenumtype) :
  701. Sets the scrollbars. Horizontal only takes affect when wordwrap is disabled
  702. valid enum types:
  703. ssNone : No scrollbars
  704. ssHorizontal: Has a horizontal scrollbar
  705. ssVertical: Has a vertical scrollbar
  706. ssBoth: Has both scrollbars
  707. ssAutoHorizontal: Same as above but only shows when there actually is something to scroll for
  708. ssAutoVertical: " " " " ...
  709. ssAutoBoth: " " " " ...
  710. ButtonControl Class: (Inheritance: WinControl->Control->Component->Object)
  711. Button Class: (Inheritance: ButtonControl->WinControl->Control->Component->Object)
  712. createButton(owner): Creates a Button class object which belongs to the given owner. Owner can be any object inherited from WinControl
  713. properties
  714. ModalResult: ModalResult - The result this button will give the modalform when clicked
  715. methods
  716. getModalResult(button)
  717. setModalResult(button, mr)
  718. CheckBox Class: (Inheritance: ButtonControl->WinControl->Control->Component->Object)
  719. createCheckBox(owner): Creates a CheckBox class object which belongs to the given owner. Owner can be any object inherited from WinControl
  720. properties
  721. Checked: boolean - True if checked
  722. AllowGrayed: boolean - True if it can have 3 states. True/False/None
  723. State: checkboxstate - The state. (cbUnchecked=0, cbChecked=1, cbGrayed=2)
  724. OnChange: function - Function to call when the state it changed
  725. methods
  726. getAllowGrayed()
  727. setAllowGrayed(boolean)
  728. getState(): Returns a state for the checkbox. (cbUnchecked, cbChecked, cbGrayed)
  729. setState(boolean): Sets the state of the checkbox
  730. onChange(function)
  731. ToggleBox Class: (Inheritance: CheckBox->ButtonControl->WinControl->Control->Component->Object)
  732. createToggleBox(owner): Creates a ToggleBox class object which belongs to the given owner. Owner can be any object inherited from WinControl
  733. GroupBox Class: (Inheritance: WinControl->Control->Component->Object)
  734. createGroupBox(owner): Creates a GroupBox class object which belongs to the given owner. Owner can be any object inherited from WinControl
  735. RadioGroup class: (Inheritance: GroupBox->WinControl->Control->Component->Object)
  736. createRadioGroup(owner): Creates a RadioGroup class object which belongs to the given owner. Owner can be any object inherited from WinControl
  737. properties
  738. Items: Strings - Strings derived object containings all the items in the list
  739. Columns: Integer - The number of columns to split the items into
  740. ItemIndex: Integer - The currently selected item
  741. OnClick: Called when the control is clicked
  742. methods
  743. getRows(): Returns the number of rows
  744. getItems(): Returns a Strings object
  745. getColumns(): Returns the nuber of columns
  746. setColumns(integer)
  747. getItemIndex()
  748. setItemIndex(integer)
  749. setOnClick(function)
  750. getOnClick()
  751. ListBox Class: (Inheritance: WinControl->Control->Component->Object)
  752. createListBox(owner): Creates a ListBox class object which belongs to the given owner. Owner can be any object inherited from WinControl
  753. properties
  754. MultiSelect: boolean - When set to true you can select multiple items
  755. Items: Strings - Strings derived object containings all the items in the list
  756. Selected[] - Returns true if the given line is selected. Use Items.Count-1 to find out the max index
  757. ItemIndex: integer - Get selected index. -1 is nothing selected
  758. Canvas: Canvas - The canvas object used to render on the object
  759. methods
  760. clear()
  761. clearSelection() : Deselects all items in the list
  762. selectAll(): Selects all items in the list
  763. getItems(): Returns a strings object
  764. setItems(Strings): sets a strings object to the listbox
  765. getItemIndex()
  766. setItemIndex(integer)
  767. getCanvas()
  768. Calendar Class: (Inheritance: WinControl->Control->Component->Object)
  769. createCalendar(owner): Creates a Calendar class object which belongs to the given owner. Owner can be any object inherited from WinControl. Valid date is between "September 14, 1752" and "December 31, 9999"
  770. properties
  771. Date: string - current date of the Calendar, format: yyyy-mm-dd
  772. DateTime: number - days since December 30, 1899
  773. methods
  774. getDateLocalFormat - returns current date of the Calendar, format: ShortDateFormat from OS local settings
  775. ComboBox Class: (Inheritance: WinControl->Control->Component->Object)
  776. createComboBox(owner): Creates a ComboBox class object which belongs to the given owner. Owner can be any object inherited from WinControl
  777. properties
  778. Items: Strings - Strings derived object containings all the items in the list
  779. ItemIndex: integer - Get selected index. -1 is nothing selected
  780. Canvas: Canvas - The canvas object used to render on the object
  781. methods
  782. clear()
  783. getItems()
  784. setItems()
  785. getItemIndex()
  786. setItemIndex(integer)
  787. getCanvas()
  788. ProgressBar Class: (Inheritance: WinControl->Control->Component->Object)
  789. createProgressBar(owner): Creates a ProgressBar class object which belongs to the given owner. Owner can be any object inherited from WinControl
  790. properties
  791. Min: integer - The minimum positionvalue the progressbar can have (default 0)
  792. Max: integer - The maximum positionvalue the progressbar can have (default 100
  793. Position: integer - The position of the progressbar
  794. Step: integer- The stepsize to step by when stepIt() is called
  795. methods
  796. stepIt() - Increase position with "Step" size
  797. stepBy(integer) - increase the position by the given integer value
  798. getMax() - returns the Max property
  799. setMax(integer) - sets the max property
  800. getMin() - returns the min property
  801. setMin(integer)- sets the min property
  802. getPosition() - returns the current position
  803. setPosition(integer) - sets the current position
  804. setPosition2(integer) - sets the current position; without slow progress animation on Win7 and later
  805. TrackBar Class : (Inheritance: WinControl->Control->Component->Object)
  806. createTrackBar(owner): Creates a TrackBar class object which belongs to the given owner. Owner can be any object inherited from WinControl
  807. properties
  808. Min: integer - Minimal value for the trackbar
  809. Max: integer - Maximum value for the trackbar
  810. Position: integer - The current position
  811. OnChange: function - Function to call when
  812. methods
  813. getMax()
  814. setMax(integer)
  815. getMin(trackbar)
  816. setMin(trackbar, integer)
  817. getPosition(progressbar)
  818. setPosition(progressbar, integer)
  819. getOnChange()
  820. setOnChange(function)
  821. CollectionItem Class: (Inheritance: Object)
  822. Base class for some higher level classes. Often used for columns
  823. properties
  824. ID: integer
  825. Index: integer - The index in the array this item belong to
  826. DisplayName: string
  827. methods
  828. getID()
  829. getIndex()
  830. setIndex()
  831. getDisplayName()
  832. setDisplayName()
  833. ListColumn class: (Inheritance: CollectionItem->Object)
  834. properties
  835. AutoSize: boolean
  836. Caption: string
  837. MaxWidth: integer
  838. MinWidth: integer
  839. Width: integer
  840. Visible: boolean
  841. methods
  842. getAutosize()
  843. setAutosize(boolean)
  844. getCaption()
  845. setCaption(caption)
  846. getMaxWidth()
  847. setMaxWidth(width)
  848. getMinWidth()
  849. setMinWidth(width)
  850. getWidth()
  851. setWidth(width)
  852. Collection Class: (Inheritance: TObject)
  853. properties
  854. Count: integer
  855. methods
  856. clear(collection)
  857. getCount(collection)
  858. delete(collection, index)
  859. ListColumns class : (Inheritance: Collection->Object)
  860. properties
  861. Columns[]: Array to access a column
  862. [] = Columns[]
  863. methods
  864. add(): Returns a new ListColumn object
  865. getColumn(index): Returns a ListColum object;
  866. setColumn(index, listcolumns): Sets a ListColum object (not recommended, use add instead)
  867. ListItem Class : (Inheritance: TObject)
  868. properties
  869. Caption: boolean - The text of this listitem
  870. Checked: boolean - Determines if the checkbox is checked (if it has a checkbox)
  871. SubItems: Strings - The Strings object that hold the subitems
  872. Selected: boolean - Returns true if selected
  873. Index: integer - The index in the Items object of the owner of this listitem (readonly)
  874. Owner: ListItems - The ListItems object that owns this ListItem (readonly)
  875. methods
  876. delete()
  877. getCaption() : Returns the first columns string of the listitem
  878. setCaption(string) : Sets the first column string of the listitem
  879. getChecked() : Returns true if the listitem is checked
  880. setChecked(boolean): Sets the checkbox of the listbox to the given state
  881. getSubItems(): Returns a Strings object
  882. makeVisible(partial): Scrolls the listview so this item becomes visible (Cheat Engine 6.4 and later)
  883. ListItems class : (Inheritance: TObject)
  884. properties
  885. Count : Integer - The number of ListItems this object holds (Normally read only, but writable if OwnerData is true in the listview)
  886. Item[]: ListItem[] - Array to access each ListItem object
  887. [] = Item[]
  888. methods
  889. clear()
  890. getCount()
  891. getItem(integer) : Return the listitem object at the given index
  892. add(): Returns a new ListItem object
  893. Listview Class : (Inheritance: WinControl->Control->Component->Object)
  894. createListView(owner): Creates a ListView class object which belongs to the given owner. Owner can be any object inherited from WinControl
  895. properties
  896. Columns: ListColumns - The Listcolumns object of the listview (Readonly)
  897. Items: ListItems - The ListItems objects of the listview
  898. ItemIndex: integer - The currently selected index in the Items object (-1 if nothing is selected)
  899. Selected: ListItem - The currently selected listitem (nil if nothing is selected)
  900. Canvas: Canvas - The canvas object used to render the listview (Readonly)
  901. AutoWidthLastColumn: Boolean - When set to true the last column will resize when the control resizes
  902. HideSelection: Boolean - When set to true the selection will not hide when the focus leaves the control
  903. RowSelect: Boolean - When set to true the whole row will be selected instead of just the first column
  904. OwnerData: Boolean - When set to true the listview will call the onData function for every line being displayed. Use Items.Count to set the number of virtual lines
  905. OnData: function(sender, ListItem) - Called when a listview with OwnerData true renders a line
  906. methods
  907. clear()
  908. getColumns() : ListColumns - Returns a ListColumns object
  909. getItems(): ListItems - Returns a ListItems object
  910. getItemIndex(): integer - Returns the currently selected index in the Items object
  911. setItemIndex(index: integer)- Sets the current itemindex
  912. getCanvas() : Canvas - Returns the canvas object used to render the listview
  913. beginUpdate() - Tells the listview to stop updating while you're busy
  914. endUpdate() - Applies all updates between beginUpdate and endUpdate
  915. TreeNode class : (Inheritance: TObject)
  916. properties
  917. Text: string - The text of the treenode
  918. Parent: Treenode - The treenode this object is a child of. (can be nil) (ReadOnly)
  919. Level: Integer - The level this node is at
  920. HasChildren: boolean - Set to true if it has children, or you wish it to have an expand sign
  921. Expanded: boolean - Set to true if it has been expanded
  922. Count : Integer - The number of children this node has
  923. Items[]: Treenode - Array to access the child nodes of this node
  924. [] = Items[]
  925. Index: Integer - The index based on the parent
  926. AbsoluteIndex: Integer - The index based on the TreeView's Treenodes object (Items)
  927. Selected: Boolean - Set to true if currently selected
  928. MultiSelected: Boolean - Set to true if selected as well, but not the main selected object
  929. Data: Pointer - Space to store 4 or 8 bytes depending on which version of CE is used
  930. methods
  931. delete()
  932. deleteChildren()
  933. makeVisible()
  934. expand(recursive:boolean=TRUE OPTIONAL) : Expands the given node
  935. collapse(recursive:boolean=TRUE OPTIONAL) : collapses the given node
  936. getNextSibling(): Returns the treenode object that's behind this treenode on the same level
  937. add(text:string): Returns a Treenode object that is a child of the treenode used to create it
  938. TreeNodes class : (Inheritance: TObject)
  939. properties
  940. Count : Integer - The total number of Treenodes this object has
  941. Item[]: TreeNode - Array to access each node
  942. [] = Item[]
  943. methods
  944. clear()
  945. getCount()
  946. getItem(integer) : Return the TreeNode object at the given index (based on the TreeView's Treenodes)
  947. add(text:string): Returns a new root Treenode object
  948. insert(treenode, string): Returns a new treenode object that has been inserted before the given treenode
  949. insertBehind(treenode, string): Returns a new treenode object that has been inserted after the given treenode
  950. Treeview Class : (Inheritance: CustomControl->WinControl->Control->Component->Object)
  951. createTreeView(owner)
  952. properties
  953. Items: TreeNodes - The Treenodes object of the treeview (ReadOnly)
  954. Selected: TreeNode - The currently selected treenode
  955. methods
  956. beginUpdate()
  957. endUpdate()
  958. getItems()
  959. getSelected()
  960. setSelected()
  961. fullCollapse() : Collapses all the nodes, including the children's nodes
  962. fullExpand() : Expands all the nodes and all their children
  963. saveToFile(filename): Saves the contents of the treeview to disk
  964. Timer Class : (Inheritance: Component->object)
  965. createTimer(owner OPT, enabled OPT):
  966. Creates a timer object. If enabled is not given it will be enabled by default (will start as soon as an onTimer event has been assigned)
  967. Owner may be nil, but you will be responsible for destroying it instead of being the responsibility of the owner object)
  968. properties
  969. Interval: integer - The number of milliseconds (1000=1 second) between executions
  970. Enabled: boolean
  971. OnTimer: function(timer) - The function to call when the timer triggers
  972. methods
  973. getInterval()
  974. setInterval(interval) : Sets the speed on how often the timer should trigger. In milliseconds (1000=1 second)
  975. getOnTimer()
  976. setOnTimer(function(timer))
  977. getEnabled()
  978. setEnabled(boolean)
  979. CustomControl class (CustomControl->WinControl->Control->Component->Object)
  980. properties
  981. Canvas : The canvas object for drawing on the control/. Readonly
  982. methods
  983. getCanvas() : Returns the Canvas object for the given object that has inherited from customControl
  984. Canvas Class : (Inheritance: CustomCanvas->Object)
  985. properties
  986. Brush: Brush - The brush object
  987. Pen: Pen - The pen object
  988. Font: Font - The font object
  989. Width: integer - Width of the canvas
  990. Height: integer - Height of the canvas
  991. methods
  992. getBrush(): Returns the brush object of this canvas
  993. getPen(): Returns the pen object of this canvas
  994. getFont(): Returns the font object of this canvas
  995. getWidth()
  996. getHeight()
  997. getPenPosition()
  998. setPenPosition(x,y)
  999. clear() - Clears the canvas
  1000. line(sourcex, sourcey, destinationx, destinationy)
  1001. lineTo(destinationx, destinationy)
  1002. rect(x1,y1,x2,y2)
  1003. fillRect(x1,y1,x2,y2)
  1004. textOut(x,y, text)
  1005. getTextWidth(text)
  1006. getTextHeight(text)
  1007. getPixel(x,y)
  1008. setPixel(x,y,color)
  1009. floodFill(x,y)
  1010. ellipse(x1,y1,x2,y2)
  1011. gradientFill(x1,y1,x2,y2, startcolor, stopcolor, direction) : Gradient fills a rectangle. Direction can be 0 or 1. 0=Vertical 1=Horizontal
  1012. copyRect(dest_x1,dest_y1,dest_x2,dest_y2, sourceCanvas, source_x1,source_y1,source_x2,source_y2) : Draws an image from one source to another. Useful in cases of doublebuffering
  1013. draw(x,y, graphic) : Draw the image of a specific Graphic class
  1014. getClipRect() : Returns a table containing the fields Left, Top, Right and Bottom, which define the invalidated region of the graphical object. Use this to only render what needs to be rendered in the onPaint event of objects
  1015. Pen Class : (Inheritance: CustomPen->CanvasHelper->Object)
  1016. properties
  1017. Color: Integer - The color of the pen
  1018. Width: integer - Thickness of the pen
  1019. methods
  1020. getColor()
  1021. setColor(color)
  1022. getWidth()
  1023. setWidth(width)
  1024. Brush Class : (Inheritance: CustomBrush->CanvasHelper->Object)
  1025. properties
  1026. Color : Integer
  1027. methods
  1028. getColor()
  1029. setColor()
  1030. Font Class : (Inheritance: CustomFont->CanvasHelper->Object)
  1031. createFont(): Returns a font object (default initialized based on the main ce window)
  1032. properties
  1033. Name: string
  1034. Size: integer
  1035. Color: integer
  1036. methods
  1037. getName(): Gets the fontname of the font
  1038. setName(string): Sets the fontname of the font
  1039. getSize(): Gets the size of the font
  1040. setSize(integer): Sets the size of the font
  1041. getColor(): Gets the color of the font
  1042. setColor(integer): Sets the color of the font
  1043. assign(font): Copies the contents of the font given as parameter to this font
  1044. Graphic Class : (Inheritance: Object) : Abstract class
  1045. properties
  1046. Width: integer
  1047. Height: integer
  1048. Transparent: boolean
  1049. methods
  1050. getWidth(graphic): Gets the current width in pixels of this graphics object
  1051. setWidth(graphic, width): Sets thw width in pixels
  1052. getHeight(graphic)
  1053. setHeight(graphic, height)
  1054. RasterImage class: (Inheritance: Graphic->Object) : Base class for some graphical controls
  1055. properties
  1056. Canvas: Canvas
  1057. PixelFormat: PixelFormat - the pixelformat for this image. Will clear the current image if it had one. Supported pixelformats: pf1bit, pf4bit, pf8bit, pf15bit, pf16bit, pf24bit, pf32bit (recommended)
  1058. TransparentColor: integer
  1059. methods
  1060. getCanvas(): Returns the Canvas object for this image
  1061. getPixelFormat(): Returns the current pixelformat
  1062. getPixelFormat(pixelformat): Sets the pixelformat for this image. Will clear the current image if it had one. Supported pixelformats: pf1bit, pf4bit, pf8bit, pf15bit, pf16bit, pf24bit, pf32bit (recommended)
  1063. setTransparentColor(integer): Sets the color that will be rendered as transparent when drawn
  1064. getTransparentColor(): Returns the color set to be transparent
  1065. Bitmap class: (Inheritance: CustomBitmap->RasterImage->Graphic->Object) : Bitmap based Graphic object
  1066. createBitmap(width, height) - Returns a Bitmap object
  1067. PortableNetworkGraphic Class: (Inheritence: CustomBitmap->RasterImage->Graphic->Object)
  1068. createPNG(width, height) - Returns a PortableNetworkGraphic object
  1069. JpegImage Class: (Inheritence: CustomBitmap->RasterImage->Graphic->Object)
  1070. createJpeg(width, height) - Returns a Jpeg object
  1071. Icon Class: (Inheritence: CustomBitmap->RasterImage->Graphic->Object)
  1072. createIcon(width, height) - Returns an Icon object
  1073. Picture Class : (Inheritance: Object) : Container for the Graphic class
  1074. createPicture() : Returns a empty picture object
  1075. properties
  1076. Graphic
  1077. PNG
  1078. Bitmap
  1079. Jpeg
  1080. Icon
  1081. methods
  1082. loadFromFile(filename)
  1083. saveToFile(filename)
  1084. loadFromStream(stream, originalextension OPTIONAL) : Loads a picture from a stream. Note that the stream position must be set to the start of the picture
  1085. assign(sourcepicture)
  1086. GenericHotkey Class : (Inheritance: Object)
  1087. createHotkey(function, keys, ...) : returns an initialized GenericHotkey class object. Maximum of 5 keys
  1088. createHotkey(function, {keys, ...}) : ^
  1089. properties
  1090. DelayBetweenActivate: integer - Interval in milliseconds that determines the minimum time between hotkey activations. If 0, the global delay is used
  1091. onHotkey: The function to call when the hotkey is pressed
  1092. methods
  1093. getKeys()
  1094. setKeys(key, ....)
  1095. setOnHotkey(table)
  1096. getOnHotkey
  1097. CommonDialog class:
  1098. properties
  1099. OnShow: function(sender)
  1100. OnClose: function(sender)
  1101. Title: string - The caption at top of the dialog
  1102. methods
  1103. Execute() : Shows the dialog and return true/false depending on the dialog
  1104. FindDialog Class: (Inheritance: CommonDialog->Component->Object)
  1105. properties
  1106. FindText: String - The text the user wishes to find
  1107. Options: Enum - Find Options
  1108. { frDown, frFindNext, frHideMatchCase, frHideWholeWord,
  1109. frHideUpDown, frMatchCase, frDisableMatchCase, frDisableUpDown,
  1110. frDisableWholeWord, frReplace, frReplaceAll, frWholeWord, frShowHelp,
  1111. frEntireScope, frHideEntireScope, frPromptOnReplace, frHidePromptOnReplace }
  1112. OnFind: function (sender) - Called when the find button has been clicked
  1113. OnHelp: function (sender) - Called when the help button is visible (see Options) and clicked
  1114. methods
  1115. FileDialog Class: (Inheritance: CommonDialog->Component->Object)
  1116. properties
  1117. DefaultExt: string - When not using filters this will be the default extention used if no extension is given
  1118. Files: Strings - Stringlist containing all selected files if multiple files are selected
  1119. FileName: string - The filename that was selected
  1120. Filter: string - A filter formatted string
  1121. FilterIndex: integer - The index of which filter to use
  1122. InitialDir: string - Sets the folder the filedialog will show first
  1123. methods
  1124. OpenDialog Class: (Inheritance: FileDialog->CommonDialog->Component->Object)
  1125. createOpenDialog(owner) : Creates an opendialog object
  1126. properties
  1127. Options: String
  1128. A string formatted as "[param1, param2, param3]" to set OpenDialogs options
  1129. Valid parameters are:
  1130. ofReadOnly,
  1131. ofOverwritePrompt : if selected file exists shows a message, that file will be overwritten
  1132. ofHideReadOnly : hide read only file
  1133. ofNoChangeDir : do not change current directory
  1134. ofShowHelp : show a help button
  1135. ofNoValidate
  1136. ofAllowMultiSelect : allow multiselection
  1137. ofExtensionDifferent
  1138. ofPathMustExist : shows an error message if selected path does not exist
  1139. ofFileMustExist : shows an error message if selected file does not exist
  1140. ofCreatePrompt
  1141. ofShareAware
  1142. ofNoReadOnlyReturn : do not return filenames that are readonly
  1143. ofNoTestFileCreate
  1144. ofNoNetworkButton
  1145. ofNoLongNames
  1146. ofOldStyleDialog
  1147. ofNoDereferenceLinks : do not expand filenames
  1148. ofEnableIncludeNotify
  1149. ofEnableSizing : dialog can be resized, e.g. via the mouse
  1150. ofDontAddToRecent : do not add the path to the history list
  1151. ofForceShowHidden : show hidden files
  1152. ofViewDetail : details are OS and interface dependent
  1153. ofAutoPreview : details are OS and interface dependent
  1154. methods
  1155. -
  1156. SaveDialog Class: (Inheritance: OpenDialog->FileDialog->CommonDialog->Component->Object)
  1157. createSaveDialog(owner)
  1158. SelectDirectoryDialog Class: (Inheritance: OpenDialog->FileDialog->CommonDialog->Component->Object)
  1159. createSelectDirectoryDialog(owner)
  1160. Stream Class
  1161. properties
  1162. Size: integer
  1163. Position: integer
  1164. methods
  1165. copyFrom(stream, count) - Copies count bytes from the given stream to this stream
  1166. read(count): bytetable - Returns a bytetable containing the bytes of the stream. This increases the position
  1167. write(bytetable, count OPTIONAL)- Writes the given bytetable to the stream
  1168. MemoryStream Class (Inheritance: Stream->Object)
  1169. createMemoryStream()
  1170. properties
  1171. Memory: Integer - The address in Cheat Engine's memory this stream is loaded (READONLY, tends to change)
  1172. methods
  1173. loadFromFile(filename) : Replaces the contents in the memory stream with the contents of a file on disk
  1174. saveToFile(filename) : Writes the contents of the memory stream to the specified file
  1175. FileStream Class (Inheritance: HandleStream->Stream->Object)
  1176. createFileStream(filename, mode)
  1177. StringStream Class (Inheritance: Stream->Object)
  1178. createStringStream(string)
  1179. properties
  1180. DataString: The internal string
  1181. TableFile class (Inheritance: Object)
  1182. findTableFile(filename): Returns the TableFile class object for the saved file
  1183. createTableFile(filename, filepath OPTIONAL): TableFile - Add a new file to your table. If no filepath is specified, it will create a blank file. Otherwise, it will read the contents from disk.
  1184. properties
  1185. Name: string
  1186. Stream: MemoryStream
  1187. methods
  1188. delete() : Deletes this file from your table.
  1189. saveToFile(filename)
  1190. getData() : Gets a MemoryStream object
  1191. xmplayer class
  1192. The xmplayer class has already been defined as xmplayer, no need to create it manually
  1193. properties
  1194. IsPlaying : boolean - Indicator that the xmplayer is currently playing a xm file
  1195. Initialized: boolean - Indicator that the xmplayer is actually actively loaded in memory
  1196. methods
  1197. setVolume(int)
  1198. playXM(filename, OPTIONAL noloop)
  1199. playXM(tablefile, OPTIONAL noloop)
  1200. playXM(Stream, OPTIONAL noloop)
  1201. pause()
  1202. resume()
  1203. stop()
  1204. CheatComponent Class: (Inheritance: WinControl->Control->Component->Object)
  1205. The cheatcomponent class is the component used in Cheat Engine 5.x trainers
  1206. Most people will probably want to design their own components but for those that don't know much coding and use the autogenerated trainer this will be used
  1207. properties
  1208. Color: Integer - background color
  1209. Textcolor: integer - text color
  1210. Activationcolor: integer - The textcolor to show when activated is true
  1211. Activated: boolean - Toggles between the ActivationColor and the TextColor
  1212. Editleft:integer - The x position of the optional edit field
  1213. Editwidth: integer - the width of the optional edit field
  1214. Editvalue:string - The string of the optional edit field
  1215. Hotkey:string read - The hotkeypart of the cheat line
  1216. Description:string - Description part of the cheat line
  1217. Hotkeyleft: integer - The x position of the hotkey line
  1218. Descriptionleft:integer - The x position of the Description line
  1219. ShowHotkey: boolean - Decides if the hotkey label should be shown
  1220. HasEditBox: boolean - Decides if the editbox should be shown
  1221. HasCheckbox: boolean - Decides if the checkbox should be shown
  1222. Font: Font - The font to use to render the text
  1223. methods
  1224. -
  1225. MemoryRecordHotkey Class: (Inheritance: object)
  1226. The memoryrecord hotkey class is mainly readonly with the exception of the event properties to be used to automatically create trainers
  1227. Use the generic hotkey class if you wish to create your own hotkeys
  1228. properties
  1229. Owner: MemoryRecord - The memoryrecord this hotkey belongs to (ReadOnly)
  1230. Keys: Table - Table containing the keys(combination) for this hotkey
  1231. action: integer - The action that should happen when this hotkey triggers
  1232. mrhToggleActivation(0): Toggles between active/deactive
  1233. mrhToggleActivationAllowIncrease(1): Toggles between active/deactive. Allows increase when active
  1234. mrhToggleActivationAllowDecrease(2): Toggles between active/deactive. Allows decrease when active
  1235. mrhActivate(3): Sets the state to active
  1236. mrhDeactivate(4): Sets the state to deactive
  1237. mrhSetValue(5): Sets a specific value to the value properyy (see value)
  1238. mrhIncreaseValue(6): Increases the current value with the value property (see value)
  1239. mrhDecreaseValue(7): Decreases the current value with the value property (see value)
  1240. value: string - Value used depending on what kind of hotkey is used
  1241. ID: integer - Unique id of this hotkey (ReadOnly)
  1242. Description: string - The description of this hotkey
  1243. HotkeyString: string - The hotkey formatted as a string (ReadOnly)
  1244. ActivateSound: string - Tablefile name of a WAV file inside the table which will get played on activate events
  1245. DeactivateSound: string - Tablefile name of a .WAV file inside the table which will get played on deactivate events
  1246. OnHotkey: function(sender) - Function to be called when a hotkey has just been pressed
  1247. OnPostHotkey: function(sender) - Function to be called when a hotkey has been pressed and the action has been performed
  1248. methods
  1249. doHotkey: Executes the hotkey as if it got triggered by the keyboard
  1250. MemoryRecord Class:
  1251. The memoryrecord objects are the entries you see in the addresslist
  1252. properties
  1253. ID: Integer - Unique ID
  1254. Index: Integer - The index ID for this record. 0 is top. (ReadOnly)
  1255. Description: string- The description of the memory record
  1256. Address: string - Get/set the interpretable address string. Useful for simple address settings.
  1257. OffsetCount: integer - The number of offsets. Set to 0 for a normal address
  1258. Offset[] : integer - Array to access each offset
  1259. OffsetText[] : string - Array to access each offset using the interpretable text style
  1260. CurrentAddress: integer - The address the memoryrecord points to
  1261. Type: ValueType - The variable type of this record. See vtByte to vtCustom
  1262. If the type is vtString then the following properties are available:
  1263. String.Size: Number of characters in the string
  1264. String.Unicode: boolean
  1265. If the type is vtBinary then the following properties are available
  1266. Binary.Startbit: First bit to start reading from
  1267. Binary.Size : Number of bits
  1268. If the type is vtByteArray then the following properties are available
  1269. Aob.Size : Number of bytes
  1270. CustomTypeName: String - If the type is vtCustomType this will contain the name of the CustomType
  1271. Script: String - If the type is vtAutoAssembler this will contain the auto assembler script
  1272. Value: string - The value in stringform.
  1273. Selected: boolean - Set to true if selected (ReadOnly)
  1274. Active: boolean - Set to true to activate/freeze, false to deactivate/unfreeze
  1275. Color: integer
  1276. ShowAsHex: boolean - Self explanatory
  1277. ShowAsSigned: boolean - Self explanatory
  1278. AllowIncrease: boolean - Allow value increasing, unfreeze will reset it to false
  1279. AllowDecrease: boolean - Allow value decreasing, unfreeze will reset it to false
  1280. Collapsed: boolean - Set to true to collapse this record or false to expand it. Use expand/collapse methods for recursive operations.
  1281. IsGroupHeader: boolean - Set to true if the record was created as a Group Header with no address or value info. (ReadOnly)
  1282. IsReadable: boolean - Set to false if record contains an unreadable address. NOTE: This property will not be set until the value property is accessed at least once. (ReadOnly)
  1283. Count: Number of children
  1284. Child[index] : Array to access the child records
  1285. [index] = Child[index]
  1286. HotkeyCount: integer - Number of hotkeys attached to this memory record
  1287. Hotkey[] : Array to index the hotkeys
  1288. OnActivate: function(memoryrecord,before,currentstate):boolean - The function to call when the memoryrecord will change (or changed) Active to true. If before is true, not returning true will cause the activation to stop.
  1289. OnDeactivate: function(memoryrecord,before,currentstate):boolean - The function to call when the memoryrecord will change (or changed) Active to false. If before is true, not returning true will cause the deactivation to stop.
  1290. OnDestroy: function() - Called when the memoryrecord is destroyed.
  1291. DontSave: boolean - Don't save this memoryrecord and it's children
  1292. methods
  1293. getDescription()
  1294. setDescription()
  1295. getAddress() : Returns the interpretable addressstring of this record. If it is a pointer, it returns a second result as a table filled with the offsets
  1296. setAddress(string) : Sets the interpretable address string, and if offsets are provided make it a pointer
  1297. getOffsetCount(): Returns the number of offsets for this memoryrecord
  1298. setOffsetCount(integer): Lets you set the number of offsets
  1299. getOffset(index) : Gets the offset at the given index
  1300. setOffset(index, value) : Sets the offset at the given index
  1301. getCurrentAddress(): Returns the current address as an integer (the final result of the interpretable address and pointer offsets)
  1302. appendToEntry(memrec): Appends the current memory record to the given memory record
  1303. getHotkey(index): Returns the hotkey from the hotkey array
  1304. getHotkeyByID(integer): Returns the hotkey with the given id
  1305. reinterpret()
  1306. createHotkey({keys}, action, value OPTIONAL): Returns a hotkey object
  1307. global events
  1308. function onMemRecPreExecute(memoryrecord, newstate BOOLEAN):
  1309. If above function is defined it will be called before action* has been performed.
  1310. Active property is about to change to newState.
  1311. function onMemRecPostExecute(memoryrecord, newState BOOLEAN, succeeded BOOLEAN):
  1312. If above function is defined it will be called after action*.
  1313. Active property was supposed to change to newState.
  1314. If 'succeeded' is true it means that Active state has changed and is newState.
  1315. newState and succeeded are read only.
  1316. *action can be: running auto assembler script (ENABLE or DISABLE section), freezing and unfreezing.
  1317. Addresslist Class: (Inheritance: Panel->WinControl->Control->Component->Object)
  1318. properties
  1319. Count: Integer - The number of records in the table
  1320. SelCount: integer- The number of records that are selected
  1321. SelectedRecord: MemoryRecord - The main selected record
  1322. MemoryRecord[]: MemoryRecord - Array to access the individial memory records
  1323. [] = MemoryRecord - Default accessor
  1324. methods
  1325. getCount()
  1326. getMemoryRecord(index)
  1327. getMemoryRecordByDescription(description): returns a MemoryRecord object
  1328. getMemoryRecordByID(ID)
  1329. createMemoryRecord() : creates an generic cheat table entry and add it to the list
  1330. getSelectedRecords(): Returns a table containing all the selected records
  1331. doDescriptionChange() : Will show the GUI window to change the description of the selected entry
  1332. doAddressChange() : Will show the GUI window to change the address of the selected entry
  1333. doTypeChange() : Will show the GUI window to change the type of the selected entries
  1334. doValueChange() : Will show the GUI window to change the value of the selected entries
  1335. getSelectedRecord() : Gets the main selected memoryrecord
  1336. setSelectedRecord(memrec) : Sets the currently selected memoryrecord. This will unselect all other entries
  1337. MemScan Class (Inheritance: Object)
  1338. getCurrentMemscan() : Returns the current memory scan object. If tabs are used the current tab's memscan object
  1339. createMemScan(progressbar OPTIONAL) : Returns a new MemScan class object
  1340. properties
  1341. OnScanDone: function(memscan) - Set a function to be called when the scan has finished
  1342. FoundList: FoundList - The foundlist currently attached to this memscan object
  1343. OnlyOneResult: boolean - If this is set to true memscan will stop scanning after having found the first result, and written the address to "Result"
  1344. Result: Integer - If OnlyOneResult is used this will contain the address after a scan has finished
  1345. methods
  1346. firstScan(scanoption, vartype, roundingtype, input1, input2 ,startAddress ,stopAddress ,protectionflags ,alignmenttype ,"alignmentparam" ,isHexadecimalInput ,isNotABinaryString, isunicodescan, iscasesensitive);
  1347. Does an initial scan.
  1348. memscan: The MemScan object created with createMemScan
  1349. scanOption: Defines what type of scan is done. Valid values for firstscan are:
  1350. soUnknownValue: Unknown initial value scan
  1351. soExactValue: Exact Value scan
  1352. soValueBetween: Value between scan
  1353. soBiggerThan: Bigger than ... scan
  1354. soSmallerThan: smaller than ... scan
  1355. vartype: Defines the variable type. Valid variable types are:
  1356. vtByte
  1357. vtWord 2 bytes
  1358. vtDword 4 bytes
  1359. vtQword 8 bytes
  1360. vtSingle float
  1361. vtDouble
  1362. vtString
  1363. vtByteArray
  1364. vtGrouped
  1365. vtBinary
  1366. vtAll
  1367. roundingtype: Defined the way scans for exact value floating points are handled
  1368. rtRounded : Normal rounded scans. If exact value = "3" then it includes 3.0 to 3.49999999. If exact value is "3.0" it includes 3.00 to 3.0499999999
  1369. rtTruncated: Truncated algorithm. If exact value = "3" then it includes 3.0 to 3.99999999. If exact value is "3.0" it includes 3.00 to 3.099999999
  1370. rtExtremerounded: Rounded Extreme. If exact value = "3" then it includes 2.0000001 to 3.99999999. If exact value is "3.0" it includes 2.900000001 to 3.099999999
  1371. input1: If required by the scanoption this is a string of the given variable type
  1372. input2: If requires by the scanoption this is the secondary input
  1373. startAddress : The start address to scan from. You want to set this to 0
  1374. stopAddress : The address the scan should stop at. (You want to set this to 0xffffffffffffffff)
  1375. protectionflags : See aobscan about protectionflags
  1376. alignmenttype : Scan alignment type. Valid options are:
  1377. fsmNotAligned : No alignment check
  1378. fsmAligned : The address must be dividable by the value in alignmentparam
  1379. fsmLastDigits : The last digits of the address must end with the digits provided by alignmentparam
  1380. alignmentparam : String that holds the alignment parameter.
  1381. isHexadecimalInput: When true this will handle the input field as a hexadecimal string else decimal
  1382. isNotABinaryString: When true and the varType is vtBinary this will handle the input field as a decimal instead of a binary string
  1383. isunicodescan: When true and the vartype is vtString this will do a unicode (utf16) string scan else normal utf8 string
  1384. iscasesensitive : When true and the vartype is vtString this check if the case matches
  1385. nextScan(scanoption, roundingtype, input1,input2, isHexadecimalInput, isNotABinaryString, isunicodescan, iscasesensitive, ispercentagescan, savedresultname OPTIONAL);
  1386. Does a next scan based on the current addresslist and values of the previous scan or values of a saved scan
  1387. memscan: The MemScan object that has previously done a first scan
  1388. scanoption:
  1389. soExactValue: Exact Value scan
  1390. soValueBetween: Value between scan
  1391. soBiggerThan: Bigger than ... scan
  1392. soSmallerThan: smaller than ... scan
  1393. soIncreasedValue: Increased value scan
  1394. soIncreasedValueBy: Increased value by scan
  1395. soDecreasedValue: Decreased value scan
  1396. soDecreasedValueBy: Decreased value by scan
  1397. soChanged: Changed value scan
  1398. soUnchanged: Unchanged value scan
  1399. roundingtype: Defined the way scans for exact value floating points are handled
  1400. rtRounded : Normal rounded scans. If exact value = "3" then it includes 3.0 to 3.49999999. If exact value is "3.0" it includes 3.00 to 3.0499999999
  1401. rtTruncated: Truncated algoritm. If exact value = "3" then it includes 3.0 to 3.99999999. If exact value is "3.0" it includes 3.00 to 3.099999999
  1402. rtExtremerounded: Rounded Extreme. If exact value = "3" then it includes 2.0000001 to 3.99999999. If exact value is "3.0" it includes 2.900000001 to 3.099999999
  1403. input1: If required by the scanoption this is a string of the given variable type
  1404. input2: If requires by the scanoption this is the secondary input
  1405. isHexadecimalInput: When true this will handle the input field as a hexadecimal string else decimal
  1406. isNotABinaryString: When true and the varType is vtBinary this will handle the input field as a decimal instead of a binary string
  1407. isunicodescan: When true and the vartype is vtString this will do a unicode (utf16) string scan else normal utf8 string
  1408. iscasesensitive : When true and the vartype is vtString this check if the case matches
  1409. ispercentage: When true and the scanoption is of type soValueBetween, soIncreasedValueBy or soDecreasedValueBy will cause CE to do a precentage scan instead of a normal value scan
  1410. savedResultName: String that holds the name of a saved result list that should be compared against. First scan is called "FIRST"
  1411. newScan() : Clears the current results
  1412. waitTillDone() : Waits for the memscan thread(s) to finish scanning. Always use this
  1413. saveCurrentResults(name) : Save the current scanresults to a unique name for this memscan. This save can be used to compare against in a subsequent next scan
  1414. getAttachedFoundlist() : Returns a FoundList object if one is attached to this scanresults. Returns nil otherwise
  1415. setOnlyOneResult(state): If set to true before you start a scan, this will cause the scanner to only return one result. Note that it does not work with a foundlist
  1416. getOnlyResult(): Only works if returnOnlyOneResult is true. Returns nil if not found, else returns the address that was found (integer)
  1417. FoundList
  1418. The foundlist is an object that opens the current memscan's result file and provides an interface for reading out the addresses
  1419. createFoundList(memscan)
  1420. properties
  1421. Count: integer;
  1422. Address[index]
  1423. Value[index]
  1424. methods
  1425. initialize() : Call this when a memscan has finished scanning. This will open the results for reading
  1426. deinitialize() : Release the results
  1427. getCount()
  1428. getAddress(index) : Returns the address as a string
  1429. getValue(index) : Returs the value as a string
  1430. Memoryview class: (Inheritance: Form->ScrollingWinControl->CustomControl->WinControl->Control->Component->Object)
  1431. createMemoryView() - Creates a new memoryview window. This window will not receive debug events. Use getMemoryViewForm() function to get the main memoryview window
  1432. properties
  1433. DisassemblerView: The disassemblerview class of this memoryview object
  1434. HexadecimalView: The hexadecimalview class of this memoryview object
  1435. methods
  1436. -
  1437. DisassemblerviewLine class: (Inheritance: Object)
  1438. properties
  1439. Address: The current address of this line
  1440. Owner: The Disassemblerview that owns this line
  1441. methods
  1442. -
  1443. Disassemblerview class: (Inheritance: Panel->CustomControl->WinControl->Control->Component->Object)
  1444. The visual disassembler used on the memory view window
  1445. properties
  1446. SelectedAddress: integer - The currently selected address in the disassemblerview
  1447. SelectedAddress2: integer - The secondary selected address in the disassemblerview
  1448. TopAddress: Integer - The first address to show
  1449. ShowJumplines: boolean - Determines if the jumplines should be shown
  1450. OnSelectionChange: function(sender, address, address2) - Function to call when the selection has changed
  1451. OnExtraLineRender: function(sender, Address, AboveInstruction, Selected): RasterImage OPTIONAL, x OPTIONAL, y OPTIONAL
  1452. Function to call when you wish to provide the disassembler view with an extra image containing data you wish to show.
  1453. This function is called once to get an image to show above the instruction, and once to get an image to show under the instruction and optional comments.
  1454. The image for both calls must be different objects as rendering will only be done when both calls have been completed
  1455. Sender is a DisassemblerviewLine object
  1456. If no coordinates are given the image will be centered above/below the instruction
  1457. methods
  1458. -
  1459. Hexadecimal class: (Inheritance: Panel->CustomControl->WinControl->Control->Component->Object)
  1460. The visual hexadecimal object used on the memory view window
  1461. properties
  1462. OnAddressChange(hexadecimalview, function): function(hexadecimalview, address)
  1463. OnByteSelect(hexadecimalview, function): function(hexadecimalview, address, address2)
  1464. methods
  1465. -
  1466. Thread Class: (Inheritance: Object)
  1467. createNativeThread(function(Thread,...), ...) :
  1468. Executes the given function in another thread using the systems thread mechanism
  1469. The function returns the Thread class object
  1470. function declaration: function (Thread, ...)
  1471. createNativeThreadSuspended(function(Thread,...), ...) :
  1472. Same as createNativeThread but it won't run until resume is called on it
  1473. properties
  1474. name: string - This name will be shown when the thread terminated abnormally
  1475. Finished: boolean - Returns true if the thread has reached the end. Do not rely on this if the thread is freeOnTerminate(true) (which is the default)
  1476. Terminated: boolean - Returns true if the Terminate method has been called
  1477. methods
  1478. freeOnTerminate(state) :
  1479. When set to true the thread object will free itself when the function ends (default=true)
  1480. Note: Use this only from inside the thread function as the thread might have already terminated and freed itself when called
  1481. synchronize(function(thread, ...), ...) :
  1482. Called from inside the thread. This wil cause the tread to get the main thread to execute the given function and wait for it to finish.
  1483. Usually for GUI access
  1484. Returns the return value of the given function
  1485. waitfor() :
  1486. Waits for the given thread to finish (Not recommended to call this from inside the thread itself)
  1487. suspend() :
  1488. Suspend the thread's execution
  1489. resume() :
  1490. Resume the thread;s executionmm
  1491. terminate() :
  1492. Tells the thread it should terminate. The Terminated property will become true
  1493. CriticalSection class: (Inheritance: Object)
  1494. createCriticalSection(): Returns a critical section object
  1495. properties
  1496. -
  1497. methods
  1498. enter()
  1499. leave()
  1500. tryEnter(): Returns true if entered, false if not
  1501. Event class: (Inheritance: Object)
  1502. createEvent(ManualReset, InitialState): Returns an event object
  1503. properties
  1504. -
  1505. methods
  1506. resetEvent()
  1507. setEvent()
  1508. waitFor(timeout): Waits for the event to be set. Returns wrSignaled(0), wrTimeout(1), wrAbandoned(2) or wrError(3);
  1509. Semaphore class: (Inheritance: Object)
  1510. createSemaphore(count): Returns an semaphore object
  1511. properties
  1512. -
  1513. methods
  1514. acquire()
  1515. release()
  1516. MultiReadExclusiveWriteSynchronizer class: (Inheritance: Object)
  1517. createMultiReadExclusiveWriteSynchronizer(): Returns a createMultiReadExclusiveWriteSynchronizer
  1518. properties
  1519. -
  1520. methods
  1521. beginWrite()
  1522. endWrite()
  1523. beginRead()
  1524. endRead()
  1525. StructureFrm class:
  1526. createStructureForm(address)
  1527. properties:
  1528. Column[index]: structColumn - Fetches a structColumn object from the structure form
  1529. Group[index]: structGroup - Fetches a structGroup object from the structure form
  1530. methods:
  1531. structChange() : Forces a refresh
  1532. addColumn(): Adds a new column in the currently focuses group and returns it's structColumn object
  1533. addGroup(): Adds a new group and returns the structGroup object
  1534. structColumn class:
  1535. properties:
  1536. Address: integer - The current address
  1537. AddressText: string - Gets/sets the visual address
  1538. Focused: boolean - Gets/sets the focused state
  1539. methods:
  1540. focus(): focuses the current column
  1541. structGroup class:
  1542. properties:
  1543. name: string - gets the current name
  1544. box: Groupbox - Gets the groupbox object
  1545. columnCount: integer- Gets the number of columns in the group
  1546. columns[index]: structColumn - Returns the specific structColumn object
  1547. methods:
  1548. addColumns(): Adds a new columns to the specific group and returns it's structColumn objecy
  1549. Structure class related functions:
  1550. getStructureCount(): Returns the number of Global structures. (Global structures are the visible structures)
  1551. getStructure(index): Returns the Structure object at the given index
  1552. createStructure(name): Returns an empty structure object (Not yet added to the Global list. Call structure.addToGlobalStructureList manually)
  1553. structure class: (Inheritance: Object)
  1554. Properties:
  1555. Name: String - The name of the structure
  1556. Size: Integer - The number of bytes between the last element and the start. ReadOnly
  1557. Count: Integer - Number of elements in the structure. ReadOnly
  1558. Element[]: structureElement - Returns the structure element at the given index. Readonly
  1559. Methods:
  1560. getName(): Returns the name
  1561. setName(name): Sets the name
  1562. getElement(index): Returns a structureElement object (Changing offsets can change the index)
  1563. getElementByOffset(offset): Returns a structureElement object where the specified offset is at least the requested offset
  1564. addElement(): Adds a new blank structureElement and returns it
  1565. autoGuess(baseaddresstoguessfrom, offset, size)
  1566. fillFromDotNetAddress(address, changeName): Fills the structure with the layout gathered from querying .NET. If changeName is true, the structure will take the name of the .NET class. (6.4+)
  1567. beginUpdate(): Call this when you want to make multiple updates to a structure. It will speed up the update process
  1568. endUpdate(): Call this when done
  1569. addToGlobalStructureList(): Add this to the list of structures for the user to select from. (Global structures will get saved to the table)
  1570. removeFromGlobalStructureList(): Remove from the list of structures.
  1571. StructureElement class: (Inheritance: Object)
  1572. Properties:
  1573. Owner: structure - The structure this element belongs to. Readonly
  1574. Offset: integer - The offset of this element
  1575. Name: string - The name of this element
  1576. Vartype: integer - The variable type of this element
  1577. ChildStruct: structure - If not nil this element is a pointer to the structure defined here
  1578. ChildStructStart: integer - The number of bytes inside the provided childstruct. (E.g: It might point to offset 10 of a certain structure)
  1579. Bytesize: integer - The number of bytes of this element. Readonly for basic types, writable for types that require a defined length like strings and array of bytes
  1580. Methods:
  1581. getOwnerStructure(): Returns the structure this element belongs to
  1582. getOffset(): Returns the offset of this element
  1583. setOffset(offset): Sets the offset of this element
  1584. getName(): Returns the name of this element
  1585. setName(name): Sets the name of this element (tip: Leave blank if you only want to set the name of the variable)
  1586. getVartype(): Returns the variable type of this element (check Variable types in defines.lua)
  1587. setVartype(vartype)
  1588. getChildStruct()
  1589. setChildStruct(structure)
  1590. getChildStructStart()
  1591. setChildStructStart(offset)
  1592. getBytesize(): Gets the bytesize of the element. Usually returns the size of the type, except for string and aob
  1593. setBytesize(size): sets the bytesize for types that are affected (string, aob)
  1594. supportCheatEngine(attachwindow, hasclosebutton, width, height, position ,yoururl OPTIONAL, extraparameters OPTIONAL, percentageshown OPTIONAL):
  1595. Will show an advertising window which will help keep the development of Cheat Engine going.
  1596. If you provide your own url it will be shown Up to 75% of the time.
  1597. attachwindow: Type=Form : The form that the ad is attached to
  1598. hasclosebutton: Type=boolean : If true the window will have a border an a close button at top
  1599. width, height: Type=integer :
  1600. The client width and height of the window.
  1601. Prefered formats are : 120x600 , 160x600, 300x250, 468x60, 728x90 ,But you are free to use different formats
  1602. Position: Type=integer/enum: The place of the window
  1603. 0=Top, 1=Right, 2=Bottom, 3=left
  1604. Yoururl: Type=string: The url you want to show. When given instead of showing CE's ads 100% it will show your url up to 75%.
  1605. You can use it for your own income, or for updating users about new versions of your trainer or whatever you feel like
  1606. Extraparameters: Type=String : are url request parameters you can add to the default parameters (e.g trainername=mytrainer for tracking purposes)
  1607. PercentageShown: You can change the default of 75% to a smaller value like 50%
  1608. fuckCheatEngine() : Removes the ad window if it was showing
  1609. Following are some more internal functions for Cheat Engine
  1610. dbk_initialize() : Returns true if the dbk driver is loaded in memory. False if it failed for whatever reason (e.g 64-bit and not booted with unsigned driver support)
  1611. dbk_useKernelmodeOpenProcess() : Switches the internal pointer of the OpenProcess api to dbk_OpenProcess
  1612. dbk_useKernelmodeProcessMemoryAccess() : Switches the internal pointer to the ReadProcessMemory and WriteProcessMemory apis to dbk_ReadProcessMemory and dbk_WriteProcessMemory
  1613. dbk_useKernelmodeQueryMemoryRegions() : Switches the internal pointer to the QueryVirtualMemory api to dbk_QueryVirtualMemory
  1614. dbk_getPEProcess(processid) : Returns the pointer of the EProcess structure of the selected processid
  1615. dbk_getPEThread(threadid) : Gets the pointer to the EThread structure
  1616. dbk_readMSR(msr): Reads the msr
  1617. dbk_writeMSR(msr, msrvalue): Writes the msr
  1618. dbk_executeKernelMemory(address, parameter) :
  1619. Executes a routine from kernelmode (e.g a routine written there with auto assembler)
  1620. parameter can be a value or an address. It's up to your code how it's handled
  1621. dbvm_initialize(offloados OPTIONAL) : Initializes the dbvm functions (dbk_initialize also calls this) offloados is a boolean that when set will offload the system onto dbvm if it's not yet running (and only IF the dbk driver is loaded)
  1622. dbvm_readMSR(msr): See dbk_readMSR
  1623. dbvm_writeMSR(msr, value): See dbk_writeMSR
  1624. dbk_getCR0(): Returns Control Register 0
  1625. dbk_getCR3(): Returns Control Register 3 of the currently opened process
  1626. dbk_getCR4(): Returns Control Register 4
  1627. dbk_getPhysicalAddress(address): Returns the physical address of the given address
  1628. dbk_writesIgnoreWriteProtection(state): Set to true if you do not wish to initiate copy-on-write behaviour
  1629. dbvm_getCR4(): Returns the real Control Register 4 state
  1630. allocateKernelMemory(size) : Allocates a block of nonpaged memory and returns the address
  1631. freeKernelMemory(address) : Frees the given memory region
  1632. mapMemory(address, size, frompid OPTIONAL, topid OPTIONAL): maps a specific address to the usermode context from the given PID to the given PID. If the PID is 0 or not specified, the cheat engine process is selected. This functions returns 2 results. Address and MDL. The MDL you will need for unmapMemory()
  1633. unmapMemory(address, mdl)
  1634. onAPIPointerChange(function): Registers a callback when an api pointer is changed (can happen when the user clicks ok in settings, or when dbk_use*** is used. Does NOT happen when setAPIPointer is called)
  1635. setAPIPointer(functionid, address): Sets the pointer of the given api to the given address. The address can be a predefined address set at initialization by Cheat Engine, or an address you got from an autoassembler script or injected dll (When Cheat Engine itself was targeted)
  1636. functionid:
  1637. 0: OpenProcess
  1638. Known compatible address defines:
  1639. windows_OpenProcess
  1640. dbk_OpenProcess
  1641. 1: ReadProcessMemory
  1642. Known compatible address defines:
  1643. windows_ReadProcessMemory
  1644. dbk_ReadProcessMemory
  1645. dbk_ReadPhysicalMemory
  1646. dbvm_ReadPhysicalMemory
  1647. 2: WriteProcessMemory
  1648. Known compatible address defines:
  1649. windows_WriteProcessMemory
  1650. dbk_WriteProcessMemory
  1651. dbk_WritePhysicalMemory
  1652. dbvm_WritePhysicalMemory
  1653. 3: VirtualQueryEx
  1654. Known compatible address defines:
  1655. windows_VirtualQueryEx
  1656. dbk_VirtualQueryEx
  1657. VirtualQueryExPhysical
  1658. Extra variables defined:
  1659. dbk_NtOpenProcess : Address of the NtOpenProcess implementation in DBK32
  1660. The dbvm_ addresses should only be used with auto assembler scripts injected into Cheat Engine
  1661. dbvm_block_interrupts : Address of function dbvm_block_interrupts : DWORD; stdcall;
  1662. dbvm_raise_privilege : Address of function dbvm_raise_privilege : DWORD; stdcall;
  1663. dbvm_restore_interrupts: Address of function dbvm_restore_interrupts : DWORD; stdcall;
  1664. dbvm_changeselectors : Address of function dbvm_changeselectors(cs,ss,ds,es,fs,gs: dword): DWORD; stdcall;
  1665. D3DHOOK class:
  1666. The d3dhook functions provide a method to render graphics and text inside the game, as long as it is running in directx9, 10 or 11
  1667. createD3DHook(textureandcommandlistsize OPTIONAL, hookmessages OPTIONAL)
  1668. Hooks direct3d and allocates a buffer with given size for storage of for the rendercommand list
  1669. hookmessages defines if you want to hook the windows message handler for the direct3d window. The d3dhook_onClick function makes use of that
  1670. If no size is provided 16MB is used and hookmessages is true
  1671. Note: You can call this only once for a process
  1672. It returns a d3dhook object
  1673. properties
  1674. Width: Integer : The width of the screen (readonly)
  1675. Height: integer: The height of the screen (readonly)
  1676. DisabledZBuffer: boolean : Set this to true if you don't want previously rendered walls to overlap a newly rendered object (e.g map is rendered first, then the players are rendered)
  1677. WireframeMode: boolean : Set this to true if you don't want the faces of 3d objects to be filled
  1678. MouseClip: boolean : Set this if to true if you have one of those games where your mouse can go outside of the gamewindow and you don't want that.
  1679. OnClick: function(d3dhook_sprite, x, y)
  1680. A function to be called when clicked on an sprite (excluding the mouse)
  1681. x and y are coordinates in the sprite object. If sprites overlap the highest zorder sprite will be given. It does NOT care if a transparent part is clicked or not
  1682. Note: If you set this it can cause a slowdown in the game if there are a lot of sprites and you press the left button a lot
  1683. OnKeyDown: function(virtualkey, char)
  1684. function(vkey, char) : boolean
  1685. A function to be called when a key is pressed in the game window (Not compatible with DirectInput8)
  1686. Return false if you do not wish this key event to pass down to the game
  1687. methods
  1688. beginUpdate() : Use this function when you intent to update multiple sprites,textcontainers or textures. Otherwise artifacts may occur (sprite 1 might be drawn at the new location while sprite 2 might still be at the old location when a frame is rendered)
  1689. endUpdate() : When done updating, call this function to apply the changes
  1690. enableConsole(virtualkey): Adds a (lua)console to the specific game. The given key will bring it up (0xc0=tilde)
  1691. createTexture(filename) : Returns a d3dhook_texture object
  1692. createTexture(picture, transparentColor OPTIONAL): Returns a d3dhook_texture object
  1693. if the picture is not a transparent image the transparentcolor parameter can be used to make one of it's colors transparent
  1694. createFontmap(font) : Returns a d3dhook_fontmap object created from the given font
  1695. createSprite(d3dhook_texture): returns a d3dhook_sprite object that uses the given texture for rendering
  1696. createTextContainer(d3dhook_fontmap, x, y, text): Returns a d3dhook_textContainer object
  1697. D3DHook_Texture Class (Inheritance: Object)
  1698. This class controls the texture in memory. Without a sprite to use it, it won't show
  1699. properties
  1700. Height: integer (ReadOnly)
  1701. Width: integer (ReadOnly)
  1702. methods
  1703. loadTextureByPicture(picture)
  1704. D3DHook_FontMap Class (Inheritance: D3DHook_Texture->Object)
  1705. A fontmap is a texture that contains extra data regarding the characters. This class is used by the textcontainer
  1706. Current implementation only supports 96 characters (character 32 to 127)
  1707. properties
  1708. -
  1709. methods
  1710. changeFont(font): Changes the fontmap to the selected font
  1711. getTextWidth(string): Returns the width of the given string in pixels
  1712. D3DHook_RenderObject Class (Inheritance: Object)
  1713. The renderobject is the abstract class used to control in what manner objects are rendered.
  1714. The sprite and TextContainer classed inherit from this
  1715. properties
  1716. X: Float - The x-coordinate of the object on the screen
  1717. Y: Float - The y-coordinate of the object on the screen
  1718. CenterX: Float - X coordinate inside the object. It defines the rotation spot and affects the X position
  1719. CenterY: Float - Y " "
  1720. Rotation: Float - Rotation value in degrees (0 and 360 are the same)
  1721. Alphablend: Float - Alphablend value. 1.0 is fully visible, 0.0=invisible
  1722. Visible: boolean - Set to false to hide the object
  1723. ZOrder: integer - Determines if the object will be shown in front or behind another object
  1724. methods
  1725. -
  1726. D3DHook_Sprite Class (Inheritance: D3DHook_RenderObject->Object)
  1727. A d3dhook_sprite class is a visible texture on the screen.
  1728. properties
  1729. Width: Integer - The width of the sprite in pixels. Default is the initial texture width
  1730. Height: Integer - The height of the sprite in pixels. Default is the initial texture height
  1731. Texture: d3dhook_texture - The texture to show on the screen
  1732. methods
  1733. -
  1734. D3Dhook_TextContainer Class (Inheritance: D3DHook_RenderObject->Object)
  1735. A d3dhook_sprite class draws a piece of text on the screen based on the used fontmap.
  1736. While you could use a texture with the text, updating a texture in memory is slow. So if you wish to do a lot of text updates, use a textcontainer
  1737. properties
  1738. FontMap : The D3DHook_FontMap object to use for rendering text
  1739. Text : The text to render
  1740. methods
  1741. -
  1742. Disassembler Class (Inheritance: Object)
  1743. createDisassembler() - Creates a disassembler object that can be used to disassemble an instruction and at the same time get more data
  1744. getDefaultDisassembler() - Returns the default disassembler object used by a lot of ce's disassembler routines
  1745. getVisibleDisassembler() - Returns the disassembler used by the disassemblerview. Special codes are: {H}=Hex value {R}=Register {S}=Symbol {N}=Nothing special
  1746. registerGlobalDisassembleOverride(function(sender: Disassembler, address: integer, LastDisassembleData: Table): opcode, description): Same as Disassembler.OnDisassembleOverride, but does it for all disassemblers, including newly created ones. Tip: Check the sender to see if you should use syntax highlighting codes or not
  1747. This function returns an ID you can pass on to unregisterGlobalDisassembleOverride() 6.4+
  1748. unregisterGlobalDisassembleOverride(id)
  1749. properties
  1750. LastDisassembleData : Table
  1751. OnDisassembleOverride: function(sender: Disassembler, address: integer, LastDisassembleData: Table): opcode, description
  1752. syntaxhighlighting: boolean : This property is set if the syntax highlighting codes are accepted or not
  1753. Methods
  1754. disassemble(address): Disassembles the given instruction and returns the opcode. It also fills in a LastDisassembleData record
  1755. decodeLastParametersToString() : Returns the unedited "Comments" information. Does not display userdefined comments
  1756. getLastDisassembleData() : Returns the LastDisassembleData table.
  1757. The table is build-up as follow:
  1758. address: integer - The address that was disassembled
  1759. opcode: string - The opcode without parameters
  1760. parameters: string - The parameters
  1761. description: string - The description of this opcode
  1762. bytes: table - A table containing the bytes this instruction consists of (1.. )
  1763. modrmValueType: DisAssemblerValueType - Defines the type of the modrmValue field (dvtNone=0, dvtAddress=1, dvtValue=2)
  1764. modrmValue: Integer - The value that the modrm specified. modrmValueType defines what kind of value
  1765. parameterValueType: DisAssemblerValueType
  1766. parameterValue: Integer - The value that the parameter part specified
  1767. isJump: boolean - Set to true if the disassembled instruction can change the EIP/RIP (not ret)
  1768. isCall: boolean - Set to true if it's a Call
  1769. isRet: boolean - Set to true if it's a Ret
  1770. isConditionalJump: boolean - Set to true if it's a conditional jump
  1771. DissectCode class: (Inheritance: Object)
  1772. getDissectCode() : Creates or returns the current code DissectCode object
  1773. properties:
  1774. methods:
  1775. clear() : Clears all data
  1776. dissect(modulename) : Dissects the memory of a module
  1777. dissect(base,size) : Dissect the specified memory region
  1778. addReference(fromAddress, ToAddress, type, OPTIONAL isstring):
  1779. Adds a reference. Type can be jtCall, jtUnconditional, jtConditional, jtMemory
  1780. In case of jtMemory setting isstring to true will add it to the referenced strings list
  1781. deleteReference(fromAddress, ToAddress)
  1782. getReferences(address) : Returns a table containing the addresses that reference this address and the type
  1783. getReferencedStrings(): Returns a table of addresses and their strings that have been referenced. Use getReferences to find out which addresses that are
  1784. getReferencedFunctions(): Returns a table of functions that have been referenced. Use getReferences to find out which callers that are
  1785. saveToFile(filename)
  1786. loadFromFile(filename)
  1787. RIPRelativeScanner class: (Inheritance: Object)
  1788. createRipRelativeScanner(startaddress, stopaddress, includejumpsandcalls OPTIONAL):
  1789. createRipRelativeScanner(modulename, includejumpsandcalls OPTIONAL): Creates a RIP relative scanner. This will scan the provided module for RIP relative instructions which you can use for whatever you like
  1790. properties:
  1791. Count: integer - The number of instructions found that have a RIP relative address
  1792. Address[]: integer - An array to access the results. The address is the address of the RIP relative offset in the instruction
  1793. methods:
  1794. -
  1795. LuaPipe class: (Inheritance: Object)
  1796. Abstract class that LuaPipeServer and LuaPipeclient inherit from. It implements the data transmission methods
  1797. properties
  1798. Connected: boolean: True if the pipe is connected
  1799. methods
  1800. lock() : Acquire a lick on this pipe till unlock is called. If lock can not be acquired, wait. Recursive calls are allowed
  1801. unlock()
  1802. writeBytes(ByteTable, size OPTIONAL): Writes the provided byte table to the pipe. if size is not provided, the whole table is sent. Returns the number of bytes sent, or nil on failure
  1803. readBytes(size: integer): returns a byte table from the pipe, or nil on failure
  1804. readDouble(): Read a double from the pipe, nil on failure
  1805. readFloat(): Read a float from the pipe, nil on failure
  1806. readQword(): Read an 8 byte value from the pipe, nil on failure
  1807. readDword(): Read a 4 byte value from the pipe, nil on failure
  1808. readWord(): Read a 2 byte value from the pipe, nil on failure
  1809. readByte(): Read a byte from the pipe, nil on failure
  1810. readString(size: integer): Reads a string from the pipe, nil on failure. (Can support 0-byte chars)
  1811. readWideString(size: integer): Reads a widestring from the pipe, nil on failure
  1812. writeDouble(v: double): Writes a double to the pipe. Returns the number of bytes sent, nil on failure
  1813. writeFloat(v: single): writes a float to the pipe. Returns the number of bytes sent, nil on failure
  1814. writeQword(v: qword): writes an 8 byte value to the pipe. Returns the number of bytes sent, nil on failure
  1815. writeDword(v: dword): writes a 4 byte value to the pipe. Returns the number of bytes sent, nil on failure
  1816. writeWord(v: word): writes a word to the pipe. Returns the number of bytes sent, nil on failure
  1817. writeByte(v: byte): writes a byte to the pipe. Returns the number of bytes sent, nil on failure
  1818. writeString(str: string; include0terminator: boolean OPTIONAL); Writes a string to the pipe. If include0terminator is false or not provided it will not write the 0 terminator byte. Returns the number of bytes written, or nil on failure
  1819. writeWideString(str: widestring; include0terminator: boolean OPTIONAL); Writes a widestring to the pipe. If include0terminator is false or not provided it will not write the 0 terminator bytes. Returns the number of bytes written, or nil on failure
  1820. LuaPipeClient class: (Inheritance: LuaPipe>Object)
  1821. Class implementing a client that connects to a pipe
  1822. connectToPipe(pipename): Returns a LuaPipeClient connected to the given pipename. Nil if the connection fails
  1823. properties:
  1824. methods:
  1825. -
  1826. LuaPipeServer Class: (Inheritance: LuaPipe>Object)
  1827. Class launching the server side of a pipe
  1828. createPipe(pipename, inputsize OPTIONAL, outputsize OPTIONAL) : Creates a LuaPipeServer which can be connected to by a pipe client. InputSize and Outputsize define buffers how much data can be in the specific buffer before the writer halts. Default input and output size is 4096 for both
  1829. properties
  1830. valid: boolean - Returns true if the pipe has been created properly. False on failure (e.g wrong pipename)
  1831. methods
  1832. acceptConnection() - Waits for a client to connect to this pipe (Warning: Freezes the thread this is executed in)
  1833. openLuaServer(Name):
  1834. Opens a pipe with the given name. The LuaClient dll needs this name to connect to ce
  1835. LuaClient.dll functions: (STDCALL calling machanic)
  1836. BOOL CELUA_Initialize(char *name) : Initializes
  1837. UINT_PTR CELUA_ExecuteFunction(char *luacode, UINT_PTR parameter)
  1838. This function executes a lua function with parameters (parameter) and with the luacode as body Parameter will be treated as an integer
  1839. In short:
  1840. function(parameter)
  1841. <luacode>
  1842. end
  1843. the return value of this function is the return value of the lua function (integer)
  1844. UINT_PTR CELUA_ExecuteFunctionAsync(char *luacode, UINT_PTR parameter)
  1845. See CELUA_ExecuteFunction but runs in the server thread instead of passing it to the main GUI and then wait for it's return
  1846. integer CELUA_GetFunctionReferenceFromName(char *functionname): Returns a reference ID you can pass on to CELUA_ExecuteFunctionByReference
  1847. UINT_PTR CELUA_ExecuteFunctionByReference(int refid, int paramcount, PVOID *parameters, BOOL async):
  1848. This functions executes the function specified by reference id. If async is true, the code will run in a seperate thread instead of the main thread
  1849. paramcount is the number of parameters to pass on to the function
  1850. parameters is a pointer to a list of integers. 32-bit in 32-bit targets, 64-bit in 64-bit targets
  1851. Settings class
  1852. This class can be used to read out and set settings of cheat engine and of plugins, and store your own data
  1853. global functions
  1854. getSettings(path Optional): Settings - Returns a settings object. If path is nil it will points to the Cheat Engine main settings (Registry) . If name is provided the settings currently accessed will be the one at the subkey provided
  1855. Note: Keep in mind that it returns a new object each call, even if he same name is used multiple times
  1856. properties
  1857. Path: string - Gets/Sets the current subkey (nil if main)
  1858. Value[]: A table access into the settings. e.g: Value["Count"]=12
  1859. methods
  1860. SymbolList class
  1861. This class can be used to look up an address to a symbolname, and a symbolname to an address
  1862. It can also be registered with the internal symbol handler of cheat engine
  1863. This class makes use of a special "Symbol" table construction that contains size and optionally other data
  1864. Symbol Table:
  1865. modulename: string
  1866. searchkey: string
  1867. address: integer
  1868. symbolsize: integer
  1869. Global functions
  1870. createSymbolList() : Creates an empty symbollist
  1871. Properties
  1872. Methods
  1873. clear()
  1874. getSymbolFromAddress(address) : Searches the list for the given address. The address does not have to match the exact address. As long as it falls withing the range
  1875. getSymbolFromString(searchkey)
  1876. addSymbol(modulename, searchkey, address, symbolsize, skipAddressToSymbolLookup OPTIONAL, extradata OPTIONAL)
  1877. Adds a symbol to the symbollist
  1878. extradata is a table which can be used to fill in a return type and parameters for function calls. It has the following fields:
  1879. returntype: string
  1880. parameters: string
  1881. deleteSymbol(searchkey)
  1882. deleteSymbol(address)
  1883. register() : Registers the current symbol list with the symbol handler
  1884. unregister(): Unregisters the current symbol list from the symbol handler
  1885. Pagecontrol Class (WinControl->Control->Component->Object)
  1886. This is an object that can hold multiple pages
  1887. global functions
  1888. createPageControl(owner)
  1889. properties
  1890. ShowTabs: boolean - Shows the tabs
  1891. TabIndex: integer - Gets and sets the current tab
  1892. ActivePage: TabSheet - Returns the current tabsheet.
  1893. PageCount: integer - Gets the number of pages
  1894. Page[]: TabSheet - Get a specific page (TabSheet)
  1895. methods
  1896. addTab() : TabSheet - Creates a new TabSheet
  1897. TabSheet class (WinControl->Control->Component->Object)
  1898. Part of a page control. This object can contain other objects
  1899. properties
  1900. TabIndex: integer - the current index in the pagelist of the owning pagecontrol
  1901. methods
  1902. Internet class (Object)
  1903. global functions
  1904. getInternet(string) - Returns an internet class object
  1905. properties
  1906. Header : string - the additional header to be sent with the next getURL request
  1907. methods
  1908. getURL(path) - returns a string containing the contents of the url. nil on failure
  1909. postURL(path, urlencodeddata) - posts the given data to the path and returns the results
  1910. --]]