Skip to content
General IRCd

Screenshot Uploader Help :)

A TG007 community discussion started by Jagie.

Discussion 22 posts
Page 1 of 2
Open
Topic #13193 · 22 published posts · 4,608 views

Hey, Ive been wondering if anyone could perhaps make me a script, which if i type "/ss" it will take a screen shot of the entire screen, and upload to imageshack.us, and then echo the imageshack link.

 

I am in need of this :)

 

If someone is able to do it, then I would be very grateful.

 

Thank you.

Its what I do.

This DLL lets you take screenshots

 

http://www.mircscripts.org/comments.php?cid=3771

 

I am not sure how you would upload them i am guessing you would need to use sockets in some way which i have no knowledge of

 

but i am sure err0r, travis etc will be along soon and will be able to help more

 

 

 

also here is a link to a mrc file that allows you to upload to imageshack

 

maybe between them we can all work it out lol

 

http://files.codes-sources.com/fichier.asp...cimageshack.mrc

 

 

Edited Jul 30, 2009 9:35 AM by Haggis adding link to mrc file

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

I had a look over that script and you'd be able to upload the file taken using the dll by heavily stripping out the dialogs. When you've got that part stripped out, you should be able to cut out any parts you no longer need from that code, compress it and add it to the /ss alias.

I don't get paid to know the answer, therefore I'm far more likely to give you a straight and honest answer.

Im very confused ^^. I only know basic mIRC and not really much of a coder. I just wanted this as, my channel takes a lot of screenshots of programs/games, as i use mIRC instead of alternate programs. :D

 

If anyone has the time to possibly create the script, Just leave it here, and i will be extremely grateful and also perhaps help others who need it. :)

Its what I do.

Maybe try this. 2 scripts. First one to upload Images to imageshack. The one below.

and capture a ss with this one off the link If you want to capture them yourself.

Image uploader/downloader courtesy of hawkee site.

ss one is this link to chainscriptz. If your not a member you will have to register to download It.

ss link

 

;=========================== Cut with scissors here =====
/*
Image uploader/downloader by Brando
This script was made on mIRC version 6.34 (also tested on version 6.3), so im not completely sure it will work on other versions.
mIRC version 6.34 can be downloaded at: [url="http://mirc.com/get.html"]http://mirc.com/get.html[/url]
If the images aren't uploading and your geting the retry error message, try increasing the keep-alive header.
For bugs PLEASE contact me on hawkee or swiftirc forums
*/
dialog -l is {
  title "Image uploader"
  size -1 -1 247 227
  option dbu
  list 1, 2 13 243 50, size
  button "+", 2, 212 2 13 10
  button "-", 3, 228 2 13 10
  icon 5, 26 91 192 106
  button "<", 4, 7 133 13 13, disable
  button ">", 6, 227 133 13 13, disable
  button "&Upload!", 7, 40 213 42 10
  text "URL:", 8, 5 65 13 8
  edit "", 9, 22 64 188 10, read autohs
  button "&Clpb", 10, 213 64 30 10
  button "&Close", 11, 162 213 42 10, ok cancel
  button "&Uploaded Pics", 12, 101 213 42 10
  text "", 13, 63 202 114 8, center
  text "No preview available", 14, 87 137 68 8, center
  text "Status:", 15, 5 79 20 8
  text "Select files to upload", 16, 27 79 183 8, right
  text "Images to upload:", 17, 5 3 46 8
}
dialog -l isv {
  title "Imageviewer"
  size -1 -1 264 238
  option dbu
  icon 1, 27 99 209 122
  button "<", 2, 5 151 15 16, disable
  button ">", 3, 244 151 15 16, disable
  list 4, 4 17 257 54, size
  button "&Delete", 5, 137 4 37 10
  button "&Add image", 6, 179 4 37 10
  button "&Close", 7, 221 4 37 10, ok cancel
  text "URL:", 8, 3 86 14 8
  edit "", 9, 29 85 212 10, read autohs
  button "&Clpb", 10, 243 85 18 10
  text "Location:", 11, 3 74 25 8
  edit "", 12, 29 73 212 10, read autohs
  button "&Clpb", 13, 243 73 18 10
  text "No preview available", 14, 51 152 161 15, center
  text "", 15, 75 226 110 8, center
  text "", 16, 4 5 65 8, left
}
menu * {
  Image uploader
  .Upload images: is
  .Download images: dialog -m isv isv
}
alias is {
  set %i.mode $iif($1,$1,-m)
  if (!$hget(is)) hmake is 50
  dialog $iif($dialog(is),-v,%i.mode) is is
}
alias -l i.loadimg {
  if ($did(is,1).sel) {
    did -v is 5
    did -g is 5 $qt($did(is,1).seltext)
    did -h is 14
    did -a is 13 $nopath($did(is,1).seltext)
    if ($hfind(is,$did(1).seltext).data) did -ra is 9 $v1
    else did -r is 9
  }
  else {
    :error
    if ($error) reseterror
    did -v is 14
    did -h is 5
    did -r is 13
  }
}
alias -l i.chkbutton {
  if ($did(is,1).lines <= 1) did -b is 4,6
  else {
    did $iif($did(is,1).sel == 1,-b,-e) is 4
    did $iif($did(is,1).sel == $did(is,1).lines,-b,-e) is 6
  }
}
alias -l i.id {
  :id
  var %x upload $+ $r(0,$str(9,12))
  if ($sock(%x)) goto id
  return %x
}
alias -l iv.loadimg {
  if ($did(isv,4).sel) {
    var %x $did(isv,4,$v1)
    did -h isv 14
    did -v isv 1
    did -g isv 1 $qt($hget(is,%x))
    did -ra isv 15 $nopath(%x)
    did -ra isv 12 $hget(is,%x)
    did -ra isv 9 %x
  }
  else {
    :error
    if ($error) reseterror
    did -vra isv 14 No preview available
    did -h isv 1
    did -r isv 9,12,15
  }
}
alias -l iv.chkbutton {
  if ($did(isv,4).lines <= 1) did -b isv 2,3
  else {
    did $iif($did(isv,4).sel == 1,-b,-e) isv 2
    did $iif($v1 == $did(isv,4).lines,-b,-e) isv 3
  }
}
on *:exit:{ hsave is is.dat }
on *:start:{ 
  hmake is 50 
  hload is is.dat
}
on *:unload:{
  echo -ag :(
  hfree is
  remove is.dat
}
on *:dialog:is:*:*:{
  if ($devent == sclick) {
    if ($did == 2) && ($msfile(.bmp,Select file,Upload)) {
      if ($v1 == -1) noop $input(You've selected too many files.,ow,Error)
      else {
        var %x 1, %err $false
        while ($msfile(%x)) {
          if (!$regex($v1,/\.(?:jpe?g|png|bmp|ico|img|gif|swf|tiff?)$/i)) var %err $true
          else did -a $dname 1 $msfile(%x)
          inc %x
        }
        if (%err) noop $input(Some selected files were not supported image files.,oh,Error)
        if (!$did(1).lines) did -ra $dname 16 Select some files to upload.
        else did -ra $dname 16 Ready to upload ( $+ $did(1).lines $+ ) images.
        did -c $dname 1 1
        i.chkbutton
        i.loadimg
      }
    }
    elseif ($did == 3) && ($did(1).sel) {
      did -d $dname 1 $v1
      if ($did(1).lines) did -ra $dname 16 Ready to upload ( $+ $did(1).lines $+ ) images.
      else did -ra $dname 16 Select some files to upload.
      did -r $dname 9
      i.loadimg
    }
    elseif ($did == 10) && ($did(9)) clipboard $v1
    elseif ($did == 1) && ($did(1).sel) {
      i.chkbutton
      i.loadimg
    }
    elseif ($istok(4 6,$did,32)) {
      did -c $dname 1 $calc($did(1).sel $iif($did == 4,-,+) 1)
      i.loadimg
      i.chkbutton
    }
    elseif ($did == 7) && ($did(1).lines) {
      if ($sock(upload*,0)) {
        if ($input(Upload in progress. Abort upload in progress?,ynw,Upload in progress)) {
          sockclose upload*
          did -ra $dname 16 Ready to upload ( $+ $did(1).lines $+ ) images.
        }
        else return
      }
      var %x $did(1).lines, %y
      while (%x) {
        if ($hfind(is,$did(1,%x)).data) {
          dec %x
          continue
        }
        var %i $i.id
        sockopen %i load.imageshack.us 80
        sockmark %i $did(1,%x)
        inc %y
        dec %x
      }
      if (%y) {
        did -ra $dname 16 Uploading images 0 of %y complete.
        if (%y < $did(1).lines) noop $input(Some of the chosen files have already been uploaded. Uploading %y images.,oi,Images already uploaded)
      }
      else {
        noop $input(All of the chosen files have already been uploaded.,o,Error)
        did -ra $dname 16 Select files to upload.
        i.loadimg
        i.chkbutton
      }
    }
    elseif ($did == 12) dialog $iif($dialog(isv),-v,%i.mode) isv isv
  }
  elseif ($devent == dclick) && ($did == 1) && ($did(1).seltext) run $v1
  elseif ($devent == close) {
    unset %i.mode
    sockclose upload*
  }
}
on *:dialog:isv:*:*:{
  if ($devent == init) {
    var %x 1
    while ($hget(is,%x).item) {
      did -a $dname 4 $v1
      inc %x
    }
    did -c $dname 4 1
    did -a $dname 16 $hget(is,0).item images
    iv.loadimg
    iv.chkbutton
  }
  elseif ($devent == sclick) {
    if ($did == 5) && ($did(4).seltext) {
      hdel is $v1
      did -d $dname 4 $did(4).sel
      did -ra $dname 16 $calc($gettok($did(16),1,32) - 1) images
      did -r $dname 9,12
      iv.loadimg
      iv.chkbutton
    }
    elseif ($did == 6) {
      if ($sock(download)) {
        if ($input(Image download in progress. Abort download in progress?,ynw,Download in progress)) sockclose download
        else return
      }
      var %i $input(Input image url (must be direct link),ei,Image download), %len $len(%i)
      if (!%i) return
      if (!$regex(%i,/^(?:http:\/\/)?([^\/]+)(.+(jpe?g|png|bmp|ico|img|gif|swf|tiff?))$|[^\x3D]{ $+ %len $+ }/i)) noop $input(Unsupported image file.,oh,Error)
      elseif ($hfind(is,http:// $+ $regml(1) $+ $regml(2))) noop $input(You've already downloaded this image.,oi,Error)
      else {
        did -h isv 1
        did -vra isv 14 Downloading $qt(%i)
        sockopen download $regml(1) 80
        sockmark download $regml(1) $regml(2)
      }
    }
    elseif ($did == 4) && ($did(4).seltext) {
      did -ra $dname 9 $v1
      did -ra $dname 12 $hget(is,$v1)
      iv.loadimg
      iv.chkbutton
    }
    elseif ($istok(2 3,$did,32)) {
      did -c $dname 4 $calc($did(4).sel $iif($did == 2,-,+) 1)
      iv.loadimg
      iv.chkbutton
    }
    elseif ($did == 10) && ($did(9)) clipboard $v1
    elseif ($did == 13) && ($did(12)) clipboard $v1
  }
  elseif ($devent == dclick) && ($did == 4) && ($did(4).seltext) run $hget(is,$v1)
}
on *:sockopen:upload*:{
  if ($sockerr) {
    .signal -n i.fail $sock($sockname).mark
    sockclose $sockname
  }
  else {
    var %i $md5($sockname), %img $sock($sockname).mark, %ext $regex(%img,/\.(\w+)$/), %ext $regml(1)
    bread $qt(%img) 0 $file($qt(%img)).size &img
    bset -t &cont 1 -- $+ %i $+ $crlf $+ Content-Disposition: form-data $+ $chr(59) name="fileupload" $+ $chr(59) filename=" $+ $nopath(%img) $+ " $+ $crlf $+ $& 
      Content-Type: image/ $+ %ext $+ $str($crlf,2)
    bcopy &cont $calc($bvar(&cont,0) + 1) &img 1 -1
    bset -t &cont $calc($bvar(&cont,0) + 1) $crlf $+ -- $+ %i $+ -- $+ $crlf
    sockwrite -n $sockname POST / HTTP/1.0
    sockwrite -n $sockname Host: load.imageshack.us
    sockwrite -n $sockname Connection: Keep-Alive
    sockwrite -n $sockname Keep-Alive: 1200
    sockwrite -n $sockname Content-Type: multipart/form-data $+ $chr(59) boundary= $+ %i
    sockwrite $sockname Content-Length: $bvar(&cont,0) $+ $str($crlf,2)
    sockwrite $sockname &cont
  }
}
on *:sockread:upload*:{
  if ($sockerr) {
    .signal -n i.fail $sock($sockname).mark
    sockclose $sockname
    return
  }
  var %x
  sockread %x
  if ($regex(%x,/<input type="text" onClick="track\('direct'\).+value="(.+)"\/>/i)) {
    did -ra is 9 $regml(1)
    tokenize 32 $did(is,16)
    var %i $3 + 1
    if (%i == $5) did -ra is 16 Uploaded $5 images.
    else did -ra is 16 Uploading images %i of $5 complete.
    hadd -m is $regml(1) $sock($sockname).mark
    sockclose $sockname
  }
}
on *:sockclose:upload*:{ .signal i.fail $sock($sockname).mark }
on *:signal:i.fail:{
  if ($input(Upload failed on img $qt($1-) $+ . Click retry to upload the img again.,rh,Error)) {
    var %s $i.id
    sockopen %s load.imageshack.us 80
    sockmark %s $1-
  }
  else {
    tokenize 32 $did(is,16)
    if ($calc($3 + 1) == $5) did -ra is 16 Upload complete.
    else did -ra is 16 Uploading images $calc($3 - 1) of $calc($5 - 1) complete.
  } 
}
on *:sockopen:download:{
  if ($sockerr) {
    noop $input(Unable to download image.,oh,Error)
    sockclose $sockname
  }
  else {
    tokenize 32 $sock($sockname).mark
    sockwrite -nt $sockname GET $2 HTTP/1.0
    sockwrite $sockname Host: $1 $+ $str($crlf,2)
  }
}
on *:sockread:download:{
  if ($sockerr) {
    noop $input(Error downloading image.,oh,Error)
    sockclose $sockname
    return
  }
  tokenize 32 $sock($sockname).mark
  if ($0 == 2) {
    var %x $true
    while (%x) {
      if (Content-Len isin %x) var %len $gettok(%x,2,32)
      sockread %x
    }
    sockmark $sockname $sock($sockname).mark $iif(%len,$v1,$false)
    return
  }
  var %fn $nopath($2)
  while ($sock($sockname).rq) {
    sockread &cont
    bwrite %fn -1 -1 &cont
  }
  if ($3) && ($file(%fn).size >= $3) {
    sockclose $sockname
    did -ac isv 4 http:// $+ $1 $+ $2
    hadd -m is http:// $+ $1 $+ $2 $longfn(%fn)
    iv.loadimg
    iv.chkbutton
  }
}
on *:sockclose:download:{ 
  tokenize 32 $sock($sockname).mark
  did -ac isv 4 http:// $+ $1 $+ $2
  hadd -m is http:// $+ $1 $+ $2 $longfn($nopath($2)) 
  iv.loadimg
  iv.chkbutton
}

;================================ End =====

Edited Aug 1, 2009 9:31 AM by The Gate Keeper PLEASE wrap code with the correct bbcode tags... the whole [code] stuff? come on&#33;

Or another Idea. :rate:

Use some sort of screen capture utility app to capture full screen. I use capture a screenshot.

or alt + print screen and paste Into paint and save for active window only.

and use dropbox instead of imageshack.

 

Link to Dropbox.

 

You could make a shared folder on dropbox and share together or use the public folder link and paste straight Into a room.

Not exactly scripting, but I notice more and more ppl doing It this way.

Much simpler and much faster. Only my personal opinion.

I really like that idea Dodge, and dropbox seems great, only question, How would I go about be able to take a screenshot of the entire screen.

 

Right, Ill have to some how work on doing that, lol.

 

 

Thanks guys <3 If you have any more ideas/codes that could help me, please post! :D

Its what I do.

download this DLL

 

i have submitted it for err0r

 

Screenshot dll

 

put it in your mirc folder and use this alias

 

 

alias ss {
  var %file desktop $+ $rand(1,10000) $+ .jpg
  $dll(pathtomirc\mirc ss.dll, takess, $base(10,9,3) c:\screenshots\ $+ %file)
}

 

the $base(10,9,3) is the quality from 0 bad to 100 best

 

currently its set to 100

 

this takes a screenshot and saves it in c:\screenshots\desktop213.jpg

 

the 213 will be a random number

 

now just to work out how to upload it

Edited Aug 1, 2009 5:50 PM by Haggis

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

Haggis, You have outdone yourself! Your bloody amazing. It works perfectly, Saves to the folder and everything.

 

Now all thats left is to somehow create a socket and upload it to imageshack and echo the link ^^ :D

 

Its what I do.

on *:sockopen:upload*:{
  if ($sockerr) {
    .signal -n i.fail $sock($sockname).mark
    sockclose $sockname
  }
  else {
    var %i $md5($sockname), %img $sock($sockname).mark, %ext $regex(%img,/\.(\w+)$/), %ext $regml(1)
    bread $qt(%img) 0 $file($qt(%img)).size &img
    bset -t &cont 1 -- $+ %i $+ $crlf $+ Content-Disposition: form-data $+ $chr(59) name="fileupload" $+ $chr(59) filename=" $+ $nopath(%img) $+ " $+ $crlf $+ $& 
      Content-Type: image/ $+ %ext $+ $str($crlf,2)
    bcopy &cont $calc($bvar(&cont,0) + 1) &img 1 -1
    bset -t &cont $calc($bvar(&cont,0) + 1) $crlf $+ -- $+ %i $+ -- $+ $crlf
    sockwrite -n $sockname POST / HTTP/1.0
    sockwrite -n $sockname Host: load.imageshack.us
    sockwrite -n $sockname Connection: Keep-Alive
    sockwrite -n $sockname Keep-Alive: 1200
    sockwrite -n $sockname Content-Type: multipart/form-data $+ $chr(59) boundary= $+ %i
    sockwrite $sockname Content-Length: $bvar(&cont,0) $+ $str($crlf,2)
    sockwrite $sockname &cont
  }
}
on *:sockread:upload*:{
  if ($sockerr) {
    .signal -n i.fail $sock($sockname).mark
    sockclose $sockname
    return
  }
  var %x
  sockread %x
  if ($regex(%x,/<input type="text" onClick="track\('direct'\).+value="(.+)"\/>/i)) {
    did -ra is 9 $regml(1)
    tokenize 32 $did(is,16)
    var %i $3 + 1
    if (%i == $5) did -ra is 16 Uploaded $5 images.
    else did -ra is 16 Uploading images %i of $5 complete.
    hadd -m is $regml(1) $sock($sockname).mark
    sockclose $sockname
  }
}
on *:sockclose:upload*:{ .signal i.fail $sock($sockname).mark }
on *:signal:i.fail:{
  if ($input(Upload failed on img $qt($1-) $+ . Click retry to upload the img again.,rh,Error)) {
    var %s $i.id
    sockopen %s load.imageshack.us 80
    sockmark %s $1-
  }
  else {
    tokenize 32 $did(is,16)
    if ($calc($3 + 1) == $5) did -ra is 16 Upload complete.
    else did -ra is 16 Uploading images $calc($3 - 1) of $calc($5 - 1) complete.
  } 
}
on *:sockopen:download:{
  if ($sockerr) {
    noop $input(Unable to download image.,oh,Error)
    sockclose $sockname
  }
  else {
    tokenize 32 $sock($sockname).mark
    sockwrite -nt $sockname GET $2 HTTP/1.0
    sockwrite $sockname Host: $1 $+ $str($crlf,2)
  }
}
on *:sockread:download:{
  if ($sockerr) {
    noop $input(Error downloading image.,oh,Error)
    sockclose $sockname
    return
  }
  tokenize 32 $sock($sockname).mark
  if ($0 == 2) {
    var %x $true
    while (%x) {
      if (Content-Len isin %x) var %len $gettok(%x,2,32)
      sockread %x
    }
    sockmark $sockname $sock($sockname).mark $iif(%len,$v1,$false)
    return
  }
  var %fn $nopath($2)
  while ($sock($sockname).rq) {
    sockread &cont
    bwrite %fn -1 -1 &cont
  }
  if ($3) && ($file(%fn).size >= $3) {
    sockclose $sockname
    did -ac isv 4 http:// $+ $1 $+ $2
    hadd -m is http:// $+ $1 $+ $2 $longfn(%fn)
    iv.loadimg
    iv.chkbutton
  }
}
on *:sockclose:download:{ 
  tokenize 32 $sock($sockname).mark
  did -ac isv 4 http:// $+ $1 $+ $2
  hadd -m is http:// $+ $1 $+ $2 $longfn($nopath($2)) 
  iv.loadimg
  iv.chkbutton
}

 

This is the upload bit I think! from what dodge gave us! :)

Its what I do.

i have an upkload bit that works i am just trying to make it all automatic

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

Woohooo i got it working lol

 

obviously not all my own work

 

alias takess {
  noop $dll(c:\Program Files\mIRC\mirc ss.dll, takess, 100 %file)
}
alias ss {
  msg # setting filename
  set %file c:\screenshots\desktop $+ $rand(1,10000) $+ .jpg
  msg # taking screenshot
  takess
  msg # trying to upload
  share %file
}


alias /share {
  if $1 = $null {
    %sharing_file = $$msfile($$msfile(C:\))
  }
  if $1 {
    %sharing_file = $1-
  }
  %tempsockname = imageshack_drone $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9)
  echo 7 Opening initial connection...
  sockopen %tempsockname www.imageshack.us 80
  sockmark %tempsockname filename= $+ %sharing_file
; unset %sharing_file
  unset %tempsockname
}


on 1:sockopen:imageshack_drone*:{

  bset -t &postdata 1 -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="uploadtype" $+ $crlf $+ $crlf

  bset -t &postdata $calc($bvar(&postdata,0) + 1) on $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="fileupload"; filename=" $+ $nopath($gettok($mid($sock($sockname).mark,11),1,59)) $+ " $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Type: image/jpeg $+ $crlf $+ $crlf

  bread " $+ $gettok($mid($sock($sockname).mark,10),1,59) $+ " 0 $file($gettok($mid($sock($sockname).mark,10),1,59)).size &file_contents
  bcopy &postdata $calc($bvar(&postdata,0) + 1) &file_contents 1 -1
  bset -t &postdata $calc($bvar(&postdata,0) + 1) $crlf $+ -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="url" $+ $crlf $+ $crlf

  bset -t &postdata $calc($bvar(&postdata,0) + 1) paste image url here $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="email" $+ $crlf $+ $crlf $+ $crlf


  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="MAX_FILE_SIZE" $+ $crlf $+ $crlf

  bset -t &postdata $calc($bvar(&postdata,0) + 1) 13145728 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="refer" $+ $crlf $+ $crlf

  bset -t &postdata $calc($bvar(&postdata,0) + 1) http://imageshack.us/ $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="brand" $+ $crlf $+ $crlf $+ $crlf


  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="optsize" $+ $crlf $+ $crlf

  bset -t &postdata $calc($bvar(&postdata,0) + 1) 320x320 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410--

  sockwrite -nt $sockname POST / HTTP/1.1
  sockwrite -nt $sockname Host: imageshack.us
  sockwrite -nt $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ko; rv:1.9.0.10) Gecko/2009042316 Frefox/3.0.5
  sockwrite -nt $sockname Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  sockwrite -nt $sockname Accept-Language: en-us,en;q=0.8,ko-kr;q=0.5,ko;q=0.3
  sockwrite -nt $sockname Accept-Charset: EUC-KR,utf-8;q=0.7,*;q=0.7
  sockwrite -nt $sockname Keep-Alive: 1200
  sockwrite -nt $sockname Connection: keep-alive
  sockwrite -nt $sockname Referer: http://imageshack.us/?no_multi=1
  sockwrite -nt $sockname Content-Type: multipart/form-data; boundary=---------------------------18762165517410
  sockwrite -nt $sockname Content-Length: $bvar(&postdata,0) $+ $crlf $+ $crlf


  echo 7 Sending file package...
  sockwrite $sockname &postdata
}

on 1:sockread:imageshack_drone*:{
  sockread -f %lol
  if $mid(%lol,1,9) = location: {
    %lol = $mid(%lol,11)
    msg $active Uploaded to imageshack: http:// $+ $gettok(%lol,2,$asc(/)) $+ / $+ $gettok($gettok(%lol,2-,$asc(?)),3-,$asc(=))
    unset %lol
  }
}

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

Wow Wow Wow, That is brilliant, Exactly what I was looking for. One final tiny last thing. You know how it has

  set %file c:\screenshots\desktop $+ $rand(1,10000) $+ .jpg

 

Well that saves the file as desktop(randomnumber).jpg, Is their a way you could have it so it would be like Desktop1, Desktop2, Desktop3, Desktop4, Desktop5, Desktop6. So then the last one taken would be the highest number, it would ordered in the folder. Basically, the number wouldnt be random, it would just keep increasing.

 

But thanks for this, this is Incredible! :D

Its what I do.

Just add this line above that one:

if (!%ssnum) { set %ssnum 0 }
inc %ssnum

Then that makes the new line:

set %file c:\screenshots\desktop $+ %ssnum $+ .jpg

 

Or, if you prefer to have more redundancy:

if (!%ssnum) { set %ssnum $findfile(c:\screenshots\,*.jpg,0) }
inc %ssnum

Though this may slow down the code somewhat if the %ssnum variable doesn't exist.

Edited Aug 2, 2009 10:59 AM by takaharu_

I don't get paid to know the answer, therefore I'm far more likely to give you a straight and honest answer.

thanks Tak

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

Ahhhhhhhhhhh it works! all of it!, Oh my lord, you guys are brilliant, Thank you all <3

 

Edited Aug 2, 2009 12:24 PM by Jagie

Its what I do.

Nice work Haggis :yes:

______________________________________________________

T.ogether
E.veryone
A.chieves
M.ore


 

 

coderirclogo.png.8580c336378f27471a13a95ffd242c9d (1).png

Jagie if you want it with the @imageshack window use this

 

alias takess {
  noop $dll(c:\Program Files\mIRC\mirc ss.dll, takess, 100 %file)
}
alias ss {



  msg # setting filename
  if (!%ssnum) { set %ssnum 0 }
  inc %ssnum
  set %file c:\screenshots\desktop $+ %ssnum $+ .jpg
  msg # taking screenshot
  takess
  msg # trying to upload
  share %file
}


alias /share {
  if $1 = $null {
    %sharing_file = $$msfile($$msfile(C:\))
  }
  if $1 {
    %sharing_file = $1-
  }
  %tempsockname = imageshack_drone $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9)
  echo 7 Opening initial connection...
  sockopen %tempsockname www.imageshack.us 80
  sockmark %tempsockname filename= $+ %sharing_file
; unset %sharing_file
  unset %tempsockname
}


on 1:sockopen:imageshack_drone*:{

  bset -t &postdata 1 -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="uploadtype" $+ $crlf $+ $crlf

  bset -t &postdata $calc($bvar(&postdata,0) + 1) on $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="fileupload"; filename=" $+ $nopath($gettok($mid($sock($sockname).mark,11),1,59)) $+ " $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Type: image/jpeg $+ $crlf $+ $crlf

  bread " $+ $gettok($mid($sock($sockname).mark,10),1,59) $+ " 0 $file($gettok($mid($sock($sockname).mark,10),1,59)).size &file_contents
  bcopy &postdata $calc($bvar(&postdata,0) + 1) &file_contents 1 -1
  bset -t &postdata $calc($bvar(&postdata,0) + 1) $crlf $+ -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="url" $+ $crlf $+ $crlf

  bset -t &postdata $calc($bvar(&postdata,0) + 1) paste image url here $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="email" $+ $crlf $+ $crlf $+ $crlf


  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="MAX_FILE_SIZE" $+ $crlf $+ $crlf

  bset -t &postdata $calc($bvar(&postdata,0) + 1) 13145728 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="refer" $+ $crlf $+ $crlf

  bset -t &postdata $calc($bvar(&postdata,0) + 1) http://imageshack.us/ $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="brand" $+ $crlf $+ $crlf $+ $crlf


  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) Content-Disposition: form-data; name="optsize" $+ $crlf $+ $crlf

  bset -t &postdata $calc($bvar(&postdata,0) + 1) 320x320 $+ $crlf
  bset -t &postdata $calc($bvar(&postdata,0) + 1) -----------------------------18762165517410--

  sockwrite -nt $sockname POST / HTTP/1.1
  sockwrite -nt $sockname Host: imageshack.us
  sockwrite -nt $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ko; rv:1.9.0.10) Gecko/2009042316 Frefox/3.0.5
  sockwrite -nt $sockname Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  sockwrite -nt $sockname Accept-Language: en-us,en;q=0.8,ko-kr;q=0.5,ko;q=0.3
  sockwrite -nt $sockname Accept-Charset: EUC-KR,utf-8;q=0.7,*;q=0.7
  sockwrite -nt $sockname Keep-Alive: 1200
  sockwrite -nt $sockname Connection: keep-alive
  sockwrite -nt $sockname Referer: http://imageshack.us/?no_multi=1
  sockwrite -nt $sockname Content-Type: multipart/form-data; boundary=---------------------------18762165517410
  sockwrite -nt $sockname Content-Length: $bvar(&postdata,0) $+ $crlf $+ $crlf


  echo 7 Sending file package...
  sockwrite $sockname &postdata
}

