home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2002 June / maximum-cd-2002-06.iso / Software / Extras / Gamespy / GameSpyInstaller255STD.exe / %MAINDIR% / gamespy.mirc < prev    next >
Encoding:
Text File  |  2002-01-16  |  3.5 KB  |  108 lines

  1. ; Example mIRC script to read LaunchInfo.txt
  2. ; To load copy this file to your scripts directory and type
  3. ; /load -rs <pathname>gamespy.mirc
  4. ; in any mIRC window and click yes when the warning appears.
  5. ; Don't e-mail me about how it works (or doesn't)
  6. ; Feel free to improve on it!
  7. ; If you want to send me a copy. It might even get included with GameSpy!
  8. ; Kevin "Zob the Slayer" Brown
  9. ; support@gamespy.com    
  10. ; REVISED: 27-Sep-2000 by deathmint[kT] <deathmint@hijinx.com>
  11. ; Thanks first go to Kevin for the starting point! <<APPLAUSE>>
  12. ; I had a world of trouble getting this script as included with GameSpy
  13. ; to work with mIRC 5.8 however.
  14. ; It looks like Kevin may have been fighting script parser bugs in earlier versions
  15. ; of mIRC. I fought with the script to make it work and added a couple features
  16. ; to boot.
  17. ; Load this script by sending: /load -rs gamespy.mrc
  18. ; ...then click the Yes button to run the load routine and make sure your
  19. ; GameSpy directory is selected correctly in the directory chooser window
  20. ; that gets displayed.
  21. ; NOTE: You will be warned repeatedly if the variable %LaunchInfo is ever deleted
  22. ; without this script having been unloaded. You can either unload it or define
  23. ; the proper variable, e.g.: /set %LaunchInfo "c:\Program Files\GameSpy\LaunchInfo.txt"
  24. ; Unload this script by sending: /unload -rs gamespy.mrc
  25. ; CHANGES:
  26. ; The script now sends the "playing" message to all channels you're connected to
  27. ; The aliases are defined to be local so as not to interfere with other scripts
  28. ; and gets rid of the double "back" message the original gave
  29. ; Clarified/simplified on-screen instructions for "returning"
  30. ; Added a cleanup alias that unsets variables that don't need to be stored globally
  31. ; Changed script filename to gamespy.mrc since .mrc extension is more meaningful
  32. ; to mIRC
  33.  
  34.  
  35. ON 1:LOAD:{ if (%LaunchInfo == $null) setupLaunchInfo }
  36.  
  37. ON 1:START:{ .timergs_timer 0 2 gs_check }
  38.  
  39. ON 1:INPUT:#:{ if (%gs_active == 1) back }
  40.  
  41. alias -l setupLaunchInfo {
  42.   %q_temp = $sdir="Locate the GameSpy folder" "c:\Program Files\GameSpy\"
  43.   %LaunchInfo = %q_temp $+ LaunchInfo.txt
  44.   unset %q_temp
  45. }
  46.  
  47. alias -l gs_check { 
  48.   if ($exists(%Launchinfo) == $true) doGsLaunch
  49. }
  50.  
  51. alias -l doGsLaunch { 
  52.   .timergs_timer off
  53.   if (%LaunchInfo == $null) {
  54.     .echo -a Please "/unload -rs gamespy.mrc" then "/load -rs gamespy.mrc" script again
  55.     exit
  56.   }
  57.   set %gs_game $read -l1 %Launchinfo
  58.   set %gs_game $remove( %gs_game , GameType )
  59.   set %gs_serv $read -l2 %Launchinfo
  60.   set %gs_serv $remove( %gs_serv ,ServerName )
  61.   set %gs_add  $read -l3 %Launchinfo
  62.   set %gs_add  $remove( %gs_add ,ServerAddr )    
  63.   set %gs_mod  $read -l4 %Launchinfo
  64.   set %gs_mod  $remove( %gs_mod ,ServerMod )
  65.   %c = $chan(0)
  66.   while ( %c > 0 ) {
  67.     %theChannel = $chan(%c)
  68.     msg %theChannel Playing %gs_game %gs_mod at %gs_serv - %gs_add
  69.     .echo %theChannel You have been marked AWAY...
  70.     .echo %theChannel This will be changed automatically when you send text to a channel
  71.     dec %c
  72.   }
  73.   .AWAY Playing %gs_game %gs_mod at %gs_serv - %gs_add
  74.   if $exists(%LaunchInfo) { .remove $shortfn(%LaunchInfo) }
  75.   cleanup
  76.   set %gs_active 1
  77. }
  78.  
  79. alias -l back {
  80.   me is back, fresh from the kill!
  81.   away
  82.   if $exists(%LaunchInfo) { .remove $shortfn(%LaunchInfo) }
  83.   .timergs_timer 0 1 gs_check
  84.   set %gs_active 0
  85. }
  86.  
  87. alias -l cleanup {
  88.   unset %c
  89.   unset %theChannel
  90.   unset %gs_game
  91.   unset %gs_serv
  92.   unset %gs_add
  93.   unset %gs_mod
  94. }
  95.