Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
; type /uthelp for info alias ut_getinfo { ; Incarnation: 2010-03-04 17:00 ; -============================ CHANGE THE VALUES BELOW ============================- ; ; the username for the webui: var %ut_username USERNAME ; the password for the webui: var %ut_password PASSWORD ; the hostname or ip of the machine running µtorrent, if µtorrent + webui is running on the same computer leave it at localhost: set -n %ut_url localhost ; µtorrent port (or the alternative webui port if activated): set -n %ut_port PORT ; OPTIONAL! maximum number of displayed torrentlines (not counting header and footer): set %ut_flood_max 0 ; -============================ CHANGE THE VALUES ABOVE ============================- ; var %continue $false if ( $sock(ut_info).to ) { if ( $sock(ut_info).to > 25 ) { ut_getinfo_end %continue = $true } } else { %continue = $true } if ( %continue == $true && $1 && $2 ) { set %ut_activechan $1 set %ut_action $2 if ( %ut_action == find && $3 ) { set %ut_find_string $3- ; msg %ut_activechan 4[µT] Showing the first %ut_flood_max torrents containing $3- } elseif ( %ut_action == downloading ) { ; msg %ut_activechan 4[µT] Showing the first %ut_flood_max torrents downloading. } elseif ( %ut_action == seeding ) { ; msg %ut_activechan 4[µT] Showing the first %ut_flood_max torrents seeding. } set %ut_credentials $encode(%ut_username $+ : $+ %ut_password,m) set %ut_download 0 set %ut_downloadingcount 0 set %ut_err_torrents 0 set %ut_flood_count 0 set %ut_ratio_sum 0 set %ut_remaining 0 set %ut_seedingcount 0 set %ut_sockerr 0 set %ut_torrentcount 0 set %ut_upload 0 set %ut_downloaded set %ut_uploaded .timerut_getinfo_end 1 20 ut_getinfo_end sockopen ut_token %ut_url %ut_port } } on 1:SOCKOPEN:ut_token:{ if ( $sockerr > 0 ) { %ut_sockerr = $sockerr ut_getinfo_end return } sockwrite -n $sockname GET /gui/token.html HTTP/1.1 sockwrite -n $sockname Host: $+(%ut_url,:,%ut_port) sockwrite -n $sockname Authorization: Basic %ut_credentials sockwrite -n $sockname $crlf } on 1:SOCKREAD:ut_token:{ if ( $sockerr > 0 ) { %ut_sockerr = $sockerr echo ow: $sockerr ut_getinfo_end return } var %i 1 while (%i > 0 ) { sockread -f %temp if ( Set-Cookie: isin %temp ) { if ( $regex(ut_re_c,%temp,/GUID=([^; ]*)/) > 0 ) { set %ut_cookie $regml(ut_re_c,1) } } if ( $+(id,$chr(61),$chr(34),token,$chr(34)) isin %temp || $+(id,$chr(61),$chr(39),token,$chr(39)) isin %temp ) { if ( $regex(ut_re,%temp,/<div[^>]*id=["\']token["\'][^>]*>([^<]*)</div>/) > 0 ) { set %ut_token $regml(ut_re,1) sockopen ut_info %ut_url %ut_port sockclose ut_token } } %i = $sockbr } } on 1:SOCKOPEN:ut_info:{ if ( $sockerr > 0 ) { %ut_sockerr = $sockerr ut_getinfo_end return } sockwrite -n $sockname GET /gui/?list=1&token= $+ %ut_token HTTP/1.1 sockwrite -n $sockname Host: $+(%ut_url,:,%ut_port) sockwrite -n $sockname Cookie: GUID= $+ %ut_cookie sockwrite -n $sockname Authorization: Basic %ut_credentials sockwrite -n $sockname $crlf unset %ut_credentials unset %ut_url } on 1:SOCKREAD:ut_info:{ if ( $sockerr > 0 ) { %ut_sockerr = $sockerr ut_getinfo_end return } sockread %temp if ( $left(%temp,12) == ,"torrentc": ) { ut_getinfo_end } else { var %pattern = \["(\w*)",(\d*),"(.*)",(\d*),(\d*),(\d*),(\d*),(\d*),(\d*),(\d*),(-?\d*),"(.*)",(\d*),(\d*),(\d*),(\d*),(\d*),(-?\d*),(\d*)[\]|,] if ( $regex(tor,%temp,%pattern) == 1 ) { var %hash = $regml(tor,1) var %status $regml(tor,2) var %torrentname = $regml(tor,3) var %progress $regml(tor,5) var %label = $regml(tor,12) inc %ut_torrentcount inc %ut_remaining $regml(tor,19) inc %ut_download $regml(tor,10) inc %ut_upload $regml(tor,9) inc %ut_downloaded $regml(tor,6) inc %ut_uploaded $regml(tor,7) inc %ut_ratio_sum $regml(tor,8) if ( $isbit(%status,1) == 1 && $isbit(%status,6) == 0 ) { if ( %progress == 1000 ) { inc %ut_seedingcount } else { inc %ut_downloadingcount } } if ( %ut_action == find ) { if ( %ut_find_string isin %torrentname ) { if ( %ut_flood_count < %ut_flood_max ) { if ( %progress == 1000 ) { var %temp = 3[µT]14 $left(%torrentname,40) $ut_convert_status( %status , %progress ) 4UP: $+ $bytes( $regml(tor,7) ).suf 11SIZE: $+ $bytes( $regml(tor,4) ).suf 11R: $+ $calc( $regml(tor,8) / 1000) 11UL: $+ $bytes( $regml(tor,9) ).suf $+ /s 11P: $+ $regml(tor,13) $+ ( $+ $regml(tor,14) $+ ) 11S: $+ $regml(tor,15) $+ ( $+ $regml(tor,16) $+ ) } else { var %temp = 3[µT]14 $left(%torrentname,40) $ut_convert_status( %status , %progress ) 4DOWN: $+ $bytes( $regml(tor,6) ).suf 4SIZE: $+ $bytes( $regml(tor,4) ).suf 11P: $+ $calc( %progress / 10) $+ $chr(37) 11DL: $+ $bytes( $regml(tor,10) ).suf $+ /s 11P: $+ $regml(tor,13) $+ ( $+ $regml(tor,14) $+ ) 11S: $+ $regml(tor,15) $+ ( $+ $regml(tor,16) $+ ) 4ETA: $+ $duration( $regml(tor,11) ) } msg %ut_activechan %temp } inc %ut_flood_count } } elseif ( %ut_action == downloading && %progress < 1000 && $isbit(%status,1) == 1 && $isbit(%status,6) == 0) { if ( %ut_flood_count < %ut_flood_max ) { var %temp = 3[µT]14 $left(%torrentname,40) $ut_convert_status( %status , %progress ) 4DOWN: $+ $bytes( $regml(tor,6) ).suf 11SIZE: $+ $bytes( $regml(tor,4) ).suf 11P: $+ $calc( %progress / 10) $+ $chr(37) 4DL: $+ $bytes( $regml(tor,10) ).suf $+ /s 11P: $+ $regml(tor,13) $+ ( $+ $regml(tor,14) $+ ) 11S: $+ $regml(tor,15) $+ ( $+ $regml(tor,16) $+ ) 4ETA: $+ $duration( $regml(tor,11) ) msg %ut_activechan %temp } inc %ut_flood_count } elseif ( %ut_action == seeding && %progress == 1000 && $isbit(%status,1) == 1 && $isbit(%status,6) == 0 ) { if ( %ut_flood_count < %ut_flood_max ) { var %temp 12[µT]14 $left(%torrentname,40) $ut_convert_status( %status , %progress ) UP: $+ $bytes( $regml(tor,7) ).suf SIZE: $+ $bytes( $regml(tor,4) ).suf R: $+ $calc( $regml(tor,8) / 1000) UL: $+ $bytes( $regml(tor,9) ).suf $+ /s P: $+ $regml(tor,13) $+ ( $+ $regml(tor,14) $+ ) S: $+ $regml(tor,15) $+ ( $+ $regml(tor,16) $+ ) msg %ut_activechan %temp } inc %ut_flood_count } } } unset %temp } alias ut_getinfo_end { sockclose ut_token sockclose ut_info if ( %ut_sockerr == 0 ) { if ( %ut_action == find || %ut_action == downloading || %ut_action == seeding ) { ; msg %ut_activechan 12[µT] Found %ut_flood_count torrents. } if ( %ut_action == stats ) { if ( %ut_err_torrents > 0 ) { var %temp = 4[µT] Torrents: $calc( %ut_torrentcount + %ut_err_torrents ) (Seed: $+ %ut_seedingcount $+ , Leech: $+ %ut_downloadingcount $+ , Inactive: $+ $calc( %ut_torrentcount - %ut_seedingcount - %ut_downloadingcount ) $+ , Unknown: $+ %ut_err_torrents $+ ). $bytes(%ut_download).suf $+ /s down, $bytes(%ut_upload).suf $+ /s up. Ratio: $round($calc($calc(%ut_ratio_sum / 1000) / %ut_torrentcount),2) Remaining: $bytes( %ut_remaining ).suf Downloaded: $bytes( %ut_downloaded ).suf Uploaded: $bytes( %ut_uploaded ).suf } else { var %temp = 3[µT] 8Torrents: %ut_torrentcount (Seeding: %ut_seedingcount $+ , Leeching: %ut_downloadingcount $+ , Inactive: $calc( %ut_torrentcount - %ut_seedingcount - %ut_downloadingcount ) $+ ). 4Download Speed: $bytes(%ut_download).suf $+ /s 4Upload Speed: $bytes(%ut_upload).suf $+ /s up. 11Downloaded: $bytes( %ut_downloaded ).suf 11Uploaded: $bytes( %ut_uploaded ).suf } msg %ut_activechan %temp } } else { ; msg %ut_activechan 12[µT] Error: webui is not responding (socket error). } unset %ut_action unset %ut_activechan unset %ut_credentials unset %ut_download unset %ut_downloadingcount unset %ut_err_torrents unset %ut_find_string unset %ut_flood_max unset %ut_flood_count unset %ut_ratio_sum unset %ut_remaining unset %ut_seedingcount unset %ut_sockerr unset %ut_torrentcount unset %ut_url unset %ut_upload unset %temp unset %ut_cookie unset %ut_token unset %ut_uploaded unset %ut_downloaded unset %ut_port .timerut_getinfo_end off } alias ut_convert_status { if ( $1 isnum && $2 isnum ) { if ( $isbit( $1, 1) == 1 ) { if ( $isbit( $1, 6) == 1 ) { return Paused } else { if ( $isbit( $1, 7) == 1 ) { if ( $2 == 1000 ) { return Seeding } else { return Downloading } } else { if ( $2 == 1000 ) { return Seeding [F] } else { return Downloading [F] } } } } elseif ( $isbit( $1 , 2 ) == 1 ) { return Checking } elseif ( $isbit( $1 , 5 ) == 1 ) { return Error } elseif ( $isbit( $1 , 7 ) == 1 ) { if ( $2 == 1000 ) { return Queued Seeding } else { return Queued } } if ( $2 == 1000 ) { return Finished } else { return Stopped } } return Invalid } alias uthelp { echo Command -=- Workings (Make sure you have filled in the username, password, hostname and port of µtorrent in the script first) echo /uthelp -=- Shows this info echo /utstats -=- Shows overall µtorrent stats echo /utdl -=- Shows torrents currently downloading echo /utul -=- Shows torrents currently seeding echo /utfind string -=- Shows torrents containing the string echo /utchan enable/disable -=- Enables/Disables the channel commands (disabled by default). (eg: !utstats) echo People in a channel can request your info using a ! instead of a / in the command (eg: !utstats) } alias utchan { if ( $1 == enable ) { set %ut_perm_nochan_ $+ $chan 0 echo uTorrent channel commands enabled for $chan } else { set %ut_perm_nochan_ $+ $chan 1 echo uTorrent channel commands disabled for $chan } } on *:TEXT:!dt*:#:{ if ( $eval( $var( ut_perm_nochan_ $+ $chan, 1 ), 2 ) == 0 ) { if ( $1 == !dtstats ) { ut_getinfo $chan stats } elseif ( $1 == !dtdl ) { ut_getinfo $chan downloading } elseif ( $1 == !dtul ) { ut_getinfo $chan seeding } elseif ( $1 == !dtfind ) { ut_getinfo $chan find $2- } } } on *:TEXT:!dt*:?:{ if ( $1 == !dtstats ) { ut_getinfo $nick stats } elseif ( $1 == !dtdl ) { ut_getinfo $nick downloading } elseif ( $1 == !dtul ) { ut_getinfo $nick seeding } elseif ( $1 == !dtfind ) { ut_getinfo $nick find $2- } } alias utstats { if ( $chan == $null ) { ut_getinfo $nick stats } else { ut_getinfo $chan stats } } alias utdl { if ( $chan == $null ) { ut_getinfo $nick downloading } else { ut_getinfo $chan downloading } } alias utul { if ( $chan == $null ) { ut_getinfo $nick seeding } else { ut_getinfo $chan seeding } } alias utfind { if ( $chan == $null ) { ut_getinfo $nick find $1- } else { ut_getinfo $chan find $1- } } ; -================================ RIGHT-CLICK MENU ===============================- ; Menu Channel { - µTorrent .$iif($menu != Menu Channel,Stats): /utstats .$iif($menu != Menu Channel,Download): /utdl .$iif($menu != Menu Channel,Upload): /utul .$iif($menu != Menu Channel,Find): { /utfind $$?="Enter Search String" } .Channels ..$iif($menu != Menu Channel,Enable Channel): { /utchan enable } ..$iif($menu != Menu Channel,Disable Channel): { /utchan disable } .$iif($menu != Menu Channel,Help): /uthelp - }
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
Untitled
Python | 1 hour ago | 0.13 KB
Decentralized Moneys
1 hour ago | 0.42 KB
120 million in 5 years
2 hours ago | 0.12 KB
December smells like money
2 hours ago | 0.07 KB
Crypto Liquidity Pools
3 hours ago | 0.47 KB
Trustless Finance
3 hours ago | 0.51 KB
The Lunar Kitsune - Yohana Tsukiko
4 hours ago | 21.38 KB
Crypto profits are insane
4 hours ago | 0.12 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!