Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.48 KB | None | 0 0
  1. https://kickass.so/mirc-7-34-final-cracked-zip-t9239700.html
  2.  
  3. ON *:PART:#: {
  4. if ($nick == $me) { unset %stream_auto_ [ $+ [ $chan ] ] | .timer[FOLLOWERS_CHECK_ [ $+ [ $chan ] ] off }
  5. }
  6.  
  7. ON *:KICK:#: {
  8. if ($knick == $me) { unset %stream_auto_ [ $+ [ $chan ] ] | .timer[FOLLOWERS_CHECK_ [ $+ [ $chan ] ] off }
  9. }
  10.  
  11. ON *:JOIN:#: {
  12. if ($nick == $me) && (%stream_chan_ [ $+ [ $chan ] ]) && (%stream_auto_ [ $+ [ $chan ] ]) { .timer[FOLLOWERS_CHECK_ $+ $chan $+ ] 0 5 twitch_check_new $chan %stream_chan_ [ $+ [ $chan ] ] }
  13. }
  14.  
  15. ON !*:TEXT:!*:#: {
  16. if ($1 == !autofollow) {
  17. if ($nick !isop $chan) { msg $chan [ $+ $nick $+ ]: Error, You are NOT an channel operator! | return }
  18. if (!$2) { msg $chan [ $+ $nick $+ ]: Error, try again and use ON or OFF options! | return }
  19. var %opt = $2
  20. if (%opt !== ON) && (%opt !== OFF) { msg $chan [ $+ $nick $+ ]: Error, Incorrect parameters, try again and use ONLY the options ON or OFF. | return }
  21. if (%opt == ON) {
  22. if (!%stream_chan_ [ $+ [ $chan ] ]) { msg $chan [ $+ $nick $+ ]: Error, There is NOT any $qt(Stream Channel) set, Please use the !SetStreamChan command to set one! | return }
  23. if (%stream_auto_ [ $+ [ $chan ] ]) { msg $chan [ $+ $nick $+ ]: Error, The AUTO-FOLLOW-WELCOME module is already running! }
  24. else {
  25. set %stream_auto_ [ $+ [ $chan ] ] $ctime
  26. .timer[FOLLOWERS_CHECK_ $+ $chan $+ ] 0 5 twitch_check_new $chan %stream_chan_ [ $+ [ $chan ] ]
  27. msg $chan [ $+ $nick $+ ]: The AUTO-FOLLOW-WELCOME module has been enabled. - (Twitch Channel:  $+ %stream_chan_ [ $+ [ $chan ] ] $+ )
  28. }
  29. }
  30. if (%opt == OFF) {
  31. if (!%stream_chan_ [ $+ [ $chan ] ]) { msg $chan [ $+ $nick $+ ]: Error, There is NOT any $qt(Stream Channel) set, Please use the !SetStreamChan command to set one! | return }
  32. if (!%stream_auto_ [ $+ [ $chan ] ]) { msg $chan [ $+ $nick $+ ]: Error, The AUTO-FOLLOW-WELCOME module is already NOT running! }
  33. else {
  34. .timer[FOLLOWERS_CHECK_ $+ $chan $+ ] off
  35. unset %stream_auto_ [ $+ [ $chan ] ]
  36. msg $chan [ $+ $nick $+ ]: The AUTO-FOLLOW-WELCOME module has been disabled. - (Twitch Channel:  $+ %stream_chan_ [ $+ [ $chan ] ] $+ )
  37. }
  38. }
  39. }
  40. if ($1 == !setstreamchan) {
  41. if ($nick !isop $chan) { msg $chan [ $+ $nick $+ ]: Error, You are NOT an channel operator! | return }
  42. if (!$2) { msg $chan [ $+ $nick $+ ]: Error, Not enough parameters, try again and enter the Twitch Channel correctly! | return }
  43. if (%stream_auto_ [ $+ [ $chan ] ]) { msg $chan [ $+ $nick $+ ]: Error, You must first disable the AUTO-FOLLOW-MESSAGE module and then change the stream channel! | return }
  44. set %stream_chan_ [ $+ [ $chan ] ] $2
  45. msg $chan [ $+ $nick $+ ]: The Twitch Channel has been set, now use !AutoFollow command to enable/disable the AUTO-FOLLOW-WELCOME module.
  46. }
  47. if ($1 == !streamchan) {
  48. if ($nick !isop $chan) { msg $chan [ $+ $nick $+ ]: Error, You are NOT an channel operator! | return }
  49. if (!%stream_chan_ [ $+ [ $chan ] ]) { msg $chan [ $+ $nick $+ ]: Error, There is NOT any Twitch Channel has been set! | return }
  50. msg $chan [ $+ $nick $+ ]: The $chan Twitch Stream Channel is now:  $+ %stream_chan_ [ $+ [ $chan ] ] $+ 
  51. }
  52. if ($1 == !followed) {
  53. if ($nick !isop $chan) { msg $chan [ $+ $nick $+ ]: Error, You are NOT an channel operator! | return }
  54. if (!$2) { msg $chan [ $+ $nick $+ ]: Error, Not enough parameters, try again and enter the nickname correctly! | return }
  55. var %stc = %stream_chan_ [ $+ [ $chan ] ]
  56. var %h = ls_followers_ [ $+ [ %stc ] $+ ] _ [ $+ [ $chan ] ]
  57. if (!$hget(%h)) { msg $chan [ $+ $nick $+ ]: There is NOT any nickname yet on my database! | return }
  58. if (!$hfind(%h,$2)) { msg $chan [ $+ $nick $+ ]: Error, Cannot find, The $qt( $+ $2 $+ ) nickname is NOT on my database! | return }
  59. var %fl = $hget(%h,$2)
  60. var %timeago = $_timeago($calc($ctime - %fl)).all
  61. msg $chan [ $+ $nick $+ ]: The $qt( $+ $2 $+ ) nickname followed the Twitch Channel on  $+ $date(%fl,ddd ddoo mmm yyyy HH:nn:ss) $+  $iif(%timeago,( $+ $v1 $+ ))
  62. }
  63. if ($1 == !lastfollow) {
  64. if ($nick !isop $chan) { msg $chan [ $+ $nick $+ ]: Error, You are NOT an channel operator! | return }
  65. var %stc = %stream_chan_ [ $+ [ $chan ] ]
  66. var %h = ls_followers_last_ [ $+ [ %stc ] $+ ] _ [ $+ [ $chan ] ]
  67. if (!$hget(%h)) { msg $chan [ $+ $nick $+ ]: There is NOT any nickname yet on my database! | return }
  68. if (!$hget(%h,1).item) { msg $chan [ $+ $nick $+ ]: Error, Cannot find, The last followed nickname cannot be found on my database! | return }
  69. var %fl = $hget(%h,1).data
  70. var %fln = $hget(%h,1).item
  71. var %timeago = $_timeago($calc($ctime - %fl)).all
  72. msg $chan [ $+ $nick $+ ]: The last follower nickname is $qt( $+ %fln $+ ) followed the Twitch Channel on  $+ $date(%fl,ddd ddoo mmm yyyy HH:nn:ss) $+  $iif(%timeago,( $+ $v1 $+ ))
  73. }
  74. }
  75.  
  76. alias twitch_check_new {
  77. if (!$1-) { return }
  78. if (!%stream_auto_ [ $+ [ $1 ] ]) { .timer[FOLLOWERS_CHECK_ $+ $1 $+ ] off | return }
  79. if ($me !ison $1) { .timer[FOLLOWERS_CHECK_ $+ $1 $+ ] off | return }
  80. var %u = https://api.twitch.tv/kraken/channels/ $+ $2 $+ /follows?limit=1&nocache= $+ $ticks
  81. var %v = twc_ $+ $ticks
  82. JSONOpen -ud %v %u
  83. if (%JSONError) { goto end | return }
  84. var %followed = $json(%v,follows,0,created_at)
  85. if (%followed) {
  86. var %followed = $replace($remove(%followed,$chr(122)),$chr(116),$chr(32))
  87. var %ctime = $ctime(%followed)
  88. var %followed = $date(%ctime,ddd ddoo mmm yyyy HH:nn:ss)
  89. var %followed_ago = $_timeago($calc($ctime - %ctime)).all
  90. }
  91. var %type = $json(%v,follows,0,user,type)
  92. var %name = $json(%v,follows,0,user,display_name)
  93. if (!%name) { var %name = $json(%v,follows,0,user,name) }
  94. if (!%name) { goto end | return }
  95. var %uu = https://api.twitch.tv/kraken/streams/ $+ $2
  96. var %vv = twl_ $+ $ticks
  97. JSONOpen -ud %vv %uu
  98. if (%JSONError) { goto end | return }
  99. var %id = $json(%vv,stream,_id)
  100. if (!%id) {
  101. msg # $1 The $qt( $+ $2 $+ ) stream channel is currently OFFLINE.
  102. msg # $1 The AUTO-FOLLOW-WELCOME module is going OFF.
  103. .timer[FOLLOWERS_CHECK_ $+ $1 $+ ] off
  104. unset %stream_auto_ [ $+ [ $1 ] ]
  105. goto end
  106. return
  107. }
  108. if (!$hget(ls_followers_ [ $+ [ $2 ] $+ ] _ [ $+ [ $1 ] ])) { hmake ls_followers_ [ $+ [ $2 ] $+ ] _ [ $+ [ $1 ] ] 500 }
  109. if ($hfind(ls_followers_ [ $+ [ $2 ] $+ ] _ [ $+ [ $1 ] ],%name)) { goto end | return }
  110. hadd -m ls_followers_ [ $+ [ $2 ] $+ ] _ [ $+ [ $1 ] ] %name $ctime(%followed)
  111. if ($hget(ls_followers_last_ [ $+ [ $2 ] $+ ] _ [ $+ [ $1 ] ])) { hfree $v1 }
  112. hadd -m ls_followers_last_ [ $+ [ $2 ] $+ ] _ [ $+ [ $1 ] ] %name $ctime(%followed)
  113. msg # $1 [ $+ %name $+ ]: Welcome & Thank you for following our channel! - (Followed on:  $+ %followed $+  $iif(%followed_ago,( $+ $v1 $+ ))) - (Type:  $+ %type $+ )
  114. :end
  115. JSONClose %v
  116. JSONClose %vv
  117. }
  118.  
  119. alias _timeago {
  120. if (!$1) { return 0 }
  121. if ($1) && ($1 !isnum) { return 0 }
  122. if ($prop == all) {
  123. var %s = $nduration($1)
  124. var %s = $replacex(%s,wks,$chr(32) weeks.,wk,$chr(32) week.)
  125. var %s = $replacex(%s,days,$chr(32) days.,day,$chr(32) day.)
  126. if (*min* iswm %s) { var %s = $replacex(%s,hrs,$chr(32) hours.,hr,$chr(32) hour.) }
  127. if (*min* !iswm %s) { var %s = $replacex(%s,hrs,$chr(32) hours,hr,$chr(32) hour) }
  128. if (*sec* iswm %s) { var %s = $replacex(%s,mins,$chr(32) minutes.,min,$chr(32) minute.) }
  129. if (*sec* !iswm %s) { var %s = $replacex(%s,mins,$chr(32) minutes,min,$chr(32) minute) }
  130. var %s = $replacex(%s,secs,$chr(32) seconds,sec,$chr(32) second)
  131. var %s = $replace(%s,$chr(46),$chr(44))
  132. return $iif(%s,%s ago,0)
  133. }
  134. if ($1 <= 59) { return $1 $iif($1 == 1,second,seconds) ago }
  135. if (($1 <= 3599) && ($1 > 59)) { return $floor($calc($1 / 60)) $iif($floor($calc($1 / 60)) == 1,minute,minutes) ago }
  136. if (($1 <= 86399) && ($1 > 3599)) { return $round($calc($1 / 3600),0) $iif($round($calc($1 / 3600),0) == 1,hour,hours) ago }
  137. if (($1 <= 2592000) && ($1 > 86399)) { return $floor($calc($1 / 86400)) $iif($floor($calc($1 / 86400)) > 1,days,day) $+ , $round($calc($calc($1 - $calc($floor($calc($1 / 86400))*86400)) / 3600),0) $iif($round($calc($calc($1 - $calc($floor($calc($1 / 86400))*86400)) / 3600),0) > 1,hours,hour) ago }
  138. if (($1 <= 31540000) && ($1 > 2592000)) { return $floor($calc($1 / 2592000)) $iif($floor($calc($1 / 2592000)) > 1,months,month) $+ , $round($calc($calc($1 - $calc($floor($calc($1 / 2592000))*2592000)) / 86400),0) $iif($round($calc($calc($1 - $calc($floor($calc($1 / 2592000))*2592000)) / 86400),0) > 1,days,day) ago }
  139. if ($1 > 31104000) { return $floor($calc($1 / 31104000)) $iif($floor($calc($1 / 31104000)) > 1,years,year) $+ , $round($calc($calc($1 - $calc($floor($calc($1 / 31104000))*31104000)) / 2592000),0) $iif($round($calc($calc($1 - $calc($floor($calc($1 / 31104000))*31104000)) / 2592000),0) > 1,months,month) ago }
  140. }
  141.  
  142. alias JSONOpen {
  143. var %switches = -
  144. if (-* iswm $1) {
  145. %switches = $1
  146. tokenize 32 $2-
  147. }
  148. var %com = JSONHandler:: $+ $1, %error, %file, %rem
  149. var %init = function init(a,b){errortext="";data="";url=b ? b : "";method="GET";headers=[];parsedJSON={};status=a;fso=new ActiveXObject("Scripting.FileSystemObject")}
  150. var %read = function readFile(filename){var ado=new ActiveXObject("ADODB.Stream");ado.CharSet="utf-8";ado.Open();ado.LoadFromFile(filename);if(!ado.EOF){data=ado.ReadText();}ado.close()}
  151. var %json = "object"!==typeof JSON&&(JSON={});(function(){function m(a){return 10>a?"0"+a:a}function t(a){p.lastIndex=0;return p.test(a)?'"'+a.replace(p,function(a){var c=u[a];return"string"===typeof c?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function q(a,l){var c,d,h,r,g=e,f,b=l[a];b&&"object"===typeof b&&"function"===typeof b.toJSON&&(b=b.toJSON(a));"function"===typeof k&&(b=k.call(l,a,b));switch(typeof b){case "string":return t(b);case "number":return isFinite(b)?String(b):"null";case "boolean":case "null":return String(b);case "object":if(!b)return"null";e+=n;f=[];if("[object Array]"===Object.prototype.toString.apply(b)){r=b.length;for(c=0;c<r;c+=1)f[c]=q(c,b)||"null";h=0===f.length?"[]":e?"[\n"+e+f.join(",\n"+e)+"\n"+g+"]":"["+f.join(",")+"]";e=g;return h}if(k&&"object"===typeof k)for(r=k.length,c=0;c<r;c+=1)"string"===typeof k[c]&&(d=k[c],(h=q(d,b))&&f.push(t(d)+(e?": ":":")+h));else for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(h=q(d,b))&&f.push(t(d)+(e?": ":":")+h);h=0===f.length?"{}":e?"{\n"+e+f.join(",\n"+e)+"\n"+g+"}":"{"+f.join(",")+"}";e=g;return h}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+m(this.getUTCMonth()+1)+"-"+m(this.getUTCDate())+"T"+m(this.getUTCHours())+":"+m(this.getUTCMinutes())+":"+m(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var s,p,e,n,u,k;"function"!==typeof JSON.stringify&&(p=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,u={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(a,l,c){var d;n=e="";if("number"===typeof c)for(d=0;d<c;d+=1)n+=" ";else"string"===typeof c&&(n=c);if((k=l)&&"function"!==typeof l&&("object"!==typeof l||"number"!==typeof l.length))throw Error("JSON.stringify");return q("",{"":a})});"function"!==typeof JSON.parse&&(s=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,JSON.parse=function(a,e){function c(a,d){var g,f,b=a[d];if(b&&"object"===typeof b)for(g in b)Object.prototype.hasOwnProperty.call(b,g)&&(f=c(b,g),void 0!==f?b[g]=f:delete b[g]);return e.call(a,d,b)}var d;a=String(a);s.lastIndex=0;s.test(a)&&(a=a.replace(s,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return d=eval("("+a+")"),"function"===typeof e?c({"":d},""):d;throw new SyntaxError("JSON.parse");})})();
  152. var %xhr = function xhr(){var a,b=['MSXML2.XMLHTTP.6.0','MSXML2.XMLHTTP.3.0','Microsoft.XMLHTTP'],c;for(a=0;a<b.length;a++){try{c=new ActiveXObject(b[a]);break}catch(e){}}if(typeof c==="undefined"){errortext = "Unable to locate an XMLHTTP object for use"}else{c.open(method,url,false);for(a=0;a<headers.length;a++){c.setRequestHeader(headers[a][0],headers[a][1])}c.send(data);if(c.status!==200){errortext="Unable to retrieve data - Server Error: " + c.status}else{status="Parsed";try{parsedJSON=JSON.parse(c.responseText)}catch(ee){errortext="Unable to parse Retrieved Data"}}}}
  153. if (!$regex(%switches, /^-[ufbwd]*$/)) { %error = Invalid switches specified }
  154. elseif ($regex(%switches, /([ufbwd])\1/)) { %error = Duplicate switch specified ( $+ $regml(1) $+ ) }
  155. elseif ($regex(%switches, /([ufb])/g) > 1) { %error = Conflicting switches specified (- $+ $regml(1) $+ , - $+ $regml(2) $+ $iif($regml(3), $chr(44) - $+ $v1) $+ ) }
  156. elseif (w isin %switches && u !isin %switches) { %error = Invalid switch (-w is only for use with -u) }
  157. elseif ($0 < 2) { %error = Required parameters missing }
  158. elseif (!$regex($1,/^[a-z\d_.-]+$/i)) { %error = Invalid name specified (Can only contant letters, numbers, _, ., and -) }
  159. elseif ($com(%com)) { %error = Specified name in use }
  160. elseif (u isin %switches && $0 > 2) { %error = Invalid URL specified. (Contains Spaces: $2-) }
  161. elseif (f isin %switches && !$isfile($2-)) { %error = File not found: $2- }
  162. elseif (b isin %switches && &* !iswm $2) { %error = Invalid binary variable specified (No '&' Prefix) }
  163. elseif (b isin %switches && $0 > 2) { %error = Invalid binary variable specified (Contains Spaces: $2-) }
  164. elseif (b isin %switches && $bvar($2, 0) < 1) { %error = Invalid binary variable specified (No content) }
  165. elseif (!$JSON::ComOpen(%com, MSScriptControl.ScriptControl) || $comerr) { %error = Unable to create an instance of MSScriptControl.ScriptControl }
  166. elseif (!$com(%com, language, 4, bstr, jscript) || $comerr) { %error = Unable to set ScriptControl's language to Javascript }
  167. elseif (!$com(%com, addcode, 1, bstr, %init) || $comerr) { %error = Unable to add init() to ScriptControl }
  168. elseif (!$com(%com, addcode, 1, bstr, %xhr) || $comerr) { %error = Unable to add xhr() to ScriptControl }
  169. elseif (!$com(%com, addcode, 1, bstr, %read) || $comerr) { %error = Unable to add readFile() to ScriptControl }
  170. elseif (!$com(%com, ExecuteStatement, 1, bstr, %JSON) || $comerr) { %error = Unable to Initalize the JSON parser object }
  171. elseif (!$com(%com, ExecuteStatement, 1, bstr, $iif(u isin %switches, $+(init,$chr(40), "XHR", $chr(44), $qt($JSON::Escape($2)),$chr(41)), $+(init,$chr(40), "Parsed", $chr(44), "", $chr(41)))) || $comerr) { %error = Unable to initalize variables for ScriptControl }
  172. else {
  173. if (u isin %switches) {
  174. if (w !isin %switches) {
  175. var %i = $com(%com, ExecuteStatement, 1, bstr, $+(xhr,$chr(40),$chr(41)))
  176. if (!%i || $comerr) { %error = Unable to retrieve data from $2 :: $com(%com).error :: $com(%com).errortext }
  177. elseif (!$com(%com, eval, 1, bstr, errortext) || $com(%com).result) { %error = Unable to retrieve data $+ $iif($v1,: $v1,) }
  178. }
  179. }
  180. else {
  181. %file = $JSON::File($1)
  182. if (f isin %switches) {
  183. %file = $longfn($2)
  184. }
  185. elseif (b isin %switches) {
  186. bwrite $qt(%file) 0 -1 $2
  187. %rem = $true
  188. }
  189. else {
  190. write -n $qt(%file) $2-
  191. %rem = $true
  192. }
  193. if (!$com(%com, ExecuteStatement, 1, bstr, $JSON::Funct(readFile, $qt($JSON::Escape(%file)))) || $comerr) { %error = Unable to read contents of data-passing file }
  194. elseif (!$com(%com, ExecuteStatement, 1, bstr, $JSON::Funct(parsedJSON=JSON.parse,data)) || $comerr) { %error = Unable to parse data into valid JSON }
  195. }
  196. if (d isin %switches) { $+(.timer,%com) 1 0 JSONClose $1 }
  197. }
  198. :error
  199. %error = $iif($error, $v1, %error)
  200. if (%rem && %file && $isfile(%file)) { .remove $qt(%file) }
  201. if (%error) {
  202. if ($timer(%com)) { $+(.timer,%com) off }
  203. if ($com(%com)) {
  204. set -eu0 $+(%,%com,::error) %error
  205. .comclose $v1
  206. }
  207. else { set -eu0 %JSONError %error }
  208. }
  209. }
  210. alias JSONURLOption {
  211. var %com = JSONHandler:: $+ $1, %error, %head, %value, %x = 2
  212.  
  213. if (!$com(%com)) { return }
  214. unset % [ $+ [ %com ] $+ ] ::error
  215. if ($0 < 3) { %error = Missing parameters }
  216. elseif (!$com(%com, eval, 1, bstr, status) || $com(%com).result != XHR) { %error = HTTP Request already completed or wasn't specified }
  217. elseif ($2 == method) {
  218. if (!$regex($3-, /^(?:GET|POST|PUT|DELETE)$/i)) { %error = Invalid HTTP Request method Specified: $3- }
  219. elseif (!$com(%com, ExecuteStatement, 1, bstr, method=" $+ $3 $+ ") || $comerr) { %error = Unable to set HTTP Request method }
  220. }
  221. else {
  222. if (!$com(%com, ExecuteStatement, 1, bstr, $JSON::Funct(headers.push,[ $+ $qt($JSON::Escape($2)), $qt($JSON::Escape($3-)) $+ ])) || $comerr) { %error = Unable to set HTTP Header: %head $+ : $+ %value }
  223. }
  224. :error
  225. %error = $iif($error, $v1, %error)
  226. if (%error) {
  227. reseterror
  228. set -e $+(%,%com,::Error) %error
  229. }
  230. }
  231. alias JSONGet {
  232. var %switches -
  233. if (-* iswm $1) {
  234. %switches = $1
  235. tokenize 32 $2-
  236. }
  237. var %com = JSONHandler:: $+ $1
  238. var %file = $JSON::File($1)
  239. var %error
  240. var %rem
  241. if ($com(%com)) {
  242. if ($com(%com, eval, 1, bstr, status) && $com(%com).result !== XHR) { %error = HTTP Request already completed or wasn't specified }
  243. elseif (!$regex(%switches, /^-[bf]*$/)) { %error = Invalid switches specified }
  244. elseif ($regex(%switches, /([bf])\1/)) { %error = Duplicate switch specified ( $+ $regml(1) $+ ) }
  245. elseif ($regex(%switches, /([bf])/g) > 1) { %error = Conflicting switches specified (- $+ $regml(1) $+ , - $+ $regml(2) $+ ) }
  246. elseif (b isin %switches && &* !iswm $2) { %error = Invalid binary variable specified (No '&' Prefix) }
  247. elseif (b isin %switches && $0 > 2) { %error = Invalid binary variable specified (Contains Spaces: $2-) }
  248. elseif (f isin %switches && !$isfile($2-)) { %error = File not found: $2- }
  249. else {
  250. if (b isin %switches && $bvar($2,0)) {
  251. bwrite $qt(%file) 0 -1 $2
  252. %rem = $true
  253. }
  254. elseif (f isin %switches) { %file = $2- }
  255. elseif ($2-) {
  256. write -n $qt(%file) $2-
  257. %rem = $true
  258. }
  259. %file = $longfn(%file)
  260. if ($isfile(%file) && (!$com(%com, ExecuteStatement, 1, bstr, $JSON::Funct(readFile,$qt($JSON::Escape(%file)))) || $comerr)) { %error = Unable to pass data to JSON Handler }
  261. elseif (!$com(%com, ExecuteStatement, 1, bstr, xhr $+ $chr(40) $+ $chr(41)) || $comerr) { %error = Unable to retrieve data from specified URL :: $com(%com).error :: $com(%com).errortext }
  262. elseif (!$com(%com, eval, 1, bstr, errortext) || $com(%com).result) { %error = $v1 }
  263. if (%rem && $isfile(%file)) { .remove %file }
  264. }
  265. }
  266. :error
  267. %error = $iif($error, $v1, %error)
  268. if (%error) {
  269. reseterror
  270. set -eu0 $+(%,%com,::Error) %error
  271. }
  272. }
  273. alias JSON {
  274. var %com, %x = 1, %i = 0, %get = parsedJSON, %tok, %res
  275. if ($regex($1,/^\d+$/) && $0 === 1) {
  276. while ($com(%x)) {
  277. if (JSONHandler::* iswm $v1) {
  278. %com = $v2
  279. inc %i
  280. if (%i === $1) { return %com }
  281. }
  282. inc %x
  283. }
  284. return $iif($1 == 0, %i)
  285. }
  286. elseif ($regex($1, /^JSONHandler::CHILD::([^:]+)::(.*)$/)) {
  287. %com = $regml(1)
  288. %get = $regml(2)
  289. }
  290. else { %com = JSONHandler:: $+ $1 }
  291. if ($com(%com)) {
  292. if ($0 == 1) {
  293. if ($prop == isChild) { return $iif($regex($1, /^JSONHandler::CHILD::([^:]+)::(.*)$/), $true, $false) }
  294. elseif ($prop == error) { return $iif($(,$+(%,%com,::error)), $true,$false) }
  295. elseif ($prop == errortext) { return $(,$+(%,%com,::error)) }
  296. elseif ($com($1)) { return $1 }
  297. }
  298. elseif (!$com(%com, eval, 1, bstr, status) || $com(%com).result != parsed) { set -eu0 $+(%,%com,::error) JSON Handler waiting for HTTP Request }
  299. else {
  300. %x = 2
  301. while (%x <= $0) {
  302. %tok = $(,$ $+ %x)
  303. if (!$regex(%tok, /^\d+$/)) {
  304. %tok = $qt($replace(%tok,\,\\,",\"))
  305. }
  306. %get = $+(%get,[,%tok,])
  307. inc %x
  308. }
  309. if (!$com(%com, eval, 1, bstr, %get) || $comerr) { set -e $+(%,%com,::error) Invalid Item|index specified }
  310. else {
  311. %res = $com(%com).result
  312. if (%res == [object]) { return JSONHandler::CHILD:: $+ $1 $+ :: $+ %get }
  313. else { return %res }
  314. }
  315. }
  316. }
  317. }
  318. alias JSONClose {
  319. var %com = JSONHandler:: $+ $1
  320. unset % [ $+ [ %com ] $+ ] ::*
  321. if ($com(%com)) { .comclose $v1 }
  322. if ($timer(%com)) { $+(.timer,%com) off }
  323. }
  324. alias JSONList {
  325. var %x = 1, %i = 0
  326. while ($com(%x)) {
  327. if (JSONHandler::* iswm $v1) {
  328. inc %i
  329. echo $color(info text) -a * # $+ %i : $regsubex($v2, /^JSONHandler::/,)
  330. }
  331. inc %x
  332. }
  333. if (!%i) { echo $color(info text) -a * No active JSON handlers }
  334. }
  335. alias JSON::ComOpen { .comopen $1- | if ($com($1) && !$comerr) { return $true } | :error | reseterror | if ($com($1)) { .comclose $1 } }
  336. alias JSON::Escape { return $replace($1,\,\\,",\") }
  337. alias JSON::File { var %a = 1 | while ($isfile(JSON $+ $1 $+ %a $+ .json)) { inc %a } | return $+(JSON, $1, %a, .json) }
  338. alias JSON::Funct { var %a = $1 $+ $chr(40), %i = 1 | while (%i < $0) { inc %i | %a = $+(%a,$iif(%i > 2,$chr(44)),$(, $ $+ %i)) } | return %a $+ $chr(41) }
  339.  
  340. alias -l addPoints {
  341. if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt }
  342. var %topic $+($chan,.,$nick)
  343. var %points $calc($readini(Points.ini,%topic,Points) + $1)
  344. writeini -n Points.ini %topic Points %points
  345. return %points
  346. }
  347.  
  348. alias -l lookUpPoints {
  349. var %topic $+($chan,.,$nick)
  350. var %points $readini(Points.ini,%topic,Points)
  351. return %points
  352. }
  353. alias doaddpoints {
  354. if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
  355. var %topic $+($1,.,$2)
  356. var %points $calc($readini(Points.ini,%topic,Points) + $3)
  357. writeini -n Points.ini %topic Points %points
  358. echo -a Added points for %topic
  359. }
  360.  
  361. alias dorempoints {
  362. var %topic $+($1,.,$2)
  363. if (%points !0) { echo 2-st You do not have that many points }
  364. remini -n Points.ini %topic Points
  365. echo -a Removed points for %topic
  366. }
  367.  
  368. on *:text:!points:#:{
  369. if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
  370. set -u10 %floodpoints On
  371. set -u30 %floodpoints. $+ $nick On
  372. msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) total points.
  373. }
  374.  
  375. on *:JOIN:# {
  376. if ($nick == ProdBot) {
  377. msg $chan Hi Im ProdBot, my creatory is MrLubert, if you have any problems please contact him.
  378. }
  379. }
  380.  
  381. on *:TEXT:!test:# {
  382. msg $chan $nick -> Hi. Im still here!
  383. }
  384.  
  385. on *:TEXT:!emotes:# {
  386. msg $chan $nick -> List of emotes are here www.twitchemotes.com
  387. }
  388.  
  389. on $*:text:/!points (add|remove)/Si:#:{
  390. if ($nick isop #) {
  391. if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
  392. writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
  393. { msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points. }
  394. }
  395. else { msg $chan This command is only available to moderators. }
  396. }
  397. on !*:join:#:{
  398. $+(.timerpoints.,#,.,$nick) 0 60 add.pts $+(#,.,$nick)
  399. add.pts $+(#,.,$nick)
  400. }
  401. on !*:part:#:$+(.timerpoints.,#,.,$nick) off
  402. alias -l add.pts {
  403. writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
  404. }
  405. on *:text:!links on:#: {
  406. if ($nick isop $chan) {
  407. if (%links) { msg $chan $nick -> Link protection is already active }
  408. else {
  409. msg $chan $nick -> Link protection activated
  410. set %links On
  411. }
  412. }
  413. }
  414.  
  415. on *:text:!links off:#: {
  416. if ($nick isop #) {
  417. if (%links) {
  418. msg $chan $nick -> Link protection deactivated
  419. unset %links On
  420. }
  421. else { msg $chan $nick -> Link protection is already disabled. }
  422. }
  423. }
  424. on *:text:*.com*:#: {
  425. if ($nick isop #) { return }
  426. if ($istok(%permit,$nick,32)) { return }
  427. if (%links) {
  428. msg $chan /timeout $nick 60
  429. msg $chan $nick -> Please ask permission before posting a link [Warning]
  430. }
  431. }
  432.  
  433. on *:text:*.net*:#: {
  434. if ($nick isop #) { return }
  435. if ($istok(%permit,$nick,32)) { return }
  436. if (%links) {
  437. msg $chan /timeout $nick 60
  438. msg $chan $nick -> Please ask permission before posting a link [Warning]
  439. }
  440. }
  441. on *:text:*.nl*:#: {
  442. if ($nick isop #) { return }
  443. if ($istok(%permit,$nick,32)) { return }
  444. if (%links) {
  445. msg $chan /timeout $nick 60
  446. msg $chan $nick -> Please ask permission before posting a link [Warning]
  447. }
  448. }
  449. on *:text:*.tv*:#: {
  450. if ($nick isop #) { return }
  451. if ($istok(%permit,$nick,32)) { return }
  452. if (%links) {
  453. msg $chan /timeout $nick 60
  454. msg $chan $nick -> Please ask permission before posting a link [Warning]
  455. }
  456. }
  457.  
  458. on *:text:*http://*:#: {
  459. if ($nick isop #) { return }
  460. if ($istok(%permit,$nick,32)) { return }
  461. if (%links) {
  462. msg $chan /timeout $nick 60
  463. msg $chan $nick -> Please ask permission before posting a link [Warning]
  464. }
  465. }
  466. on *:text:*www.*:#: {
  467. if ($nick isop #) { return }
  468. if ($istok(%permit,$nick,32)) { return }
  469. if (%links) {
  470. msg $chan /timeout $nick 60
  471. msg $chan $nick -> Please ask permission before posting a link [Warning]
  472. }
  473. }
  474.  
  475. on *:text:!permit*:#: {
  476. if ($nick isop #) {
  477. if (%links) {
  478. set -u120 %permit $addtok(%permit,$2,32)
  479. msg $chan $nick -> You have 2 mins to post a link.
  480. }
  481. }
  482. }
  483. on *:TEXT:!allow*:#: {
  484. if ($nick isop $chan) {
  485. if (%links) {
  486. set -u120 %permit $addtok(%permit,$2,32)
  487. msg $chan $nick -> You have 2 mins to post a link.
  488. }
  489. }
  490. }
  491.  
  492. on *:TEXT:$(!bot cmds *):#: {
  493. if ($nick isop $chan) {
  494. if ($3 == on) {
  495. if (%CADD.On. [ $+ [ $network ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] == $null) {
  496. set %CADD.On. [ $+ [ $network ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] 1
  497. msg $chan $nick -> Adding and Deleting Commands Script has been turned on for $chan on $network $+ .
  498. }
  499. else {
  500. msg $chan $nick -> Adding and Deleting Commands Script is already turned on for $chan on $network $+ .
  501. }
  502. }
  503. if ($3 == off) {
  504. if (%CADD.On. [ $+ [ $network ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] != $null) {
  505. unset %CADD.On. [ $+ [ $network ] ] [ $+ [ . ] ] [ $+ [ $chan ] ]
  506. msg $chan $nick -> Adding and Deleting Commands Script has been turned off for $chan on $network $+ . - However, Custom added Commands for the channel have not been deleted.
  507. }
  508. else {
  509. msg $chan $nick -> Adding and Deleting Commands Script is already turned off for $chan on $network $+ .
  510. }
  511. }
  512. }
  513. }
  514.  
  515. on *:TEXT:!cmds:#: {
  516. if (%CADD.On. [ $+ [ $network ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] != $null) {
  517. var %command_file = rcdradio_commands.ini
  518. var %k = $+($network,-,$chan)
  519. var %x = $ini(%command_file,%k,0)
  520. var %kk = ''
  521. msg $chan Sorry about the spam!
  522.  
  523. if (%x) {
  524. msg $chan $nick == Customized Command List for $chan on $network
  525. while (%x) {
  526. %kk = $ini(%command_file,%k,%x)
  527. msg $chan $nick = ! $+ %kk => $readini(%command_file,n,%k,%kk)
  528. dec %x
  529. }
  530. msg $chan $nick == End of Custom Command List
  531. }
  532. else {
  533. msg $chan Sorry $nick $+ , No custom commands available.
  534. }
  535. }
  536. }
  537.  
  538. on *:TEXT:!comadd *:#:{
  539. if (%CADD.On. [ $+ [ $network ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] != $null) {
  540. if ($nick isop $chan) {
  541. var %command_file = rcdradio_commands.ini
  542. var %k = $+($network,-,$chan)
  543.  
  544. if ($ini(%command_file,%k,$2) >= 1) {
  545. msg $chan $nick -> The command ! $2 Is already created.
  546. }
  547. else {
  548. writeini %command_file %k $2 $3-
  549. msg $chan $nick -> The command ! $+ $2 has been added.
  550. }
  551. }
  552. }
  553. }
  554. on *:TEXT:!comedit *:#:{
  555. if (%CADD.ON [ $network ] ] [ $+ [ . ] ] [ $= [ $chan ] ] != $null) {
  556. if ($nick isop $chan) {
  557. var %command_file = rcdradio_commands.ini
  558. var %k = $+($network,-,$chan)
  559.  
  560. if($ini(%command_file,%k,$2) >= 1) {
  561. remini %command_file %k $2 { Halt
  562. writeini %command_file %k $2 $3-
  563. msg $chan $nick -> The command ! $+ $2 has been edited.
  564. }
  565. }
  566. }
  567. }
  568. }
  569.  
  570. on *:TEXT:!bot:# {
  571. msg $chan $nick -> My code was made my MrLubert! But im ran on Prodiod's computer. If there's anything wrong with the bot please contact MrLubert.
  572. }
  573.  
  574. on *:TEXT:!comdel *:#:{
  575. if (%CADD.On. [ $+ [ $network ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] != $null) {
  576. if ($nick isop $chan) {
  577. var %command_file = rcdradio_commands.ini
  578. var %k = $+($network,-,$chan)
  579.  
  580. if ($ini(%command_file,%k,$2) >= 1) {
  581. remini %command_file %k $2
  582. msg $chan $nick -> The command ! $+ $2 has been deleted.
  583. }
  584. else {
  585. msg $chan $nick -> Sorry, command ! $+ $2 could not be found.
  586. }
  587.  
  588.  
  589. if (%CADD.On. [ $+ [ $network ] ] [ $+ [ . ] ] [ $+ [ $chan ] ] != $null) {
  590. var %command_file = rcdradio_commands.ini
  591. var %cmd = $mid($1,2)
  592.  
  593. if ($me == $nick) {
  594. halt
  595. }
  596.  
  597. var %k = $+($network,-,$chan)
  598. var %t = $readini(%command_file,n,%k,%cmd)
  599.  
  600. if ($len(%t)) {
  601.  
  602. }
  603. }
  604. }
  605. }
  606. }
  607.  
  608. on *:TEXT:!bot leave:# {
  609. if ($nick isop $chan) {
  610. msg $chan $nick -> GoodBye <3
  611. part $chan
  612. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement