'***************************************************** ' Header and Info '***************************************************** ' ' This Script will generate a series of binds that can be used for "Setting the Title" ' on your City of Heroes / City of Villains Character, in order to have the badges of your ' character validated on the Titan Network Game Tracker site ' ' It allows you to select the folder where the binds will be generated ' as well as selecting the key to be temporarily replaced ' Created by "Iceheart" - http://boards.cityofvillains.com/showprofile.php?Cat=0&User=167553 ' 2008/04 ' ' Based on an original idea for set_title binds by ' Maverick X, as posted in the Titan Networks Forums ' at: http://www.cohtitan.com/forum/index.php/topic,2.0.html ' ' References: ' City of Heroes game main website: http://www.cityofheroes.com ' City of villains game main website: http://cityofvillains.com ' Titan Network aggregated site: http://www.cohtitan.com/ ' Titan Network City InfoTracker site: http://cit.cohtitan.com/ ' ' Disclaimer: ' This script is provided AS-IS; ' It is YOUR responsibility if you execute it in your system!!! ' There are NO guarantees, express or implied that it will work for you correctly, ' or that it will not affect your system adversely. ' This script is provided free and can be modified as needed. ' This script is not an exercise in best-coding practices, there are always better ways to code things ;) ' ' Happy Badge-Hunting!! ' ' UPDATES ' 2008-08-04: ' Updated to show new CityInfoTracker Sites ' Updated to generate set_title_binds_commandline.txt ' 2008-12-23: ' Expanded to 1200 settitle's ' 2008-12-23: ' Konoko added comments ' added option for relative paths ' '***************************************************** ' Main Sub '***************************************************** Option Explicit Const intMaxItems=1199 Dim strBindsPath, strBindsLetter, strBindsCommand, strMsgLine, strBindsPathRelative Main Sub Main dim iCounter 'dialog "Start" confirmation if MsgBox ("Set_Title Binds Generator is starting...",1,"Set Title Binds Generator Script")=2 then MsgBox "Cancelling..",0,"Generation cancelled" exit Sub end if 'dialog "Output Folder" strBindsPath = BrowseFolder( "", "Select folder to place Set_Title binds..", False ) if strBindsPath="" then MsgBox "No folder selected. Cancelling..",0,"Generation cancelled" exit Sub end if ' add slash to folder output strBindsPath=strBindsPath+"\" ' strBindsPathRelative defaults to strBindsPath strBindsPathRelative=strBindsPath ' dialog "Relative Path" strMsgLine="Would you like to use a Relative Path?"+ Chr(13) strMsgLine=strMsgLine+"This will require the files to be placed in the City of Heroes installation directory." if MsgBox (strMsgLine,1,"Relative Paths dialog test")=1 then strMsgLine="Please enter the relative path you wish to use."+Chr(13) strMsgLine=strMsgLine+"The bind files will need to be placed in the City of Heroes installation directory. Specifically in the \data or \piggs folder" strBindsPathRelative=InputBox(strMsgLine,"Relative Paths Input test",".\") if len(strBindsPathRelative)=0 then MsgBox "Path was empty. Cancelling..",0,"Generation cancelled" exit Sub end if end if ' dialog "Trigger" selection, the key that will be pressed multiple times ' DOES NOT SUPPORT CHORD KEYS strMsgLine="Please type the letter you want to temporarily use. The default is 'T'"+ Chr(13) strMsgLine=strMsgLine+"You MUST use standard letters and numbers. This script cannot read or validate F keys, or CTRL,ALT or SHIFT variations, " strBindsLetter=InputBox(strMsgLine,"Select command letter","T") if len(strBindsLetter)=0 then MsgBox "No letter was entered. Cancelling..",0,"Generation cancelled" exit Sub end if if len(strBindsLetter)>1 then MsgBox "Multiple letters selected. Cancelling..",0,"Generation cancelled" exit Sub end if 'custom command for the "trigger" once verification is complete dialog strMsgLine="Please type the command currently associated with that letter. The default for the letter 'T' was 'Target'"+chr(13)+"If you want to unbind the command, you MUST type 'nop' - without the quotes" strBindsCommand=InputBox(strMsgLine,"Select current command ","target") if strBindsPath="" then MsgBox "No command was entered. Cancelling..",0,"Generation cancelled" exit Sub end if 'confirmation dialog strMsgLine="Binds Generator is ready to generate bind files. Please review your settings:" + chr(13)+Chr(13) strMsgLine=strMsgLine+"Folder path: "+ strBindsPath + Chr(13) 'strMsgLine=strMsgLine+"Relative path: "+ strBindsPathRelative strMsgLine=strMsgLine+"Temporary Key: "+ strBindsLetter + Chr(13) strMsgLine=strMsgLine+"Original command: "+ strBindsCommand + Chr(13)+chr(13) strMsgLine=strMsgLine+"Ready to proceed ?" if MsgBox (strMsgLine,1,"Review your settings and confirm")=2 then MsgBox "Cancelling..",0,"Generation cancelled" exit Sub end if GenStartFile() for iCounter= 0 to intMaxItems step 10 GenMiddleFiles(iCounter) next GenEndFile() GenCommandLineFile() End Sub '***************************************************** ' Supporting Functions '***************************************************** 'Generate File "set_title_binds_start.txt" used to start the badge verification proccess Function GenStartFile Dim fso, objFile Set fso = CreateObject("Scripting.FileSystemObject") 'strBindsPath is used here for the file creation. Set objFile = fso.CreateTextFile(strBindsPath+"set_title_binds_start.txt", True) strMsgLine = strBindsLetter+ " " + chr(34) + "t $name, Starting Bind Verification. Please press "+ chr(39) strMsgLine = strMsgLine + strBindsLetter + chr(39) + " slowly until finished. TNTBM-On$$bindloadfile " ' strMsgLine = strMsgLine + strBindsPath + "set_title_binds_0-9.txt" + chr(34) 'strBindsPathRelative is used inside the file itself strMsgLine = strMsgLine + strBindsPathRelative + "set_title_binds_0-9.txt" + chr(34) objFile.WriteLine(strMsgLine) objFile.Close End Function 'Generate File "set_title_binds_done.txt"uysed at the end to reset the trigger key Function GenEndFile Dim fso, objFile Set fso = CreateObject("Scripting.FileSystemObject") 'strBindsPath is used here for the file creation. Set objFile = fso.CreateTextFile(strBindsPath+"set_title_binds_done.txt", True) strMsgLine = strBindsLetter + " " + chr(34)+"t $name, Set_Title binds run finished. Thank you for using CityInfoTerminal.com. Resetting key: "+chr(39) strMsgLine = strMsgLine + strBindsLetter + chr(39)+" to its original command: '" strMsgLine = strMsgLine + strBindsCommand +chr(39)+". TNTBM-Off$$bind " strMsgLine = strMsgLine + strBindsLetter + " " + strBindsCommand + chr(34) objFile.WriteLine(strMsgLine) objFile.Close End Function 'Generate File "set_title_commandline.txt" which is a helpfile of sorts. Also gives user dialog box with the command to type to start badge verification Function GenCommandLineFile () Dim fso, objFile strMsgLine =" Set Title binds have been generated successfully! :) "+ chr(13) strMsgLine = strMsgLine + "You can Copy-Paste the line below and use it in your CoH/CoV game chat window to get started."+Chr(13)+Chr(13) strMsgLine = strMsgLine + "Alternatively, you can always go to your set-title binds folder at:"+Chr(13) 'This statement may be confusing if the user chose to use relative paths instead of absolute paths. Too bad. strMsgLine = strMsgLine + strBindsPathRelative+Chr(13) strMsgLine = strMsgLine + "and look for the file: "+Chr(34)+"set_title_commandline.txt"+Chr(34)+chr(13) strMsgLine = strMsgLine + "which has this same information."+Chr(13)+Chr(13) strMsgLine = strMsgLine + " Thanks for using the Set-title Binds Generator script, and.. "+Chr(13) strMsgLine = strMsgLine + " Happy Badge-Hunting!"+Chr(13) Set fso = CreateObject("Scripting.FileSystemObject") 'strBindsPath is used here for the file creation. Set objFile = fso.CreateTextFile(strBindsPath+"set_title_binds_commandline.txt", True) objFile.WriteLine(strMsgLine+Chr(13)+Chr(13)) objFile.WriteLine("The command line to use in your COH/COV game Chat Window is:"+chr(13)) 'objFile.WriteLine("/bindloadfile "+strBindsPath+"set_title_binds_start.txt") 'This statement may be confusing if the user chose to use relative paths instead of absolute paths. Too bad. objFile.WriteLine("/bindloadfile "+strBindsPathRelative+"set_title_binds_start.txt") objFile.Close ' InputBox strMsgLine,"Generation successful!","/bindloadfile "+strBindsPath+"set_title_binds_start.txt" InputBox strMsgLine,"Generation successful!","/bindloadfile "+strBindsPathRelative+"set_title_binds_start.txt" End Function 'Generate File "set_title_binds_*", will be called multiple times. Function GenMiddleFiles (intIndex) Dim fso, objFile, strMidFilename, strMidFilenameNext, jCounter strMidFilename="set_title_binds_" strMidFilename=strMidFilename + Cstr(intIndex) + "-" + CStr(intIndex+9) +".txt" Set fso = CreateObject("Scripting.FileSystemObject") 'strBindsPath is used here for the file creation. Set objFile = fso.CreateTextFile(strBindsPath+strMidFilename, True) if intIndex+10