XaVeR Posted November 5, 2005 Share Posted November 5, 2005 Hi, i need !updater script, did aanyone have this script ? [sorry 4 my english ] Link to comment
Mophead Posted November 5, 2005 Share Posted November 5, 2005 You could A) Ask Aeron for his. B) Filter it from MP-Global script. C) Make your own. Link to comment
XaVeR Posted November 5, 2005 Author Share Posted November 5, 2005 i'm from poland and i havent msn to contact with him update script from mp-global doesn't work any ideac ? Link to comment
MeanpantheR Posted November 6, 2005 Share Posted November 6, 2005 update script from mp-global doesn't work it dose. if you find out how to edit it to your website etc. and un-comment it, it will work fine for you. because atm its linked up with my site Link to comment
Aeron Posted November 6, 2005 Share Posted November 6, 2005 alias [uPDATE_ALIAS] { if (!$sock([uPDATE_ALIAS])) { var %a = $findfile($mircdir,*.tmp,0,1,!.remove " $+ $1-") mta.log $dialog(mta).tab * Updater: Checking for [YOUR_SCRIPT_NAME] updates... !sockclose [uPDATE_ALIAS] !sockopen [uPDATE_ALIAS] [YOUR_HOST] 80 } } dialog -l [uPDATE_ALIAS] { title "[YOUR_SCRIPT_NAME] Updater" size -1 -1 94 98 option dbu icon [YOUR_SCRIPT_ICON], 0 button "Yes", 1, 8 84 37 12 button "No", 2, 52 84 37 12, ok edit "", 3, 2 2 90 54, multi return vsbar text "Status:", 4, 2 58 19 8 text "", 5, 22 58 69 14 box "", 6, 2 70 90 11 text "", 7, 4 74 86 5 } on *:sockopen:[uPDATE_ALIAS]: { if (!$sockerr) !sockwrite -n [uPDATE_ALIAS] GET [YOUR_FILES_DIRECTORY][YOUR_UPDATE_FILE] $+(HTTP/1.1,$crlf,Host: [YOUR_HOST],$crlf,Connection: Close,$crlf,$crlf) elseif ($dialog(mta)) mta.log $dialog(mta).tab * Updater: Connection problems. } on *:sockread:[uPDATE_ALIAS]:{ !sockread &a while ($sockbr != 0) { !bwrite [YOUR_TEMPORARY_FILE] -1 &a !sockread &a } } on *:sockclose:[uPDATE_ALIAS]:{ if ($dialog(mta)) && (!$dialog([uPDATE_ALIAS])) { !bread [YOUR_TEMPORARY_FILE] 1 $file([YOUR_TEMPORARY_FILE]).size &a !bcopy -c &a 1 &a $calc($bfind(&a,1,10 13 10)+3) -1 !.remove [YOUR_TEMPORARY_FILE] !bwrite [YOUR_TEMPORARY_FILE] 0 &a var %a = $read([YOUR_TEMPORARY_FILE],2) if (%a !isnum) { !.remove [YOUR_TEMPORARY_FILE] mta.log $dialog(mta).tab * Updater: Invalid update file. } elseif ([YOUR_SCRIPT_VERSION_ALIAS] < %a) { mta.log $dialog(mta).tab * Updater: Version %a available. !dialog -v mta !dialog -ma [uPDATE_ALIAS] [uPDATE_ALIAS] !did -m [uPDATE_ALIAS] 3 !did -a [uPDATE_ALIAS] 5 Download version %a $+ ? !loadbuf -o [uPDATE_ALIAS] 3 [YOUR_TEMPORARY_FILE] } else { !.remove [YOUR_TEMPORARY_FILE] mta.log $dialog(mta).tab * Updater: No updates. } } } on *:sockopen:[DOWNLOAD_ALIAS]:{ if ($sockerr == 0) { !tokenize 32 $read([YOUR_TEMPORARY_FILE],$sock([DOWNLOAD_ALIAS]).mark) if ($1 == Fixes:) { !did -a [uPDATE_ALIAS] 5 Finished. !did -ea [uPDATE_ALIAS] 1 Install } else { !did -a [uPDATE_ALIAS] 5 Downloading " $+ $1" !did -r [uPDATE_ALIAS] 7 !sockwrite -n [DOWNLOAD_ALIAS] GET [YOUR_FILES_DIRECTORY] $+ $1 $+(HTTP/1.1,$crlf,Host: [YOUR_HOST],$crlf,Connection: Close,$crlf,$crlf) } } else { !did -a [uPDATE_ALIAS] 5 Connection error. !did -a [uPDATE_ALIAS] 2 Close } } on *:sockread:[DOWNLOAD_ALIAS]:{ !tokenize 32 $read([YOUR_TEMPORARY_FILE],$sock([DOWNLOAD_ALIAS]).mark) !sockread -f &a while ($sockbr != 0) { !did -a [uPDATE_ALIAS] 7 $str(l,$calc(86/ $2 * $sock([DOWNLOAD_ALIAS]).rcvd)) !bwrite $1.tmp -1 &a !sockread -f &a } } on *:sockclose:[DOWNLOAD_ALIAS]:{ !tokenize 32 $read([YOUR_TEMPORARY_FILE],$sock([DOWNLOAD_ALIAS]).mark) !bread $1.tmp 1 $file($1.tmp).size &a !bcopy -c &a 1 &a $calc($bfind(&a,1,10 13 10)+3) -1 !.remove $1.tmp !bwrite $1.tmp 0 &a if ($crc($1.tmp) != $3) { !did -a [uPDATE_ALIAS] 5 CRC mismatch on " $+ $1" !did -a [uPDATE_ALIAS] 2 Close } else !.timer 1 0 [DOWNLOAD_ALIAS] $calc(1+$sock([DOWNLOAD_ALIAS]).mark) } alias [DOWNLOAD_ALIAS] { !sockopen [DOWNLOAD_ALIAS] [YOUR_HOST] 80 !sockmark [DOWNLOAD_ALIAS] $1 } on *:DIALOG:[uPDATE_ALIAS]:close:0:!sockclose [DOWNLOAD_ALIAS] $findfile($mircdir,*.tmp,0,1,!.remove " $+ $1-") on *:DIALOG:[uPDATE_ALIAS]:sclick:1:{ if (Yes == $did([uPDATE_ALIAS],1)) { !did -a [uPDATE_ALIAS] 5 Connecting... !did -b [uPDATE_ALIAS] 1 !did -a [uPDATE_ALIAS] 2 Cancel !sockclose [DOWNLOAD_ALIAS] [DOWNLOAD_ALIAS] 4 } if (Install == $did([uPDATE_ALIAS],1)) { !did -a [uPDATE_ALIAS] 5 Installing... !dll -u [DOWNLOAD_ALIAS]l var %a = 4 while ($read([YOUR_TEMPORARY_FILE],%a) != Fixes:) { !tokenize 32 $read([YOUR_TEMPORARY_FILE],%a) !.copy -o $1.tmp $+(",$scriptdir,$1") !inc %a } [YOUR_SCRIPT_SHUTDOWN_ALIAS] !.load -rs $+(",[YOUR_MAIN_SCRIPT],") } } Replace all the [...] then create a [YOUR_UPDATE_FILE] with in: Version: [VERSION] File / Size (bytes) / CRC32: [FILE_NAME] [FILE_SIZES_IN_BYTES] [FILE_CRC32] [FILE_NAME] [FILE_SIZES_IN_BYTES] [FILE_CRC32] Fixes: [FIXES] [FIXES] Comments: [COMMENTS] [COMMENTS] If you dont understand this, or mIRC scripting at all. Please don't even try to get support on this code. Link to comment
XaVeR Posted November 6, 2005 Author Share Posted November 6, 2005 wow, THX areon i understand evryting Link to comment
XaVeR Posted November 6, 2005 Author Share Posted November 6, 2005 ahh, sorry what does it mean ?? [FILE_CRC32] ?? Link to comment
Aeron Posted November 6, 2005 Share Posted November 6, 2005 /me drops dead. CRC32 is a sort of 'unique'-file-number, you can generate it in mirc by function '$crc()'. Or else do '/help $crc' Link to comment
XaVeR Posted November 6, 2005 Author Share Posted November 6, 2005 sorry for mu lame uestion but where i mutt to write it ? if i'm doing it in main mirc window he saing u are not on a channel, if i'm write it on some channel it havent effect sorry 4 mu english Link to comment
Recommended Posts