User Tools

Site Tools


misc_func

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
misc_func [2022/07/05 15:02] – [File] adminmisc_func [2022/09/03 23:25] (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="font-size:85%; border:solid 2px; width: 50%;" {|style="font-size:85%; border:solid 2px; width: 50%;"
Line 114: Line 118:
 |- style="background-color:#f0f0f0;" |- style="background-color:#f0f0f0;"
 |**Parameters:** |**Parameters:**
-|string FileName +|string FileNamestring LineToInsert
-|string LineToInsert+
  
  
 |} |}
 +
 +{|style="font-size:85%; border:solid 2px; width: 50%;"
 +|style="font-size:150%;  padding: 2px" colspan="2" | **Remove a line from a file**
 +|- style="background-color:#f0f0f0;"
 +|**Syntax**
 +|style="width: 90%" | Misc.DeleteFile(string FileName)
 +|-
 +|colspan="2" |**Description:**
 +|-
 +|colspan="2" |Deletes a file
 +|- style="background-color:#f0f0f0;"
 +|**Returns**
 +|bool True - success False - Fail
 +|-
 +|**In Object:**
 +|Misc
 +|- style="background-color:#f0f0f0;"
 +|**Parameters:**
 +|string FileName
 +
 +|}
 +
  
 {|style="font-size:85%; border:solid 2px; width: 50%;" {|style="font-size:85%; border:solid 2px; width: 50%;"
Line 813: Line 838:
 |**Parameters:** |**Parameters:**
 |scriptfilename |scriptfilename
 +
 +|}
 +
 +===== Maps =====
 +{|style="font-size:85%; border:solid 2px; width: 50%;"
 +|style="font-size:150%;  padding: 2px" colspan="2" | **Co-Ordinates of a Decoded Map**
 +|- style="background-color:#f0f0f0;"
 +|**Syntax**
 +|style="width: 90%" | Misc.GetMapInfo(serial)
 +|-
 +|colspan="2" |**Description:**
 +|-
 +|colspan="2" | Retrieve the co-ordinates of a decoded t-map. Your code would look like:
 +<code>
 +#
 +mapInfo = Misc.GetMapInfo(0x400BFD6C)
 +print("Treasure at ({}, {}), Origin ({}, {}), pin at ({}, {})"
 +    .format(mapInfo.MapOrigin.X+mapInfo.PinPosition.X, mapInfo.MapOrigin.Y+mapInfo.PinPosition.Y,
 +            mapInfo.MapOrigin.X, mapInfo.MapOrigin.Y, mapInfo.PinPosition.X, mapInfo.PinPosition.Y))
 +#
 +</code>
 +
 +|- style="background-color:#f0f0f0;"
 +|**Note:**
 +|The pin position is an offset from the origin, so you have to add them to get absolute location
 +
 +|- style="background-color:#f0f0f0;"
 +|**Returns**
 +|MapInfo{ PinPosition, MapOrigin, MapEnd }
 +|-
 +|**In Object:**
 +|Misc
 +|- style="background-color:#f0f0f0;"
 +|**Parameters:**
 +|serial - Serial of the t-map
  
 |} |}
misc_func.1657033320.txt.gz · Last modified: 2022/09/03 22:41 (external edit)

Exception: Git command failed to perform periodic pull: From https://github.com/RazorEnhanced/razorenhanced.github.io * branch main -> FETCH_HEAD error

Exception: Git command failed to perform periodic pull: From https://github.com/RazorEnhanced/razorenhanced.github.io * branch main -> FETCH_HEAD error

An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the gitbacked plugin.

More info has been written to the DokuWiki error log.