Terror Alert Level

By LIQUID_NiTrO on Jul 10, 2005

I made this snippet for someone else here and decided it was good enough to add as a snippet. The syntax is /getalert CHANNEL|ECHO. Specifying a channel will cause it to send the alert level to that channel, specifying echo will cause it to echo the alert level to the active window.
--EDIT--
Updated per Xdaemon's request. Must have been a brain fluke that I had that in there in the first place.

alias getalert {
  if ( #* !iswm $1 ) && ( $1 != echo ) {
    echo $colour(info) -a * Invalid Channel Name
    halt
  }
  if ( $me !ison $1 && $1 != echo ) {
    echo $colour(info2) -a * $1 You are not on that channel, attempting to send message anyway...
  }
  sockopen tl www.defenselink.mil 80
  sockmark tl $1
}
on *:SOCKOPEN:tl: {
  if ( $sockerr ) {
    echo $colour(info2) -a * Error in SockOpen.  Error code $sockerr $+ ; aborting loookup.
    sockclose tl
    halt
  }
  sockwrite -n tl GET /index.html HTTP/1.0
  sockwrite -n tl Host: www.defenselink.mil
  sockwrite -n tl Connection: Keep-Alive
  sockwrite tl $crlf
}
on *:SOCKREAD:tl: {
  if ( $sockerr ) {
    echo $colour(info2) -a * Error in SockRead.  Error code $sockerr $+ ; aborting loookup.
    sockclose tl
    halt
  }
  sockread %tmp
  tokenize 32 %tmp
  if ( *IMG SRC*Banner*advisory* iswm $1- ) {
    %tl = $remove($gettok($gettok($deltok($1-,1- $+ $calc($findtok($1-,$wildtok($1-,ALT="*,2,32),32) -1),32),2,34),8,32),:)
    if ( $sock($sockname).mark == echo ) echo $colour(info) -a * Terror Alert Level: %tl
    else msg $sock($sockname).mark Terror Alert Level: %tl
    sockclose $sockname
  }
}

Comments

Sign in to comment.
LIQUID_NiTrO   -  Jul 12, 2005

@xdaemon, fixed
@supergeo, this can only be used on one channel at a time. The only way to use it for a flood would be with a timer, which you can already flood with. This would also be a much slower flood because it would have to keep opening and closing the socket, and sift through all the data. Much slower than just rapidly sending a single message or whatever.

 Respond  
xDaeMoN   -  Jul 12, 2005

To get the Alert Level via mIRC instead of manually going to a website.

 Respond  
aeros   -  Jul 11, 2005

lala nice ~~ dont get why you would use it though but nice scripting!

 Respond  
GalaxiesWarrior   -  Jul 11, 2005

I have used it since LIQUID_NiTrO made it for me it doesn\'t flood anything the channel only see\'s the alert status

 Respond  
xDaeMoN   -  Jul 11, 2005

@ Liquid

on this part \" if ( !$me !ison $1 && $1 != echo ) {\"

Remove the \"!\" in the \"!$me\" so it won\'t echo a notice if you are on the channel where you want to send the message.

 Respond  
supergeo   -  Jul 11, 2005

Could be used for flooding.Why not make it so that it can only be sent to $active?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.