Misc
The Misc class contains general purpose functions of common use.
TODO: Misc Constructors
Methods
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
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
Misc.Beep()
Play Beep system sound.
Misc.CancelPrompt()
Cancel a prompt request.
Misc.CaptureNow()
Creates a snapshot of the current UO window.
Return
StringThe path to the saved file.
Misc.ChangeProfile(profileName)
Misc.ChangeProfile(profileName)
Allow the scripted loading of a profile
Parameters
profileNameStringName of profile to load
Misc.CheckIgnoreObject(serial)
Misc.CheckIgnoreObject(serial)
Check object from ignore list, return true if present. Can check Serial, Items or Mobiles
Parameters
serialInt32
UOEntitySerial to check.
Return
BooleanTrue: Object is ignored - False: otherwise.
Misc.CheckSharedValue(name)
Misc.CheckSharedValue(name)
Check if a shared value exixts.
Parameters
nameStringName of the value.
Return
BooleanTrue: Shared value exists - False: otherwise.
Misc.ClearDragQueue()
Clear the Drag-n-Drop queue.
Misc.ClearIgnore()
Clear ignore list from all object
Misc.CloseBackpack()
Close the backpack.
(OSI client only, no ClassicUO)
Misc.CloseMenu()
Close opened Old Menu.
Misc.ConfigDirectory()
Get the full path to the Config Directory.
Return
StringFull 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
UOEntitySerial of the Entity
serial number of the item to get a context menu from
respone_numString
Int32Name of the Entry as wirtten in-game.
Poition of the option in the menu. Starts from 0.
Misc.DataDirectory()
Get the full path to the Config Directory.
Return
StringFull 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
Misc.Disconnect()
Force client to disconnect.
Misc.Distance(X1, Y1, X2, Y2)
Misc.Distance(X1, Y1, X2, Y2)
Returns the UO distance between the 2 sets of co-ordinates.
Parameters
X1Int32X co-ordinate of first place.
Y1Int32Y co-ordinate of first place.
X2Int32X co-ordinate of second place.
Y2Int32Y co-ordinate of second place.
Misc.DistanceSqrt(point_a, point_b)
Misc.DistanceSqrt(point_a, point_b)
Compute the distance between 2 Point3D using pythagorian.
Parameters
point_aPoint3DFirst coordinates.
point_bPoint3DSecond coordinates.
Misc.ExportPythonAPI(path, pretty)
Misc.ExportPythonAPI(path, pretty)
Return a string containing list RE Python API list in JSON format.
Parameters
pathStringName of the output file. (default: Config/AutoComplete.json )
prettyBooleanPrint a readable JSON. (default: True )
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
enableBooleanTrue: enable seasons filter
seasonFlagUInt320: Spring (default fallback)
1: Summer
2: Fall
3: Winter
4: Desolation
Misc.FocusUOWindow()
Set UoClient window in focus or restore if minimized.
Misc.GetContPosition()
Get the position of the currently active Gump/Container.
(OSI client only, no ClassicUO)
Return
PointReturn X,Y coordinates as a Point2D
Misc.GetMapInfo(serial)
Get MapInfo about a Mobile or Item using the serial
Parameters
serialUInt32Serial of the object.
Return
Misc.MapInfoA MapInfo object.
Misc.GetMenuTitle()
Get the title of title for open Old Menu.
Misc.GetWindowSize()
Get a Rectangle representing the window size.
See also: https://docs.microsoft.com/dotnet/api/system.drawing.rectangle
Return
RectangleRectangle object. Properties: X, Y, Width, Height.
Misc.HasMenu()
Check if an Old Menu is open.
Return
BooleanTrue: is open - False: otherwise
Misc.HasPrompt()
Check if have a prompt request.
Return
BooleanTrue: there is a prompt - False: otherwise
Misc.HasQueryString()
Check if a have a query string menu opened, return true or false.
Return
BooleanTrue: 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
UOEntitySerial to ignore.
Misc.Inspect()
Prompt the user with a Target. Open the inspector for the selected target.
Misc.IsItem(serial)
Determine if the serial is an item
Parameters
serialUInt32Serial number of object to test is Item
Return
BooleanReturn True - is an Item False - is not an item
Misc.IsMobile(serial)
Determine if the serial is a mobile
Parameters
serialUInt32Serial number of object to test is Mobile
Return
BooleanReturn True - is a mobile False - is not a mobile
Misc.LastHotKey()
Returns the latest HotKey recorded by razor as HotKeyEvent object.
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
xposInt32X click coordinate.
yposInt32Y click coordinate.
clientCoordsBooleanTrue: Client coordinates.- False:Screen coordinates (default: True, client).
Misc.MenuContain(text)
Search in open Old Menu if contains a specific text.
Parameters
textStringText to search.
Return
BooleanTrue: Text found - False: otherwise.
Misc.MenuResponse(text)
Perform a menu response by subitem name. If item not exist close menu.
Parameters
textStringName of subitem to respond.
Misc.MouseLocation()
Returns a point with the X and Y coordinates of the mouse relative to the UO Window
Return
PointReturn 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
posXInt32X screen coordinate.
posYInt32Y screen coordinate.
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
xInt32X coordinate.
yInt32Y coordinate.
Misc.NoOperation()
Just do nothing and enjot the present moment.
Misc.NoRunStealthStatus()
Misc.NoRunStealthStatus()
Get the status of "No Run When Stealth" via scripting.
Return
BooleanTrue: 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
enableBooleanTrue: enable the option.
Misc.OpenPaperdoll()
Open the backpack.
(OSI client only, no ClassicUO)
Misc.Pause(millisec)
Pause the script for a given amount of time.
Parameters
millisecInt32Pause duration, in milliseconds.
Misc.PetRename(serial, name)
Misc.PetRename(serial, name)
Rename a specific pet.
Parameters
serialInt32
MobileMobile object representing the pet.
Serial of the pet.
nameStringname to assign to the pet
New name to set.
Misc.PlaySound(sound, x, y, z)
Misc.PlaySound(sound, x, y, z)
Send a sound to the client.
Parameters
soundInt32The sound to play.
xInt32The x point to send sound to.
yInt32The y point to send sound to.
zInt32The z point to send sound to.
Misc.QueryStringResponse(okcancel, response)
Misc.QueryStringResponse(okcancel, response)
Perform a query string response by ok or cancel button and specific response string.
Parameters
okcancelBooleanOK Button
responseStringCancel Button
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)
Misc.ReadSharedValue(name)
Misc.ReadSharedValue(name)
Get a Shared Value, if value not exist return null.
Shared values are accessible by every script.
Parameters
nameStringName of the value.
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
Misc.RemoveSharedValue(name)
Misc.RemoveSharedValue(name)
Remove a Shared Value.
Parameters
nameStringName of the value.
Misc.ResetPrompt()
Reset a prompt response.
Misc.ResponsePrompt(text)
Misc.ResponsePrompt(text)
Response a prompt request. Often used to rename runes and similar.
Parameters
textStringText of the response.
Misc.Resync()
Trigger a client ReSync.
Misc.RightMouseClick(xpos, ypos, clientCoords)
Misc.RightMouseClick(xpos, ypos, clientCoords)
Perform a phisical Right click on the window.
Parameters
xposInt32X click coordinate.
yposInt32Y click coordinate.
clientCoordsBooleanTrue: Client coordinates - False: Screen coordinates (default: True, client).
Misc.ScriptCurrent(fullpath)
Misc.ScriptCurrent(fullpath)
Returns the path of the current script.
Parameters
fullpathBooleanTrue:Returns the full path. False: Returns the filename. (Dafault: true)
Misc.ScriptDirectory()
Get the full path to the Scripts Directory.
Return
StringFull 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
BooleanTrue: 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
scriptfileStringName of the script.
Misc.ScriptRun(scriptfile)
Misc.ScriptRun(scriptfile)
Run a script by file name, Script must be present in script grid.
Parameters
scriptfileStringName of the script.
Misc.ScriptStatus(scriptfile)
Misc.ScriptStatus(scriptfile)
Get status of script if running or not, Script must be present in script grid.
Parameters
scriptfileString
Return
BooleanTrue: 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
scriptfileStringName of the script.
Misc.ScriptStopAll(skipCurrent)
Misc.ScriptStopAll(skipCurrent)
Stop all script running.
Parameters
skipCurrentBooleanTrue: Stop all scripts, but the current one - False: stop all scripts. (Dafault: false)
Misc.ScriptSuspend(scriptfile)
Misc.ScriptSuspend(scriptfile)
Suspend a script by file name, Script must be present in script grid.
Parameters
scriptfileStringName of the script.
Misc.SendMessage(msg, color, wait)
Misc.SendMessage(msg, color, wait)
Send a message to the client.
Parameters
msgString
Object
Single
Double
UInt32
Boolean
Int32The object to print.
colorBoolean
Int32Color of the message.
waitBooleanTrue: Wait for confimation. - False: Returns instatnly.
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} )
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
nameStringName of the value.
valueObjectValue to set.
Misc.ShardName()
Get the name of the shard.
Misc.UnIgnoreObject(serial)
Misc.UnIgnoreObject(serial)
Remove object from ignore list. Can remove serial, items or mobiles
Parameters
serialInt32
UOEntitySerial to unignore.
Item to unignore.
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
serialInt32Serial of the Item or Mobile.
choiceStringOption as Text or integer.
delayInt32Maximum wait for the action to complete.
Return
BooleanTrue: 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
MobileEntity as Item object.
Serial of the entity.
delayInt32Maximum wait.
max time to wait for context
showContextBooleanShow context menu in-game. (default: True)
Return
List[Misc.Context]A List of Context objects.
Misc.WaitForMenu(delay)
Pause script until server send an Old Menu, for a maximum amount of time.
Parameters
delayInt32Maximum wait, in milliseconds.
Return
BooleanTrue: 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
delayInt32Maximum wait time.
Return
BooleanTrue: 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
delayInt32Maximum wait, in milliseconds.
Return
BooleanTrue: if player has a query - False: otherwise.