misc_func
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
misc_func [2022/07/05 14:50] – admin | misc_func [2025/02/25 22:20] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 69: | Line 69: | ||
===== File ===== | ===== File ===== | ||
+ | |||
+ | The file operations are limited, because I am paranoid of bad actors. | ||
+ | The file to be written to MUST be in the RE directory tree, or if your running CUO it can be in the CUO directory tree. Further, the file suffix has to be one of {data, xml, map, csv}. The file suffixes list could be extended, but the main thing I didn't want someone to do damage to files needed for execution. | ||
+ | |||
{|style=" | {|style=" | ||
Line 74: | Line 78: | ||
|- style=" | |- style=" | ||
|**Syntax** | |**Syntax** | ||
- | |style=" | + | |style=" |
|- | |- | ||
|colspan=" | |colspan=" | ||
Line 81: | Line 85: | ||
|- style=" | |- style=" | ||
|**Returns** | |**Returns** | ||
- | |bool True - asuccess | + | |bool True - success |
|- | |- | ||
|**In Object:** | |**In Object:** | ||
Line 91: | Line 95: | ||
|} | |} | ||
+ | {|style=" | ||
+ | |style=" | ||
+ | |- style=" | ||
+ | |**Syntax** | ||
+ | |style=" | ||
+ | |- | ||
+ | |colspan=" | ||
+ | |- | ||
+ | |colspan=" | ||
+ | use in your code like: | ||
+ | < | ||
+ | # | ||
+ | result = Misc.AppendNotDupToFile(" | ||
+ | # | ||
+ | </ | ||
+ | |- style=" | ||
+ | |**Returns** | ||
+ | |bool | ||
+ | |- | ||
+ | |**In Object:** | ||
+ | |Misc | ||
+ | |- style=" | ||
+ | |**Parameters: | ||
+ | |string FileName, string LineToInsert | ||
+ | |||
+ | |||
+ | |} | ||
+ | |||
+ | {|style=" | ||
+ | |style=" | ||
+ | |- style=" | ||
+ | |**Syntax** | ||
+ | |style=" | ||
+ | |- | ||
+ | |colspan=" | ||
+ | |- | ||
+ | |colspan=" | ||
+ | |- style=" | ||
+ | |**Returns** | ||
+ | |bool True - success False - Fail | ||
+ | |- | ||
+ | |**In Object:** | ||
+ | |Misc | ||
+ | |- style=" | ||
+ | |**Parameters: | ||
+ | |string FileName | ||
+ | |||
+ | |} | ||
+ | |||
+ | |||
+ | {|style=" | ||
+ | |style=" | ||
+ | |- style=" | ||
+ | |**Syntax** | ||
+ | |style=" | ||
+ | |- | ||
+ | |colspan=" | ||
+ | |- | ||
+ | |colspan=" | ||
+ | |- style=" | ||
+ | |**Returns** | ||
+ | |bool True - success False - Fail | ||
+ | |- | ||
+ | |**In Object:** | ||
+ | |Misc | ||
+ | |- style=" | ||
+ | |**Parameters: | ||
+ | |string FileName, string LineToInsert | ||
+ | |||
+ | |} | ||
===== System ===== | ===== System ===== | ||
Line 764: | Line 838: | ||
|**Parameters: | |**Parameters: | ||
|scriptfilename | |scriptfilename | ||
+ | |||
+ | |} | ||
+ | |||
+ | ===== Maps ===== | ||
+ | {|style=" | ||
+ | |style=" | ||
+ | |- style=" | ||
+ | |**Syntax** | ||
+ | |style=" | ||
+ | |- | ||
+ | |colspan=" | ||
+ | |- | ||
+ | |colspan=" | ||
+ | < | ||
+ | # | ||
+ | mapInfo = Misc.GetMapInfo(0x400BFD6C) | ||
+ | print(" | ||
+ | .format(mapInfo.MapOrigin.X+mapInfo.PinPosition.X, | ||
+ | mapInfo.MapOrigin.X, | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | |- style=" | ||
+ | |**Note:** | ||
+ | |The pin position is an offset from the origin, so you have to add them to get absolute location | ||
+ | |||
+ | |- style=" | ||
+ | |**Returns** | ||
+ | |MapInfo{ PinPosition, | ||
+ | |- | ||
+ | |**In Object:** | ||
+ | |Misc | ||
+ | |- style=" | ||
+ | |**Parameters: | ||
+ | |serial - Serial of the t-map | ||
|} | |} |
misc_func.1657032652.txt.gz · Last modified: 2022/09/03 22:41 (external edit)