Updated - thanks to Jethro_ .
on $*:text:/^!(hit|touch|clap|poke|b(ow|oom))/iS:#:{
if (!%f) { inc -u3 %f | if ($regml(1) == hit) { .msg # ACTION: sees $nick hit $$2- }
elseif ($regml(1) == touch) { .describe # sees: $nick $v1 $$2- in the private area }
else { .describe # $replace($regml(1),bow,see $nick bows down to,boom,sees: $nick Blows up,clap,claps for,poke,pokes) $$2- }
}
}
Phil24, I'd love the idea of getting along, but some members don't appreciate the value of it. Instead, he or she makes unconstructive criticism, arises cynicism and incites some sort of bitter commotion toward other folks who actually take their time and give helpful, effective suggestions. What gets me the most is, some of them give out bad coding habits, and they claim it's "one of a kind" and an "unique style." They bite back at you if you pinpoint any opinionated inefficiency in their coding methods and then some.
The site I've found for the simple socket script I made above is very easy to pull the info. (it's recommendable that you find sites with simple, clean source codes) Some websites may have complicated ones, which mean you may need to pull 'em off by way of tokenize or by writing the whole source into a text and then filtering out the unneeded strings and html brackets to get to the info you're after.
a socket works in in most basic form:
connect to site, read page
find one prticular line on the whole page
find two pieces of unique text on the line and save the bit in the middle.
Which mean there is only one way you could just change the link and it would still work... And thats if the site looks identical to the original.
If you want a hint at how different sites can look to a socket, bring up any webpage, even this one:
right click on a blank section
view page source
The text window that pops up will show you the bare code for the site, sometimes the information you may want isn't even on the page, but linked inside something else instead, similar to how a picture of words isn't recognised as word text.
Btw, good to see you've updated and I hope you know a little more for it.
on $*:text:/^[.!@]fact$/:#:{
if !%t [ $+ [ $wildsite ] ] {
inc -u5 $+(%,t,$wildsite) | $fact
}
}
alias fact {
$+(sock,$iif($sock(f),close,$&
open f www.randomfunfacts.com 80))
sockmark f msg #
}
on *:sockopen:f:{
var %f sockwrite -n f
%f GET / HTTP/1.1
%f Host: $sock(f).addr
%f $crlf $crlf
}
on *:sockread:f:{
var %f | sockread %f
$iif($regex(%f,/<i>(.*)</i>/),$&
$token($sock(f).mark,1-2,32) $regml(1))
}
For your own use, enter: > /fact
For other people to trigger, enter: > !fact, .fact or @fact
!fact Only two people signed the Declaration of Independence on July 4th, John Hancock and Charles Thomson. Most of the rest signed on August 2, but the last signature wasn't added until 5 years later. !fact In 1976, the 10 billionth gallon of "Coca-Cola" syrup was produced. !fact Armadillos, opossums, and sloth's spend about 80% of their lives sleeping. !fact The highest paid CEO in 2004 was Terry Semel of Yahoo. He earned $230 million, or approximately $630,000 per day.
napa182, get a life. why would you waste your time putting others down. No-one else is listening, napa182. Seriously, get a life.
i lol'd... Napa182 has gotten plenty
of respect from scripters a like to
say what he needs to say.
and you lil boy, needa calm your nipples ;]
nigguhs be arrogant nowadays but its whatever i guess
Hawkee.com is NOT a pastebin for crap like this
and yes crap. its leaned more towards the learning
from your bullshit rather then talkin shi back
to the ppl trying to better your skills in mSL.
yes i agree mSL is not a completely legit style of
coding, but it is infact a base of coding. it is the
easiest, and if your learned more you can learn things
that will get you dat money. but idc if you decide to take
the time an learn from others rather then being lame.
but anyways
to make this script LESS uglier then it awready is
if statements or a goto loop would be better then
this basic structure.
ON *:TEXT:*:#: {
if ($1 == !bow) describe $chan sees: $nick Bows down to $2-
if ($1 == !boom describe $chan sees: $nick Blows up $2-
}