Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias -l pac_cinstall {
- 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)
- if ($input($+(Do you want to install to the default folder?,$crlf,Default folder: $scriptdirPacman\),yi,Pacman - Install)) set %pac_dir_install $scriptdirPacman\
- elseif ($sdir($mircdir,Where do you want to install Pacman to?) != $null) set %pac_dir_install $v1
- else return $input($+(The installation has been cancelled,$crlf,Execute this installer again if you want to install),ow,Pacman - Install)
- if (!$isdir(%pac_dir_install)) mkdir $qt(%pac_dir_install)
- if (!$isdir(%pac_dir_install $+ maps)) mkdir $qt(%pac_dir_install $+ maps)
- sockclose pac_ckinst
- sockopen -e pac_ckinst dl.dropboxusercontent.com 443
- sockmark pac_ckinst $false
- write -c $qt(%pac_dir_install $+ update.pac)
- }
- on *:sockopen:pac_ckinst:{
- if (!$sockerr) {
- sockwrite -n $sockname GET /u/4249275/Pacman/update.pac HTTP/1.1
- sockwrite -n $sockname Host: dl.dropboxusercontent.com
- sockwrite -n $sockname Connection: close
- sockwrite -n $sockname
- }
- else {
- .timer -ho 1 0 noop $!input(Cannot connect to the server $+ $chr(44) aborting the installation..,ow,Pacman - Install)
- unset %pac_dir_install
- }
- }
- on *:sockread:pac_ckinst:{
- if (!$sockerr) {
- if ($sock($sockname).mark) {
- sockread -f &a
- bwrite $qt(%pac_dir_install $+ \update.pac) -1 -1 &a
- }
- else {
- var %a
- sockread %a
- if (%a == $null) sockmark $sockname 1
- elseif ($sock($sockname).mark == $false) {
- if (*200 OK* !iswm %a) {
- .timer -ho 1 0 noop $!input(Cannot find the list of files $!+ $!chr(44) the installation has been aborted.,wo,Pacman - Install)
- sockclose $sockname
- .remove $qt(%pac_dir_install $+ update.pac)
- unset %pac_dir_install
- }
- sockmark $sockname 0
- }
- }
- }
- else {
- .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)
- .remove $qt(%pac_dir_install $+ update.pac)
- unset %pac_dir_install
- }
- }
- on *:sockclose:pac_ckinst:pac_install
- alias -l pac_install {
- var %a 2
- while ($read(%pac_dir_install $+ update.pac,tn,%a)) {
- pac_dl_install %a $v1
- inc %a
- }
- set %pacinstall %a - 2
- }
- alias -l pac_dl_install {
- sockclose pac_install $+ $1
- sockopen -e pac_install $+ $1 dl.dropboxusercontent.com 443
- sockmark pac_install $+ $1 $2-
- }
- on *:sockopen:pac_install?*:{
- if (!$sockerr) {
- .fopen -no $sockname $qt(%pac_dir_install $+ $sock($sockname).mark)
- sockwrite -n $sockname GET $+(/u/4249275/Pacman/,$sock($sockname).mark) HTTP/1.1
- sockwrite -n $sockname Host: dl.dropboxusercontent.com
- sockwrite -n $sockname Connection: close
- sockwrite -n $sockname
- sockmark $sockname $false
- }
- else {
- .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)
- pac_abortinstall
- }
- }
- on *:sockread:pac_install?*:{
- if (!$sockerr) {
- if ($sock($sockname).mark) {
- sockread -f &a
- .fwrite -b $sockname &a
- }
- else {
- var %a
- sockread %a
- if (%a == $null) sockmark $sockname 1
- elseif ($sock($sockname).mark == $false) {
- if (*200 OK* !iswm %a) {
- .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)
- pac_abortinstall
- }
- sockmark $sockname 0
- }
- }
- }
- else {
- .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)
- pac_abortinstall
- }
- }
- alias -l pac_abortinstall {
- sockclose pac_install?*
- .fclose pac_install?*
- var %a 2
- while ($read(%pac_dir_install $+ update.pac,tn,%a) != $null) {
- if (*.mrc iswm $v1) .unload -rs $qt($v2)
- .remove $qt(%pac_dir_install $+ $v2)
- inc %a
- }
- .remove $qt(%pac_dir_install $+ update.pac)
- unset %pac_dir_install %pacinstall
- }
- on *:sockclose:pac_install?*:{
- var %f $fopen($sockname).fname
- dec %pacinstall
- .fclose $sockname
- if ($right(%f,4) == .mrc) .load -rs $qt(%f)
- if (!%pacinstall) { unset %pacinstall | .timer -h 1 0 pac_finstall }
- }
- alias pac_finstall {
- noop $input(Pacman installed sucessfully!,t,Pacman - Install)
- 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)) {
- !.remove $qt($script)
- var %u 1
- }
- if (!$v1) && ($input(Do you want to unload that file anyway?,wy,Pacman - Install)) var %u 1
- 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
- var %menu $input(Please select some popups locations for Pacman,m,Pacman - Install,%m1,%m1,%m2,%m3,%m4,%m5,%m6,%m7)
- var %read $read($script(pacman.mrc),wnt,menu & $({,0))
- write -l $+ $readn $qt($script(pacman.mrc)) menu %menu $({,0)
- ;left up right down nicklobby nickgame autodupdate dialtop wintop blink upnp
- write -il1 $qt($script(pacman.mrc)) ;37 38 39 40 - - 0 0 0 1 0 0
- .reload -rs $qt($script(pacman.mrc))
- pacman
- if (%u) .unload -rs $qt($script)
- }
- menu menubar,channel,query,status {
- Pacman Install: pacman_install
- }
- alias Pacman_install {
- 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)
- 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
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement