Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; PIK Auth Get Captcha Code ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- alias pikAUTHid {
- sockopen pikAUTHid %pikauthhost 80
- }
- on *:SOCKOPEN:pikAUTHid:{
- sockwrite -nt $sockname GET %pikauthurl HTTP/1.1
- sockwrite -nt $sockname Host: %pikauthhost
- sockwrite -nt $sockname $crlf
- }
- on *:SNOTICE:*U protivnom, posetite*:{
- set %pikauthstrana $17
- if ($regex(%pikauthstrana,/((?:http://)?(?:http://|www\.)([^/\s]+)(/\S+)?)/i)) {
- set %pikauthhost $regml(2)
- set %pikauthurl $regml(3)
- pikAUTHid
- }
- }
- on *:SNOTICE:*am je dozvoljen*:{
- window -c @PIKauth
- unset %pikauthstrana
- unset %pikauthhost
- unset %pikauthurl
- unset %rezultat
- unset %authslika
- unset %authcode
- if ($findfile($mircdir,slika.gif,0) == 1) { remove slika.gif }
- }
- on *:SOCKREAD:pikAUTHid:{
- var %read
- sockread -f %read
- if ($sockerr) {
- write SockErr.txt $sockname : $sockerr
- write SockErr.txt Line : %read
- write SockErr.txt $crlf
- echo -a Socket Error - Check SockErr.txt
- halt
- }
- if ($regex(%read,<img src="(.+)" border=.+)) {
- set %rezultat $sock(pikAUTHid).mark $regml(1)
- set %authslika http:// $+ %pikauthhost $+ /auth/ $+ %rezultat
- if ($findfile($mircdir,slika.gif,0) == 1) { remove slika.gif }
- if ($findfile($mircdir,piklogo.gif,0) == 0) { GetPIKlogo }
- GetPica
- }
- }
- ;;;;;;;;;;;;;;;
- ; get captcha ;
- ;;;;;;;;;;;;;;;
- Alias GetPica {
- SockOpen GetPica %pikauthhost 80
- }
- On 1:SockOpen:GetPica:{
- sockwrite -nt $sockname GET %authslika HTTP/1.1
- sockwrite $sockname Host: %pikauthhost $+ $crlf $+ $crlf
- }
- On 1:SockRead:GetPica:{
- if (!$sock($sockname).mark) {
- var %SockReader
- sockread %SockReader
- if (%SockReader == $null) { sockmark $sockname 1 }
- }
- else {
- sockread &picture
- bwrite $qt($mIRCdir $+ slika.gif) -1 -1 &picture
- showpica
- }
- }
- ;;;;;;;;;;;;
- ; get logo ;
- ;;;;;;;;;;;;
- Alias GetPIKlogo {
- SockOpen GetPIKlogo cm.ikimg.com 80
- }
- On 1:SockOpen:GetPIKlogo:{
- sockwrite -nt $sockname GET /krstarica-srbija-srl.gif HTTP/1.1
- sockwrite $sockname Host: cm.ikimg.com $+ $crlf $+ $crlf
- }
- On 1:SockRead:GetPIKlogo:{
- if (!$sock($sockname).mark) {
- var %SockReader
- sockread %SockReader
- if (%SockReader == $null) { sockmark $sockname 1 }
- }
- else {
- sockread &picture
- bwrite $qt($mIRCdir $+ piklogo.gif) -1 -1 &picture
- }
- }
- ;;;;;;;;;;;;;;;
- ; auth window ;
- ;;;;;;;;;;;;;;;
- Alias ShowPica {
- window -dpCe0k0 +l @PIKauth -1 -1 250 180
- drawpic @PIKauth 40 1 $qt($mIRCdir $+ piklogo.gif)
- drawtext -po @PIKauth 4 10 35 Unesite kod sa slike
- drawtext -po @PIKauth 4 70 92 i stisnite ENTER
- drawpic @PIKauth 50 50 $qt($mIRCdir $+ slika.gif)
- }
- ;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; post auth captcha code ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;
- on 1:INPUT:@PIKauth:{
- set %authcode $1-
- sockopen pikauthpost %pikauthhost 80
- }
- on *:sockopen:pikauthpost:{
- var -s %data code= $+ %authcode
- sockwrite -n $sockname POST %pikauthurl HTTP/1.1
- sockwrite -n $sockname Host: %pikauthhost
- sockwrite -n $sockname Content-Type: application/x-www-form-urlencoded
- sockwrite -n $sockname Content-Length: $len(%data)
- sockwrite -n $sockname $crlf $+ %data
- }
- on *:sockread:pikauthpost:{
- var %x
- sockread %x
- if (*autorizacionog* iswm %x) {
- echo -a Greska!
- echo -a Nema autorizacionog koda. Proverite da li ste ispravno kopirali URL. Možda ste već uspešno prošli autorizaciju?
- window -c @PIKauth
- unset %pikauthstrana
- unset %pikauthhost
- unset %pikauthurl
- unset %rezultat
- unset %authslika
- unset %authcode
- if ($findfile($mircdir,slika.gif,0) == 1) { remove slika.gif }
- }
- if (*neispravan* iswm %x) { drawtext -po @PIKauth 4 5 110 Uneli ste neispravan kod, pokušajte ponovo. }
- }
Advertisement
Add Comment
Please, Sign In to add comment