Advertisement
Lucifer

evilMonkey's Steam Script (Fixed)

Jun 27th, 2015
2,868
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.58 KB | None | 0 0
  1. ;// All Credits go to evilMonkey (irc.lucidchat.net)
  2. ;// Fixed by Vegito (irc.lucidchat.net) on 27-06-2015
  3.  
  4. on $*:text:/store.steampowered.com/(sub|app)/(\w+)/Si:#:{
  5.   if (%steamTimeout) halt
  6.   %msg = msg $target
  7.   steam $1-
  8. }
  9.  
  10. on *:INPUT:*: {
  11.   if ($regex($1, /store.steampowered.com/(sub|app)/(\w+)/Si)) {
  12.     if (%steamTimeout) halt
  13.     %msg = msg $target
  14.     steam $1-
  15.   }
  16. }
  17.  
  18. alias steam {
  19.   set -u3 %steamTimeout $true
  20.   if ($regex($1-, /(http://)?store.steampowered.com/(sub|app)/(\d+)/Si)) {
  21.     sockclose steam
  22.     sockopen steam store.steampowered.com 80
  23.     sockmark steam $iif($regml(3), $regml(3), $regml(2))
  24.   }
  25. }
  26.  
  27. on *:sockopen:steam: {
  28.   sockwrite -n steam GET /api/appdetails?appids= $+ $sock($sockname).mark $+ &cc=us HTTP/1.1
  29.   sockwrite -n steam Host: store.steampowered.com
  30.   sockwrite -n steam
  31. }
  32.  
  33. on *:sockread:steam: {
  34.   while ($sock($sockname).rq) {
  35.     sockread &steam
  36.     bwrite steam -1 -1 &steam
  37.   }
  38.   bread steam 0 $file(steam).size &steam2
  39.   if ($bfind(&steam2, 0, {"packageid")) var %start = $v1
  40.   if ($bfind(&steam2, 0, }])) var %end = $v1
  41.   var %steam = $bvar(&steam2, %start - %end).text
  42.   %steam = $regsubex(%steam, /["\{\}]/g, )
  43.   var %n = 4
  44.   while (1) {
  45.     if ($gettok(%steam, %n, 44)) {
  46.       var %game = $addtok(%game, $right($v1, -12), 44)
  47.       inc %n 8
  48.       continue
  49.     }
  50.     else break
  51.   }
  52.  
  53.   if ($bfind(&steam2, 0, }}})) {
  54.     .remove steam
  55.     sockclose $sockname
  56.     %game = $replace(%game, $chr(44), $+($chr(44), $chr(32)))
  57.     %game = $regsubex(%game, /\\u(\d+)/g, $chr($base(\1, 16, 10)))
  58.     %msg %game
  59.   }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement