Truthfully, I would delete this snippet. I had a working version and a non working version way back when and accidentally posted the wrong one. Now it's been so long I have neither, lol.
haha dude, you must be one angry person. FYI this code again is 2 and a half years old and it was never meant to be an advanced web server. If that was the case I would have made an addon rather than snippet, don't you think? Also, the sockread event is only for the initial connection. After that point it is not needed because mIRC then sends the content of the html page to the client and then the connectin is no longer needed (same would happen if the Connection: close parameters are sent in the initial request). Now I know this has it's bugs and at one point did work, and I haven't updated it at all since I originally posted it because it's meant as basically an example for sockets. I know how to do sockets, just check my tutorial in the tutorials section of the forum, buddy :)
First thing. You can't kick someone who's talking to you in a query. You can do this however:
if ($chan) { kick $v1 $nick blah blah }
else { close -m $nick }
Also, the above would work, but you can use this for shorter code too:
on *:TEXT:*:#: {
var %x = 1,%y
while (%x <= $len($1-)) {
if ($right($left($1-,%x),1) isupper) inc %y
inc %x
}
if (%y > $calc($len($1-) * .5)) { do action... }
}
Although I didn't understand what mountaindew was pointing out, you need to get rid of the or (||) symbols in your if statement under the !addleader command.
Ports can be added, plus your script doesn't cover closed proxies, only open. Plus, you can add all the ports you need to, and theres alot more ports than that are used by proxies. 65536 ports can be used by a proxy. Next time you comment, please make sure it's constructive, thanks :)
A. Why did Nikola Tesla improve electricity from DC to AC?
B. Who said Thomas Edison use the work of Micheal Faraday for each and one of his inventions?
You theories are just plain selfish and posessive. He gave credit to the script owner, and as stated in Hawkee.com's rules, is all that is needed. You are just proving yourself a hypocrite for saying this, considering you've made many scripts that have used methods and formats as old as mIRC, pretty much. Really, what your saying is if someone made this script:
on *:JOIN:#: { msg $chan Hi $nick }
and someone remade it to
on *:JOIN:#: { msg $chan Hello $nick }
Honestly, should person B have to ask person A for permission to use the same format? The mimic script is older then i've even known mIRC existed. So why don't we just trace back to the person who had the idea and ask them?
Riachu.. people "rip" ideas all the time. It's called making improvements. If this didn't happen, we wouldn't be talking because the internet wouldn't exist.
Your while loop is set up in a bad. You should perform checks to make sure your reading actual lines of the text file
This is yours:
while ($read(blacklist.txt,%blacklist) != $null) {
did -a blacklist 6 $read(blacklist.txt,%blacklist)
inc %blacklist
}
A better one should be:
while (%blacklist <= $lines(blacklist.txt) {
did -a blacklist 6 $read(blacklist.txt,%blacklist)
inc %blacklist
}
The $lines identifier returns the number of lines in a text file. Although both formats will still grab everything from a txt file, this is a cleaner way of doing it
You should probably do a few more checks within the if-than-else to make sure that your script doesn't try to perform a command without sufficient information, and use a bit cleaner code, IE:
elseif (.bk == $1) { mode # +b $2 | kick # $2 $3- }
should be:
elseif (.bk == $1) && ($3) { mode # +b $2 | kick # $2- }
See what I mean?
KuTsuMcommented on mIRC Snippet: P2p Kill
-
May 09, 2006
I think it'd be better if you use the on open event, this way if you p2p someone you can keep the p2p kill on and they won't get killed. Not bad though ;)
$1 on that string is "my", besides I don't see how it's usefull. It takes a lot of system resources to split strings up, and if you just want to return the entire string, use $1-, rather than splitting the string up once again
if i had a chatspace server that I knew of i probably would attempt it again. lol