Please be patient, I will get to this as soon as I can. Evidently, the script is not working because of socket error; this script was posted a very long time ago, and Google Translator seems to have changed their website format, and I need to adjust to that. At the moment, please do not rate this script, or say that it does not work. Thanks.
@Grant-:
Must correct (Grammar nazi mode on)
Code:
if ($sock(sitecheck)) { sockclose sitecheck }
if ($sock(sitecheck)) sockclose sitecheck
That actually slows the script down. ^_^
Using brackets speeds up processing. If an alias uses too few brackets then the statement might be ambiguous and the alias will take longer to parse, might be parsed incorrectly, or might not be parsed at all.
In retrospect, what I'm saying is true.
@Cheiron:
oh crap i know what i did forget to ask .. for the bot version .. how do i restrict it to ops only to use it and if a non op tried to use it.. it will message the user they need ops to use it
Just add:
if ($nick(#,$nick,o)) {
Something like this Cheiron?
on $*:text:/^[.!@]check*/Si:#: {
if ($sock(check)) { sockclose check }
sockopen check www.downforeveryoneorjustme.com 80
sockmark check $$2 # $nick
}
on *:sockopen:check: {
sockwrite -n $sockname GET $+(/,$gettok($sock(check).mark,1,32)) HTTP/1.1
sockwrite -n $sockname Host: www.downforeveryoneorjustme.com
sockwrite -n $sockname Connection: close
sockwrite -n $sockname $crlf
}
on *:sockread:check: {
var %x | sockread %x
if ($regex(%x,(.+)<a href="(.+)"\sclass="domain">.+<\/a>(.+))) {
tokenize 32 $sock(check).mark
msg $2 $+($3,:) $regsubex($+($regml(1),,$regml(2),,$regml(3)),/(<[^>]*>)/g,)
}
}
[size=14]Syntax: .check [/size]
Intended for a bot...renamed the sock name...
..and thank you.
I wanted this to be simple, for personal use, rather than bot use. Otherwise, use the code above.
No, you [size=28]don't[/size] want to use:
elseif (!$wildtok($1,http://www.youtube.com/watch?v=*,1,32)) echo -a * Url specified was not valid. ...
because with the regex I put in, it does four things: Check to see if it's an actual YouTube URL, varies the different "types" of YouTube (as in countries), checks to see if the video ID matches 11 characters, and strips out any other & tags.
WorldDMT said:
u can use isin and $remove dont need to use a regex for a smal thing like thatAlthough this controversy is quite over, I'd also like to add the reason why I prefer using $regex in my sockread is because not only do I use it for detection, it's easier for me to make the use of a single $regml(N) than using many $gettok and $htmlfree.
[size=28]@ WorldDMT[/size]
I see that you are trying to give me helpful suggestions, but I do not agree with some of your suggestions.
line 148 "if ($did == 3) && ($regex($did(3),/[^\w-]/ig)) { did -ra PasteBin 3 $regsubex($did(3),/([^\w-])/ig,$null) }"
u can use isin and $remove dont need to use a regex for a smal thing like that
if ($did == 3) && ($chr(32) isin $did(3)) { did -ra $dname 3 $remove($v2,$chr(32)) }
In this case, I had to use $regsubex there to remove all non 123-ABC characters, excluding the character '-'. Only '\w' regex strings and - are allowed for PasteBin names. So, I can't really just remove $chr(32)...
Same with:
also for $did == 5
if ($did == 5) && ($chr(32) isin $did(5)) || (.. isin $did(5)) did -ra PasteBin 5 $replace($remove($v2,$chr(32)),..,.)
All '\w' characters and, . and -, as exceptions are allowed for sub-domain names. Thus, two subsequent periods are not allowed, but -'s are, which leads to more complication. Furthermore, I had to use many $iif's and some $regsubex there to remove all possible invalid entries.
Simple $remove is not going to help.
As for checking the error of sockets...
u dont check the error of socket?? and "if ($regex(%pb,))" u can use isin i think
All that $regex and $regsubex used for the edit boxes try to make the PasteBin paste as "valid" as possible, hence, they are the error checkers.
In fact, about 30% ~ 40% of this snippet is for error checking. The actual script itself can be written in about 100 lines.
Not to mention my code:
if ($regex(%pb,</h1><ul><li>(.*)</li>)) || ($regex(%pb,(.*)<P>)) {
checks for invalid links...
But yes, thanks for the other suggestions, I'll take a look into them.
[size=28]@ ^Neptune[/size]
Dialog is WAY too big, it won't even fit on my screen.
Well, my screen is only 800 x 600 and it fits fine.
I'll think about compressing the dialog size.
Hello. Updates?
I was thinking of "future" updates for this script, but I would like some opinions about this.
Some things that I were thinking about were:
Hey BlueThen. Another cool snippet.
I've recently taken a brief look at trigonometry and I've gotten down some of the basics (cosine, sine, tangent, and their opposites); and yeah, it's quite interesting.
However, I haven't actually started making picture window animations/games yet, but they seem to be a fine challenge. :d
And to answer your question, I think it'd be a good idea to release your documentation of algorithms.