Advertisement
westor

[PLAY NOW]: PacMan via mIRC (by Wims)

Jun 11th, 2015
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 6.10 KB | None | 0 0
  1. alias -l pac_cinstall {
  2.   if (!$sslready) return $input(You do not have SSL capabilities. SSL is required to download Pacman $+ $crlf See http://www.mirc.com/ssl.html for more information,wo,Pacman install)
  3.   if ($input($+(Do you want to install to the default folder?,$crlf,Default folder: $scriptdirPacman\),yi,Pacman - Install)) set %pac_dir_install $scriptdirPacman\
  4.   elseif ($sdir($mircdir,Where do you want to install Pacman to?) != $null) set %pac_dir_install $v1
  5.   else return $input($+(The installation has been cancelled,$crlf,Execute this installer again if you want to install),ow,Pacman - Install)
  6.   if (!$isdir(%pac_dir_install)) mkdir $qt(%pac_dir_install)
  7.   if (!$isdir(%pac_dir_install $+ maps)) mkdir $qt(%pac_dir_install $+ maps)
  8.   sockclose pac_ckinst
  9.   sockopen -e pac_ckinst dl.dropboxusercontent.com 443
  10.   sockmark pac_ckinst $false
  11.   write -c $qt(%pac_dir_install $+ update.pac)
  12. }
  13.  
  14. on *:sockopen:pac_ckinst:{
  15.   if (!$sockerr) {
  16.     sockwrite -n $sockname GET /u/4249275/Pacman/update.pac HTTP/1.1
  17.     sockwrite -n $sockname Host: dl.dropboxusercontent.com
  18.     sockwrite -n $sockname Connection: close
  19.     sockwrite -n $sockname
  20.   }
  21.   else {
  22.     .timer -ho 1 0 noop $!input(Cannot connect to the server $+ $chr(44) aborting the installation..,ow,Pacman - Install)
  23.     unset %pac_dir_install
  24.   }
  25. }
  26.  
  27. on *:sockread:pac_ckinst:{
  28.   if (!$sockerr) {
  29.     if ($sock($sockname).mark) {
  30.       sockread -f &a
  31.       bwrite $qt(%pac_dir_install $+ \update.pac) -1 -1 &a
  32.     }
  33.     else {
  34.       var %a
  35.       sockread %a
  36.       if (%a == $null) sockmark $sockname 1
  37.       elseif ($sock($sockname).mark == $false) {
  38.         if (*200 OK* !iswm %a) {
  39.           .timer -ho 1 0 noop $!input(Cannot find the list of files $!+ $!chr(44) the installation has been aborted.,wo,Pacman - Install)
  40.           sockclose $sockname
  41.           .remove $qt(%pac_dir_install $+ update.pac)
  42.           unset %pac_dir_install
  43.         }
  44.         sockmark $sockname 0
  45.       }
  46.     }
  47.   }
  48.   else {
  49.     .timer -ho 1 0 noop $!input(An error occured while downloading the list of files $!+ $!chr(44) the installation has been aborted.,wo,Pacman - Install)
  50.     .remove $qt(%pac_dir_install $+ update.pac)
  51.     unset %pac_dir_install
  52.   }
  53. }
  54. on *:sockclose:pac_ckinst:pac_install
  55.  
  56. alias -l pac_install {
  57.   var %a 2
  58.   while ($read(%pac_dir_install $+ update.pac,tn,%a)) {
  59.     pac_dl_install %a $v1
  60.     inc %a
  61.   }
  62.   set %pacinstall %a - 2
  63. }
  64.  
  65. alias -l pac_dl_install {
  66.   sockclose pac_install $+ $1
  67.   sockopen -e pac_install $+ $1 dl.dropboxusercontent.com 443
  68.   sockmark pac_install $+ $1 $2-
  69. }
  70.  
  71. on *:sockopen:pac_install?*:{
  72.   if (!$sockerr) {
  73.     .fopen -no $sockname $qt(%pac_dir_install $+ $sock($sockname).mark)
  74.     sockwrite -n $sockname GET $+(/u/4249275/Pacman/,$sock($sockname).mark) HTTP/1.1
  75.     sockwrite -n $sockname Host: dl.dropboxusercontent.com
  76.     sockwrite -n $sockname Connection: close
  77.     sockwrite -n $sockname
  78.     sockmark $sockname $false
  79.   }
  80.   else {
  81.     .timer -ho 1 0 noop $!input(Cannot connect to the server to download the file $sock($sockname).mark $!+ $!chr(44) the installation has been aborted.,ow,Pacman - Install)
  82.     pac_abortinstall
  83.   }
  84. }
  85.  
  86. on *:sockread:pac_install?*:{
  87.   if (!$sockerr) {
  88.     if ($sock($sockname).mark) {
  89.       sockread -f &a
  90.       .fwrite -b $sockname &a
  91.     }
  92.     else {
  93.       var %a
  94.       sockread %a
  95.       if (%a == $null) sockmark $sockname 1
  96.       elseif ($sock($sockname).mark == $false) {
  97.         if (*200 OK* !iswm %a) {
  98.           .timer -ho 1 0 noop $!input(Cannot find the file $fopen($sockname).fname on the server $!+ $!chr(44) the installation has been aborted.,ho,Pacman - Install)
  99.           pac_abortinstall
  100.         }
  101.         sockmark $sockname 0
  102.       }
  103.     }
  104.   }
  105.   else {
  106.     .timer -ho 1 0 noop $!input(An error occured while downloading the file $fopen($sockname).fname $!+ $!chr(44) the installation has been aborted.,ho,Pacman - Install)
  107.     pac_abortinstall
  108.   }
  109. }
  110.  
  111. alias -l pac_abortinstall {
  112.   sockclose pac_install?*
  113.   .fclose pac_install?*
  114.   var %a 2
  115.   while ($read(%pac_dir_install $+ update.pac,tn,%a) != $null)  {
  116.     if (*.mrc iswm $v1) .unload -rs $qt($v2)
  117.     .remove $qt(%pac_dir_install $+ $v2)
  118.     inc %a
  119.   }
  120.   .remove $qt(%pac_dir_install $+ update.pac)
  121.   unset %pac_dir_install %pacinstall
  122. }
  123.  
  124. on *:sockclose:pac_install?*:{
  125.   var %f $fopen($sockname).fname
  126.   dec %pacinstall
  127.   .fclose $sockname
  128.   if ($right(%f,4) == .mrc) .load -rs $qt(%f)
  129.   if (!%pacinstall) { unset %pacinstall | .timer -h 1 0 pac_finstall }
  130. }
  131. alias pac_finstall {
  132.   noop $input(Pacman installed sucessfully!,t,Pacman - Install)
  133.   if ($input($+(Do you want to delete the file used for the installer (that file will be unloaded as well)?,$crlf,File : $script),wy,Pacman - Install)) {
  134.     !.remove $qt($script)
  135.     var %u 1
  136.   }
  137.   if (!$v1) && ($input(Do you want to unload that file anyway?,wy,Pacman - Install)) var %u 1
  138.   var %m1 menubar,%m2 menubar,status,%m3 menubar,channel, %m4 menubar,query,%m5 menubar,status,channel,%m6 menubar,status,query,%m7 menubar,status,channel,query
  139.   var %menu $input(Please select some popups locations for Pacman,m,Pacman - Install,%m1,%m1,%m2,%m3,%m4,%m5,%m6,%m7)
  140.   var %read $read($script(pacman.mrc),wnt,menu & $({,0))
  141.   write -l $+ $readn $qt($script(pacman.mrc)) menu %menu $({,0)
  142.   ;left up right down nicklobby nickgame autodupdate dialtop wintop blink upnp
  143.   write -il1 $qt($script(pacman.mrc)) ;37 38 39 40 - - 0 0 0 1 0 0
  144.   .reload -rs $qt($script(pacman.mrc))
  145.   pacman
  146.   if (%u) .unload -rs $qt($script)
  147. }
  148.  
  149.  
  150. menu menubar,channel,query,status {
  151.   Pacman Install: pacman_install
  152. }
  153. alias Pacman_install {
  154.   if ($script(pacman.mrc)) || ($script(pac_server.mrc)) || ($script(pac_client.mrc)) || ($script(pac_lobby.mrc)) || ($script(pac_editor.mrc)) return $input($+(The following Pacman file is loaded:,$crlf,$v1,$crlf,Please unload it before reinstalling Pacman),oi,Pacman - Install)
  155.   if ($version >= 7.22) || ($input($+(Pacman Online requires a version of mIRC greater or equal to 7.22,$crlf,You are using mIRC v,$version,$chr(44) $chr(32),Do you want to install nonetheless?),yw,Pacman - Install)) pac_cinstall
  156. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement