home *** CD-ROM | disk | FTP | other *** search
- ; Example mIRC script to read LaunchInfo.txt
- ;
- ; To load copy this file to your scripts directory and type
- ; /load -rs <pathname>gamespy.mirc
- ; in any mIRC window and click yes when the warning appears.
- ;
- ; Don't e-mail me about how it works (or doesn't)
- ;
- ; Feel free to improve on it!
- ; If you want to send me a copy. It might even get included with GameSpy!
- ; Kevin "Zob the Slayer" Brown
- ; support@gamespy.com
- ;
- ; REVISED: 27-Sep-2000 by deathmint[kT] <deathmint@hijinx.com>
- ; Thanks first go to Kevin for the starting point! <<APPLAUSE>>
- ; I had a world of trouble getting this script as included with GameSpy
- ; to work with mIRC 5.8 however.
- ; It looks like Kevin may have been fighting script parser bugs in earlier versions
- ; of mIRC. I fought with the script to make it work and added a couple features
- ; to boot.
- ;
- ; Load this script by sending: /load -rs gamespy.mrc
- ; ...then click the Yes button to run the load routine and make sure your
- ; GameSpy directory is selected correctly in the directory chooser window
- ; that gets displayed.
- ;
- ; NOTE: You will be warned repeatedly if the variable %LaunchInfo is ever deleted
- ; without this script having been unloaded. You can either unload it or define
- ; the proper variable, e.g.: /set %LaunchInfo "c:\Program Files\GameSpy\LaunchInfo.txt"
- ;
- ; Unload this script by sending: /unload -rs gamespy.mrc
- ;
- ; CHANGES:
- ;
- ; The script now sends the "playing" message to all channels you're connected to
- ;
- ; The aliases are defined to be local so as not to interfere with other scripts
- ; and gets rid of the double "back" message the original gave
- ;
- ; Clarified/simplified on-screen instructions for "returning"
- ;
- ; Added a cleanup alias that unsets variables that don't need to be stored globally
- ;
- ; Changed script filename to gamespy.mrc since .mrc extension is more meaningful
- ; to mIRC
-
-
- ON 1:LOAD:{ if (%LaunchInfo == $null) setupLaunchInfo }
-
- ON 1:START:{ .timergs_timer 0 2 gs_check }
-
- ON 1:INPUT:#:{ if (%gs_active == 1) back }
-
- alias -l setupLaunchInfo {
- %q_temp = $sdir="Locate the GameSpy folder" "c:\Program Files\GameSpy\"
- %LaunchInfo = %q_temp $+ LaunchInfo.txt
- unset %q_temp
- }
-
- alias -l gs_check {
- if ($exists(%Launchinfo) == $true) doGsLaunch
- }
-
- alias -l doGsLaunch {
- .timergs_timer off
- if (%LaunchInfo == $null) {
- .echo -a Please "/unload -rs gamespy.mrc" then "/load -rs gamespy.mrc" script again
- exit
- }
- set %gs_game $read -l1 %Launchinfo
- set %gs_game $remove( %gs_game , GameType )
- set %gs_serv $read -l2 %Launchinfo
- set %gs_serv $remove( %gs_serv ,ServerName )
- set %gs_add $read -l3 %Launchinfo
- set %gs_add $remove( %gs_add ,ServerAddr )
- set %gs_mod $read -l4 %Launchinfo
- set %gs_mod $remove( %gs_mod ,ServerMod )
- %c = $chan(0)
- while ( %c > 0 ) {
- %theChannel = $chan(%c)
- msg %theChannel Playing %gs_game %gs_mod at %gs_serv - %gs_add
- .echo %theChannel You have been marked AWAY...
- .echo %theChannel This will be changed automatically when you send text to a channel
- dec %c
- }
- .AWAY Playing %gs_game %gs_mod at %gs_serv - %gs_add
- if $exists(%LaunchInfo) { .remove $shortfn(%LaunchInfo) }
- cleanup
- set %gs_active 1
- }
-
- alias -l back {
- me is back, fresh from the kill!
- away
- if $exists(%LaunchInfo) { .remove $shortfn(%LaunchInfo) }
- .timergs_timer 0 1 gs_check
- set %gs_active 0
- }
-
- alias -l cleanup {
- unset %c
- unset %theChannel
- unset %gs_game
- unset %gs_serv
- unset %gs_add
- unset %gs_mod
- }
-