Hey yo!
It's me again :P How are you?
So! Since you bothered clicking this snippet page i should go ahead and explain what this one is!
This small script will be usefull if you have many or any of MY script(s) loaded in your mIRC!
Simply type !versions ID
ID is the ID of the script you wanna check! From now on all my scripts will include a script ID in them and the version so that you know how to check for updates!
So if you're reading this and you haven't updated to the latest version please do it now or else the script will not be able to find your current version
Thanks for using my scripts, visiting my website, following me here and for your comments and requests <3
ON *:TEXT:*:#: {
tokenize 32 $strip($1-)
if ($1 == !versions) {
sockopen versionsList humanity.ucoz.com 80
msg $chan Updating Scripts List! :)
set %vch $2
set %vchan $chan
}
}
ON *:SOCKOPEN:*: {
if ($istok(versions versionsList,$sockname,32)) {
if ($sockerr) { msg #Humanity Error While $iif($sockname == versions, Checking Versions, Updating Script List) | sockclose $sockname }
sockwrite -nt $sockname GET /versions.txt HTTP/1.1
sockwrite -nt $sockname Host: humanity.ucoz.com
sockwrite -nt $sockname Connection: Close
sockwrite $sockname $crlf
}
}
ON *:SOCKREAD:*: {
if ($sockname == versions) {
var %vers | sockread %vers
tokenize 32 %vers
if ($1 == %vch) {
if ($3 == $($+(%,%vch,version),2)) {
.timer 1 1 msg #Humanity 3Your Version14: $v2 3Current Version14: $v1 3You14'3re ok14!
}
elseif ($3 != $($+(%,%vch,version),2)) {
.timer 1 1 msg #Humanity 3Your Version14: $v2 3Current Version14: $v1 3You should check 7http14://7humanity14.7ucoz14.7com3 to get the latest version14! :) 3Thanks for using my scripts14! 3Stay awesome14!
}
}
}
elseif ($sockname == versionsList) {
var %vl | sockread %vl | tokenize 32 %vl
if (*v*.* iswm $3) && ($2 == >) {
set %OrFeAsGr-Scripts-List $addtok(%OrFeAsGr-Scripts-List,$1,32)
}
}
}
ON *:SOCKCLOSE:*: {
if ($sockname == versions) {
var %vers | sockread -f %vers
tokenize 32 %vers
if ($1 == %vch) {
if ($3 == $($+(%,%vch,version),2)) {
.timer 1 1 msg #Humanity 3Your Version14: $v2 3Current Version14: $v1 3You14'3re ok14!
}
elseif ($3 != $($+(%,%vch,version),2)) {
.timer 1 1 msg #Humanity 3Your Version14: $v2 3Current Version14: $v1 3You should check 7http14://7humanity14.7ucoz14.7com3 or http://hawkee.com/profile/634479/ to get the latest version14! :) 3Thanks for using my scripts14! 3Stay awesome14!
}
}
}
elseif ($sockname == versionsList) {
var %vl | sockread -f %vl | tokenize 32 %vl
set -u3 %scriptListready 1
set %OrFeAsGr-Scripts-List $addtok(%OrFeAsGr-Scripts-List,$1,32)
msg #Humanity Script List Was Updated! Now Checking For %vch Script Version!
check_versions bla %vch %vchan
}
}
alias check_versions {
if ($istok(%OrFeAsGr-Scripts-List,$2,32)) {
if ($($+(%,$2,version),2)) {
set %vch $2
sockopen versions humanity.ucoz.com 80
}
elseif (!$($+(%,$2,version),2)) {
.timer 1 1 msg %vchan It seems like you don't have $2 Script Loaded
}
}
elseif (!$2) || (!$istok(%OrFeAsGr-Scripts-List,$2,32)) {
.timer 1 1 msg %vchan USAGE: Please use one of these script ID's: %OrFeAsGr-Scripts-List
}
}
Do you want to help me make some money? You can do it without paying! Just visit my site http://humanity.ucoz.com ,turn off your ad blocker, watch an ad and turn it back on! You'll be giving me something less than a cent! Thanks!
How you can use this for your own scripts update checker!
SImple Steps!
Additional Ideas:
Add short comments for the version of your script!
Simply change the format of each line to:
ID > version > comment(s)
And use $4 or $4- in the SOCKREAD event to get the comments!