////////////// // // Pulse Protection v1.0 by Pri (9th of October 2011) // This script requires Metis v2.82 & RoboMX v2.08 // Please use Metis v2.82 for the smoothest experience: http://bit.ly/ldk6C3 // Website: http://www.renmx.com // Forum: http://www.mxpulse.com/board // /////// COMMANDS // // !PulseGeo On/Off - Turn the Geolocate feature on/off (Finds where users are based on IP) (Default: On) // !PulseHost On/Off - Turn the 'Currently Hosting' feature on/off (Displays rooms hosted by your users) (Default: On) // !PulseRooms - View all the rooms using the same Password as you // /////// SERVER SUPPORT // // WCS, RCS, ZCS, RSWCS, and FXServer are all supported out of the box // ////////////// // This usergroup is only for your admins so that they can control some of the special commands. // Those commands include !PulseGeo On/Off - !PulseRooms is open to all users * ®ÊN Pri * // Clear variable "Private_IP_Detected" for a clean run // Break if the IP is private (127.0.0.1, 192.168.x.x, 10.0.x.x and so on) :%IP% 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 // Check that the user has the correct version of Metis to run this script by quering server and checking for a file, if this file doesn't display right tell the user to update /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#You appear to be running an outdated version of Metis. /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#You can download the latest one here#c63#: #c62#http://www.mxpulse.com/metis/Metis.r2x /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#To install this file replace your old Metis.r2x file located in your script plugins folder // Check that the scripts folder and settings file has been setup. If it hasn't do it. cmd.exe /c MD C:\Pri.Script.Dependencies\Pulse.Protection 1 // Check if the Geolocate file has been made, if it hasnt make it. 1 // Check if the Host Reporting file has been made, if it hasnt make it and then tell the admins about it too /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#This version of Pulse Protection includes Host reporting #c63#(#c62#Rooms being hosted by users#c63#)#c9# If you don't like this feature you can turn it off by typing #c4#!PulseHost Off #c9#But remember you need to edit the Pulse Protection XML file to list your name in the usergroup before you can use that command. 1 // Download some special characters required for this to function (Metis by itself doesn't allow these characters inside the code so they have to be loaded as varibles) // If the IP supplied to the bot is blank then load in the Access Level reminder counter (should be blank at first, then goes up to 3+) $ReminderCount$ // Break if the IP is blank then tell the Admins that they need to give their Bot high enough access to see IP Addresses /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#Your bot doesn't have a high enough access level to see the IP's of people who enter your room, Try logging it in as Admin or Host to correct this, or make your bot its own password with the necessary access level /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#Reminder #c62#%RANDOMNUM[ReminderCount]%#c9# of 3 // Check for an updated version of this script v1.0 /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#%USERVAR[Version_Release_Message]% %DATE%\n%USERVAR[Version_Info]% // Pulse Protection now requires version 2.82 of Metis, if the user is not using this version tell the admins and break /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#This script requires Metis v2.82, please upgrade from v%VERSION%#c63#: #c62#http://bit.ly/ldk6C3 // Perform a check to see if the Geolocation system is operational, if it isn't block the Geolocation queries until the bot is rebooted // Perform a check to see if the IP -> Roomname API is operational, if it isn't block the Roomname queries until the bot is rebooted // Check if a custom Password has been set by the admins of the room for use with Pulse Protections authentication system // If no password was found use the default %RANDOMNUM[251]%%RANDOMNUM[252]%%RANDOMNUM[253]%%RANDOMNUM[254]%%RANDOMNUM[255]% // If a random password was generated let the user know what it is /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#A Random Password has been generated for the data you supply to the Server /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#Generated Password#c63#: #c62#%USERVAR[Pass_generator]% /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#Saved in#c63#: #c62#C:\Pri.Script.Dependencies\Pulse.Protection\.password.ini /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#You and your friends can use the same password to share the same database // Save the Random Password (But of course only if a password isn't present already) %USERVAR[Pass_generator]%\nWhen making a password you can use uppercase and lowercase letters and also numbers, for example H1b0A9sD8mSd8 is an acceptible password.\nTo change your password simply erase the code at the top of this file, change it to something else, and save it. %USERVAR[Pass_generator]% // Sometimes the creation of the Folder for the Setup Check is to slow causing the install check file to not save, so let's just re-attempt that if this is a first time install 1 // Remove colour codes from username %NAME% 0 // Replace some symbols from the name that just don't work in a httpget request to the web server, and other characters we just don't want saved // Replace some symbols from the Roomname that don't work in httpget requests %ROOMNAME% // Check if the user wants to use Pulse with the Geolocating API or just Pulse on its own, default is with Geolocate // If for some reason the geolocate setting is missing just consider it set to 1 and also save this setting 1 1 // If the Geolocation server is down then default to non-Geo query 0 // Create a query for checking what usernames this IP is matched to and query mxpulse // If the users current name is present remove it, unless using Geolocate in which case only remove the name if they have other aliases // If no [:@:] is found insert it in to the end of the Result variable, unless Geolocate is off in which case skip this %USERVAR[Result]%%USERVAR[Cleaned_Name]%[:@:] // Work out if the user has multiple aliases or not and format the output to reflect that by using 'Only Known as' or 'Also Known as' // Make the output a little nicer to read / Put some symbols back that were removed for HTTPGET to server // Pop Geo_Filtered_Result for clean run next time // Skip the default output if the user has chosen Geolocate (default behavior) to be on // Output to the room the users aliases unless they don't have any /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#Also known as#c63#: #c62#%USERVAR[Result]% /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#From#c63#: #c62#%USERVAR[Result]% // Check if the user has the 'Currently Hosting' feature on or off (Default is on) // If the IP -> Roomname API is not functional then break here 0 // Lets see if this users IP is currently hosting any rooms and if they are, show those rooms in Opmsg // Break the script here if the Web_Result is blank // Save the output to a file cache %USERVAR[Web_Result]% // Read back in the cache to formulate the room message // If the server being reported isn't blank then modify the UI to accept server version %USERVAR[Pulse_Server_Version]%, #c9# // Break if the Cache is blank // Combine the data in to a single output and display it /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#Currently Hosting#c63#: #c62#%USERVAR[Pulse_Room_Name]% #c63#(#c9#%USERVAR[Pulse_Server_Version]%%USERVAR[Pulse_User_Current]%/%USERVAR[Pulse_User_Max]%#c63#) // Clear the Cache just incase something goes wrong as we don't want the same cache being used for multiple users under any circumstances !pulserooms // Check that the command was used at the beginning of a sentence %TRIGGER% // Load in the users password, if they don't have a password yet tell them they need to set one /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#You have not yet set a password for Pulse Protection to use. Have a user enter your room to have one created automatically. // Create a query including this rooms Pulse Password to retrieve a list of rooms using the same password back from the server // If the result is blank then say an error occured /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#An error occured, please try again later. // Make the output a little nicer to read / Put some symbols back that were removed for HTTPGET to server // Write this answer to a temporary cache in the Pulse folder so we can split the results up and read them back %USERVAR[Result]% // Tell the user the listing is going to start /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#Rooms using the same Pulse password as you#c63#: // Now read back the cache one line at a time 0 /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c62#%USERVAR[LINERESULT]% // Tell the user the listing is complete /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#Listing complete. !PulseGeo on !PulseGeo off // Check if the command was typed at the start of a sentence, if not break %TRIGGER% // Process which command the user typed 1 0 // Output message to Opmsg explaining which setting was chosen and what it does /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#The #c63#"#c1#Gelocation Feature#c63#"#c9# has been turned #c8#OFF /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c62#When this Setting is Off the Bot will Not display a users location when they enter your room /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#The #c63#"#c1#Gelocation Feature#c63#"#c9# has been turned #c4#ON /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c62#When this Setting is On the Bot will display users locations as they enter your room !Pulsehost on !Pulsehost off // Check if the command was typed at the start of a sentence, if not break %TRIGGER% // Process which command the user typed 1 0 // Output message to Opmsg explaining which setting was chosen and what it does /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#The #c63#"#c1#Currently Hosting Feature#c63#"#c9# has been turned #c8#OFF /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c62#When this Setting is Off the Bot will Not display rooms that users are hosting /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c9#The #c63#"#c1#Currently Hosting Feature#c63#"#c9# has been turned #c4#ON /opmsg #c4#Pulse #c63#(#c62#v1.0#c63#): #c62#When this Setting is On the Bot will display the rooms that users are hosting