////////////// // // Dynamic Room Adder v1.0 by Pri (25th of November 2012) // This script requires Metis v2.82 or Higher & RoboMX v2.08 http://bit.ly/ldk6C3 // Website: http://www.renmx.com // Forum: http://www.mxpulse.com/board // /////// COMMANDS // // !ListRoom - Foribly re-send your room to the WPNLister (The script will keep you listed automatically so you shouldn't need to use this) // !SetTopic [Topic] - Set your room topic that will appear on the WPNLister // !SetUsers [#] - Set the amount of users who are in your room that will appear on the WPNLister // /////// SERVER SUPPORT // // WCS, RCS, ZCS, RSWCS, FXServer and Ouka are all supported out of the box // Technically this should work with all servers including WinMX // ////////////// !listroom !botlistroom !updatetopiclistroom !updateuserslistroom // 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\Dynamic.Room.Adder 1 // Check if the user has supplied their Topic and Users yet, and if not tell them to do it. // If this is the first time the script has been run then inform the admins what steps they have to take to make the script function /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c9#This script has not yet been configured. /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c4#1. #c9#You need to edit the #c62#Dynamic.Room.Adder.by.Pri.xml #c9#file to add your username so that you can edit settings /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c4#2. #c9#You then need to type #c62#!SetTopic [Topic] #c9#and tell the bot what your rooms topic is /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c4#3. #c9#You then need to type #c62#!SetUsers [#] #c9#and tell the bot how many users you want to be shown on the WPNList Page /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c4#4. #c9#Once the three above steps are done the script will automatically begin listing your room for you, so check the website! /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c4#5. #c9#Check this page to see if your rooms been listed#c63#: #c62#http://winmxunlimited.net/tools/chat-room-list/winmx-chat-manager/ // 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#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c9#You appear to be running an outdated version of Metis. /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c9#You can download the latest one here#c63#: #c62#http://bit.ly/ldk6C3 /opmsg #c4#Dynamic Room Adder #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 Dynamic Room Adder requires version 2.82 of Metis at a minimum, if the user is not using this or a higher version tell the admins and break /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c9#This script requires Metis v2.82 minimum, please upgrade from v%VERSION%#c63#: #c62#http://bit.ly/ldk6C3 // Check for an updated version of this script (Now with Auto Update if wget is found!) v1.0 // Check if the Version_Server_Health is okay, if it isn't skip this update entirely // Auto Update Code http://dynamic.room.adder.mxpulse.com/version.ini Plugins\wget\wget.exe -q -O Plugins\%USERVAR[Update_Filename]% %USERVAR[Update_URL]% /opmsg #c4#Dynamic Room Adder #c63#(#c62#%USERVAR[Version_Info]%#c63#): #c1#Your Dynamic Room Adder plugin has just downloaded and installed an update. /mxc load // Normal Update Code /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c1#A new version (%USERVAR[Version_Info]%) of Dynamic Room Adder is available. /opmsg #c4# · Update Notes#c63#: #c62#%USERVAR[Version_Release_Message]% %DATE% // Read in the rooms Topic and User Count from files in the Database /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c1#Your rooms topic has been updated /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c1#Your rooms user count has been updated // Check if the data required to add a room has been supplied by the rooms Admins, if it hasn't break // Query mxpulse.com so the site can take your IP Address and encode it for your room name /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c9#Your room couldn't be added at this time because the Dynamic Room Adder online service is currently offline // Locate and take the Port Number from the roomname // Remove the entire Hash from the room name // Create the final encoding %USERVAR[Room_Name_Without_Hash]%%USERVAR[Hashcode]%%USERVAR[Port_Number]% // Replace some characters that are not http friendly // Send the room to the WPN List // Tell the admin that their room was foribly sent to the WPNList server (or skip if the bot requested the listing) /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c1#Your room has been sent to the WPNLister /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c62#http://winmxunlimited.net/tools/chat-room-list/ // Push the current hour in to a variable so that we wait a maximum of 60 minutes before trying to relist this room %HOUR% !SetTopic %PARAM% !SetUsers %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#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c9#Login and show an #c62#@ #c9#in the userlist to use this command. // 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\Dynamic.Room.Adder 1 // 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#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c9#You appear to be running an outdated version of Metis. /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c9#You can download the latest one here#c63#: #c62#http://bit.ly/ldk6C3 /opmsg #c4#Dynamic Room Adder #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 Dynamic Room Adder requires version 2.82 of Metis at a minimum, if the user is not using this or a higher version tell the admins and break /opmsg #c4#Dynamic Room Adder #c63#(#c62#v1.0#c63#): #c9#This script requires Metis v2.82 minimum, please upgrade from v%VERSION%#c63#: #c62#http://bit.ly/ldk6C3 // Save the setting that the admin set %PARAM%\n %PARAM%\n // Send a self command activating the service !updatetopiclistroom !updateuserslistroom // Break here if the room has already been sent this hour (Limited to 24 queries per day this way) !botlistroom // Push the current hour in to a variable so that we wait a maximum of 60 minutes before trying to relist this room %HOUR%