<config>

//////////////
//
//  Proxy Blocker v1.0.5b by Pri (20th of May 2010)
//
//////////////
//
//  Commands Included that you can use:
//  !Download - Begins a Download of the Proxy Blocklist
//  !Stop - Stops/Pauses a Download, you can continue a stopped download at any time
//  !SetDownload - Set an alternative download link for a Blocklist
//  !ResetDownload - Set the bot to use the default download location for a Blocklist
//  !Tor On - Sets the script to download TOR IP's manually (Default is on)
//  !Tor Off - Stops the script from automatically updating its TOR node list
//  !PG On - Sets the script to download its PG2 Lists (Default is on)
//  !PG Off - Stops the script from automatically updating its PG2 List
//  !Silent On - Hide certain messages from Opmsg. Only when downloads complete and users are banned do you get a message  (Default is On)
//  !Silent Off - Unhide all messages, receive everything as normal in Opmsg
//  !Livecheck On - Check the IP's of your visitors against a definition file for Proxies (Default is On)
//  !Livecheck Off - Turn off the Live Check feature completely. (Saves bandwidth but significantly lowers Proxy Detection capability)
//
//  Dev commands:
//  !SetLine - Tell the bot at which line it should begin downloading from
//
//////////////

<usergroup name="proxusers" case="0">
_BOT_SELF_TRIGGER_
*  ®ÊN  Pri  *
</usergroup>

<command type="script" usergroup="proxusers">
<in>!setdownload %PARAM%</in>
<in>!resetdownload</in>
// Check if the command was typed at the start of a sentence, if not break
<out type="push" extdata="Prox_CMD_REQ">%TRIGGER%</out>
<out type="push" extdata="Prox_CMD_REQ"><operator type="strleft" lvalue="$Prox_CMD_REQ$" rvalue="1"/></out>
<out type="break" condition="!_?" lvalue="$Prox_CMD_REQ$" rvalue="!"></out>
<out>/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#You have set an alternative blocklist to be downloaded from: #c1#%PARAM%</out>
<out type="file" extdata="C:\proxy\.Proxy.Settings.ini" mode="t" condition="!_?" lvalue="%TRIGGER%" rvalue="!setdownload">%PARAM%</out>
<out type="file" extdata="C:\proxy\.Proxy.Settings.ini" mode="t" condition="_?" lvalue="%TRIGGER%" rvalue="!resetdownload"></out>
</command>

<command type="script" usergroup="proxusers">
<in>!stop</in>
// Check if the command was typed at the start of a sentence, if not break
<out type="push" extdata="Prox_CMD_REQ">%TRIGGER%</out>
<out type="push" extdata="Prox_CMD_REQ"><operator type="strleft" lvalue="$Prox_CMD_REQ$" rvalue="5"/></out>
<out type="break" condition="!_?" lvalue="$Prox_CMD_REQ$" rvalue="!stop"></out>
// Push 0 to Prox_DL_Status, if a Download is happening it will notice the variable change and stop/pause the download
<out type="push" extdata="Prox_DL_Status">0</out>
</command>

<command type="script" usergroup="proxusers">
<in>!setline %PARAM%</in>
// Check if the command was typed at the start of a sentence, if not break
<out type="push" extdata="Prox_CMD_REQ">%TRIGGER%</out>
<out type="push" extdata="Prox_CMD_REQ"><operator type="strleft" lvalue="$Prox_CMD_REQ$" rvalue="9"/></out>
<out type="break" condition="!_?" lvalue="$Prox_CMD_REQ$" rvalue="!setline "></out>
// Check that a download is already in progress, if it isnt tell the user they must first begin a download
<out type="push" extdata="Prox_DL_Count">%PARAM%</out>
<out type="push" extdata="Prox_Previous_Download">%PARAM%</out>
<out type="self" condition="!=" lvalue="%USERVAR[Prox_DL_Status]%" rvalue="1">!download</out>
</command>

