This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

mrc to tcl: http

Old posts that have not been replied to for several years.
Locked
k
kanibus
Halfop
Posts: 44
Joined: Tue May 03, 2005 7:22 am

mrc to tcl: http

Post by kanibus »

hey i am in search of a code, and i found the exact code i need but its in mrc :( if someone could please convert this for me or know of a tcl that can search for CAL steam id's i would appreciate it. thanks.

Code: Select all

;; Original author: Parasite-FT-, #script (irc.gamesnet.net)
;; Modified to use a website which gave explicit permission to use it
;; Modified again by eX|Psycho, #crisisZone (irc.gamesnet.net) for SteamID comptibility.
;; Modified again by MeLt`pneumo, #pneumo (irc.gamesurge.net) for steamid.com

alias urlencode { var %t, %i = 0 | while (%i < $len($1)) { inc %i | if ($regex($mid($1,%i,1),/[A-Z0-9]/i)) { %t = %t $+ $mid($1,%i,1) } | else { %t = %t $+ % $+ $base($asc($mid($1,%i,1)),10,16,2) } } | return %t }

;; [STEAMID] ------- Text event
on *:text:@steamid *:#: {
  inc -u30 %wonflood. [ $+ [ $nick ] ]
  if (%wonflood. [ $+ [ $nick ] ] > 3) return
  sockclose steamid. $+ $nick
  sockopen steamid. $+ $nick www.steamid.com 80
  sockmark steamid. $+ $nick $2 n $+ $nick $ticks
  sockmark steamid. $+ $nick $2 c $+ $chan $ticks
}
;; [STEAMID] ------- Sockopen event
on *:sockopen:steamid.*:{
  sockwrite -n $sockname GET /ircbot.php?qvalue= $+ $urlencode($gettok($sock($sockname).mark,1,32)) HTTP/1.1
  sockwrite -n $sockname Host: www.steamid.com
  sockwrite -n $sockname Connection: Close
  sockwrite -n $sockname User-Agent: modified from ircscripting.net
  sockwrite -n $sockname $crlf
  set %steamid.total. [ $+ [ $sockname ] ] 0
}
;; [STEAMID] ------- Sockread event
on *:sockread:steamid.*:{
  if ($sockerr > 0) return
  while ($sock($sockname)) {
    sockread %temp
    window -e @steamid
    echo @steamid : %temp
    set -l %data $gettok($gettok(%temp,2,$asc(> )),1,$asc(< ))
    if ($sockbr == 0) return
    if (%temp == <disabled> ) {
      if ($left($gettok($sock($sockname).mark,2,32),1) == n) notice $right($gettok($sock($sockname).mark,2,32),-1) Error, Source DB has been disabled, please contact %owner
      else msg $right($gettok($sock($sockname).mark,2,32),-1) Error, Source DB has been disabled, please contact %owner
    }
    else if (%temp == </results> ) {
      if ($left($gettok($sock($sockname).mark,2,32),1) == n) notice $right($gettok($sock($sockname).mark,2,32),-1) %steamid.total. [ $+ [ $sockname ] ] result $+ $iif(%steamid.total. [ $+ [ $sockname ] ] != 1,s) found. [#melt]
      else msg $right($gettok($sock($sockname).mark,2,32),-1) 0,1[ 0· %steamid.total. [ $+ [ $sockname ] ] result $+ $iif(%steamid.total. [ $+ [ $sockname ] ] != 1,s) found. Results from www.8Steam0ID.com 0,1 0· ]

      if (%steamid.total. [ $+ [ $sockname ] ] > 4) {
        if ($left($gettok($sock($sockname).mark,2,32),1) == n) notice $right($gettok($sock($sockname).mark,2,32),-1) (only 4 results shown from: http://www.steamid.com/?qvalue= $+ %steamid.player_steamid. [ $+ [ $sockname ] ] )
        else msg $right($gettok($sock($sockname).mark,2,32),-1) 0,1[ 0· (0only 8 4 0results shown from: http8://0www.8steamid0.com8/?0qvalue=8 $+ %steamid.player_steamid. [ $+ [ $sockname ] ] ) 0· ]

      }
      sockclose $sockname
      unset %steamid.*. [ $+ [ $sockname ] ]
    }
    else if (%temp == <result> ) inc %steamid.total. [ $+ [ $sockname ] ]
    else if (<ban_status>*</ban_status> iswm %temp) set %steamid.ban_status. [ $+ [ $sockname ] ] %data
    else if (<player_id>*</player_id> iswm %temp) set %steamid.player_id. [ $+ [ $sockname ] ] %data
    else if (<player_alias>*</player_alias> iswm %temp) set %steamid.player_alias. [ $+ [ $sockname ] ] %data
    else if (<player_name>*</player_name> iswm %temp) set %steamid.player_name. [ $+ [ $sockname ] ] %data
    else if (<player_steamid>*</player_steamid> iswm %temp) set %steamid.player_steamid. [ $+ [ $sockname ] ] %data
    else if (<team_id>*</team_id> iswm %temp) set %steamid.team_id. [ $+ [ $sockname ] ] %data
    else if (<team_game>*</team_game> iswm %temp) set %steamid.team_game. [ $+ [ $sockname ] ] %data
    else if (<team_league>*</team_league> iswm %temp) set %steamid.team_league. [ $+ [ $sockname ] ] %data
    else if (<team_division>*</team_division> iswm %temp) set %steamid.team_division. [ $+ [ $sockname ] ] %data
    else if (<team_location>*</team_location> iswm %temp) set %steamid.team_location. [ $+ [ $sockname ] ] %data
    else if (<team_name>*</team_name> iswm %temp) set %steamid.team_name. [ $+ [ $sockname ] ] %data
    else if (<team_tag>*</team_tag> iswm %temp) set %steamid.team_tag. [ $+ [ $sockname ] ] %data
    else if (<team_irc>*</team_irc> iswm %temp) set %steamid.team_irc. [ $+ [ $sockname ] ] %data
    else if (<team_website>*</team_website> iswm %temp) set %steamid.team_website. [ $+ [ $sockname ] ] %data
    else if (%temp == </result> ) {
      if (%steamid.total. [ $+ [ $sockname ] ] < 5) {
        set %steamid.return. [ $+ [ $sockname ] ] 0,1[ 0· 8S0team8ID8:0 %steamid.player_steamid. [ $+ [ $sockname ] ] 8A0lias8:0 %steamid.player_alias. [ $+ [ $sockname ] ] 8T0eam8:0 %steamid.team_name. [ $+ [ $sockname ] ] 8C0hannel8:0 %steamid.team_irc. [ $+ [ $sockname ] ] 8L0eague8:0 %steamid.team_league. [ $+ [ $sockname ] ] 0· ]
        if ($left($gettok($sock($sockname).mark,2,32),1) == n) notice $right($gettok($sock($sockname).mark,2,32),-1) %steamid.return. [ $+ [ $sockname ] ]
        else msg $right($gettok($sock($sockname).mark,2,32),-1) %steamid.return. [ $+ [ $sockname ] ]
      }
    }
  }
  unset %steamid*
}
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

it would be alot easier to write the script from scratch than to convert some obscure mirc code. Could you give us an idea of what this nonsensical mirc script is supposed to accomplish?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

it's sort of parsing a webpage, displaying results, and (naturally) it's written in auwful manner, like most mIRC scripts tend to be (and the blame for that shouldn't be solely on scripts' authors, since mIRC's scripting language syntax hardly encourages you to write clean, obvious and maintainable code)

maybe it's time for a "Parsing webpages" section in the FAQ forum... lots of folks have been asking for such stuff lately
k
kanibus
Halfop
Posts: 44
Joined: Tue May 03, 2005 7:22 am

Post by kanibus »

yeah im starting to write something from scratch, it wasnt that important so i was hoping someone had written one i could use already, but when im done ill post the finished scripts. it searches for Steam ID's(Unique ID for a game) in an online gaming leagues database.
Locked