lua scripting reference
SysTool supports user written-scripts or macros in the lua language.
For discussion and language feature requests you can find a forum here.
SysTool lua Language extensions
You can type hex literals in the code as 0x... For example hex 1000 as 0×1000.
The AND operation is supported as & The OR operation is supported as |
SysTool API Interface
Callbacks
onload
When SysTool is loaded this function will be called.
onquit
When SysTool is shutting down this function will be called.
onsensorupdate
Every time the sensors are refreshed, this function is called.
If any of the callback functions do not exist, nothing will hapen, there will be no error.
Misc.
hex(number n)
Convert number to hexadecimal string
print_r(table t)
Recursively print a table.
trace(string s)
Sends text to the log file.
setvar(string name, value)
Set a variable in a table, arbitrary nesting levels deep.
messagebox(string text, string title)
Shows a message box to the user.
confirmbox(string text, string title)
Shows a confirmation box (Yes/No) to the user.
quit()
Terminates SysTool.
GUI
gui.showpanel(string panelname)
Switches the active panel to the one passed in panelname. Write exactly the same as displayed in the GUI.
Subpages are reached by putting “/” as seperator, ie. “Hardware Monitoring/Settings”.
Low-Level
system.iswin64()
Checks if SysTool is running on a 64-bit Windows Edition.
system.isiscurrentuserlocaladministrator()
Checks if the currently logged in user is member of the Administrators group on the local machine.
system.getmoboid()
Returns the motherboard ID from the BIOS.
system.mapmemory(number addr, number len)
Maps physical memory into the process.
system.unmapmemory(number addr)
Unmaps physical memory from a previous call to mapmemory.
system.readportuchar(number addr)
system.readportushort(number addr)
system.readportulong(number addr)
Reads an 8/16/32-bit value from a machine port.
system.writeportuchar(number addr, number data)
system.writeportushort(number addr, number data)
system.writeportulong(number addr, number data)
Writes an 8/16/32-bit value to a machine port.
system.readisauchar(number addr)
Reads an 8-bit value from ISA port 290h.
system.writeisauchar(number addr, number data)
Writes an 8-bit value to ISA port 290h.
system.readmsr(number reg)
Reads a 64-bit value from a machine specific register.
system.writemsr(number reg, number data)
Writes a 64-bit value data to a machine specific register.
system.rdtsc()
Returns the 64-bit timestamp counter value of the CPU.
system.readpciuchar(number bus, number dev, number fn, number offset)
system.readpciushort(number bus, number dev, number fn, number offset)
system.readpciulong(number bus, number dev, number fn, number offset)
Reads 8/16/32-bit data from a PCI device.
system.writepciuchar(number bus, number dev, number fn, number offset, number data)
system.writepciushort(number bus, number dev, number fn, number offset, number data)
system.writepciulong(number bus, number dev, number fn, number offset, number data)
Writes 8/16/32-bit data to a PCI device.
system.writepcibyiduchar(number mfgr, number deviceid, number offset, number data)
system.writepcibyidushort(number mfgr, number deviceid, number offset, number data)
system.writepcibyidulong(number mfgr, number deviceid, number offset, number data)
Writes 8/16/32-bit data to a PCI device.
system.pcidevexists(number mfgr, number deviceid)
Checks if a PCI device exists.
system.usleep(number delay)
Delays execution for delay microseconds.
system.sleep(number delay)
Delays execution for delay milliseconds.
system.findprocess(string name)
Checks if a process exists and returns it process id.
ATI VGA
ativga.getcatalystversion()
Returns a string which contains the Catalyst Version number.
number ativga.numcards
This variable contains the number of detected ATI cards.
ativga.cards
This table contains functions for each detected ATI card. It starts at 0.
number ativga.cards[].bus
PCI bus number (0..7).
number ativga.cards[].dev
PCI bus device (0..31).
number ativga.cards[].fn
PCI bus function number.
number ativga.cards[].deviceid
PCI Device ID.
number ativga.cards[].memsize
Memory size in bytes.
number ativga.cards[].numpipes
Number of active pixel pipelines.
string ativga.cards[].gpuname
Name of the GPU chip.
number ativga.cards[].interface
Connector type. 0=unknown, 1=PCI, 2=AGP, 3=PCI-X, 4=HTT, 5=PCI-E.
string ativga.cards[].devicename
Windows name.
string ativga.cards[].devicestring
Windows name.
string ativga.cards[].memtype
Memory type.
number ativga.cards[].coredefault
Default GPU core clock.
number ativga.cards[].memdefault
Default Memory clock.
ativga.cards[].readmmruchar(number register)
ativga.cards[].readmmrulong(number register)
Reads 8/32-bit data from a GPU register.
ativga.cards[].writemmruchar(number register, number data)
ativga.cards[].writemmrulong(number register, number data)
Writes 8/32-bit value data to a GPU register.
ativga.cards[].readpll(number index)
Reads a 32-bit value from a PLL register.
ativga.cards[].writepll(number index, number data)
Writes a 32-bit value to a PLL register.
ativga.cards[].setdefaultclocks()
Sets the clock speeds to the card’s defaults.
ativga.cards[].getclocks()
Returns the current core and memory speed.
ativga.cards[].setclocks(number core, number mem)
Sets the current core and memory speed.
ativga.cards[].supportsperfswitch()
Check if the card supports 2D/3D clocks (X1800XT and up).
ativga.cards[].selecti2cport()
Selects one of the i2c busses on the card.
ativga.cards[].readi2c()
Reads data from a device on the i2c bus.
ativga.cards[].writei2c()
Writes data to a device on the i2c bus.
CPU Information
string cpuinfo.vendorid
The vendor of the CPU.
string cpuinfo.processorname
Processor name as reported by the CPU.
number cpuinfo.stepping
CPU stepping code.
number cpuinfo.model
CPU model.
number cpuinfo.family
Family of the CPU.
number cpuinfo.brandid
BrandId of the CPU.
number cpuinfo.cpucount
Number of cores.
number cpuinfo.modelext
CPU extended model.
number cpuinfo.familyext
CPU extended family.
number cpuinfo.cpuidrevision
CPU Revision ID.
cpuinfo.getmultiplier()
Returns the current CPU multiplier.
cpuinfo.isfeaturesupported()
Checks if a certain feature is supported.
cpuinfo.execcpuid()
Executes the CPUID instruction.