<command type="script" mode="thread" usergroup="proxusers">
<in>!download</in>
// Check if the command was typed at the start of a sentence, if not break
<out type="push" extdata="Prox_CMD_REQ">%TRIGGER%</out>
<out type="push" extdata="Prox_CMD_REQ"><operator type="strleft" lvalue="$Prox_CMD_REQ$" rvalue="9"/></out>
<out type="break" condition="!_?" lvalue="$Prox_CMD_REQ$" rvalue="!download"></out>
// Clear Output Message Variables
<out type="pop" extdata="Output_MSG_01"/>
<out type="pop" extdata="Output_MSG_02"/>
<out type="pop" extdata="Output_MSG_03"/>
<out type="pop" extdata="Output_MSG_04"/>
<out type="pop" extdata="Output_MSG_05"/>
<out type="pop" extdata="Output_MSG_06"/>
<out type="pop" extdata="Version_Info"/>
<out type="pop" extdata="Version_Release_Message"/>
// Check if this script is the latest version and display an update message if it isn't
<out type="push" extdata="Version_Info"><operator type="readweb" nvalue="http://private.proxy.mxpulse.com/Version.ini" lvalue="l" rvalue="1"/></out>
<out type="push" extdata="Version_Release_Message" condition="!=" lvalue="%USERVAR[Version_Info]%" rvalue="v1.0.5b"><operator type="readweb" nvalue="http://private.proxy.mxpulse.com/Version.ini" lvalue="l" rvalue="2"/></out>
<out condition="!=" lvalue="%USERVAR[Version_Release_Message]%" rvalue="">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#%USERVAR[Version_Release_Message]%</out>
// Check that a download is not already in progress, if it is, block and alert Admins
<out condition="==" lvalue="%USERVAR[Prox_DL_Status]%" rvalue="1">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#You cannot start a download as one is already in progress</out>
<out type="break" condition="==" lvalue="%USERVAR[Prox_DL_Status]%" rvalue="1"></out>
// Check that the scripts folder and settings file has been setup. If it hasn't do it.
<out type="push" extdata="Prox_Setup_Check"><operator type="readfile" nvalue="C:\proxy\.proxy.setup.check.ini" lvalue="l" rvalue="1"/></out>
<out condition="==" lvalue="$Prox_Setup_Check$" rvalue="" type="exec" extdata="1">cmd.exe /c MD C:\proxy</out>
<out condition="==" lvalue="$Prox_Setup_Check$" rvalue="" type="file" extdata="C:\proxy\.proxy.setup.check.ini" mode="t">1</out>
// Check if the user has blocked this from happening
<out type="push" extdata="Prox_PG_CHECK"><operator type="readfile" nvalue="C:\proxy\.Download.PG2.Or.Not.ini" lvalue="l" rvalue="1"/></out>
<out type="push" extdata="Prox_Silent_Mode"><operator type="readfile" nvalue="C:\proxy\.Silent.Mode.ini" lvalue="l" rvalue="1"/></out>
<out type="file" mode="t" condition="!=" lvalue="%USERVAR[Prox_Silent_Mode]%" rvalue="0" extdata="C:\proxy\.Silent.Mode.ini">1</out>
<out type="push" extdata="Prox_Silent_Mode" condition="!=" lvalue="%USERVAR[Prox_Silent_Mode]%" rvalue="0">1</out>
<out type="goto" extdata="2" condition="==" lvalue="%USERVAR[Prox_Silent_Mode]%" rvalue="1"></out>
<out condition="==" lvalue="%USERVAR[Prox_PG_CHECK]%" rvalue="1">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#Downloading of the PG2 Blocklist has been turned off, the script will now skip to the direct TOR update</out>
<out type="goto" extdata="48" condition="==" lvalue="%USERVAR[Prox_PG_CHECK]%" rvalue="1"></out>
// Read in a file from the folder that holds a previous download count, incase the bot crashed mid-download (This will save having to start from 0)
<out type="push" extdata="Prox_Previous_Download" condition="==" lvalue="$Prox_Previous_Download$" rvalue=""><operator type="readfile" nvalue="C:\proxy\.proxy.previous.download.ini" lvalue="l" rvalue="1"/></out>
// Set the Prox status for other parts of the code to reference
<out type="push" extdata="Prox_DL_Status">1</out>
<out condition="==" lvalue="%USERVAR[Prox_Previous_Download]%" rvalue="0">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#Updating Database by Downloading the latest Blocklist</out>
<out condition="!=" lvalue="%USERVAR[Prox_Previous_Download]%" rvalue="0">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#Continuing update from last known position #c63#(#c62#%USERVAR[Prox_Previous_Download]%#c63#)</out>
// Tell the user how they can stop/pause the download
<out>/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9##c9#To pause the download type #c1#!Stop #c9#You may continue it later by typing #c1#!Download</out>
// Push the default download location
<out type="push" extdata="Prox_URL">http://private.proxy.mxpulse.com/Auto_Update_Blocklist.p2p</out>
// Read in the specified cache size from mxpulse for this list. If no number is present default to 200K
<out type="push" extdata="Prox_cache_size"><operator type="readweb" nvalue="http://private.proxy.mxpulse.com/cache.size.ini" lvalue="l" rvalue="1"/></out>
// Check that the list on the site is different to the list last downloaded, if its the same then cancel the current download
<out type="push" extdata="Prox_Last_Cache_CHECK"><operator type="readfile" nvalue="C:\proxy\.Last.Download.Cache.Size.ini" lvalue="l" rvalue="1"/></out>
<out type="push" extdata="Output_MSG_01" condition="==" lvalue="%USERVAR[Prox_Last_Cache_CHECK]%" rvalue="%USERVAR[Prox_cache_size]%">1</out>
<out type="goto" extdata="38" condition="==" lvalue="%USERVAR[Prox_Last_Cache_CHECK]%" rvalue="%USERVAR[Prox_cache_size]%"></out>
<out type="push" extdata="Prox_cache_size" condition="==" lvalue="%USERVAR[Prox_cache_size]%" rvalue="">200000</out>
<out type="push" extdata="Prox_input"><operator type="readweb" nvalue="%USERVAR[Prox_URL]%" lvalue="l" rvalue="$Prox_cache_size$"/></out>
// Check for a possible alternative download link and alert the user if one is found that it will be used
<out type="push" extdata="Prox_Alternative_List"><operator type="readfile" nvalue="C:\proxy\.Proxy.Settings.ini" lvalue="l" rvalue="1"/></out>
<out type="push" extdata="Prox_URL" condition="!=" lvalue="%USERVAR[Prox_Alternative_List]%" rvalue="">%USERVAR[Prox_Alternative_List]%</out>
<out type="goto" extdata="2" condition="==" lvalue="%USERVAR[Prox_Silent_Mode]%" rvalue="1"></out>
<out type="push" extdata="Output_MSG_02" condition="!=" lvalue="%USERVAR[Prox_Alternative_List]%" rvalue="">1</out>
// Set the script up for a new download
<out type="push" extdata="Prox_DL_Count">0</out>
<out type="push" extdata="Prox_Block_Count">0</out>
<out  type="push" extdata="Prox_DL_Count" condition="!=" lvalue="%USERVAR[Prox_Previous_Download]%" rvalue="0">%USERVAR[Prox_Previous_Download]%</out>
<out type="push" extdata="Prox_DL_Count"><operator type="+" lvalue="%USERVAR[Prox_DL_Count]%" rvalue="1"/></out>
<out condition="==" lvalue="%USERVAR[Prox_DL_Status]%" rvalue="0">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#Download stopped @ #c1#%USERVAR[Prox_DL_Count]% #c9#You may continue it by typing #c1#!Download</out>
<out type="push" extdata="Prox_Previous_Download" condition="==" lvalue="%USERVAR[Prox_DL_Status]%" rvalue="0">%USERVAR[Prox_DL_Count]%</out>
<out type="break" condition="==" lvalue="%USERVAR[Prox_DL_Status]%" rvalue="0"></out>
// Read in a line from the PG2 list and filter it for saving in the Scripts folder for later retrieval
<out type="push" extdata="Prox_input"><operator type="readweb" nvalue="%USERVAR[Prox_URL]%" lvalue="l" rvalue="%USERVAR[Prox_DL_Count]%"/></out>
<out type="push" extdata="Prox_loc_0007"><operator type="strrfind" lvalue="%USERVAR[Prox_input]%" rvalue="-"/></out>
<out type="push" extdata="Prox_loc_0006"><operator type="strright" lvalue="%USERVAR[Prox_input]%" rvalue="$Prox_loc_0007$"/></out>
<out type="push" extdata="Prox_loc_0006" condition="==" lvalue="$Prox_loc_0007$" rvalue="-1">Empty</out>
<out type="push" extdata="Prox_loc_0007"><operator type="strrfind" lvalue="%USERVAR[Prox_input]%" rvalue="-"/></out>
<out type="push" extdata="Prox_loc_0003"><operator type="strleft" lvalue="%USERVAR[Prox_input]%" rvalue="$Prox_loc_0007$"/></out>
<out type="push" extdata="Prox_loc_0003" condition="==" lvalue="$Prox_loc_0007$" rvalue="-1">Empty</out>
<out type="push" extdata="Prox_loc_0004"><operator type="strrfind" lvalue="$Prox_loc_0003$" rvalue=":"/></out>
<out type="push" extdata="Prox_loc_0001"><operator type="strright" lvalue="$Prox_loc_0003$" rvalue="$Prox_loc_0004$"/></out>
<out type="push" extdata="Prox_loc_0001" condition="==" lvalue="$Prox_loc_0004$" rvalue="-1"></out>
<out type="push" extdata="Prox_loc_0005"><operator type="strrfind" lvalue="$Prox_loc_0003$" rvalue=":"/></out>
<out type="push" extdata="Prox_loc_0002"><operator type="strleft" lvalue="$Prox_loc_0003$" rvalue="$Prox_loc_0005$"/></out>
<out type="push" extdata="Prox_loc_0002" condition="==" lvalue="$Prox_loc_0005$" rvalue="-1"></out>
<out type="push" extdata="Prox_loc_0001"><operator type="strrem" lvalue="$Prox_loc_0001$" rvalue=":"/></out>
<out type="push" extdata="Prox_Block_Count">%USERVAR[Prox_DL_Count]%.</out>
<out type="push" extdata="Prox_Silent_Mode"><operator type="readfile" nvalue="C:\proxy\.Silent.Mode.ini" lvalue="l" rvalue="1"/></out>
<out type="goto" extdata="4" condition="==" lvalue="%USERVAR[Prox_Silent_Mode]%" rvalue="1"></out>
// Announce to the user the status of the download if it is at 10, 500 or increments of 1000 (Just so they know its actually doing something)
<out condition="==" lvalue="%USERVAR[Prox_Block_Count]%" rvalue="10.">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#Downloaded #c1#%USERVAR[Prox_DL_Count]% #c9#IP's thus far and counting... #c63#(#c62#Next Notice at 500#c63#)</out>
<out condition="==" lvalue="%USERVAR[Prox_Block_Count]%" rvalue="500.">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#Downloaded #c1#%USERVAR[Prox_DL_Count]% #c9#IP's thus far and counting...#c63#(#c62#Next Notice at 1000#c63#)</out>
<out condition="?" lvalue="%USERVAR[Prox_Block_Count]%" rvalue="000.">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#Downloaded #c1#%USERVAR[Prox_DL_Count]% #c9#IP's thus far and counting... #c63#(#c62#Next Notice in 1000#c63#)</out>
// Save 1 line from the PG2 list to the scripts folder
<out condition="!=" lvalue="%USERVAR[Prox_input]%" rvalue="" type="file" extdata="C:\proxy\%USERVAR[Prox_loc_0001]%.ini" mode="t">%USERVAR[Prox_loc_0002]%</out>
// Push the current line to a file incase the bot crashes
<out type="file" extdata="C:\proxy\.proxy.previous.download.ini" mode="t">%USERVAR[Prox_DL_Count]%</out>
// If the piece of data it read in from the PG2 list wasnt blank then go back 23 lines of code to read in another piece of information, rinse and repeat until every line with data in it is downloaded and processed
<out type="goto" extdata="-26" condition="!=" lvalue="%USERVAR[Prox_input]%" rvalue=""></out>
// If the script has reached this line then it has read through all the contents of the PG2 blocklist, announce that the download completed and tell the user how many IP's belonging to Proxy Servers are now being blocked
<out type="push" extdata="Output_MSG_03">1</out>
<out type="file" extdata="C:\proxy\.Proxy.Status.ini" mode="t">Proxy Blocklist Last Updated: %DATE%\nIP's Blocked: %USERVAR[Prox_DL_Count]%\nLast Update Instigated by: %NAME%</out>
<out type="file" extdata="C:\proxy\.proxy.previous.download.ini" mode="t">0</out>
<out type="push" extdata="Prox_DL_Status">0</out>
<out type="push" extdata="Prox_Previous_Download">0</out>
// Push the old Cache Size so a repeat download of the same sized list cannot occur
<out condition="!=" lvalue="%USERVAR[Prox_cache_size]%" rvalue="" type="file" extdata="C:\proxy\.Last.Download.Cache.Size.ini" mode="t">%USERVAR[Prox_cache_size]%</out>
// Download the latest definition file for the Live Proxy Checker
<out type="push" extdata="Definition_DL_Count">0</out>
// Set the definition update URL
<out type="push" extdata="Definition_URL">http://private.proxy.mxpulse.com/Live.Proxy.Check.Definition.File.ini</out>
// Setup a cache to hold lines 1 to 300 (Definition file should be below 100)
<out type="push" extdata="Definition_input"><operator type="readweb" nvalue="%USERVAR[Definition_URL]%" lvalue="l" rvalue="300"/></out>
// Start reading through the file for the definition entries
<out type="push" extdata="Definition_DL_Count"><operator type="+" lvalue="%USERVAR[Definition_DL_Count]%" rvalue="1"/></out>
<out type="push" extdata="Definition_input"><operator type="readweb" nvalue="%USERVAR[Definition_URL]%" lvalue="l" rvalue="%USERVAR[Definition_DL_Count]%"/></out>
<out condition="==" lvalue="%USERVAR[Definition_DL_Count]%" rvalue="1" type="file" extdata="C:\proxy\.live.proxy.checker.definitions.ini" mode="t">%USERVAR[Definition_input]%\n</out>
<out condition="!=" lvalue="%USERVAR[Definition_DL_Count]%" rvalue="1" type="file" extdata="C:\proxy\.live.proxy.checker.definitions.ini" mode="a">%USERVAR[Definition_input]%\n</out>
<out type="goto" extdata="-4" condition="!=" lvalue="%USERVAR[Definition_input]%" rvalue=""></out>
<out type="push" extdata="Output_MSG_04">1</out>
// Check if the user wishes to use TOR to download IP's manually (Default = Yes)
<out type="push" extdata="Prox_TOR_CHECK"><operator type="readfile" nvalue="C:\proxy\.Download.From.Tor.Direct.Or.Not.ini" lvalue="l" rvalue="1"/></out>
<out type="push" extdata="Prox_Silent_Mode"><operator type="readfile" nvalue="C:\proxy\.Silent.Mode.ini" lvalue="l" rvalue="1"/></out>
<out type="goto" extdata="2" condition="==" lvalue="%USERVAR[Prox_Silent_Mode]%" rvalue="1"></out>
<out condition="==" lvalue="%USERVAR[Prox_TOR_CHECK]%" rvalue="1">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#TOR Direct Updating is off. To turn it on type #c1#!Tor On</out>
<out  type="push" extdata="Prox_DL_Status" condition="==" lvalue="%USERVAR[Prox_TOR_CHECK]%" rvalue="1">0</out>
<out type="goto" extdata="14" condition="==" lvalue="%USERVAR[Prox_TOR_CHECK]%" rvalue="1"></out>
<out type="goto" extdata="2" condition="==" lvalue="%USERVAR[Prox_Silent_Mode]%" rvalue="1"></out>
<out>/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#Updating Database from The Onion Network Directly. Please wait...</out>
// Set the Counter to line 3
<out type="push" extdata="Tor_DL_Count">3</out>
// Set the TOR Abuse Exit Node URL
<out type="push" extdata="TOR_URL">http://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=109.198.121.101</out>
// Setup a cache to hold lines 1 to 2000 (The Exit list is normally under 800. 2000 is just a precaution)
<out type="push" extdata="TOR_input"><operator type="readweb" nvalue="%USERVAR[TOR_URL]%" lvalue="l" rvalue="2000"/></out>
// Start reading through the file for the IP's
<out type="push" extdata="Tor_DL_Count"><operator type="+" lvalue="%USERVAR[Tor_DL_Count]%" rvalue="1"/></out>
<out type="push" extdata="TOR_input"><operator type="readweb" nvalue="%USERVAR[TOR_URL]%" lvalue="l" rvalue="%USERVAR[Tor_DL_Count]%"/></out>
<out condition="!=" lvalue="%USERVAR[TOR_input]%" rvalue="" type="file" extdata="C:\proxy\%USERVAR[TOR_input]%.ini" mode="t">The Onion Router Proxy</out>
<out type="goto" extdata="-3" condition="!=" lvalue="%USERVAR[TOR_input]%" rvalue=""></out>
<out type="push" extdata="Output_MSG_05">1</out>
<out type="push" extdata="Prox_DL_Status">0</out>
<out type="push" extdata="Prox_Previous_Download">0</out>
<out type="file" extdata="C:\proxy\.Proxy.Status.ini" mode="t">Proxy Blocklist Last Updated: %DATE%\nIP's Blocked: %USERVAR[Tor_DL_Count]%\nLast Update Instigated by: %NAME%</out>
// Formulate the completion messages for the admins to view
<out type="push" extdata="Output_MSG_06" condition="==" lvalue="%USERVAR[Output_MSG_03]%" rvalue="1">%USERVAR[Output_MSG_06]% #c1#Blocklist #c63#(#c62#%USERVAR[Prox_DL_Count]%#c63#)</out>
<out type="push" extdata="Output_MSG_06" condition="==" lvalue="%USERVAR[Output_MSG_02]%" rvalue="1"><operator type="strrep" nvalue="%USERVAR[Output_MSG_06]%" lvalue="#c1#Blocklist" rvalue="#c1#Alt-Blocklist"/></out>
<out type="push" extdata="Output_MSG_06" condition="==" lvalue="%USERVAR[Output_MSG_04]%" rvalue="1">%USERVAR[Output_MSG_06]% #c1#Definitions #c63#(#c62#%USERVAR[Definition_DL_Count]%#c63#)</out>
<out type="push" extdata="Output_MSG_06" condition="==" lvalue="%USERVAR[Output_MSG_05]%" rvalue="1">%USERVAR[Output_MSG_06]% #c1#TOR #c63#(#c62#%USERVAR[Tor_DL_Count]%#c63#)</out>
// Output what completed to the room on 1 line
<out condition="!=" lvalue="%USERVAR[Output_MSG_06]%" rvalue="">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#Download[s] Complete#c63#:#c1#%USERVAR[Output_MSG_06]%</out>
// Remove DL Counts
<out type="pop" extdata="Prox_DL_Count"/>
<out type="pop" extdata="Definition_DL_Count"/>
<out type="pop" extdata="Tor_DL_Count"/>
// Download the Whitelist (Basically, any IP on this list will be removed from the Blocking Database)
<out type="push" extdata="Whitelist_DL_Count">0</out>
// Set the Whitelist update URL
<out type="push" extdata="Whitelist_URL">http://private.proxy.mxpulse.com/Whitelist.ini</out>
// Setup a cache to hold lines 1 to 30000
<out type="push" extdata="Whitelist_input"><operator type="readweb" nvalue="%USERVAR[Whitelist_URL]%" lvalue="l" rvalue="30000"/></out>
// Start reading through the file for the Whitelist entries
<out type="push" extdata="Whitelist_DL_Count"><operator type="+" lvalue="%USERVAR[Whitelist_DL_Count]%" rvalue="1"/></out>
<out type="push" extdata="Whitelist_input"><operator type="readweb" nvalue="%USERVAR[Whitelist_URL]%" lvalue="l" rvalue="%USERVAR[Whitelist_DL_Count]%"/></out>
<out type="push" extdata="Whitelist_File_Check"><operator type="readfile" nvalue="C:\proxy\%USERVAR[Whitelist_input]%.ini" lvalue="l" rvalue="1"/></out>
<out condition="!=" lvalue="%USERVAR[Whitelist_File_Check]%" rvalue="" type="file" extdata="C:\proxy\%USERVAR[Whitelist_input]%.ini" mode="t"></out>
<out type="goto" extdata="-4" condition="!=" lvalue="%USERVAR[Whitelist_input]%" rvalue=""></out>
</command>

