tcp/ip

By LGrobert on Feb 01, 2011

Can someone edit me this script for a bot to use it with .tcp *** or so...
i hate to use it with /tcp in client

alias tcpip {
  if ($1 == next) {
    inc %prt.showing
    if (%prt.showing <= %prt.count) {
      set %prt.show.port $gettok(%prt.match. [ $+ [ %prt.showing ] ], 1, 32)
      set %prt.show.protocol $gettok(%prt.match. [ $+ [ %prt.showing ] ], 2, 32)
      set %prt.show.description $gettok(%prt.match. [ $+ [ %prt.showing ] ], 3-, 32)
      echo -atg 08TCP/IP » 08Port: %prt.show.port 08Protocol: %prt.show.protocol 08Description: %prt.show.description
    }
    else { echo -atg 08TCP/IP » No more matches | dec %prt.showing }
  }

  else if ($1 == previous) {
    dec %prt.showing
    if (%prt.showing > 0) {
      set %prt.show.port $gettok(%prt.match. [ $+ [ %prt.showing ] ], 1, 32)
      set %prt.show.protocol $gettok(%prt.match. [ $+ [ %prt.showing ] ], 2, 32)
      set %prt.show.description $gettok(%prt.match. [ $+ [ %prt.showing ] ], 3-, 32)
      echo -atg 08TCP/IP » 08Port: %prt.show.port 08Protocol: %prt.show.protocol 08Description: %prt.show.description
    }
    else { inc %prt.showing }
  }

  else if ($1 == clear) {
    echo -atg 08TCP/IP » List cleared
    unset %prt.*
  }

  else {
    unset %prt.*
    set %prt.find $1
    set %prt.search $2-
    set %prt.count 0
    sockopen tcpip www.skynet.ie 80
  }
}

on 1:SOCKOPEN:tcpip:{
  set %prt.pattern <tr><td>(.+)</td>.+<td>(.+)</td>.+<td>(.+)</td>.+</tr>
  set %prt.get /~colinmac/Programming/port_listing.html
  sockwrite -n $sockname GET %prt.get HTTP/1.0
  sockwrite -n $sockname Host: www.skynet.ie
  sockwrite -n $sockname $crlf
}

on 1:SOCKREAD:tcpip:{
  var %prt.src
  sockread %prt.src
  if (*<tr><td>*</td>*<td>*</td>*<td>*</td>*</tr>* iswm %prt.src) {
    noop $regex(%prt.src, %prt.pattern)
    if ((%prt.find == port) && (%prt.search == $regml(1))) {
      inc -tg %prt.count
      set %prt.match. [ $+ [ %prt.count ] ] $regml(1) $regml(2) $regml(3)
    }

    else if ((%prt.find == protocol) && ($+(*,%prt.search,*) iswm $regml(2))) {
      inc %prt.count
      set %prt.match. [ $+ [ %prt.count ] ] $regml(1) $regml(2) $regml(3)
    }
  }
}

on 1:SOCKCLOSE:tcpip:{
  if (%prt.count == 0) {
    echo -atg 08TCP/IP » No match found for $lower(%prt.find) $+(",%prt.search,")
  }
  else {
    set %prt.showing 1
    if (%prt.count == 1) { echo -atg 08TCP/IP » $+(08,%prt.count) Match Found: }
    else if (%prt.count > 1) { echo -atg 08TCP/IP » $+(08,%prt.count) Matches Found (/tcpip next) }
    echo -atg 08TCP/IP » 08Port: $gettok(%prt.match.1, 1, 32) 08Protocol: $gettok(%prt.match.1, 2, 32) 08Description: $gettok(%prt.match.1, 3-, 32)
  }
}

Comments

Sign in to comment.
daFreak   -  Feb 02, 2011

I wrote the original for this one. Would never put my name on anyone elses work. That's the most disrespectfull thing you can do as a developer, and it's indeed a true copy paste of the one i wrote.. Just don't get why he would need to copy/paste the snippet, instead of just asking in a comment if I could make a bot friendly version... That's all ;)

 Respond  
Jethro   -  Feb 01, 2011

I think LDrobert was trying to ask for help with that code but winding up posting it at the snippet section.

Pichu, as sunslayer said, he was stating that he needs the script edited to work for him. He didn't state these two words "My script" everywhere to be brought into this so-called allegation.

We still have no way of knowing if the original author wrote the code in the first place. We're not talking about "one-of-a-kind" script here. The script shown above is rather common. You have to know that MSL is so open sourced you can easily get a code and claim it's yours.

 Respond  
Pichu   -  Feb 01, 2011

He did to remove the name on the author. If you look at the real script, the others name and credits are at the top of the script. On here, they're nowhere to be found.

 Respond  
sunslayer   -  Feb 01, 2011

why the hell jack a snippet, remove the name of the authorhe never claimed this snippet to be his, nor did he> remove the name of the author

 Respond  
daFreak   -  Feb 01, 2011

Indeed! And also why the hell jack a snippet, remove the name of the author, repost it and try to get people to rewrite it for you? D.I.Y

 Respond  
Pichu   -  Feb 01, 2011

Wrong place to post to get help anyways, but no one seems to care.

 Respond  
daFreak   -  Feb 01, 2011

See you grabbed my script... Sucks that you didn't just ask me, since I modified it to be bot friendly right after i posted it here... just didn't get around to post it here

 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.