Misc
The Misc class contains general purpose functions of common use.
TODO: Misc Constructors
Methods
Creates a snapshot of the current UO window.
Misc
.
ChangeProfile
(
profileName
)
Misc
.
ChangeProfile
(
profileName
)
Allow the scripted loading of a profile
Parameters
profileName
String
Name 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
serial
Int32
Mobile
Item
Mobile to check
Item to check
Serial to check.
Return
Boolean
True: Object is ignored - False: otherwise.
Misc
.
CheckSharedValue
(
name
)
Misc
.
CheckSharedValue
(
name
)
Check if a shared value exixts.
Parameters
name
String
Name of the value.
Return
Boolean
True: Shared value exists - False: otherwise.
Clear the Drag-n-Drop queue.
Clear ignore list from all object
Close the backpack.
(OSI client only, no ClassicUO)
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
serial
Int32
Mobile
Item
Serial of the Entity
serial number of the item to get a context menu from
respone_num
Int32
String
Name of the Entry as wirtten in-game.
Poition of the option in the menu. Starts from 0.
Get the full path to the Config Directory.
Return
String
Full path to the Config Directory.
Force client to disconnect.
Misc
.
DistanceSqrt
(
point_a
,
point_b
)
Misc
.
DistanceSqrt
(
point_a
,
point_b
)
Compute the distance between 2 Point3D using pitagora's.
Parameters
point_a
Point3D
First coordinates.
point_b
Point3D
Second coordinates.
Misc
.
ExportPythonAPI
(
path
,
pretty
)
Misc
.
ExportPythonAPI
(
path
,
pretty
)
Return a string containing list RE Python API list in JSON format.
Parameters
path
String
Name of the output file. (default: Config/AutoComplete.json )
pretty
Boolean
Print 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
enable
Boolean
True: enable seasons filter
seasonFlag
UInt32
0: Spring (default fallback)
1: Summer
2: Fall
3: Winter
4: Desolation
Set UoClient window in focus or restore if minimized.
Get the position of the currently active Gump/Container.
(OSI client only, no ClassicUO)
Return
Point
Return X,Y coordinates as a Point2D
Get MapInfo about a Mobile or Item using the serial
Parameters
serial
UInt32
Serial of the object.
Return
Misc.MapInfo
A MapInfo object.
Get the title of title for open Old Menu.
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.
Check if an Old Menu is open.
Return
Boolean
True: is open - False: otherwise
Check if have a prompt request.
Return
Boolean
True: there is a prompt - False: otherwise
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
serial
Int32
Mobile
Item
Item to ignore
Serial to ignore.
Mobile to ignore
Prompt the user with a Target. Open the inspector for the selected target.
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
xpos
Int32
X click coordinate.
ypos
Int32
Y click coordinate.
clientCoords
Boolean
True: Client coordinates.- False:Screen coordinates (default: True, client).
Search in open Old Menu if contains a specific text.
Parameters
text
String
Text to search.
Return
Boolean
True: Text found - False: otherwise.
Perform a menu response by subitem name. If item not exist close menu.
Parameters
text
String
Name of subitem to respond.
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
posX
Int32
X screen coordinate.
posY
Int32
Y 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)
Just do nothing and enjot the present moment.
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
enable
Boolean
True: enable the option.
Open the backpack.
(OSI client only, no ClassicUO)
Pause the script for a given amount of time.
Parameters
millisec
Int32
Pause duration, in milliseconds.
Misc
.
PetRename
(
serial
,
name
)
Misc
.
PetRename
(
serial
,
name
)
Rename a specific pet.
Parameters
serial
Int32
Mobile
Serial of the pet.
Mobile object representing the pet.
name
String
New name to set.
name to assign to the pet
Misc
.
QueryStringResponse
(
okcancel
,
response
)
Misc
.
QueryStringResponse
(
okcancel
,
response
)
Perform a query string response by ok or cancel button and specific response string.
Parameters
response
String
Cancel Button
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
name
String
Name of the value.
Misc
.
RemoveSharedValue
(
name
)
Misc
.
RemoveSharedValue
(
name
)
Remove a Shared Value.
Parameters
name
String
Name of the value.
Misc
.
ResponsePrompt
(
text
)
Misc
.
ResponsePrompt
(
text
)
Response a prompt request. Often used to rename runes and similar.
Parameters
text
String
Text of the response.
Misc
.
RightMouseClick
(
xpos
,
ypos
,
clientCoords
)
Misc
.
RightMouseClick
(
xpos
,
ypos
,
clientCoords
)
Perform a phisical Right click on the window.
Parameters
xpos
Int32
X click coordinate.
ypos
Int32
Y click coordinate.
clientCoords
Boolean
True: Client coordinates - False: Screen coordinates (default: True, client).
Get the full path to the Scripts Directory.
Return
String
Full path to the Scripts Directory.
Misc
.
ScriptRun
(
scriptfile
)
Misc
.
ScriptRun
(
scriptfile
)
Run a script by file name, Script must be present in script grid.
Parameters
scriptfile
String
Name of the script.
Misc
.
ScriptStatus
(
scriptfile
)
Misc
.
ScriptStatus
(
scriptfile
)
Get status of script if running or not, Script must be present in script grid.
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
scriptfile
String
Name of the script.
Misc
.
SendMessage
(
msg
,
color
,
wait
)
Misc
.
SendMessage
(
msg
,
color
,
wait
)
Send a message to the client.
Parameters
msg
Object
Int32
String
Boolean
Double
Single
UInt32
The object to print.
color
Int32
Boolean
Color of the message.
wait
Boolean
True: Wait for confimation. - False: Returns instatnly.
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
name
String
Name of the value.
Get the name of the shard.
Misc
.
UnIgnoreObject
(
serial
)
Misc
.
UnIgnoreObject
(
serial
)
Remove object from ignore list. Can remove serial, items or mobiles
Parameters
serial
Int32
Mobile
Item
Item to unignore
Serial 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
serial
Int32
Serial of the Item or Mobile.
choice
String
Option as Text or integer.
delay
Int32
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
serial
Int32
Mobile
Item
Entity as Item object.
Serial of the entity.
delay
Int32
Maximum wait.
max time to wait for context
showContext
Boolean
Show context menu in-game. (default: True)
Return
List[Misc.Context]
A List of Context objects.
Pause script until server send an Old Menu, for a maximum amount of time.
Parameters
delay
Int32
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
delay
Int32
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
delay
Int32
Maximum wait, in milliseconds.
Return
Boolean
True: if player has a query - False: otherwise.