Misc
The Misc class contains general purpose functions of common use.
TODO: Misc Constructors
Methods
Misc.AllSharedValue()
Misc.AllSharedValue()
Return
List[String]
Misc.AppendNotDupToFile(fileName, lineOfData)
Misc.AppendNotDupToFile(fileName, lineOfData)
Allows creation and append of a file within RE ValidLocations. For OSI/RE this is only the RE directory / sub-directories For CUO/RE this is only CUO or RE directory / sub-directories The filename MUST end in a limited file suffix list Checks to see if an identical line is already in the file, and does not add if it exists
Parameters
fileNameString lineOfDataString
Return
Boolean
Misc.AppendToFile(fileName, lineOfData)
Misc.AppendToFile(fileName, lineOfData)
Allows creation and append of a file within RE ValidLocations. For OSI/RE this is only the RE directory / sub-directories For CUO/RE this is only CUO or RE directory / sub-directories The filename MUST end in a limited file suffix list
Parameters
fileNameString lineOfDataString
Return
Boolean
Misc.Beep()
Misc.Beep()
Play Beep system sound.
Return
Void
Misc.CancelPrompt()
Misc.CancelPrompt()
Cancel a prompt request.
Return
Void
Misc.CaptureNow()
Misc.CaptureNow()
Creates a snapshot of the current UO window.
Return
String
The path to the saved file.
Misc.ChangeProfile(profileName)
Misc.ChangeProfile(profileName)
Allow the scripted loading of a profile
Parameters
profileNameString
Name of profile to load
Return
Void
Misc.CheckIgnoreObject(serial)
Misc.CheckIgnoreObject(serial)
Check object from ignore list, return true if present. Can check Serial, Items or Mobiles
Parameters
serialInt32 UOEntity
Serial to check.
Return
Boolean
True: Object is ignored - False: otherwise.
Misc.CheckSharedValue(name)
Misc.CheckSharedValue(name)
Check if a shared value exixts.
Parameters
nameString
Name of the value.
Return
Boolean
True: Shared value exists - False: otherwise.
Misc.ClearDragQueue()
Misc.ClearDragQueue()
Clear the Drag-n-Drop queue.
Return
Void
Misc.ClearIgnore()
Misc.ClearIgnore()
Clear ignore list from all object
Return
Void
Misc.CloseBackpack()
Misc.CloseBackpack()
Close the backpack. (OSI client only, no ClassicUO)
Return
Void
Misc.CloseMenu()
Misc.CloseMenu()
Close opened Old Menu.
Return
Void
Misc.ConfigDirectory()
Misc.ConfigDirectory()
Get the full path to the Config Directory.
Return
String
Full path to the Scripts Directory.
Misc.ContextReply(serial, respone_num)
Misc.ContextReply(serial, respone_num)
Respond to a context menu on mobile or item. Menu ID is base zero, or can use string of menu text.
Parameters
serialInt32 UOEntity
Serial of the Entity serial number of the item to get a context menu from
respone_numString Int32
Name of the Entry as wirtten in-game. Poition of the option in the menu. Starts from 0.
Return
Void
Misc.DataDirectory()
Misc.DataDirectory()
Get the full path to the Config Directory.
Return
String
Full path to the Config Directory.
Misc.DeleteFile(fileName)
Misc.DeleteFile(fileName)
Allows deletion of a file within RE ValidLocations. For OSI/RE this is only the RE directory / sub-directories For CUO/RE this is only CUO or RE directory / sub-directories The filename MUST end in a limited file suffix list
Parameters
fileNameString
Return
Boolean
Misc.Disconnect()
Misc.Disconnect()
Force client to disconnect.
Return
Void
Misc.Distance(X1, Y1, X2, Y2)
Misc.Distance(X1, Y1, X2, Y2)
Returns the UO distance between the 2 sets of co-ordinates.
Parameters
X1Int32
X co-ordinate of first place.
Y1Int32
Y co-ordinate of first place.
X2Int32
X co-ordinate of second place.
Y2Int32
Y co-ordinate of second place.
Return
Int32
Misc.DistanceSqrt(point_a, point_b)
Misc.DistanceSqrt(point_a, point_b)
Compute the distance between 2 Point3D using pythagorian.
Parameters
point_aPoint3D
First coordinates.
point_bPoint3D
Second coordinates.
Return
Double
Misc.ExportPythonAPI(path, pretty)
Misc.ExportPythonAPI(path, pretty)
Return a string containing list RE Python API list in JSON format.
Parameters
pathString
Name of the output file. (default: Config/AutoComplete.json )
prettyBoolean
Print a readable JSON. (default: True )
Return
Void
Misc.FilterSeason(enable, seasonFlag)
Misc.FilterSeason(enable, seasonFlag)
Enable or disable the Seasons filter forcing a specific season Season filter state will be saved on logout but not the season flag that will be recovered.
Parameters
enableBoolean
True: enable seasons filter
seasonFlagUInt32
0: Spring (default fallback) 1: Summer 2: Fall 3: Winter 4: Desolation
Return
Void
Misc.FocusUOWindow()
Misc.FocusUOWindow()
Set UoClient window in focus or restore if minimized.
Return
Void
Misc.GetContPosition()
Misc.GetContPosition()
Get the position of the currently active Gump/Container. (OSI client only, no ClassicUO)
Return
Point
Return X,Y coordinates as a Point2D
Misc.GetMapInfo(serial)
Misc.GetMapInfo(serial)
Get MapInfo about a Mobile or Item using the serial
Parameters
serialUInt32
Serial of the object.
Return
Misc.MapInfo
A MapInfo object.
Misc.GetMenuTitle()
Misc.GetMenuTitle()
Get the title of title for open Old Menu.
Return
String
Text of the title.
Misc.GetWindowSize()
Misc.GetWindowSize()
Get a Rectangle representing the window size. See also: https://docs.microsoft.com/dotnet/api/system.drawing.rectangle
Return
Rectangle
Rectangle object. Properties: X, Y, Width, Height.
Misc.HasMenu()
Misc.HasMenu()
Check if an Old Menu is open.
Return
Boolean
True: is open - False: otherwise
Misc.HasPrompt()
Misc.HasPrompt()
Check if have a prompt request.
Return
Boolean
True: there is a prompt - False: otherwise
Misc.HasQueryString()
Misc.HasQueryString()
Check if a have a query string menu opened, return true or false.
Return
Boolean
True: Has quesy - False: otherwise.
Misc.IgnoreObject(serial)
Misc.IgnoreObject(serial)
Add an entiry to the ignore list. Can ignore Serial, Items or Mobiles.
Parameters
serialInt32 UOEntity
Serial to ignore.
Return
Void
Misc.Inspect()
Misc.Inspect()
Prompt the user with a Target. Open the inspector for the selected target.
Return
Void
Misc.IsItem(serial)
Misc.IsItem(serial)
Determine if the serial is an item
Parameters
serialUInt32
Serial number of object to test is Item
Return
Boolean
Return True - is an Item False - is not an item
Misc.IsMobile(serial)
Misc.IsMobile(serial)
Determine if the serial is a mobile
Parameters
serialUInt32
Serial number of object to test is Mobile
Return
Boolean
Return True - is a mobile False - is not a mobile
Misc.LastHotKey()
Misc.LastHotKey()
Returns the latest HotKey recorded by razor as HotKeyEvent object.
Return
HotKeyEvent
Misc.LeftMouseClick(xpos, ypos, clientCoords)
Misc.LeftMouseClick(xpos, ypos, clientCoords)
Perform a phisical left click on the window using Windows API. Is possible to use abolute Screen Coordinates by setting clientCoords=False.
Parameters
xposInt32
X click coordinate.
yposInt32
Y click coordinate.
clientCoordsBoolean
True: Client coordinates.- False:Screen coordinates (default: True, client).
Return
Void
Misc.MenuContain(text)
Misc.MenuContain(text)
Search in open Old Menu if contains a specific text.
Parameters
textString
Text to search.
Return
Boolean
True: Text found - False: otherwise.
Misc.MenuResponse(text)
Misc.MenuResponse(text)
Perform a menu response by subitem name. If item not exist close menu.
Parameters
textString
Name of subitem to respond.
Return
Void
Misc.MouseLocation()
Misc.MouseLocation()
Returns a point with the X and Y coordinates of the mouse relative to the UO Window
Return
Point
Return X,Y coords as Point object.
Misc.MouseMove(posX, posY)
Misc.MouseMove(posX, posY)
Moves the mouse pointer to the position X,Y relative to the UO window
Parameters
posXInt32
X screen coordinate.
posYInt32
Y screen coordinate.
Return
Void
Misc.NextContPosition(x, y)
Misc.NextContPosition(x, y)
Return the X,Y of the next container, relative to the game window. (OSI client only, no ClassicUO)
Parameters
xInt32
X coordinate.
yInt32
Y coordinate.
Return
Void
Misc.NoOperation()
Misc.NoOperation()
Just do nothing and enjot the present moment.
Return
Void
Misc.NoRunStealthStatus()
Misc.NoRunStealthStatus()
Get the status of "No Run When Stealth" via scripting.
Return
Boolean
True: Open is active - False: otherwise.
Misc.NoRunStealthToggle(enable)
Misc.NoRunStealthToggle(enable)
Set "No Run When Stealth" via scripting. Changes via scripting are not persistents.
Parameters
enableBoolean
True: enable the option.
Return
Void
Misc.OpenPaperdoll()
Misc.OpenPaperdoll()
Open the backpack. (OSI client only, no ClassicUO)
Return
Void
Misc.Pause(millisec)
Misc.Pause(millisec)
Pause the script for a given amount of time.
Parameters
millisecInt32
Pause duration, in milliseconds.
Return
Void
Misc.PetRename(serial, name)
Misc.PetRename(serial, name)
Rename a specific pet.
Parameters
serialInt32 Mobile
Mobile object representing the pet. Serial of the pet.
nameString
name to assign to the pet New name to set.
Return
Void
Misc.PlaySound(sound, x, y, z)
Misc.PlaySound(sound, x, y, z)
Send a sound to the client.
Parameters
soundInt32
The sound to play.
xInt32
The x point to send sound to.
yInt32
The y point to send sound to.
zInt32
The z point to send sound to.
Return
Void
Misc.QueryStringResponse(okcancel, response)
Misc.QueryStringResponse(okcancel, response)
Perform a query string response by ok or cancel button and specific response string.
Parameters
okcancelBoolean
OK Button
responseString
Cancel Button
Return
Void
Misc.RazorDirectory()
Misc.RazorDirectory()
Get the full path to the main Razor Enhanced folder. This path maybe be different from the Python starting folder when RE is loaded as plugin (ex: ClassicUO)
Return
String
Path as text
Misc.ReadSharedValue(name)
Misc.ReadSharedValue(name)
Get a Shared Value, if value not exist return null. Shared values are accessible by every script.
Parameters
nameString
Name of the value.
Return
Object
The stored object.
Misc.RemoveLineInFile(fileName, lineOfData)
Misc.RemoveLineInFile(fileName, lineOfData)
Allows removal of a line in a file within RE ValidLocations. For OSI/RE this is only the RE directory / sub-directories For CUO/RE this is only CUO or RE directory / sub-directories The filename MUST end in a limited file suffix list Checks to see if an identical line is in the file, and if it exists, it is removed and file written
Parameters
fileNameString lineOfDataString
Return
Boolean
Misc.RemoveSharedValue(name)
Misc.RemoveSharedValue(name)
Remove a Shared Value.
Parameters
nameString
Name of the value.
Return
Void
Misc.ResetPrompt()
Misc.ResetPrompt()
Reset a prompt response.
Return
Void
Misc.ResponsePrompt(text)
Misc.ResponsePrompt(text)
Response a prompt request. Often used to rename runes and similar.
Parameters
textString
Text of the response.
Return
Void
Misc.Resync()
Misc.Resync()
Trigger a client ReSync.
Return
Void
Misc.RightMouseClick(xpos, ypos, clientCoords)
Misc.RightMouseClick(xpos, ypos, clientCoords)
Perform a phisical Right click on the window.
Parameters
xposInt32
X click coordinate.
yposInt32
Y click coordinate.
clientCoordsBoolean
True: Client coordinates - False: Screen coordinates (default: True, client).
Return
Void
Misc.ScriptCurrent(fullpath)
Misc.ScriptCurrent(fullpath)
Returns the path of the current script.
Parameters
fullpathBoolean
True:Returns the full path. False: Returns the filename. (Dafault: true)
Return
String
Misc.ScriptDirectory()
Misc.ScriptDirectory()
Get the full path to the Scripts Directory.
Return
String
Full path to the Scripts Directory.
Misc.ScriptIsSuspended(scriptfile)
Misc.ScriptIsSuspended(scriptfile)
Get status of script if is suspended or not, Script must be present in script grid.
Parameters
scriptfileString
Return
Boolean
True: Script is suspended - False: otherwise.
Misc.ScriptResume(scriptfile)
Misc.ScriptResume(scriptfile)
Resume a script by file name, Script must be present in script grid.
Parameters
scriptfileString
Name of the script.
Return
Void
Misc.ScriptRun(scriptfile)
Misc.ScriptRun(scriptfile)
Run a script by file name, Script must be present in script grid.
Parameters
scriptfileString
Name of the script.
Return
Void
Misc.ScriptStatus(scriptfile)
Misc.ScriptStatus(scriptfile)
Get status of script if running or not, Script must be present in script grid.
Parameters
scriptfileString
Return
Boolean
True: Script is running - False: otherwise.
Misc.ScriptStop(scriptfile)
Misc.ScriptStop(scriptfile)
Stop a script by file name, Script must be present in script grid.
Parameters
scriptfileString
Name of the script.
Return
Void
Misc.ScriptStopAll(skipCurrent)
Misc.ScriptStopAll(skipCurrent)
Stop all script running.
Parameters
skipCurrentBoolean
True: Stop all scripts, but the current one - False: stop all scripts. (Dafault: false)
Return
Void
Misc.ScriptSuspend(scriptfile)
Misc.ScriptSuspend(scriptfile)
Suspend a script by file name, Script must be present in script grid.
Parameters
scriptfileString
Name of the script.
Return
Void
Misc.SendMessage(msg, color, wait)
Misc.SendMessage(msg, color, wait)
Send a message to the client.
Parameters
msgString Object Single Double UInt32 Boolean Int32
The object to print.
colorBoolean Int32
Color of the message.
waitBoolean
True: Wait for confimation. - False: Returns instatnly.
Return
Void
Misc.SendToClient(keys)
Misc.SendToClient(keys)
Send to the client a list of keystrokes. Can contain control characters: - Send Control+Key: ctrl+u: ^u - Send ENTER: {Enter} Note: some keys don't work with ClassicUO (es: {Enter} )
Parameters
keysString
List of keys.
Return
Void
Misc.SetSharedValue(name, value)
Misc.SetSharedValue(name, value)
Set a Shared Value by specific name, if value exist he repalce value. Shared values are accessible by every script.
Parameters
nameString
Name of the value.
valueObject
Value to set.
Return
Void
Misc.ShardName()
Misc.ShardName()
Get the name of the shard.
Return
String
Name of the shard
Misc.UnIgnoreObject(serial)
Misc.UnIgnoreObject(serial)
Remove object from ignore list. Can remove serial, items or mobiles
Parameters
serialInt32 UOEntity
Serial to unignore. Item to unignore.
Return
Void
Misc.UseContextMenu(serial, choice, delay)
Misc.UseContextMenu(serial, choice, delay)
Open and click the option of Context menu, given the serial of Mobile or Item, via packets.
Parameters
serialInt32
Serial of the Item or Mobile.
choiceString
Option as Text or integer.
delayInt32
Maximum wait for the action to complete.
Return
Boolean
True: Optiona selected succesfully - False: otherwise.
Misc.WaitForContext(serial, delay, showContext)
Misc.WaitForContext(serial, delay, showContext)
Return the List entry of a Context menu, of Mobile or Item objects. The function will ask the server for the List and wait for a maximum amount of time.
Parameters
serialInt32 Item Mobile
Entity as Item object. Serial of the entity.
delayInt32
Maximum wait. max time to wait for context
showContextBoolean
Show context menu in-game. (default: True)
Return
List[Misc.Context]
A List of Context objects.
Misc.WaitForMenu(delay)
Misc.WaitForMenu(delay)
Pause script until server send an Old Menu, for a maximum amount of time.
Parameters
delayInt32
Maximum wait, in milliseconds.
Return
Boolean
True: if the Old Menu is open - False: otherwise.
Misc.WaitForPrompt(delay)
Misc.WaitForPrompt(delay)
Wait for a prompt for a maximum amount of time.
Parameters
delayInt32
Maximum wait time.
Return
Boolean
True: Prompt is present - False: otherwise
Misc.WaitForQueryString(delay)
Misc.WaitForQueryString(delay)
Pause script until server send query string request, for a maximum amount of time.
Parameters
delayInt32
Maximum wait, in milliseconds.
Return
Boolean
True: if player has a query - False: otherwise.