<command type="script" usergroup="proxusers">
<in>!tor off</in>
<in>!tor on</in>
// Check if the command was typed at the start of a sentence, if not break
<out type="push" extdata="Prox_CMD_REQ">%TRIGGER%</out>
<out type="push" extdata="Prox_CMD_REQ"><operator type="strleft" lvalue="$Prox_CMD_REQ$" rvalue="6"/></out>
<out type="break" condition="!_?" lvalue="$Prox_CMD_REQ$" rvalue="!tor o"></out>
// Process which command the user typed
<out type="file" mode="t" condition="_?" lvalue="%TRIGGER%" rvalue="on" extdata="C:\proxy\.Download.From.Tor.Direct.Or.Not.ini">0</out>
<out type="file" mode="t" condition="_?" lvalue="%TRIGGER%" rvalue="off" extdata="C:\proxy\.Download.From.Tor.Direct.Or.Not.ini">1</out>
// Output message to Opmsg explaining which setting was chosen and what it does
<out condition="_?" lvalue="%TRIGGER%" rvalue="off">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#The #c63#"#c1#TOR Automatic Updater#c63#"#c9# has been turned #c8#OFF</out>
<out condition="_?" lvalue="%TRIGGER%" rvalue="off">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c62#When this Setting is Off the Bot will Not automatically download a list of TOR Exit Nodes #c63#(#c1#Proxy Servers#c63#)</out>
<out condition="_?" lvalue="%TRIGGER%" rvalue="on">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#The #c63#"#c1#TOR Automatic Updater#c63#"#c9# has been turned #c4#ON</out>
<out condition="_?" lvalue="%TRIGGER%" rvalue="on">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c62#When this Setting is On the Bot will automatically download a list of TOR Exit Nodes #c63#(#c1#Proxy Servers#c63#)</out>
</command>

