Script updater
Posted by Rustynails
Tuesday, May 02, 2006
Description: Updates your script off the internet

Usage: Add this snippet to your script at the TOP! Whenever you make updates, upload to your website the new script with a different version. Upon signaling the script it compares the versions, checks if it's a new release then overwrites the current one in your .mrc
Type the following to signal the script: /signal MyScript.Update <Website URL (No http://)> <Port> <File Name>
It should update if there's a new version available.

PS Make the version one word!


alias -l MyScript.Version return 0.1
on *:signal:MyScript.Update:{
  sockopen MyScript.Update $1 $2
  sockmark MyScript.Update $1 $3-
}
on *:sockopen:MyScript.Update:{
  sockwrite -n $sockname GET $+(/,$gettok($sock($sockname).mark,2-,32)) HTTP/1.0
  sockwrite -n $sockname Host: $gettok($sock($sockname).mark,1,32)
  sockwrite -n $sockname Connection: Close
  sockwrite -n $sockname $crlf
  sockmark $sockname 0 0
}
on *:sockread:MyScript.Update:{
  var %MyScript.Read | sockread %MyScript.Read | tokenize 32 %MyScript.Read
  if ($sock($sockname).mark == 0 0) && (!$1) { sockmark $sockname 1 0 }
  if ($sock($sockname).mark == 1 0) && (alias -l MyScript.Version return isin $1-) && ($gettok($1-,$gettok($1-,0,32),32) != $MyScript.Version) { .write -c $+(",$script,") | sockmark $sockname 1 1 }
  if ($sock($sockname).mark == 1 0) && (alias -l MyScript.Version return isin $1-) && ($gettok($1-,$gettok($1-,0,32),32) == $MyScript.Version) { sockclose $sockname }
  if ($sock($sockname).mark == 1 1) { .write $+(",$script,") $1- }
}
on *:sockclose:MyScript.Update:{
  .load -rs $+(",$script,")
}

Reviewz
Posted by cs2r`nonamee
Tuesday, May 02, 2006 03:03pm PDT
Omg k liek... I tried dis out and it's da bomb. It works fo'sheezy ya'll. I dled that stuff and put it in my mirc dir den typed: /load -rs theNameofDaScript.mrc

Aight so I tried dis 'ish with my new CALeague script and ya'll it like totally works. ykno?

Anywayz, it's the shizzle. Good job r-nails.
hehe
Posted by b00hp
Wednesday, May 03, 2006 10:26am PDT
sexy :P

but noname

stfu, your not black :D
Submit a comment
Oops! You need to login or register before you can post a comment!

ebaum's world