misc_func
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
misc_func [2022/03/22 21:39] – external edit 127.0.0.1 | misc_func [2025/02/25 22:20] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 67: | Line 67: | ||
|} | |} | ||
+ | |||
+ | ===== 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=" | ||
+ | |- style=" | ||
+ | |**Syntax** | ||
+ | |style=" | ||
+ | |- | ||
+ | |colspan=" | ||
+ | |- | ||
+ | |colspan=" | ||
+ | |- style=" | ||
+ | |**Returns** | ||
+ | |bool True - success False - Fail | ||
+ | |- | ||
+ | |**In Object:** | ||
+ | |Misc | ||
+ | |- style=" | ||
+ | |**Parameters: | ||
+ | |string FileName, string LineToInsert | ||
+ | |||
+ | |} | ||
+ | |||
+ | {|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 739: | 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 | ||
|} | |} | ||
Line 984: | Line 1118: | ||
|} | |} | ||
+ | |||
+ | {|style=" | ||
+ | |style=" | ||
+ | |- style=" | ||
+ | |**Syntax** | ||
+ | |style=" | ||
+ | |- | ||
+ | |colspan=" | ||
+ | |- | ||
+ | |colspan=" | ||
+ | use in your code like: | ||
+ | < | ||
+ | # | ||
+ | d = Misc.Distance(10, | ||
+ | # | ||
+ | </ | ||
+ | |- style=" | ||
+ | |**Returns** | ||
+ | |int | ||
+ | |- | ||
+ | |**In Object:** | ||
+ | |Misc | ||
+ | |- style=" | ||
+ | |**Parameters: | ||
+ | |X1 - x origin | ||
+ | |Y1 - y origin | ||
+ | |X2 - x dest | ||
+ | |Y2 - y dest | ||
+ | |||
+ | |} | ||
+ | |||
misc_func.1647985159.txt.gz · Last modified: 2022/09/03 22:41 (external edit)