<command type="script" usergroup="proxusers">
<in>!silent off</in>
<in>!silent on</in>
// Check if the command was typed at the start of a sentence, if not break
<out type="push" extdata="Prox_CMD_REQ">%TRIGGER%</out>
<out type="push" extdata="Prox_CMD_REQ"><operator type="strleft" lvalue="$Prox_CMD_REQ$" rvalue="9"/></out>
<out type="break" condition="!_?" lvalue="$Prox_CMD_REQ$" rvalue="!silent o"></out>
// Process which command the user typed
<out type="file" mode="t" condition="_?" lvalue="%TRIGGER%" rvalue="on" extdata="C:\proxy\.Silent.Mode.ini">1</out>
<out type="file" mode="t" condition="_?" lvalue="%TRIGGER%" rvalue="off" extdata="C:\proxy\.Silent.Mode.ini">0</out>
// Output message to Opmsg explaining which setting was chosen and what it does
<out condition="_?" lvalue="%TRIGGER%" rvalue="off">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#The #c63#"#c1#Proxy Blocker Silent Mode#c63#"#c9# has been turned #c8#OFF</out>
<out condition="_?" lvalue="%TRIGGER%" rvalue="off">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c62#When this Setting is Off the Bot will show all alerts in Opmsg as normal</out>
<out condition="_?" lvalue="%TRIGGER%" rvalue="on">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#The #c63#"#c1#Proxy Blocker Silent Mode#c63#"#c9# has been turned #c4#ON</out>
<out condition="_?" lvalue="%TRIGGER%" rvalue="on">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c62#When this Setting is On the Bot will not show any alerts in opmsg, except when a proxy user is banned and when downloads complete</out>
</command>