on 1:sockread:imageshack_drone*:{
  sockread -f %lol
  if $mid(%lol,1,9) = location: {
    %lol = $mid(%lol,11)
    msg $active Uploaded to imageshack: http:// $+ $gettok(%lol,2,$asc(/)) $+ / $+ $gettok($gettok(%lol,2-,$asc(?)),3-,$asc(=))
    window -z @imageshack
    aline @imageshack http:// $+ $gettok(%lol,2,$asc(/)) $+ / $+ $gettok($gettok(%lol,2-,$asc(?)),3-,$asc(=))
    unset %lol
  }
}

 

 

the first time u do it it will move to imageshack window everytime after that will write to it but keep channel active

 

i am not sure how to move back to channel window

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

I managed to do a different way ^^ But thanks again

 

on 1:sockread:imageshack_drone*:{
  sockread -f %lol
  if $mid(%lol,1,9) = location: {
    %lol = $mid(%lol,11)
   /set %link http:// $+ $gettok(%lol,2,$asc(/)) $+ / $+ $gettok($gettok(%lol,2-,$asc(?)),3-,$asc(=))
    /echo -a Uploaded to %link
/write screenshots %link
    unset %lol
  }
}

 

Then created an alias

/screen /window -e @Screenshots | /filter -fw screenshots.txt @screenshots

 

So that will list all the screenshots from the text file I do.

 

Thank you all for all the hard work you put it in this, I am so grateful of all your help! This is why I love TG :D

 

Thank you once again <3

Its what I do.