mIRC Snippet:
Anagram
Posted on Jun 25, 2008 3:17 am
Posted on Jun 25, 2008 3:17 am
When testing yours, I realized it will return the same exact text it was given if the randomness works out that way. For instance, if you $anagram(is) a few times you will get is returned at some point.
Heres the code I came up with to jumble a word/sentence. It isnt as good looking as yours but seems to work great.
This script also makes sure the spaces dont get placed at the very begginning or end of the sentence where they get lost.
One of the reasons mine looks so much longer is the check for space placement and that I couldnt call $jumble() from within $jumble() so i used a goto line and reset all variables to start it over for when the output == input . To test these I used this line echoed 100 times to test finctionability.
$jumble(hello this is a test) $jumble(this is) $jumble(test) $jumble(is)
Nice work man.
Heres the code I came up with to jumble a word/sentence. It isnt as good looking as yours but seems to work great.
This script also makes sure the spaces dont get placed at the very begginning or end of the sentence where they get lost.
| Code: |
| alias jumble { :start unset %jmln* %jmps %tjm* %bdm %bw var %jmln = $len($1), %jmln2 = $len($1), %bw = $replace($1,$chr(32),$chr(127)) while (%jmln >= 1) { var %jmps = $rand(1,%jmln2) if ($(% $+ tjm $+ %jmps,2) == $null) { if ($mid(%bw,%jmln,1) == $chr(127)) && (%jmps != 1) && (%jmps != $len(%bw)) { var % $+ tjm $+ %jmps $mid(%bw,%jmln,1) | dec %jmln 1 } elseif ($mid(%bw,%jmln,1) != $chr(127)) { var % $+ tjm $+ %jmps $mid(%bw,%jmln,1) | dec %jmln 1 } } } while (%jmln2 >= 1) { var %bdm = %bdm $+ $(% $+ tjm [ $+ [ %jmln2 ] ],2) dec %jmln2 1 } if (%bdm != %bw) { return $replace(%bdm,$chr(127),$chr(32)) } else { goto start } } |
One of the reasons mine looks so much longer is the check for space placement and that I couldnt call $jumble() from within $jumble() so i used a goto line and reset all variables to start it over for when the output == input . To test these I used this line echoed 100 times to test finctionability.
$jumble(hello this is a test) $jumble(this is) $jumble(test) $jumble(is)
Nice work man.
mIRC Snippet:
!snippet : get latest snippet from hawkee.com
Posted on Feb 22, 2008 11:05 am
Posted on Feb 22, 2008 11:05 am
oh right
mIRC Snippet:
!snippet : get latest snippet from hawkee.com
Posted on Feb 22, 2008 11:04 am
Posted on Feb 22, 2008 11:04 am
I'm sure Quickstep needs to modify the code. Our HTML layout changed since he originally posted which probably broke the scraper.
mIRC Snippet:
!snippet : get latest snippet from hawkee.com
Posted on Feb 22, 2008 10:51 am
Posted on Feb 22, 2008 10:51 am
Dont Work!
mIRC Snippet:
mIRC Firewall
Posted on Feb 17, 2008 11:42 pm
Posted on Feb 17, 2008 11:42 pm
u got one to block port scan's? i already block ctcp
but i was wondering if i could block port scan's / port knocks for the irc ports
but i was wondering if i could block port scan's / port knocks for the irc ports
mIRC Snippet:
Upload file to remote server
Posted on Oct 23, 2007 6:35 pm
Posted on Oct 23, 2007 6:35 pm
i would put a $$?="input" or a $input() to ask for the things u have to set when u /upload
mIRC Snippet:
Alphabatically sort a text file
Posted on Oct 4, 2007 6:05 pm
Posted on Oct 4, 2007 6:05 pm
good idea :P
mIRC Snippet:
/mail abc@abc.com
Posted on Oct 3, 2007 2:29 pm
Posted on Oct 3, 2007 2:29 pm
Too bad this doesn't work anymore. I was really looking forward to using this. :(
mIRC Snippet:
mIRC Hex Editor
Posted on Sep 19, 2007 3:43 pm
Posted on Sep 19, 2007 3:43 pm
other than that very very nice
keep up the good work
keep up the good work
mIRC Snippet:
mIRC Hex Editor
Posted on Sep 19, 2007 3:40 pm
Posted on Sep 19, 2007 3:40 pm
Suggestion's
1. some thing ultra simple have the filename of the file your messing with is the @window title bar
2. Is there anyway you could add compare file's ( for snapshot's to make finding the changing data a little easier? )
By that I mean just checking for the differences
3. It seems to be adding lines... ( the one I use cygnus stops at
2030
but your's seems to skip lines
2024 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
203A 00 00 00 00 00 00
mIRC Snippet:
/download (http://path/to/file) (SaveAs-Filename) [/commands when file is done]
Posted on Sep 15, 2007 2:30 pm
Posted on Sep 15, 2007 2:30 pm
/*
I edited this so that it'll support quotations around the filename. It seems to work fine. I hope you don't mind. I'm also unsure about the policies about posting edited versions of code on this site.. but anyway, for anyone who wants it: (tested on mIRC 6.3 using Hawkee's noprofile.gif image, and some image of a fuzzy cat eating a plant)
For the noprofile.gif image:
/download http://www.hawkee.com/images/noprofile.gif "no profile.gif" echo -a Completed download. Check the mIRC directory.
*/
alias download {
;Detect host
var %hostn = $iif(*: !iswm $geturl($1,1),1,2), %sock = $+(download,$1)
;Error checks
if ($sock(%sock)) {
erroutput Script is already downloading $1
return
}
var %2 = $iif($left($2,1) == ",$gettok($2-,1,34),$2)
var %3- = $iif($left($2,1) == ",$gettok($2-,2-,34),$3-)
if ($file(%2)) {
erroutput File %2 already exists
return
}
;Everything ready to go
sockopen %sock $geturl($1,%hostn) 80
sockmark %sock $false $geturl($1,%hostn) $iif($geturl($1,$+($calc(%hostn + 1),-)),$+(/,$v1),/) $replace(%2,$chr(32),^_^) %3-
}
on *:SOCKOPEN:download*:{
var %a = sockwrite -n $sockname
;Nessecary requests
%a GET $getmark($sockname,3) HTTP/1.1
%a Host: $getmark($sockname,2)
;Connection: close to force the sockclose event
%a Connection: close
;Just-to-make-sure requests:
%a Accept: */*
%a Accept-Charset: *
%a Accept-Encoding: *
%a Accept-Language: *
%a Content-Type: application/octet-stream
%a User-Agent: Mozilla/5.0
%a $crlf
}
on *:SOCKREAD:download*:{
;First read the headers, and if the header is send, binary write to the specified file
var %header, &binvar
if ($getmark($sockname,1)) {
sockread &binvar
bwrite $qt($replace($getmark($sockname,4),^_^,$chr(32))) -1 -1 &binvar
}
else sockread %header
$iif((!%header) && (!$getmark($sockname,1)),sockmark $sockname $true $getmark($sockname,2-))
}
on *:SOCKCLOSE:download*:$iif($getmark($sockname,5-),$v1)
;Local aliases
alias -l geturl return $gettok($1,$$2,47)
alias -l getmark return $gettok($sock($1).mark,$$2,32)
alias -l erroutput echo $color(info) -ae * /download error: $$1-
I edited this so that it'll support quotations around the filename. It seems to work fine. I hope you don't mind. I'm also unsure about the policies about posting edited versions of code on this site.. but anyway, for anyone who wants it: (tested on mIRC 6.3 using Hawkee's noprofile.gif image, and some image of a fuzzy cat eating a plant)
For the noprofile.gif image:
/download http://www.hawkee.com/images/noprofile.gif "no profile.gif" echo -a Completed download. Check the mIRC directory.
*/
alias download {
;Detect host
var %hostn = $iif(*: !iswm $geturl($1,1),1,2), %sock = $+(download,$1)
;Error checks
if ($sock(%sock)) {
erroutput Script is already downloading $1
return
}
var %2 = $iif($left($2,1) == ",$gettok($2-,1,34),$2)
var %3- = $iif($left($2,1) == ",$gettok($2-,2-,34),$3-)
if ($file(%2)) {
erroutput File %2 already exists
return
}
;Everything ready to go
sockopen %sock $geturl($1,%hostn) 80
sockmark %sock $false $geturl($1,%hostn) $iif($geturl($1,$+($calc(%hostn + 1),-)),$+(/,$v1),/) $replace(%2,$chr(32),^_^) %3-
}
on *:SOCKOPEN:download*:{
var %a = sockwrite -n $sockname
;Nessecary requests
%a GET $getmark($sockname,3) HTTP/1.1
%a Host: $getmark($sockname,2)
;Connection: close to force the sockclose event
%a Connection: close
;Just-to-make-sure requests:
%a Accept: */*
%a Accept-Charset: *
%a Accept-Encoding: *
%a Accept-Language: *
%a Content-Type: application/octet-stream
%a User-Agent: Mozilla/5.0
%a $crlf
}
on *:SOCKREAD:download*:{
;First read the headers, and if the header is send, binary write to the specified file
var %header, &binvar
if ($getmark($sockname,1)) {
sockread &binvar
bwrite $qt($replace($getmark($sockname,4),^_^,$chr(32))) -1 -1 &binvar
}
else sockread %header
$iif((!%header) && (!$getmark($sockname,1)),sockmark $sockname $true $getmark($sockname,2-))
}
on *:SOCKCLOSE:download*:$iif($getmark($sockname,5-),$v1)
;Local aliases
alias -l geturl return $gettok($1,$$2,47)
alias -l getmark return $gettok($sock($1).mark,$$2,32)
alias -l erroutput echo $color(info) -ae * /download error: $$1-
mIRC Snippet:
Counter-Strike:Source Query Script (Also works on other source servers!)
Posted on Jun 19, 2007 9:21 am
Posted on Jun 19, 2007 9:21 am
How Does it works
mIRC Snippet:
/mail abc@abc.com
Posted on Jun 9, 2007 12:58 pm
Posted on Jun 9, 2007 12:58 pm
i tryed this and it did not work :S
mIRC Snippet:
/download (http://path/to/file) (SaveAs-Filename) [/commands when file is done]
Posted on May 16, 2007 11:56 pm
Posted on May 16, 2007 11:56 pm
reason it no longer works is due to a correction made as of 6.2:
"82.Fixed /sockread -nf bug, switches were not being parsed correctly"
not sure why the author even tried to read a line at a time (as -fn is supposed to do, when this script was made -fn with a &var was simply ignored and treated as if no switches were passed) which is a recipe for disaster :P much less efficient, and reading with -n to a &var causes the trailing CRLF to be turned into 2 null bytes
so in short, anyone still wanting to use this snippet should remove "-fn" from "sockread -fn &binvar"
"82.Fixed /sockread -nf bug, switches were not being parsed correctly"
not sure why the author even tried to read a line at a time (as -fn is supposed to do, when this script was made -fn with a &var was simply ignored and treated as if no switches were passed) which is a recipe for disaster :P much less efficient, and reading with -n to a &var causes the trailing CRLF to be turned into 2 null bytes
so in short, anyone still wanting to use this snippet should remove "-fn" from "sockread -fn &binvar"
mIRC Snippet:
!snippet : get latest snippet from hawkee.com
Posted on Mar 21, 2007 3:33 am
Posted on Mar 21, 2007 3:33 am
I think I may have just broken this with the new snippet system.
mIRC Snippet:
GAME: Bash
Posted on Feb 21, 2007 11:28 am
Posted on Feb 21, 2007 11:28 am
haha WOW i just got a new high score after trying like for the past 2 days
GOOD GAME. love it!
3NEW HIGHSCORE! (190)
-------------------
[ENTER] = Try again
GOOD GAME. love it!
3NEW HIGHSCORE! (190)
-------------------
[ENTER] = Try again
mIRC Snippet:
/splitfile
Posted on Feb 1, 2007 10:25 pm
Posted on Feb 1, 2007 10:25 pm
what exactly does this do....