<command type="script" usergroup="proxusers">
<in>!PG off</in>
<in>!PG on</in>
// Check if the command was typed at the start of a sentence, if not break
<out type="push" extdata="Prox_CMD_REQ">%TRIGGER%</out>
<out type="push" extdata="Prox_CMD_REQ"><operator type="strleft" lvalue="$Prox_CMD_REQ$" rvalue="5"/></out>
<out type="break" condition="!_?" lvalue="$Prox_CMD_REQ$" rvalue="!PG o"></out>
// Process which command the user typed
<out type="file" mode="t" condition="_?" lvalue="%TRIGGER%" rvalue="on" extdata="C:\proxy\.Download.PG2.Or.Not.ini">0</out>
<out type="file" mode="t" condition="_?" lvalue="%TRIGGER%" rvalue="off" extdata="C:\proxy\.Download.PG2.Or.Not.ini">1</out>
// Output message to Opmsg explaining which setting was chosen and what it does
<out condition="_?" lvalue="%TRIGGER%" rvalue="off">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#The #c63#"#c1#Peer Guardian 2 Updater#c63#"#c9# has been turned #c8#OFF</out>
<out condition="_?" lvalue="%TRIGGER%" rvalue="off">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c62#When this Setting is Off the Bot will Not download the Peer Guardian 2 Blocklist file</out>
<out condition="_?" lvalue="%TRIGGER%" rvalue="on">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#The #c63#"#c1#Peer Guardian 2 Updater#c63#"#c9# has been turned #c4#ON</out>
<out condition="_?" lvalue="%TRIGGER%" rvalue="on">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c62#When this Setting is On the Bot will download the Peer Guardian 2 Blocklist file</out>
</command>

