Jump to content

Screenshot Uploader Help :)


Jagie

Recommended Posts

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.

Link to comment
Share on other sites

  • Replies 21
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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 by Haggis
adding link to mrc file
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

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 by The Gate Keeper
PLEASE wrap code with the correct bbcode tags... the whole [code] stuff? come on!
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by Haggis
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...