Jump to content



Photo

Shutup


  • Please log in to reply
No replies to this topic

#1 Snarg

Snarg

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 288 posts

Posted 31 July 2004 - 08:29 PM

This application allows you to build a 'mute list' in Diablo in order to automaticly mute known spammers.
Plain Text         
AutoItSetOption ("SendKeyDelay", 10) $SettingsFile = @SCRIPTDIR & '\Settings.ini' SplashTextOn ('ShutUp 2.0', 'ShutUp 2.0 by Snarg (Supa.Snarg@gmail.com)', 200, 75) Sleep (5000) SplashOff () WinWaitActive ( "Diablo II") ;====== Main Body ======================= While 1 $MuteNames = HotKeySet ("{PGUP}", "ShutUp") $AddNames = HotKeySet ("{INS}", "NewNames") $RemoveName = HotKeySet ("{PGDN}", "DelName")   Select     Case $MuteNames = 0       ShutUp ()     Case $AddNames = 0       NewNames ()     Case $RemoveName = 0       DelName ()     Case WinWaitClose ("Diablo II")       IamDone () EndSelect WEnd ; =========== Subroutines =============== Func ShutUp () WinWaitActive ("Diablo II") Local $A, $I, $File $NumberOfNames = IniRead ($SettingsFile, 'Settings', 'NumberOfNames', "ERROR")   $FileHandle = FileOpen ("ShutUpList.txt", 0)   If $File = -1 Then     MsgBox(0, "Error", "Unable to open file.")     Exit   EndIf   $A = 1     For $I = 1 to $NumberOfNames     $Name = FileReadLine ($FileHandle, $A)         Send ("/squelch " & $Name & '{ENTER}')         Sleep (500)   $A = $A + 1   Next   FileClose ($FileHandle) EndFunc ;======================================================================== Func NewNames () Local $File $NumberOfNames = IniRead ($SettingsFile, 'Settings', 'NumberOfNames', "ERROR")   $AddName = InputBox ("Add Name", "Enter the name to add:", "")     If $AddName = 1 Then           EndIf     $FileHandle = FileOpen ("ShutUpList.txt", 1)       If $File = -1 Then         MsgBox(0, "Error", "Unable to open file.")         Exit       EndIf   FileWriteLine ($FileHandle, @LF & $AddName)   FileClose ($FileHandle) $NumberOfNames = $NumberOfNames + 1 IniWrite ($SettingsFile, 'Settings', 'NumberOfNames', $NumberOfNames) WinActivate ("Diablo II") EndFunc ;======================================================================== Func DelName ()   Local $A, $I, $File, $Line     $NumberOfNames = IniRead ($SettingsFile, 'Settings', 'NumberOfNames', "ERROR")     $RemName = InputBox ("Delete Name", "Enter the name to be deleted:", "")       $Count = 0         $FileHandle = FileOpen ("ShutUpList.txt", 0)           If $File = -1 Then             MsgBox (0, "Error", "Unable to open file.")             Exit           EndIf         $File2 = FileOpen ("TempNameList.txt", 2)           If $File2 = -1 Then            MsgBox (0, "Error", "Unable to open file.")            Exit         EndIf   While 1     $SearchLine = FileReadLine ($FileHandle)       If @error = -1 Then ExitLoop         If $SearchLine <> "" Then           If $SearchLine <> $RemName Then             If $Count = 0 Then               FileWrite ($File2, $SearchLine)             Else               FileWrite ($File2, @CRLF & $SearchLine)             EndIf      $Count = $Count + 1           Else             $Out = MsgBox (4, $SearchLine &" found","Delete?")               If $out=7 Then                 If $Count = 0 Then                   FileWrite ($File2, $SearchLine)                 Else                   FileWrite ($File2, @CRLF & $SearchLine)                 EndIf      $Count = $Count + 1               EndIf           EndIf        EndIf    Wend FileClose ($FileHandle) FileClose ($File2) FileCopy ("TempNameList.txt", "ShutUpList.txt", 1) FileDelete ("TempNameList.txt") $NumberOfNames = $Count IniWrite ($SettingsFile, 'Settings', 'NumberOfNames', $NumberOfNames) WinActivate ("Diablo II") EndFunc ;======================================================================== Func IamDone ()   Exit EndFunc

Edited by Snarg, 05 July 2006 - 01:22 AM.

A little reading goes a long way. Post count means nothing.My sorry little scripts:Multiple TimersTCP String FunctionsYaC-P - Yet Another Chat ProgramScripts for Diablo IIShutUp 1.0CloneHunter 2.3








0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users