<command type="script" usergroup="proxusers">
<in>!livecheck off</in>
<in>!livecheck on</in>
// Check if the command was typed at the start of a sentence, if not break
<out type="push" extdata="Prox_CMD_REQ">%TRIGGER%</out>
<out type="push" extdata="Prox_CMD_REQ"><operator type="strleft" lvalue="$Prox_CMD_REQ$" rvalue="11"/></out>
<out type="break" condition="!_?" lvalue="$Prox_CMD_REQ$" rvalue="!livecheck "></out>
// Process which command the user typed
<out type="file" mode="t" condition="_?" lvalue="%TRIGGER%" rvalue="on" extdata="C:\proxy\.Live.Proxy.Checking.ini">0</out>
<out type="file" mode="t" condition="_?" lvalue="%TRIGGER%" rvalue="off" extdata="C:\proxy\.Live.Proxy.Checking.ini">1</out>
// Output message to Opmsg explaining which setting was chosen and what it does
<out condition="_?" lvalue="%TRIGGER%" rvalue="off">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#The #c63#"#c1#Live Proxy Checking#c63#"#c9# has been turned #c8#OFF</out>
<out condition="_?" lvalue="%TRIGGER%" rvalue="off">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c62#When this Setting is Off the Bot will not perform any live checks</out>
<out condition="_?" lvalue="%TRIGGER%" rvalue="on">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#The #c63#"#c1#Live Proxy Checking#c63#"#c9# has been turned #c4#ON</out>
<out condition="_?" lvalue="%TRIGGER%" rvalue="on">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c62#When this Setting is On the Bot will make a query to search engines to determine if users are using a Proxy as they enter your room.</out>
</command>

