////////////// // // Find Room v1.0 by Pri (26th of May 2012) // This script requires Metis v2.80 or higher & RoboMX v2.08 // Please use Metis v2.82 or higher for the smoothest experience: http://bit.ly/ldk6C3 // Website: http://www.renmx.com // Forum: http://www.mxpulse.com/board // /////// COMMANDS // // !FindRoom [Query] - Find a room // !FindChan [Query] - Find a room (Alternative trigger) // !PrivateFindRoom - Set all output to Private, only those who use the commands see results (Default = On) // !PublicFindRoom - Set all output to Public, Whenever someone searches for a room, everyone sees the results // !SetFindRoomColour [number] - Set the colours of the script to something other than the default green, Use the custom settings file instead of this. // /////// SERVER SUPPORT // // WCS, RCS, ZCS, RSWCS, FXServer and Ouka are all supported out of the box // ////////////// !findroom %PARAM% !findchan %PARAM% // This script can detect a URL in any part of a sentence, but we don't want it to do that if the sentence begins with ! or / %TRIGGER% // Check that the scripts folder and settings files have been setup. If they haven't then do so. cmd.exe /c MD C:\Pri.Script.Dependencies\Find.Room 1 // If this is the first setup write the massive customisation settings file ### This is the Find Room settings file, you can customise many aspects of the Find Room Script from here ###\n### Using this file is simple, Just change the output text to what you want, you can use colour codes too! ###\n\n### Change these formats below to alter how things appear in-room, Changes happen as soon as you save this file ###\n\nBeginning of Results Message: #c4#Searching [Total Rooms] rooms based on your query#c63#: #c62#[Search Query]\nRoom Listing Format: #c4# · #c1#[Room Name] #c63#|#c62# [User Count]#c63#/#c62#[Maximum Users] #c63#|#c1# [Server Version]\nNo Rooms Found Format: #c4#[Find Room Name/Version] #c1#I'm sorry no rooms matching your query were found out of [Total Rooms] rooms.\nEnd of Results Message: #c4#You received #c62#[Result Number] #c4#Result[s]\n\n### Basic Variable Changes below ###\n\nMaximum Amount of Results to show: 20\n\n### You can use any of these variables below in your custom formats ###\n\n- [Room Name] [User Count] [Maximum Users] [Room Topic] [Server Version] [Result Number] [Search Query] [Total Rooms]\n\n### The variable [Server Version] may not always output a server due to some rooms running in offline mode ### // If this is the first time the script has been setup tell them how they can customise this script through the customisation file /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v1.0#c63#): #c9#A customisation file has been created#c63#: #c1#C:\Pri.Script.Dependencies\Find.Room\Customisation.Settings.File.ini /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v1.0#c63#): #c62#Inside that file you can customise how this script looks including all text, colours and what information is displayed such as topic titles in room search results // Set the script up to use Private Mode by default 0 /hidecmd /privnotice :@:RAWNAME:@::@:SPACE:@: /hidecmd /privnotice :@:RAWNAME:@::@:SPACE:@: /message :@:RAWNAME:@::@:SPACE:@: #private :@:RAWNAME:@: #message:@:SPACE:@: // Because ZCS does not report itself as ZCS and instead as WinMX we are just going to assume that WinMX = ZCS /privnotice :@:RAWNAME:@::@:SPACE:@: 1 /stats // Save the command for later use 1\n%USERVAR[Server_Private_Command]% // Check that the user has the correct version of Metis to run this script by querying my server and checking for a file, if this file doesn't display right tell the user to update // The reason this code has Pulse in it is because it's just copy and pasted from the Pulse script and it uses less web queries to share the same variable name this way /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v1.0#c63#): #c9#You appear to be running an outdated version of Metis. /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v1.0#c63#): #c9#You can download the latest one here#c63#: #c62#http://bit.ly/ldk6C3 /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v1.0#c63#): #c9#To install this file replace your old Metis.r2x file located in your script plugins folder // Perform an online check to see if this version of Metis is supported by this script or not // The Find Room plugin requires version 2.80 of Metis or higher, however 2.82 or higher is recommended for optimum performance, We will now alert the user if their Metis is below v2.80 /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v1.0#c63#): #c9#This script requires Metis v2.80 minimum, please upgrade from v%VERSION%#c63#: #c62#http://bit.ly/ldk6C3 // Check if the user is using Metis v2.80 or v2.81, if they are suggest to them upgrading to v2.82 or higher - Only make this recommendation once $ReminderCount$ $ReminderCount$ /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v1.0#c63#): #c9#This script performs much faster with Metis v2.82 or higher, please upgrade from v%VERSION%#c63#: #c62#http://bit.ly/ldk6C3 /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v1.0#c63#): #c9#Reminder #c62#1#c9# of 1 /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v1.0#c63#): #c9#This script performs much faster with Metis v2.82 or higher, please upgrade from v%VERSION%#c63#: #c62#http://bit.ly/ldk6C3 /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v1.0#c63#): #c9#Reminder #c62#1#c9# of 1 // Pop some variables for later use // Load in the menucolour selected by the admins, if nothing found default is #c4# // Check if the script has been set to Public or Private Mode // If the user has selected to use private commands formulate how it should look for this query // Check for an updated version of this script v1.0 /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v1.0#c63#): #c9#%USERVAR[Version_Release_Message]% %DATE% // Take the incoming parameter and form a url to query the MXPulse room API http://www.find.room.mxpulse.com/?search=%PARAM% // Load in the Customisation Settings File to get the format that the user selected 0 $Custom_Format$ $Custom_Format$ $Custom_Format$ $Custom_Format$ $Custom_Format$ // Clean up the formats removing human readable text // Get the count of how many rooms are currently listed by WinMXUnlimited.net // Replace some of the chosen format options with their real values (Static) $Room_Listing_Format$ // Query the URL // Take the response and replace some seperators with newlines for reading back // Check if the API gave any response and if didn't tell the user no result could be found %USERVAR[Server_Private_Command]%%USERVAR[No_Rooms_Found_Amount]% // Save the API response for reading back $API_Response$ // Tell the user that the room search results are going to be sent now %USERVAR[Server_Private_Command]%%USERVAR[Start_Results_Format]% // Read through the saved API response and push them in to variables 1 -4 // Replace some of the chosen format options with their real values (Dynamic) $Room_Listing_Format_Saved$ 0%USERVAR[FR_Result_Amount]% // Output to the room the found results %USERVAR[Server_Private_Command]%%USERVAR[Room_Listing_Format]% // Do a final custom format replace // Tell the user that the query has ended %USERVAR[Server_Private_Command]%%USERVAR[End_Results_Format]% WCS Version: %PARAM% // Tell the user that WCS was detected and that they may have seen some temporary garbled text /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v1.0#c63#): #c9#WCS %PARAM% has been detected, You may have seen some /privnotice commands above this is normal during WCS %PARAM% detection due to a bug in the server // If WCS was detected then save that 1\n/hidecmd /privnotice :@:RAWNAME:@::@:SPACE:@: // Push 0 to Checking for WCS 0 !privatefindroom !publicfindroom // Check if the command was typed at the start of a sentence, if not break %TRIGGER% // Check if the Metis version is below v2.83 so we know that %USERMODE% works 1 0 0 0 // If the user doesn't have an @ in the User List, tell them they need to login to use this command and break #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v0.3a#c63#): #c9#Login and show an #c62#@ #c9#in the userlist to use this command. // Process which command the user typed 1\n 0 // Output to the Admins if it was set to Public Mode /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v0.3a#c63#): #c1#Find Room Has been set to Public Mode /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v0.3a#c63#): #c62#When this is set to Public, all Find Room results will be shown to the entire room // Break if the user selected to use Public // If the user selected PrivateFindRoom, work out which server is in use 0 /hidecmd /privnotice :@:RAWNAME:@::@:SPACE:@: /hidecmd /privnotice :@:RAWNAME:@::@:SPACE:@: /message :@:RAWNAME:@::@:SPACE:@: #private :@:RAWNAME:@: #message:@:SPACE:@: // Because ZCS does not report itself as ZCS and instead as WinMX we are just going to assume that WinMX = ZCS /privnotice :@:RAWNAME:@::@:SPACE:@: // Save the command for later use %USERVAR[Server_Private_Command]% // Server not recognised Message /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v0.3a#c63#): #c9#Find Room cannot be set to Private in your room as the Server #c63#(#c62#%SERVER%#c63#)#c9# is not supported by the script currently 0 // Output to the Admins if it was set to Private Mode /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v0.3a#c63#): #c1#Find Room Has been set to Private Mode /opmsg #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v0.3a#c63#): #c62#When this is set to Private, only those who use the room searching commands will see results // Check that WCS 1.8.8 is in use if the Server is reporting itself as WinMX 1 /stats !setfindroomcolour %PARAM% !setfindroomcolor %PARAM% // Check if the command was typed at the start of a sentence, if not break %TRIGGER% // Check if the Metis version is below v2.83 so we know that %USERMODE% works 1 0 0 0 // If the user doesn't have an @ in the User List, tell them they need to login to use this command and break #c4#%USERVAR[Menu_Colour]%Find Room #c63#(#c62#v0.3a#c63#): #c9#Login and show an #c62#@ #c9#in the userlist to use this command. // Encapsulate parameter with colour tags if none are present and save to file %PARAM%\n #c%PARAM%#\n // Output to the Admins what colour it has been set to /opmsg #c4#%PARAM%Find Room #c63#(#c62#v0.3a#c63#): #c1#Find Room Has set its colours to#c63#: %PARAM% ||||| /opmsg #c4##c%PARAM%#Find Room #c63#(#c62#v0.3a#c63#): #c1#Find Room Has set its colours to#c63#: #c%PARAM%# ||||| // Tell them for full control they will need to use the new customisation file /opmsg #c4#%PARAM%Find Room #c63#(#c62#v0.3a#c63#): #c62#For full customisation of this script you will need to use the customisation file found here#c63#: #c1#C:\Pri.Script.Dependencies\Find.Room\Customisation.Settings.File.ini