<OnEnter type="script" mode="thread">
// Clear variable "Private_IP_Detected" for a clean run
<out type="pop" extdata="Private_IP_Detected"/>
<out type="pop" extdata="Definition_Result"/>
<out type="pop" extdata="Live_Check_Cache_Date"/>
<out type="pop" extdata="Live_Check_Cache_Content"/>
// Break if the IP is private (127.0.0.1, 192.168.x.x, 10.0.x.x and so on)
<out type="push" extdata="Joined_IP">:%IP%</out>
<out type="push" extdata="Private_IP_Detected" condition="==" lvalue="%IP%" rvalue="127.0.0.1">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":169.254.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.16.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.17.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.18.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.19.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.20.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.21.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.22.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.23.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.24.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.25.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.26.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.27.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.28.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.29.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.30.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":172.31.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":192.168.">1</out>
<out type="push" extdata="Private_IP_Detected" condition="?" lvalue="%USERVAR[Joined_IP]%" rvalue=":10.">1</out>
<out type="break" condition="==" lvalue="%USERVAR[Private_IP_Detected]%" rvalue="1"></out>
// Check if this users IP is present in the current Blocklist, if found Kickban for 60 minutes and alert admins
<out type="push" extdata="Prox_Check"><operator type="readfile" nvalue="C:\proxy\%IP%.ini" lvalue="l" rvalue="1"/></out>
<out condition="!=" lvalue="%USERVAR[Prox_Check]%" rvalue="">/kickban %IP% 60</out>
<out condition="!=" lvalue="%USERVAR[Prox_Check]%" rvalue="">/kickban %IP%</out>
<out condition="!=" lvalue="%USERVAR[Prox_Check]%" rvalue="">/kickban %RAWNAME%</out>
<out condition="!=" lvalue="%USERVAR[Prox_Check]%" rvalue="">/opmsg #c10#%NAME% #c9#is using a Proxy and has had their IP banned for 60 Minutes. #c63#(#c62#%USERVAR[Prox_Check]%#c63#)</out>
// Check that the Live Proxy Checking is Activated (Default is on)
<out type="goto" extdata="21" condition="!=" lvalue="%USERVAR[Prox_Check]%" rvalue=""></out>
<out type="push" extdata="Live_Proxy_Check_Setting"><operator type="readfile" nvalue="C:\proxy\.Live.Proxy.Checking.ini" lvalue="l" rvalue="1"/></out>
<out type="goto" extdata="19" condition="==" lvalue="%USERVAR[Live_Proxy_Check_Setting]%" rvalue="1"></out>
// Check the Cache
<out type="push" extdata="Live_Check_Cache_Date"><operator type="readfile" nvalue="C:\proxy\%IP%.Live.Cache.ini" lvalue="l" rvalue="1"/></out>
<out type="push" extdata="Live_Check_Cache_Content" condition="==" lvalue="%USERVAR[Live_Check_Cache_Date]%" rvalue="%MONTH%"><operator type="readfile" nvalue="C:\proxy\%IP%.Live.Cache.ini" lvalue="l" rvalue="2"/></out>
<out type="push" extdata="Definition_Result" condition="==" lvalue="%USERVAR[Live_Check_Cache_Content]%" rvalue="1">Proxy Detected in the Cache</out>
<out type="goto" extdata="11" condition="==" lvalue="%USERVAR[Live_Check_Cache_Content]%" rvalue="1"></out>
// Process the Query if the Cache wasn't populated within the last month
<out type="push" extdata="Result_Page"><operator type="readweb" nvalue="http://www.google.com/search?q=%IP%" lvalue="c" rvalue="100"/></out>
<out type="pop" extdata="Definition_Result"/>
// Reference the previously downloaded definition file
<out type="push" extdata="Definition_Line">0</out>
<out type="push" extdata="Definition_Line"><operator type="+" lvalue="$Definition_Line$" rvalue="1"/></out>
<out type="push" extdata="Definition_Result"><operator type="readfile" nvalue="C:\proxy\.live.proxy.checker.definitions.ini" lvalue="l" rvalue="$Definition_Line$"/></out>
<out type="goto" extdata="3" condition="==" lvalue="%USERVAR[Definition_Result]%" rvalue=""></out>
<out type="goto" extdata="2" condition="?" lvalue="%USERVAR[Result_Page]%" rvalue="%USERVAR[Definition_Result]%"></out> 
<out type="goto" extdata="-4"></out>
// Create a cache for this IP so that we don't query it again atleast within a month
<out condition="!=" lvalue="%USERVAR[Definition_Result]%" rvalue="" type="file" extdata="C:\proxy\%IP%.Live.Cache.ini" mode="t">%MONTH%\n1\nThis is a Proxy, Detected by Live Proxy Checker</out>
<out condition="==" lvalue="%USERVAR[Definition_Result]%" rvalue="" type="file" extdata="C:\proxy\%IP%.Live.Cache.ini" mode="t">%MONTH%\n0\nNot detected as a Proxy</out>
// If a match was found, Kick/Ban and alert admins to this users Proxy use
<out condition="!=" lvalue="%USERVAR[Definition_Result]%" rvalue="">/kickban %IP% 60</out>
<out condition="!=" lvalue="%USERVAR[Definition_Result]%" rvalue="">/kickban %IP%</out>
<out condition="!=" lvalue="%USERVAR[Definition_Result]%" rvalue="">/kickban %RAWNAME%</out>
<out condition="!=" lvalue="%USERVAR[Definition_Result]%" rvalue="">/opmsg #c10#%NAME% #c9#is using a Proxy and has had their IP banned for 60 Minutes. #c63#(#c62#Live Proxy Checker#c63#)</out>
// If a download is happening right now then skip all this stuff below
<out type="break" condition="==" lvalue="%USERVAR[Prox_DL_Status]%" rvalue="1"></out>
// Check if a download of the Blocklist has been performed today
<out type="push" extdata="Prox_Last_Update"><operator type="readfile" nvalue="C:\proxy\.Proxy.Status.ini" lvalue="l" rvalue="1"/></out>
<out type="push" extdata="Prox_Silent_Mode"><operator type="readfile" nvalue="C:\proxy\.Silent.Mode.ini" lvalue="l" rvalue="1"/></out>
<out type="goto" extdata="2" condition="==" lvalue="%USERVAR[Prox_Silent_Mode]%" rvalue="1"></out>
<out condition="!?" lvalue="%USERVAR[Prox_Last_Update]%" rvalue="%DATE%">/opmsg #c4#Proxy Blocker #c63#(#c62#v1.0.5b#c63#): #c9#An update has not yet been performed today so one will now be attempted automatically.</out>
<out type="self" condition="!?" lvalue="%USERVAR[Prox_Last_Update]%" rvalue="%DATE%">!download</out>
</OnEnter>

//////////////
//
//  Output_MSG_xx Key for Developers, If any of these Varibles are True (1):
//  Output_MSG_01 = Already have latest Blocklist, Skipping to TOR Update
//  Output_MSG_02 = Alternative Blocklist has been set. It will now be downloaded instead of the default one
//  Output_MSG_03 = Downloading of the Proxy List Completed Successfully and downloaded: %USERVAR[Prox_DL_Count]% This Many IP's
//  Output_MSG_04 = Definition File Downloaded Successfully and downloaded: %USERVAR[Definition_DL_Count]% This many Definitions
//  Output_MSG_05 = TOR Updated Successfully and downloaded: %USERVAR[Tor_DL_Count]% This many IP's
//  Output_MSG_06 = This variable includes any/all of the above for the final output in to the Room
//
//////////////


</config>